middleware(AuthorizesPivot::class.":{$foreignModel},{$foreignParameter},{$relatedModel},{$relatedParameter}"); $this->middleware(Authenticate::using('sanctum'))->except(['index', 'show']); } /** * Get the underlying schema. */ public function schema(): Schema { $schemaClass = Str::of(static::class) ->replace('Controllers\\Api', 'Api\\Schema') ->replace('Controller', 'Schema') ->__toString(); return new $schemaClass(); } }