PHP code example of athphane / filament-support

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

    

athphane / filament-support example snippets


// config/filament-support.php

return [
    'modifiers' => [
        'forms' => env('FILAMENT_SUPPORT_MODIFIER_FORMS', true),
        'actions' => env('FILAMENT_SUPPORT_MODIFIER_ACTIONS', true),
        'tables' => env('FILAMENT_SUPPORT_MODIFIER_TABLES', true),
        'infolists' => env('FILAMENT_SUPPORT_MODIFIER_INFOLISTS', true),
        'summarizers' => env('FILAMENT_SUPPORT_MODIFIER_SUMMARIZERS', true),
    ],
];

use Athphane\FilamentSupport\Forms\Components\Coordinate;

Coordinate::make('coordinates')
    ->defaultCoordinates(4.1749, 73.5079)
    ->mapHeight(500);

use Athphane\FilamentSupport\Forms\Components\PublishStatusSelect;

PublishStatusSelect::make('status');

use Athphane\FilamentSupport\Forms\Components\SpatieMediaLibraryFileUpload;

SpatieMediaLibraryFileUpload::make('attachment');

use Athphane\FilamentSupport\Infolists\Components\CoordinateMap;

CoordinateMap::make('coordinates');

use Athphane\FilamentSupport\Enums\PublishStatuses;

// Options: DRAFT, PENDING, PUBLISHED, REJECTED
// Includes color, icon, and label methods for Filament

use Athphane\FilamentSupport\Traits\FilamentAdminUrls;

class Post extends Model
{
    use FilamentAdminUrls;

    // Disable admin URL generation if needed
    public function disableAdminUrlGeneration(): bool
    {
        return true;
    }
}

// Usage
$adminUrl = $post->getAdminUrl('edit');
bash
php artisan vendor:publish --tag="filament-support-config"