faustbrian/laravel-pages

Pages for Laravel 5

1.1.0 2018-11-10 06:50 UTC

README

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/laravel-pages

Migration

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish --provider="BrianFaust\Package\PagesServiceProvider"

And then run the migrations to setup the database table.

$ php artisan migrate

Usage

Create a new Page
Page::create([
    'title' => str_random(10),
    'content' => '# Hello World!',
    'meta' => [
        'title' => str_random(10),
        'description' => str_random(10),
        'author' => str_random(10),
        'keywords' => implode(',' $faker->randomElements()),
    ],
    'status' => Page::STATUS_PUBLISHED,
    'type' => Page::TYPE_MARKDOWN,
]);
Parse the title, content and meta attributes.
$page->parse();

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust