Config Awal Laravel
Laravel 2021-11-27
1. Agar Resgister Laravel UI disable
Tambahakan code pada rputes/web.php
Auth::routes(['register' => false]);
2. Ubah Direct after Login
Seeting pada file app/provides/RouteServiceProvide.php Rubah baris
public const PANEL = '/panel/home';
Selanjutnya rubah XXX yang ada pada path app/Http/Auth/LoginController.php menjadi cons variable yg sudah di buat.
protected $redirectTo = RouteServiceProvider::XXX;
3. Jika susah login direct ke halaman Dashboard
Buka path app/Http/Middleware RedirectIfAuthenticated.php dan rubah function handle ganti
RouteServiceProvider jadi cons yg sudah di buat
public function handle(Request $request, Closure $next, ...$guards)
{
$guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::PANEL);
}
}
return $next($request);
}