- 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);

View file

@ -19,6 +19,7 @@ class TrimStrings extends BaseTrimmer
* @var array
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];

View file

@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers =
Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}