PHP code example of flexpik / filament-studio

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

    

flexpik / filament-studio example snippets


use Flexpik\FilamentStudio\FilamentStudioPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugins([
        FilamentStudioPlugin::make(),
    ]);
}

FilamentStudioPlugin::make()
    ->navigationGroup('Content')
    ->enableVersioning()
    ->enableSoftDeletes()
    ->enableApi()
    ->fieldTypes(['currency' => CurrencyFieldType::class])
    ->panelTypes([CustomMapPanel::class]);

use Flexpik\FilamentStudio\FieldTypes\AbstractFieldType;
use Flexpik\FilamentStudio\Enums\EavCast;

class RatingFieldType extends AbstractFieldType
{
    protected static string $key = 'rating';
    protected static string $label = 'Rating';
    protected static string $icon = 'heroicon-o-star';
    protected static EavCast $eavCast = EavCast::Integer;
    protected static string $category = 'numeric';

    public function settingsSchema(): array { /* ... */ }
    public function toFilamentComponent(): Component { /* ... */ }
    public function toTableColumn(): ?Column { /* ... */ }
    public function toFilter(): ?Filter { /* ... */ }
}

FilamentStudioPlugin::afterCollectionCreated(fn ($collection) => /* ... */);
FilamentStudioPlugin::afterFieldAdded(fn ($field) => /* ... */);

FilamentStudioPlugin::modifyFormSchema(fn (array $schema, $collection) => $schema);
FilamentStudioPlugin::modifyTableColumns(fn (array $columns, $collection) => $columns);
FilamentStudioPlugin::modifyQuery(fn ($query) => $query);
bash
composer vendor:publish --tag="filament-studio-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-studio-config"