PHP code example of jeffersongoncalves / laravel-cms

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

    

jeffersongoncalves / laravel-cms example snippets


use JeffersonGoncalves\Cms\Models\Page;
use JeffersonGoncalves\Cms\Models\Post;

$page = Page::create([
    'title' => ['en' => 'About us'],
    'slug' => 'about-us',
    'content' => ['en' => '...'],
]);

$post = Post::create([
    'title' => ['en' => 'Hello world'],
    'slug' => 'hello-world',
    'content' => ['en' => '...'],
]);
bash
php artisan vendor:publish --tag="cms-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="cms-config"
bash
php artisan cms:generate-sitemap