Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Jeroen-G/laravel-pages

Repository files navigation

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.

About

Simple pages package for Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages