PHPackages                             gbrock/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. gbrock/laravel-pages

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

gbrock/laravel-pages
====================

0.1.1(10y ago)112593[1 issues](https://github.com/gbrock/laravel-pages/issues)PHP

Since Aug 19Pushed 10y ago2 watchersCompare

[ Source](https://github.com/gbrock/laravel-pages)[ Packagist](https://packagist.org/packages/gbrock/laravel-pages)[ RSS](/packages/gbrock-laravel-pages/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Pages [![Build Status](https://camo.githubusercontent.com/ef8d51e309a1cabc6aeccb0f2d90ab4a9578793292a9a3a09e6a76baee61e940/68747470733a2f2f7472617669732d63692e6f72672f6762726f636b2f6c61726176656c2d70616765732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gbrock/laravel-pages)
=================================================================================================================================================================================================================================================================================================

[](#pages-)

A [Laravel 5.1](http://laravel.com/docs/5.1) package designed to add pages to your Laravel application. A page is just **content** defined by specific URL, or **slug**. A page may or may not be **published**.

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

[](#installation)

1. Run `composer require gbrock/laravel-pages` from your project directory.
2. Add the service provider to the `providers` array in `config/app.php`:
    `Gbrock\Pages\Providers\PageServiceProvider::class,`
3. Publish the migrations, views, and config file:
    `php artisan vendor:publish --provider="Gbrock\Pages\Providers\ContactableServiceProvider"`
4. Run the migrations:
    `php artisan migrate`

Usage
-----

[](#usage)

### Creating a Public Page

[](#creating-a-public-page)

Create a **Page** model:

```
\Gbrock\Pages\Models\Page::create([
    'title' => 'Hello, World',
    'content' => 'Hi everybody',
    'public' => true,
]);
```

...which is now accessible by browsing to `/hello-world`!

### Making a Domain

[](#making-a-domain)

A **domain** is a set of pages which are always under a specific slug. For example, you might make a "BlogPage" model whose members are always accessible under `blog/{slug}`:

```
