jeroen-g/laravel-pages

Simple pages package for Laravel 5

Downloads

240

Stars

8

Version

v3.0

This package has been archived

Laravel Pages

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.

Jeroen-G

Author

Jeroen-G