From 71a605051d7f1b7244dada8a4ae568f862099a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Tue, 14 May 2024 07:05:32 +0000 Subject: [PATCH] add types to RelationController --- src/Http/Controllers/RelationController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Http/Controllers/RelationController.php b/src/Http/Controllers/RelationController.php index d6de839f..79a7d3b8 100644 --- a/src/Http/Controllers/RelationController.php +++ b/src/Http/Controllers/RelationController.php @@ -18,6 +18,7 @@ class RelationController extends Controller */ public function index(Request $request, Model $model): Response { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $data = $field->toIndex($request, $model); @@ -32,6 +33,7 @@ public function index(Request $request, Model $model): Response */ public function create(Request $request, Model $model): Response { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $data = $field->toCreate($request, $model); @@ -46,6 +48,7 @@ public function create(Request $request, Model $model): Response */ public function store(Request $request, Model $model): RedirectResponse { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $related = $field->getRelation($model)->make(); @@ -61,6 +64,7 @@ public function store(Request $request, Model $model): RedirectResponse */ public function show(Request $request, Model $model, Model $related): Response { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $data = $field->toShow($request, $model, $related); @@ -75,6 +79,7 @@ public function show(Request $request, Model $model, Model $related): Response */ public function edit(Request $request, Model $model, Model $related): Response { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $data = $field->toEdit($request, $model, $related); @@ -89,6 +94,7 @@ public function edit(Request $request, Model $model, Model $related): Response */ public function update(Request $request, Model $model, Model $related): RedirectResponse { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $field->handleFormRequest($request, $related); @@ -102,6 +108,7 @@ public function update(Request $request, Model $model, Model $related): Redirect */ public function destroy(Request $request, Model $model, Model $related): RedirectResponse { + /** @var \Cone\Root\Fields\Relation $field */ $field = $request->route('field'); $trashed = class_uses_recursive(SoftDeletes::class) && $related->trashed();