diff --git a/src/Http/Controllers/Cp/Auth/MagicLinkLoginController.php b/src/Http/Controllers/Cp/Auth/MagicLinkLoginController.php index 968f24c..e2f4395 100644 --- a/src/Http/Controllers/Cp/Auth/MagicLinkLoginController.php +++ b/src/Http/Controllers/Cp/Auth/MagicLinkLoginController.php @@ -28,11 +28,11 @@ public function login(Request $request) * the protected content feature. */ $user = User::findByEmail($request->get('user_email')); - if($user !== null) { + if ($user !== null) { Auth::guard('web')->login($user); } - $redirect = !empty($this->magicLinkManager->get()->get($user->email())['redirect_to']) + $redirect = ! empty($this->magicLinkManager->get()->get($user->email())['redirect_to']) ? route($this->magicLinkManager->get()->get($user->email())['redirect_to']) : cp_route(config('statamic-magiclink.url.redirect_on_success')); diff --git a/src/Http/Controllers/Cp/LinksController.php b/src/Http/Controllers/Cp/LinksController.php index a48b33f..de07bf4 100644 --- a/src/Http/Controllers/Cp/LinksController.php +++ b/src/Http/Controllers/Cp/LinksController.php @@ -6,7 +6,6 @@ use Carbon\Carbon; use Codedge\MagicLink\MagicLinkManager; -use Illuminate\Http\Request; use Statamic\CP\Column; final class LinksController extends BaseCpController diff --git a/src/Http/Middleware/MagicLink.php b/src/Http/Middleware/MagicLink.php index 249b354..1474d8d 100644 --- a/src/Http/Middleware/MagicLink.php +++ b/src/Http/Middleware/MagicLink.php @@ -24,7 +24,7 @@ public function handle(Request $request, Closure $next) { $previousRoute = $request->create(url()->previous()); - if($request->has('referer')) { + if ($request->has('referer')) { $previousRoute = $request->create($request->get('referer')); } diff --git a/src/MagicLink.php b/src/MagicLink.php index 64ac127..3417742 100644 --- a/src/MagicLink.php +++ b/src/MagicLink.php @@ -5,7 +5,6 @@ namespace Codedge\MagicLink; use Carbon\Carbon; -use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\URL; use Statamic\Contracts\Auth\User; @@ -19,7 +18,6 @@ final class MagicLink /** * Redirect to the page after a successful login. This is either the CP dashboard or a page with protected * content. - * */ protected string $redirectTo; protected string $link;