1. Go to this page and download the library: Download farsi/inertia-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/ */
farsi / inertia-content example snippets
use Farsi\InertiaContent\Facades\Content;
Route::get('/docs/{path?}', function ($path = 'index') {
return Content::pageOrFail("docs/$path");
})->where('path', '.*');
use Farsi\InertiaContent\Facades\Content;
// Find a single entry
$entry = Content::find('docs/intro');
// Check if content exists
if (Content::exists('docs/intro')) {
// ...
}
// Query multiple entries
$entries = Content::query()
->where('_dir', 'docs')
->where('draft', false)
->orderBy('order', 'asc')
->get();
// Get navigation tree
$nav = Content::navigation('docs');