tethys/app/Http/Controllers/Auth/LoginController.php
Arno Kaimbacher dfe76d1a36 - composer updates for 3rd party libraries
- LoginController.php: logout to new frontend
- db migration file for changing smallInteger to integer for: elevation_min, elevation_max, elevation_absolut, depth_min, depth_max, depth_absolut
2022-08-04 15:03:05 +02:00

58 lines
1.4 KiB
PHP

<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
/**
* Logout trait
*
* @author Yugo <dedy.yugo.purwanto@gmail.com>
* @param Request $request
* @return void
*/
protected function logout(Request $request)
{
$this->guard()->logout();
$request->session()->flush();
$request->session()->regenerate();
$frontend = config('tethys.frontend');
return redirect($frontend);
}
}