PHP code example of afea / filament-pages

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

    

afea / filament-pages example snippets


->plugin(\Afea\Cms\Pages\Filament\PagesPlugin::make())

$toc = $page->toc();
$tree = $toc->tree();        // nested array of id/text/children
$html = $toc->html();         // content with ids injected

class CustomPage extends \Afea\Cms\Pages\Models\CustomPage
{
    public function scopePublished(Builder $q): Builder
    {
        return $q->active()->whereNotNull('system_name');
    }
}

'models' => ['custom_page' => \App\Models\CustomPage::class],
bash
php artisan vendor:publish --tag=afea-pages-views