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