PHPackages                             fbf/laravel-pages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fbf/laravel-pages

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fbf/laravel-pages
=================

A Laravel 4 package for adding simple content managed pages to a website with banner image, heading, main image or YouTube video and body content.

v0.5.2(12y ago)151.0k6MITPHPPHP &gt;=5.3.0

Since Jan 10Pushed 11y ago4 watchersCompare

[ Source](https://github.com/FbF/Laravel-Pages)[ Packagist](https://packagist.org/packages/fbf/laravel-pages)[ RSS](/packages/fbf-laravel-pages/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (10)Used By (0)

Laravel-Pages
=============

[](#laravel-pages)

A Laravel 4 package for adding simple content managed pages to a website with banner image, heading, main image or YouTube video and body content.

Features
--------

[](#features)

- Pages can be draft or approved
- They have a published date that you can set in the future for delayed/scheduled publishing
- Page uris are automatically generated from the page heading on create, but can be edited
- Page uris can include '/' to denote sections of a website
- Configurable route matching pattern (by default it's everything except the root route, i.e. '/')
- Control page title, meta description and keywords for SEO purposes
- Uses soft deletes in case you need to retrieve old content
- Configure the rendered view so you can use one in your app rather than the one in the package
- Make use of 2 partials in your own view so you can add extra stuff around the banner image and the content area

Comes with a
------------

[](#comes-with-a)

- Migration for creating the fbf\_pages table
- Model, controller and view (main view and 2 partials for content and banner image)
- Built in route (currently catches anything from the root of the site, so include the ServiceProvider last in the list if other packages have routes that this would interfere with)
- Service provider that automatically registers the eloquent sluggable package

Installation
------------

[](#installation)

Add the following to you composer.json file

```
"fbf/laravel-pages": "dev-master"

```

Run

```
composer update

```

Add the following to app/config/app.php

```
'Fbf\LaravelPages\LaravelPagesServiceProvider'

```

Publish the config

```
php artisan config:publish fbf/laravel-pages

```

Run the migration

```
php artisan migrate --package="fbf/laravel-pages"

```

Create the relevant image upload directories that you specify in your config, e.g.

```
public/uploads/packages/fbf/laravel-pages/banner/originals
public/uploads/packages/fbf/laravel-pages/banner/resized
public/uploads/packages/fbf/laravel-pages/main/originals
public/uploads/packages/fbf/laravel-pages/main/resized

```

Configuration
-------------

[](#configuration)

Check out the options in the `src/config/config.php` file

### Routes configuration

[](#routes-configuration)

By default, the routes file from the package will be automatically included, which matches all routes except the homepage.

However, the default route in the package will also override any of your `app/routes.php` routes.

To avoid this, if you have app routes, you can configure it to not use the package's built-in routes file, and then just copy the routes from the package to your own `app/routes.php` file, but after your existing routes.

Administrator
-------------

[](#administrator)

You can use the excellent Laravel Administrator package by frozennode to administer your pages.

A ready-to-use model config file for the Page model (pages.php) is provided in the src/config/administrator directory of the package, which you can copy into the app/config/administrator directory (or whatever you set as the model\_config\_path in the administrator config file).

Extending
---------

[](#extending)

Let's say each page in your site can have a testimonial on it.

- After installing the package you can create the testimonials table and model etc (or use the fbf/laravel-testimonials package)
- Create the migration to add a testimonial\_id field to the fbf\_pages table, and run it

```
