jawaad
jawaad
FFilament
Created by yannisc. on 2/4/2024 in #❓┊help
TrimStrings Middleware is not working?
It still does not work..
use Illuminate\Foundation\Http\Middleware\TrimStrings;

// ...
->middleware([
TrimStrings::class,
], isPersistent: true)
use Illuminate\Foundation\Http\Middleware\TrimStrings;

// ...
->middleware([
TrimStrings::class,
], isPersistent: true)
The only working solution is using configure in appService in boot:
Forms\Components\TextInput::configureUsing(function (Forms\Components\TextInput $textInput): void {
$textInput
->dehydrateStateUsing(function (?string $state): ?string {
return is_string($state) ? trim($state) : $state;
});
});
Forms\Components\TextInput::configureUsing(function (Forms\Components\TextInput $textInput): void {
$textInput
->dehydrateStateUsing(function (?string $state): ?string {
return is_string($state) ? trim($state) : $state;
});
});
Not as perfect as I espected but, I think TextInput is enough for me, and if we want, we can also add in Textarea, Richeditor as well..
4 replies
FFilament
Created by Benjamin on 9/14/2024 in #❓┊help
How to customize select option label (different when open/closed)
my bad, you said that it is implemented with getLabel, and using allowHtml, make sense.
8 replies
FFilament
Created by Benjamin on 9/14/2024 in #❓┊help
How to customize select option label (different when open/closed)
How you get this feature? Is it FIlament 4? I have try it and Description is not showed in Select Field. In the docs also mentioned "HasDescription" applied for Radio and CheckboxList: https://filamentphp.com/docs/3.x/support/enums#enum-descriptions
8 replies
FFilament
Created by rubendn on 9/14/2024 in #❓┊help
2 Different Tables For The Same Resource
The OP asked how to make 2 different CRUD with the same "Resource", which can be confused. Because, one CRUD = one Resource. So, my guess the OP want to have 2 different CRUD, with the same Model.
9 replies
FFilament
Created by rubendn on 9/14/2024 in #❓┊help
2 Different Tables For The Same Resource
You can create another Resource with the same Model. Just change the $model, for example User.
php artisan make:filament-resource MyOtherUser
php artisan make:filament-resource MyOtherUser
class MyOtherUserResource extends Resource {
protected static ?string $model = User::class; // change it
// ...
}
class MyOtherUserResource extends Resource {
protected static ?string $model = User::class; // change it
// ...
}
9 replies
FFilament
Created by krkmo on 3/6/2024 in #❓┊help
Equivalence of getEloquentQuery( ) in Relation Manager
In the table function add this:
->modifyQueryUsing(fn (Builder $query) => $query->query()) // your query
->modifyQueryUsing(fn (Builder $query) => $query->query()) // your query
3 replies