PHP code example of glebstar / laravel5-simple-cms

1. Go to this page and download the library: Download glebstar/laravel5-simple-cms library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

glebstar / laravel5-simple-cms example snippets


GlebStarSimpleCms\ServiceProvider::class,


Route::group(['prefix' => 'cms', 'middleware' => 'cms'], function(){
    Route::get('/', ['as' => 'cms', 'uses' =>'\GlebStarSimpleCms\Controllers\AdminController@index']);
    Route::match(['get', 'post'], '/add', '\GlebStarSimpleCms\Controllers\AdminController@add');
    Route::match(['get', 'post'], '/edit/{id}', '\GlebStarSimpleCms\Controllers\AdminController@edit');
    Route::delete('/delete/{id}', '\GlebStarSimpleCms\Controllers\AdminController@delete');
});

// this route should be the last.
Route::get('{path}', '\GlebStarSimpleCms\Controllers\CmsController@index')->where('path', '([A-z\d-\/_.]+)?');

@extends('layouts.main')

@section('add_title'){{$page->title}}@endsection
@section('description'){{$page->description}}@endsection
@section('keywords'){{$page->keywords}}@endsection

@section('content')
    <div class="container">
        @can('editor')
        <div>
            <a class="btn btn-info" href="{{ route('cms') }}/edit/{{ $page->id }}">Edit</a>
        </div>
        @endcan
        @yield('cmspagebody')
    </div>
@endsection
shell
php artisan vendor:publish --provider="GlebStarSimpleCms\ServiceProvider"
shell
php artisan migrate