gbrock/laravel-pages
Larablocks Analysis
gbrock/laravel-pages works with any PHP project: the latest release (0.1.1, Aug 19, 2015) doesn't depend on Laravel.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- No release in the last 12 months (last: Aug 19, 2015)
- 0 downloads a month (needs 10,000)
- 11 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Aug 19, 2015.
- No releases in the last 12 months.
- First released: Aug 19, 2015.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.
| Install | |
|---|---|
composer require gbrock/laravel-pages |
|
| Latest Version: | 0.1.1 |
| Last Updated: | Aug 20, 2015 |
| Links: | GitHub · Packagist |
Pages 
A Laravel 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
-
Run
composer require gbrock/laravel-pagesfrom your project directory. -
Add the service provider to the
providersarray inconfig/app.php:
Gbrock\Pages\Providers\PageServiceProvider::class, -
Publish the migrations, views, and config file:
php artisan vendor:publish --provider="Gbrock\Pages\Providers\ContactableServiceProvider" -
Run the migrations:
php artisan migrate
Usage
Creating a Public Page
Create a Page model:
\Gbrock\Pages\Models\Page::create([
'title' => 'Hello, World',
'content' => '<p>Hi everybody</p>',
'public' => true,
]);
...which is now accessible by browsing to /hello-world!
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}:
<?php
namespace App;
use Gbrock\Pages\Models\Page;
use Gbrock\Pages\Traits\Domainable;
class BlogPage extends Page {
use Domainable;
protected static $domain = 'blog';
}
Then you can query that model for only that domain of pages. Please note that, by default, domained pages will be
included in queries when using the above Page model. In order to ignore domained pages, extend the included Page model
and add ignorable domains to the $subdomains property:
<?php
namespace App;
use Gbrock\Pages\Models\Page as BasePage;
class Page extends BasePage
{
protected static $subdomains = ['blog'];
}
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | License |
|---|---|---|
| 0.1.1 | ||
| 0.1.0 |