rinvex/laravel-pages

Rinvex Pages is an integral part for your Laravel content management system (CMS), it affords an easy, yet powerful way to create and manage pages with full control over their URLs, active status, titles, content, and other attributes.

v4.1.2 2020-08-03 20:59 UTC

README

Rinvex Pages is an integral part for your Laravel content management system (CMS), it affords an easy, yet powerful way to create and manage pages with full control over their URLs, active status, titles, content, and other attributes.

Packagist Scrutinizer Code Quality Travis StyleCI License

Installation

  1. Install the package via composer:

    composer require rinvex/laravel-pages
  2. Publish resources (migrations and config files):

    php artisan rinvex:publish:pages
  3. Execute migrations via the following command:

    php artisan rinvex:migrate:pages
  4. Done!

Usage

Create Your Page

To get started, you simply create a new page as follows:

$page = app('rinvex.pages.page')->create([
    'uri' => 'test',
    'slug' => 'test-page',
    'route' => 'frontend.pages.test',
    'title' => 'Test Page',
    'view' => 'test-page',
]);

// Deactivate the page
$page->deactivate();

// Activate the page
$page->activate();

// Get all pages
$pages = app('rinvex.pages.page')->all();

// Get active pages
$pages = app('rinvex.pages.page')->where('is_active', true)->get();

Notes:

  • All active pages are registered automatically into your application router with page's attributes, so the example page we created above could be accessed via the URL http://your-project/test, and you can generate page's URL using the named route route('frontend.pages.test') as you may expect. The result of accessing that page is the content of the page's rendered view.
  • Rinvex Pages auto register routes for your active pages, but you can disable routes auto registration in case you need more flexibility writing your own routes and maybe linking to your custom controllers, and that could be done from the config file config/rinvex.pages.php if you already published it in the installation step.
  • Rinvex Pages expects you to create your own views before setting in page records, and that view could be anywhere and contain anything. It's important to know that all page views have access to the $page instance variable by default, so you can access any of the page's attributes.

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to help@rinvex.com. All security vulnerabilities will be promptly contacted.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2020 Rinvex LLC, Some rights reserved.