Add store function to LoginController
MODIFY
app/Http/Controllers/LoginController.php
app/Http/Controllers/LoginController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
class LoginController extends Controller {
public function index() {
return view('login');
}
+
+ public function store(Request $request) {
+ $email = $request->input('email');
+ $password = $request->input('password');
+
+ if (Auth::attempt([
+ 'email' => $email,
+ 'password' => $password
+ ])) {
+ return redirect()->route('dashboard_get');
+ } else {
+ return redirect()->route('login_get');
+ }
+ }
}

MODIFY
routes/web.php
routes/web.php
@@ -16,3 +16,4 @@ Route::get('/', function () {
});
Route::get('/login', 'LoginController@index')->name('login_get');
+Route::post('/login', 'LoginController@store')->name('login_post');

Add store function to LoginController