awcodes/trov-components

This package is abandoned and no longer maintained. The author suggests using the awcodes/filament-addons package instead.

A set of components / fields to extend Filament Admin.

v0.3.0 2022-05-23 15:42 UTC

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

date input

DateInput::make(string $fieldname)
    ->label('Publish Date')
    ->withoutTime() //optional

Password Generator

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

title with slug title with slug open

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

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

title with status

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()