26b / laravel-content-pages
Laravel package for Content Pages
Installs: 1 579
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- spatie/laravel-package-tools: ^1.14
Requires (Dev)
- orchestra/testbench: ^8.0
This package is auto-updated.
Last update: 2024-11-12 14:59:06 UTC
README
Have a configurable controller to navigate pages of content.
- Supports multi levels.
- Configurable folder for blade templates.
- Optional catch-all route so you don't need to configure specific routes.
Getting started
Require the package
composer require 26b/laravel-content-pages
That's it, now, under the /resources/views/
create a folder called content
(can be changed on the configuration) and place your blade templates there.
Once you have created a template, for example somepage.blade.php
, you can point your browser to yourproject.test/somepage
and you'll see your content.
Custom configuration
Publish the configuration file should you need to customise it.
php artisan vendor:publish --tag=content-pages-config
If for example you dont want to use the catch-all route, you can disable it on the config content-pages.php
fallback_route => false,
Then on your web routes you can add something like this.
Route::get('/pages/{any}', [PageController::class, 'show']);