dmyers/laravel-pages

A simple static pages package for Laravel 4.

Installs: 391

Dependents: 0

Stars: 6

Watchers: 3

Forks: 2

Language: PHP

v1.0.6 2015-06-10 17:24 UTC

README

Pages is a static page system for Laravel 4 applications.

Installation via Composer

Add this to you composer.json file, in the require object:

"dmyers/laravel-pages": "dev-master"

After that, run composer install to install Pages.

Add the service provider to app/config/app.php, within the providers array.

'providers' => array(
    // ...
    'Dmyers\Pages\PagesServiceProvider',
)

Add a class alias to app/config/app.php, within the aliases array.

'aliases' => array(
    // ...
    'Pages' => 'Dmyers\Pages\Pages',
)

Configuration

Publish the default config file to your application so you can make modifications.

$ php artisan config:publish dmyers/laravel-pages

Usage

To add a page, create a view in your app directory at views/pages/ and the URL will map to the path. You can nest folders and they will be included in the URL.

In your views there is a helper you can use to link to pages:

page_url('about');

Or if you just want the path to the page:

page_path('about');