PHP code example of tanthammar / filament-extras

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

    

tanthammar / filament-extras example snippets


AddressSection::make(string $jsonColumnName = 'address', string $label = 'Address'); //Address lookup using free OSM service. Consists of AddressSearch + AddressFields
AddressSearch::make(string $jsonColumnName = 'address'); //Address search field only, if you want to add your own fields for the Address lookup
AddressFields::make(?string $jsonColumnName = null); //The fields that Address search tries to fill 

Uuid::make(mixed $hiddenOn, string $column = 'uuid');
BusinessName::make(string $column = 'name');
FirstName::make(string $column = 'first_name');
LastName::make(string $column = 'last_name');
Email::make(string $column = 'email', bool $unique = true);

Disabled::make(string $name); //Field that carries and displays a value but cannot be edited in frontend, represented with a dashed border
HiddenOrSelect::make(bool $condition, string $column, string $label, string|array $rule, array $options );
HiddenOrText::make(bool $condition, string $column, string $label, string|array $rule);

JetstreamAuthorSection::make();

LandLine::make(string $column = 'phone', null|int $default = 460, string $label = 'fields.phone');//validates international landline numbers
Mobile::make(string $column = 'mobile', null|int $default = 460, string $label = 'fields.mobile'); //validates international mobile numbers
Phone::make(string $column = 'phone', null|int $default = 460, string $label = 'fields.phone'); //validates international phone numbers (disregards phone number type)

SpatieSlug::make(mixed $hiddenOn, string $column = 'slug');
TranslatableDescription::make(string $column, string $autoFillFrom, string $label);

PasswordInput::current();
PasswordInput::create();
PasswordInput::confirmation();

TodoField::make('Create a custom positioning field'),

PhoneInput, validators and more...

DTOColumn::make(string $column, string $attribute); //If you cast your json column into DTO's. Retrieved as $column?->attribute ?? ''
JsonColumn::make(string $column, string $dotNotation); //Cast your json column into 'array'. Retreived as data_get($column, $dotNotation, '')
PhoneColumn::make(string $column); //Auto-format phone numbers
PhoneParseE164Column::make(string $column) //Auto-format E164 phone numbers