- laravel framework upgrade frpm 7.x to 8. see also: https://laravel.com/docs/8.x/upgrade#assert-exact-json-method

- use  PHP7 null coalesce operator instead of laravel optional method
- change Breadcrumbs::register method to Bredcrumbs::for method
- composer updates
This commit is contained in:
Arno Kaimbacher 2022-08-10 11:18:10 +02:00
parent 1b2e77d907
commit 8ea540a88c
50 changed files with 616 additions and 263 deletions

View file

@ -1,6 +1,7 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Support\Facades\Auth;
@ -14,10 +15,17 @@ class RedirectIfAuthenticated
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
public function handle($request, Closure $next, $guards = [null])
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
$guards = empty($guards) ? [null] : $guards;
// if (Auth::guard($guard)->check()) {
// return redirect('/home');
// }
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
}
return $next($request);