mcdc
Repeater: Get current form id
I have this task table where fields are
id
, title
, description
, creator_id
, due_date
, parent_id
, type
I added Repeater on my $form , my goal is I want create sub task, which is determine by type
and also under what main task parent_id
.
How to get the id
and assign it as default on my TextInput::make('parent_id')
4 replies
Restrict user to view certain Navigation Group
How to restrict other user/acc with type
user
from viewing NavigationGroup::make('Admin')
and only user with type admin
https://filamentphp.com/docs/2.x/admin/navigation#advanced-navigation-customization
11 replies
Store data to pivot table
How do I call or store some data to my pivot_table
task_user
public static function form(Form $form): Form
{
return $form
->schema([
TextInput::make('title')->required(),
TextInput::make('description')->required(),
Forms\Components\MultiSelect::make('assignee_id')
->label('Assigned to')
->multiple()
->options(User::pluck('name', 'id')->toArray()),
TextInput::make('creator_id')
->label('Creator')
->default(auth()->user()->id)
->disabled()
->hint('Creator '.auth()->user()->name)
->hintIcon('tabler-info-circle'),
DatePicker::make('due_date')
->label('Due Date')
->minDate(now())
]);
}
So I want those assignee_id
to be store on my task_user
table
I did try this one out, and seems like I cant figure it out
https://filamentphp.com/docs/2.x/admin/resources/relation-managers#creating-with-pivot-attributes4 replies
Multiple headerActions on export plugins
It will be good idea to have fully custom multiple header action, i dont know if its already there, but I tried its not working
use AlperenErsoy\FilamentExport\Actions\FilamentExportHeaderAction;
->headerActions([
FilamentExportHeaderAction::make('Export')->defaultFormat('pdf')->label('Export PDF'),
FilamentExportHeaderAction::make('Export')->defaultFormat('xlsx')->label('Export Excel'),
FilamentExportHeaderAction::make('Export')->defaultFormat('csv')->label('Export CSV')
])
https://github.com/alperenersoy/filament-export/issues/6628 replies
How to hide custom navigation menu for my regular user? and only admin can see it
private function configureAdminMenu()
{
Filament::navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $builder->item(
NavigationItem::make('Dashboard')
->url(route('filament.pages.dashboard'))
->label('Dashboard')
->icon('heroicon-o-home'))
->groups([
// hide this to regular user
NavigationGroup::make('Authentication')
->items([
// hide this to regular user
NavigationGroup::make('System')
->items([
NavigationItem::make('Application Health')
->url(route('filament.pages.health-check-results'))
->icon('heroicon-o-heart')
->sort(1),
NavigationItem::make('Backups')
->url('/admin/backups')
->icon('heroicon-o-cog')
->sort(2),
]),
]);
});
}
2 replies