PHP code example of tilabs / laravel-content
1. Go to this page and download the library: Download tilabs/laravel-content 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/ */
tilabs / laravel-content example snippets
use Tilabs\LaravelContent\Models\Content;
// all published posts
$posts = Content::published()->get();
// a single post by slug
$post = Content::where('slug', 'news_laravel-content')->firstOrFail();
bash
php artisan vendor:publish --provider="Tilabs\LaravelContent\Providers\ContentServiceProvider"
bash
php artisan content:clear