A set of components, fields and layouts to extend Filament Admin.
composer require awcodes/filament-addons
php artisan vendor:publish --tag=filament-addons-config
If you are using a custom theme for Filament you will need to add this plugin's views to your Tailwind CSS config. Once this is done you may disable the plugin's stylesheet in the config file by changing 'load_styles' to false.
content: [
...
"./vendor/awcodes/filament-addons/resources/views/**/*.blade.php",
],
Just return it directly from your form function in your model resource.
use FilamentAddons\Admin\FixedSidebar;
public static function form(Form $form): Form
{
return FixedSidebar::make()
->schema([
// Main section form components
], [
// Sidebar form components
]);
}
use FilamentAddons\Forms\Fields\DateInput;
DateInput::make(string $fieldname)
->label('Publish Date')
->withoutTime() //optional
All methods from TextInput are available.
use FilamentAddons\Forms\Fields\PasswordGenerator;
PasswordGenerator::make(string $fieldname)
->passwordLength(int $length = 12)
->hasNumbers(bool $hasNumbers = true)
->hasSymbols(bool $hasSymbols = true)
Creates a TextInput with the ability to modify the slug after creation, but preserves the slug when editing to help with SEO.
use FilamentAddons\Forms\Components\TitleWithSlug;
TitleWithSlug::make(
string $titleFieldName = 'title',
string $slugFieldName = 'slug',
string|Closure $basePathForResource = '/'
)->columnSpan('full')
Outputs Created At and Updated At information blocks.
use FilamentAddons\Forms\Components\Timestamps;
Timestamps::make()
Just outputs a sensible hr to help separate components.
use FilamentAddons\Forms\Components\Separator;
Separator::make()
use FilamentAddons\Forms\Components\Heading;
Heading::make('whatevs')->level('h3')->content('This is a test')
Allows embeded code with preview. This field does not sanitize your values. You are responsible for purifying any raw html input or output.
Supports most of the Textarea field's options.
use FilamentAddons\Forms\Fields\VideoEmbed;
VideoEmbed::make(string $fieldname)
->label('label')
->rows()
Allows oembedding a video with preview.
Onlys supports YouTube and Vimeo at the moment.
use FilamentAddons\Forms\Components\OEmbed;
OEmbed::make(string $fieldname)
use FilamentAddons\Tables\Columns\TitleWithStatus;
TitleWithStatus::make(string $fieldname = 'title')
->statusField(string $fieldname = 'status') // optional
->statuses(array | Arrayable (Enum) Status::class)
->colors(array | Arrayable (Enum) Status::colors())
->hiddenOn(string | null Status::Published->name) //optional