Skip to content

Commit

Permalink
Merge pull request #1 from amvisor/obey-permissions
Browse files Browse the repository at this point in the history
only display the resource in the quick add dropdown menu if the user is allowed to create a record
  • Loading branch information
awcodes authored Jul 14, 2022
2 parents 6c4a801 + 78173ac commit 8bdfe40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FilamentQuickCreateServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getFilamentResouces()
$resources = array_map(function($resource) {
$resource = App::make($resource);
$route = $resource->getRouteBaseName() . '.create';
if (Route::has($route)) {
if ($resource->canCreate() && Route::has($route)) {
$navItems = $resource->getNavigationItems();
return [
'label' => Str::title($resource->getModelLabel()),
Expand Down

0 comments on commit 8bdfe40

Please sign in to comment.