H4L1M
H4L1M
FFilament
Created by codeartisan on 3/22/2024 in #❓┊help
Create default filter to be today
what if the user wants to see records from older dates
11 replies
FFilament
Created by nowak on 3/7/2024 in #❓┊help
How to hide a field in a 2 column layout and keep the space reserved
main section with 2 columns contains child section + field 3 child section with 2 columns and contains ur 2 fields
4 replies
FFilament
Created by WEBMAS on 3/4/2024 in #❓┊help
How to align content to the right?
schema([.......])->alignEnd()
8 replies
FFilament
Created by nowak on 3/4/2024 in #❓┊help
Show name instead of id in Select relationship field, upon record soft deletion.
hi; out of ur question ; whats $get('../../meal_type_id') ??? can u explain it pls
10 replies
FFilament
Created by H4L1M on 2/23/2024 in #❓┊help
Notification not working from Action Component
inside the action() method we can initiate a notification without the need to use successNotificationTitle() method {wich didnt work me}
->action(function (array $data) {
// your logic
Notification::make()
->success()
->title('test')
->body('test')
->send();
})
->action(function (array $data) {
// your logic
Notification::make()
->success()
->title('test')
->body('test')
->send();
})
4 replies
FFilament
Created by H4L1M on 2/22/2024 in #❓┊help
Save Action in a separate file
any other suggestions?
6 replies
FFilament
Created by H4L1M on 2/22/2024 in #❓┊help
Save Action in a separate file
@Leandro Ferreira Was just wondering and thought to add a question maybe some else will have the same ... , figured that I can add a method like userform() that returns an array in the related model "User" for example
public static function userForm() {
return [
textinput::make('email'),
.....
];
}
public static function userForm() {
return [
textinput::make('email'),
.....
];
}
then just call it like
User::userForm()
User::userForm()
wherever I want the form
6 replies
FFilament
Created by MajistraFila on 2/20/2024 in #❓┊help
[Solved] : Add Action to generate a word doc
inside your shema add
Forms\Components\Actions\Action::make('generateWordAction')
Forms\Components\Actions\Action::make('generateWordAction')
and follow https://filamentphp.com/docs/3.x/actions/trigger-button
6 replies
FFilament
Created by H4L1M on 2/17/2024 in #❓┊help
Form Component Placeholder
hello, the place holder accepts a method ->extraAttributes() the solution is to pass css class in an array like this
Forms\Components\Placeholder::make('User.ban')
->extraAttributes([
'class' => 'text-danger-600',
])
->content('red text')
Forms\Components\Placeholder::make('User.ban')
->extraAttributes([
'class' => 'text-danger-600',
])
->content('red text')
how ever theres only text-danger-600 compiled in the CSS app class , so am using
'sytle' => 'color: red'
'sytle' => 'color: red'
instead , did I forget somethig ? also the palceholder accepts HTML code ingection like this
->content(function ($record) {
$content = $record->isBanned()
? '<p style="color: red" class="font-bold">Banned</p>
<span class="block sm:inline">This user is Banned.</span>'
: '<p style="color: green" class="font-bold">Not Banned</p>
<span class="block sm:inline">This user currently has no active bans.</span>';
return new HtmlString($content);
})
->content(function ($record) {
$content = $record->isBanned()
? '<p style="color: red" class="font-bold">Banned</p>
<span class="block sm:inline">This user is Banned.</span>'
: '<p style="color: green" class="font-bold">Not Banned</p>
<span class="block sm:inline">This user currently has no active bans.</span>';
return new HtmlString($content);
})
as @Prosp30 motioned , thnks
5 replies