app->bind(CustomFieldValueWriter::class, EloquentCustomFieldValueWriter::class); } public function boot(): void { Gate::policy(CustomField::class, CustomFieldPolicy::class); Gate::policy(Note::class, NotePolicy::class); $noteAbilities = [ 'manage notes' => 'manageNotes', 'view notes' => 'viewNotes', ]; foreach ($noteAbilities as $ability => $method) { Gate::define($ability, [NotePolicy::class, $method]); } } }