Areslane
Areslane
FFilament
Created by Areslane on 9/25/2024 in #❓┊help
table filters are not working when i customized getEloquentQuery()
public static function getEloquentQuery(): Builder { // Apply custom authorization and query modifications if (!auth()->user()->can("viewAny")) { $subordinateIds = auth()->user()->subordinates()->pluck('id'); // Ensure the query context is for MyEvent model $createdByUserOrSubordinates = function ($query) use ($subordinateIds) { $query->whereIn('creator_id', [...$subordinateIds, auth()->id()]); }; // Ensure the query context is for MyEvent model $eventHasAuthUserOrSubordinates = function ($query) use ($subordinateIds) { $query->whereIn('worker_id', [...$subordinateIds, auth()->id()]); }; // Apply conditions to the query return parent::getEloquentQuery()->where($createdByUserOrSubordinates) ->orWhereHas('eventWorkers', $eventHasAuthUserOrSubordinates); } return parent::getEloquentQuery(); }
2 replies
FFilament
Created by Areslane on 9/25/2024 in #❓┊help
Table action modal freezes and searchable does not work
No description
3 replies
FFilament
Created by Areslane on 8/27/2024 in #❓┊help
how to make roles accesible only to admin in filament shields
i am working on an erp where mutliple users have access to the same panel, and i wanted to make an rbac but allow only the admin to see and use the filament shields along with assigning the roles to users.
2 replies
FFilament
Created by Areslane on 7/22/2024 in #❓┊help
how to require confirmation in the save action of the edit page?
i want to require confirmation before saving my edited informations
3 replies