jeroen-g/laravel-pages

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple pages package for Laravel 5

v3.0 2017-09-16 17:05 UTC

This package is auto-updated.

Last update: 2022-02-01 12:31:56 UTC


README

Simple pages package for Laravel.

Scrutinizer Quality Score Latest Stable Version License

Installation

Via Composer

$ composer require jeroen-g/laravel-pages

The following command installs the package without the testing requirements.

$ composer require jeroen-g/laravel-pages --update-no-dev

For Laravel 5.4 or lower

Add the service provider in app/config/app.php:

JeroenG\LaravelPages\LaravelPagesServiceProvider::class,

And in the same file, add the alias:

'LPages'   =>  JeroenG\LaravelPages\Facades\LaravelPages::class,

Configuration

To publish the package's migration files.

$ artisan vendor:publish

The last thing to do is to migrate:

$ artisan migrate

Usage

This package does not provide controllers and routes. To show pages you could use the route below. You'll need a page view to show the data from the database.

Route::get('{uri?}', function($uri)
{
	if(LPages::pageExists($uri))
	{
		$pageData = LPages::getPage($uri);
		return View::make('page', $pageData);
	}
	else
	{
		App::abort(404, 'Page Not Found');
	}
});

Have a look at src\JeroenG\LaravelPages\LaravelPages.php to see what this package can do and what each function needs. Everything is documented.