middleware(Authenticate::using('sanctum')); } /** * Display a listing of the resource. * * @param ShowRequest $request * @param ShowAction $action * @return MyResource */ public function show(ShowRequest $request, ShowAction $action): MyResource { $query = new Query($request->validated()); /** @var User $user */ $user = Auth::user(); $show = $action->show($user, $query, $request->schema()); return new MyResource($show, $query); } /** * Get the underlying schema. * * @return Schema * * @noinspection PhpMissingParentCallCommonInspection */ public function schema(): Schema { return new MySchema(); } }