PHP code example of statikbe / laravel-filament-flexible-content-blocks

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

    

statikbe / laravel-filament-flexible-content-blocks example snippets


public static function table(Table $table): Table {
    return $table->columns([
            TitleColumn::create(),
            PublishedColumn::create(),
        ])
        ->filters([
            PublishedFilter::create(),
        ])
        ->actions([
            Tables\Actions\EditAction::make(),
            PublishAction::make(),
            ReplicateAction::make(),
        ])
        ->bulkActions([
            Tables\Actions\DeleteBulkAction::make(),
        ]);
}

use Statikbe\FilamentFlexibleContentBlocks\Filament\Table\Actions\ViewAction;

->actions([
    Tables\Actions\EditAction::make(),
    PublishAction::make(),
    ViewAction::make(), // <-- Add this
])

use Statikbe\FilamentFlexibleContentBlocks\Filament\Table\Actions\ViewAction;

->actions([
    Tables\Actions\EditAction::make(),
    PublishAction::make(),
    ReplicateAction::make(), // <-- Add this
])

public static function form(Form $form): Form {
    return $form
        ->schema([
            Tabs::make('Heading')
                ->columnSpan(2)
                ->tabs([
                    Tab::make('General')
                        ->schema([
                            TitleField::create(true),
                            SlugField::create(),
                            PublicationSection::create(),
                            AuthorField::create(),
                            HeroImageSection::create(),
                            IntroField::create(),
                            ParentField::create(),
                        ]),
                    Tab::make('Content')
                        ->schema([
                            ContentBlocksField::create(),
                        ]),
                    Tab::make('Overview')
                        ->schema([
                            OverviewFields::make(1),
                        ]),
                    Tab::make('SEO')
                        ->schema([
                            SEOFields::make(1),
                        ]),
                ]),    
        ]);
}

protected static ?string $recordRouteKeyName = 'id';

public static function getPages(): array
{
    //note: replace the page classes!
    return [
        'index' => Pages\ListArticles::route('/'),
        'create' => Pages\CreateArticle::route('/create'),
        'edit' => Pages\EditArticle::route('/{record:id}/edit'),
    ];
}

'theme' => 'tailwind', // 'tailwind' (default), 'bootstrap4-kul' or 'filament'

'theme' => 'filament',
json
{
    "scripts": {
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=filament-flexible-content-blocks-assets --force"
        ]
    }
}

@source "../../vendor/statikbe/laravel-filament-flexible-content-blocks/**/*.blade.php";
@source "../../config/filament-flexible-content-blocks.php";
css
/* the first line covers published views, the second the package defaults */
@source '../../../../resources/views/vendor/filament-flexible-content-blocks/**/*.blade.php';
@source '../../../../vendor/statikbe/laravel-filament-flexible-content-blocks/resources/views/**/*.blade.php';
@source '../../../../config/filament-flexible-content-blocks.php';

php artisan openai:install