mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-11-03 14:03:18 -05:00 
			
		
		
		
	* Create PHP CS Fixer config and add to CI workflow * Run php cs fixer on project * Add newline at end of file * Update to use PHP CS Fixer v3 * Run v3 config on project * Run seperate config in CI
		
			
				
	
	
		
			28 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Crater\Http\Middleware;
 | 
						|
 | 
						|
use Closure;
 | 
						|
use Crater\Providers\RouteServiceProvider;
 | 
						|
use Illuminate\Support\Facades\Auth;
 | 
						|
 | 
						|
class RedirectIfAuthenticated
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Handle an incoming request.
 | 
						|
     *
 | 
						|
     * @param  \Illuminate\Http\Request  $request
 | 
						|
     * @param  \Closure  $next
 | 
						|
     * @param  string|null  $guard
 | 
						|
     * @return mixed
 | 
						|
     */
 | 
						|
    public function handle($request, Closure $next, $guard = null)
 | 
						|
    {
 | 
						|
        if (Auth::guard($guard)->check()) {
 | 
						|
            return redirect(RouteServiceProvider::HOME);
 | 
						|
        }
 | 
						|
 | 
						|
        return $next($request);
 | 
						|
    }
 | 
						|
}
 |