This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
ModuleWeb/SRC/app/Http/Controllers/Auth/AuthController.php

30 lines
617 B
PHP
Raw Normal View History

2015-02-12 12:56:47 +00:00
<?php namespace App\Http\Controllers\Auth;
2015-02-15 06:12:44 +00:00
use Illuminate\Routing\Controller;
use Auth;
2015-02-12 12:56:47 +00:00
class AuthController extends Controller {
/**
2015-02-15 06:12:44 +00:00
* Handle an authentication attempt.
*
* @return Response
*/
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password]))
{
return redirect()->intended('/admin');
}
return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?',]);
}
2015-02-12 12:56:47 +00:00
2015-02-15 06:12:44 +00:00
public function logout()
{
Auth::logout();
}
2015-02-12 12:56:47 +00:00
}
2015-02-15 06:12:44 +00:00