User::withTrashed()->findOrFail($value)); // Set new role for users. UserRoleRegistry::add(3, 'project-manager', trans('enums.user-role.project-manager')); UserRoleRegistry::add(4, 'developper', trans('enums.user-role.developper')); UserRoleRegistry::add(5, 'client', trans('enums.user-role.client')); // Set new props to share. InertiaSharedRegistry::add('noticeTypeEnum', fn () => NoticeTypeEnum::toArray()); InertiaSharedRegistry::add('auth.policies.notices', fn () => [ 'viewAny' => Gate::allows('viewAny', Notice::class), 'viewTrash' => Gate::allows('viewTrash', Notice::class), 'create' => Gate::allows('create', Notice::class), ]); InertiaSharedRegistry::add('auth.policies.invoicePackages', fn () => [ 'viewAny' => Gate::allows('viewAny', InvoicePackage::class), 'viewTrash' => Gate::allows('viewTrash', InvoicePackage::class), 'create' => Gate::allows('create', InvoicePackage::class), ]); InertiaSharedRegistry::add('auth.policies.invoiceCompanies', fn () => [ 'viewAny' => Gate::allows('viewAny', InvoiceCompany::class), 'viewTrash' => Gate::allows('viewTrash', InvoiceCompany::class), 'create' => Gate::allows('create', InvoiceCompany::class), ]); InertiaSharedRegistry::add('auth.policies.gitlabProjects', fn () => [ 'viewAny' => Gate::allows('viewAny', GitlabProject::class), 'viewTrash' => Gate::allows('viewTrash', GitlabProject::class), 'create' => Gate::allows('create', GitlabProject::class), ]); InertiaSharedRegistry::add('auth.policies.sites', fn () => [ 'viewAny' => Gate::allows('viewAny', Site::class), 'viewTrash' => Gate::allows('viewTrash', Site::class), 'create' => Gate::allows('create', Site::class), ]); InertiaSharedRegistry::add('auth.policies.brands', fn () => [ 'viewAny' => Gate::allows('viewAny', Brand::class), 'viewTrash' => Gate::allows('viewTrash', Brand::class), 'create' => Gate::allows('create', Brand::class), ]); } }