1<?php
2namespace App\Http\Controllers;
3
4use Illuminate\Http\Request;
5use Illuminate\Support\Facades\Auth;
6
7class LoginController extends Controller{
8 public function authenticate(Request $request){
9 // Retrive Input
10 $credentials = $request->only('email', 'password');
11
12 if (Auth::attempt($credentials)) {
13 // if success login
14
15 return redirect('berhasil');
16
17 //return redirect()->intended('/details');
18 }
19 // if failed login
20 return redirect('login');
21 }
22}