authorizeResource($model, $parameter); $this->middleware('auth:sanctum')->except(['index', 'show']); $this->middleware("can:restore,$parameter")->only('restore'); $this->middleware("can:forceDelete,$parameter")->only('forceDelete'); } /** * Get the underlying schema. * * @return Schema */ public function schema(): Schema { $schemaClass = Str::of(get_class($this)) ->replace('Controllers\\Api', 'Api\\Schema') ->replace('Controller', 'Schema') ->__toString(); return new $schemaClass(); } }