diff --git a/src/Laravel/src/Fields/Relationships/HasMany.php b/src/Laravel/src/Fields/Relationships/HasMany.php index cee1dd101..a3a9c664a 100644 --- a/src/Laravel/src/Fields/Relationships/HasMany.php +++ b/src/Laravel/src/Fields/Relationships/HasMany.php @@ -111,7 +111,7 @@ public function getRedirectAfter(Model|int|null|string $parentId): ?string return (string) value($this->redirectAfter, $parentId, $this); } - if($this->isAsync()) { + if ($this->isAsync()) { return null; } diff --git a/src/Laravel/src/Fields/Relationships/HasOne.php b/src/Laravel/src/Fields/Relationships/HasOne.php index 6f169bf35..bb63297e6 100644 --- a/src/Laravel/src/Fields/Relationships/HasOne.php +++ b/src/Laravel/src/Fields/Relationships/HasOne.php @@ -168,7 +168,7 @@ public function getRedirectAfter(Model|int|null|string $parentId): ?string return (string) value($this->redirectAfter, $parentId, $this); } - if($this->isAsync()) { + if ($this->isAsync()) { return null; } diff --git a/src/Laravel/src/Http/Controllers/CrudController.php b/src/Laravel/src/Http/Controllers/CrudController.php index 43b083392..410a1fb32 100644 --- a/src/Laravel/src/Http/Controllers/CrudController.php +++ b/src/Laravel/src/Http/Controllers/CrudController.php @@ -7,7 +7,6 @@ use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Contracts\Support\Jsonable; use Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests; -use MoonShine\Contracts\Core\CrudResourceContract; use MoonShine\Laravel\Contracts\Notifications\MoonShineNotificationContract; use MoonShine\Laravel\Http\Requests\MoonShineFormRequest; use MoonShine\Laravel\Http\Requests\Resources\DeleteFormRequest; @@ -151,10 +150,10 @@ protected function updateOrCreate( $resource = $request->getResource(); $item = $resource->getItemOrInstance(); - $redirectRoute = static function (CrudResource $resource) use($request): ?string { + $redirectRoute = static function (CrudResource $resource) use ($request): ?string { $redirect = $request->input('_redirect', $resource->getRedirectAfterSave()); - if(\is_null($redirect) && !$resource->isCreateInModal() && $resource->isRecentlyCreated()) { + if (\is_null($redirect) && ! $resource->isCreateInModal() && $resource->isRecentlyCreated()) { return $resource->getFormPageUrl($resource->getCastedData()); } @@ -182,7 +181,7 @@ protected function updateOrCreate( ToastType::SUCCESS ); - if(\is_null($redirectRoute($resource))) { + if (\is_null($redirectRoute($resource))) { return back(); } diff --git a/src/Laravel/src/Http/Controllers/MoonShineController.php b/src/Laravel/src/Http/Controllers/MoonShineController.php index 6931d84ef..9181c31c8 100644 --- a/src/Laravel/src/Http/Controllers/MoonShineController.php +++ b/src/Laravel/src/Http/Controllers/MoonShineController.php @@ -75,7 +75,7 @@ protected function reportAndResponse(bool $isAjax, Throwable $e, ?string $redire $this->toast(__($message), $type); - if(\is_null($redirectRoute)) { + if (\is_null($redirectRoute)) { return back()->withInput(); } diff --git a/src/Laravel/src/Traits/Resource/ResourceCrudRouter.php b/src/Laravel/src/Traits/Resource/ResourceCrudRouter.php index 39df14963..b81106d37 100644 --- a/src/Laravel/src/Traits/Resource/ResourceCrudRouter.php +++ b/src/Laravel/src/Traits/Resource/ResourceCrudRouter.php @@ -114,11 +114,11 @@ public function getAsyncMethodUrl( public function getRedirectAfterSave(): ?string { - if(\is_null($this->redirectAfterSave) && !$this->isAsync()) { + if (\is_null($this->redirectAfterSave) && ! $this->isAsync()) { $this->redirectAfterSave = PageType::FORM; } - if(\is_null($this->redirectAfterSave)) { + if (\is_null($this->redirectAfterSave)) { return null; }