awcodes / trov-components
A set of components / fields to extend Filament Admin.
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.0.2
- filament/filament: ^2.0
- spatie/laravel-package-tools: ^1.9.2
README
‼️ This package is being deprecated. New version can be found at Filament Addons
A set of components, fields and layouts to extend Filament Admin.
Used by Trov CMS.
Admin
Fixed Sidebar Layout
Just return it directly from your form function in your model resource.
public static function form(Form $form): Form { return FixedSidebar::make() ->schema([ // Main section form components ], [ // Sidebar form components ]); }
Multi Action Button
Usage:
Publish necessary views
php artisan trov-components:make-multi-action-button
Add the following to either Your EditPage or CreatePage resources, or both. And the view will take care of the rest.
protected bool $hasMultiActionButton = true;
Forms
Date Input
DateInput::make(string $fieldname) ->label('Publish Date') ->withoutTime() //optional
Password Generator
All methods from TextInput are available.
PasswordGenerator::make(string $fieldname) ->passwordLength(int $length = 12) ->hasNumbers(bool $hasNumbers = true) ->hasSymbols(bool $hasSymbols = true)
Title With Slug
Creates a TextInput with the ability to modify the slug after creation, but preserves the slug when editing to help with SEO.
TitleWithSlug::make( string $titleFieldName = 'title', string $slugFieldName = 'slug', string|Closure $basePathForResource = '/' )->columnSpan('full')
Separator
Just outputs a sensible hr to help separate components.
Separator::make()
Timestamps
Outputs Created At and Updated At information blocks.
Timestamps::make()
Video Embed
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.
VideoEmbed::make(string $fieldname) ->label('label') ->rows()
Tables
Title With Status Indicator
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
Soft Delete Filter
Require that your model and resources are setup for Soft Deletes. This might become obsolete if Filament impliments their own way of handling Soft Deletes.
SoftDeleteFilter::make()