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/ */
$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');
}
}