Package Data | |
---|---|
Maintainer Username: | attrox |
Maintainer Contact: | rickyleman@gmail.com (Ricky Leman) |
Package Create Date: | 2016-03-11 |
Package Last Update: | 2016-03-12 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-17 03:06:02 |
Package Statistics | |
---|---|
Total Downloads: | 15 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This package provides a quick front-end admin interface to update a Laravel configuration file.
This is for the lazy developers who wants a quick "CMS" like admin interface to control the display of some web-page without the use of database. Just set up the Laravel configuration file and expose the page name (slug). The admin update will write back into the Laravel configuration file keeping intact the structure and comment in the config file.
Copy vendor/attrox/config-controller/config/configcontroller.php
to Laravel config/
folder.
Add slug
name. This should represent the page name for both the web facing page and the admin interface page.
Add entries in input
and content
array for the slug
, see the comments in configcontroller.php
for more details.
Extends Attrox\ConfigController\Controllers\AbstractController
and expose admin($slug)
and adminPost($slug)
to your routes to provide access to the configuration admin interface.
Adjust the properties of the controller (if needed):
protected $config_base = 'configcontroller'; // This is mapped to Laravel config/configcontroller.php
protected $admin_view = 'config_admin'; // This is the blade view used by the admin
protected $index_view = '';
Add a method in this controller to return the dynamic web page. getSlugContent($slug)
will return the content that you can manipulate within your view.
Add a similar route like below:
$router->get('/test/{slug}', 'YourControllerClass@admin');
$router->post('/test/{slug}', 'YourControllerClass@adminPost');
$router->get('/dynamic/{$slug}', 'YourControllerClass@index');
Copy vendor/attrox/config-controller/views/config_admin.blade.php
to your views folder. This is a sample admin interface view that you can include in your main view.
This package is dependent on October\Rain\Config\Repository
package (https://github.com/attrox/laravel-config-writer). A package I fork from https://github.com/daftspunk/laravel-config-writer to work with Laravel 5.x
"require": {
"laravelcollective/html": "5.1.*"
}
Need to make the Form
facade available (https://laravelcollective.com/docs/5.1/html)