PHP code example of nickdekruijk / larapages

1. Go to this page and download the library: Download nickdekruijk/larapages 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/ */

    

nickdekruijk / larapages example snippets


NickDeKruijk\LaraPages\LaraPagesServiceProvider::class,

'larapages' => \NickDeKruijk\LaraPages\LaraPagesAuth::class,

Route::get('{any}', 'PageController@route')->where('any', '(.*)');

'preview' => '/preview/page/{id}',          # Enable preview button, links to this url

Route::get('/preview/page/{id}', function ($id) {
    $page = App\Page::findOrFail($id);
    if (!View::exists($page->view)) $page['view']='detail';
    return view($page->view, compact('page'));
})->middleware('larapages');