PHP code example of fayne / laravel-filament-page

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

    

fayne / laravel-filament-page example snippets


use Fayne\Page\Filament\PagePlugin;

return $panel->plugins([
    // Keep the host's existing plugins.
    PagePlugin::make(),
]);

namespace App\Models;

class Page extends \Fayne\Page\Models\Page
{
}

namespace App\Filament\Resources;

use Fayne\Page\Filament\Resources\PageResource as BasePageResource;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;

class PageResource extends BasePageResource
{
    public static function form(Schema $schema): Schema
    {
        $schema = parent::form($schema);

        return $schema->components([
            ...$schema->getComponents(),
            TextInput::make('extra_data.project_note'),
        ]);
    }
}

// config/filament-page.php
'models' => [
    'page' => \App\Models\Page::class,
],
'resources' => [
    'page' => \App\Filament\Resources\PageResource::class,
],
'resource_slugs' => [
    'page' => 'content-pages',
],

// config/filament-page.php
'creation_limited_page_types' => ['homepage' => 1, '404_page' => 1],
'page_type_changeable' => false,
'fixed_components' => [],
'excluded_components' => [],
'use_default_frontend_routes' => true,

// config/filament-cms.php
'multilingual_enabled' => true,
'default_locale' => 'en',
'supported_locales' => ['en' => 'English', 'zh_CN' => '简体中文'],
bash
composer vendor:publish --tag=filament-page-config
php artisan cms:install
php artisan filament:assets
php artisan cms:page:install
bash
php artisan cms:page:install
php artisan cms:page:install --demo
php artisan cms:page:install --demo --tenant=shop
php artisan cms:page:install --no-interaction