https://github.com/jithintc/laravel-webpage-manager
Laravel package to create and manage static content pages.
https://github.com/jithintc/laravel-webpage-manager
laravel-5-package laravel-package static-content static-page-generator static-pages
Last synced: 19 days ago
JSON representation
Laravel package to create and manage static content pages.
- Host: GitHub
- URL: https://github.com/jithintc/laravel-webpage-manager
- Owner: jithintc
- Created: 2018-09-17T09:46:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T11:26:23.000Z (over 7 years ago)
- Last Synced: 2025-12-14T16:48:38.543Z (7 months ago)
- Topics: laravel-5-package, laravel-package, static-content, static-page-generator, static-pages
- Language: PHP
- Homepage: https://packagist.org/packages/jithin/cubet-wpm
- Size: 12.7 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jithin/cubet-wpm
Web Page Manager: A laravel package to create and manage static content pages like about, privacy policy etc.
## Installation ##
```
$ composer require jithin/cubet-wpm
```
Open config/app.php, Add the Service Provider
```
jithin\CubetWpm\WebPageProvider::class,
```
Add the Facade to your aliases
```
'WebPage' => jithin\CubetWpm\Facades\WebPage::class,
```
Publish the migrations and commands
```
$ php artisan vendor:publish -tag=migrations
$ php artisan vendor:publish -tag=commands
```
Then run
```
$ php artisan migrate
```
Generate WPM controller, views and routes
```
$ php artisan make:wpm
```
```
$ php artisan make:wpm --views (Only scaffold the wpm views),
$ php artisan make:wpm --force (Overwrite existing files by default)
```
###### Views, Controller and Routes are now published and it can be customized based on the project requirement.
###### Views include `layouts\app` blade; ignore include if there is no such layout blade.
###### Check the `routes\web.php` to find the admin routes.
## Usage
Create new page in admin and publish it. To invoke the page, use the system-generated page slug and specify the view file (optional) to be rendered. If the view file is not specified the default view will be `wpm\static`.
```
WebPage::bind('slug', 'path\to\view')
```
Example:
Create a new page with title 'About Us'. Go to Web Pages List and copy the slug 'about-us'.
Then create new route
```
Route::get('/about', function () {
return WebPage::bind('about-us');
});
```
That's it! You're done.
Have fun!
Jithin