Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::post('login', function()
- {
- $email = Input::get('email');
- $password = Input::get('password');
- $hashedPassword = Hash::make( $password );
- if (Auth::attempt(array('User_Email' => $email, 'User_Password' => $hashedPassword ) ) )
- {
- $user = User::find(1);
- Auth::login($user);
- return Redirect::intended('dashboard');
- }
- return Redirect::intended('login')->with('flash_error', 'Invalid E-mail/Password');
- });
- /* ############################## VIEW - login.blade.php */
- @extends('backoffice.master')
- @section('content')
- <div class="small-4 small-centered columns">
- @if (Session::has('flash_error'))
- <div class="alert-box alert">{{ Session::get('flash_error') }}</div>
- @endif
- <form method="POST" id="frmLogin">
- <div class="large-12 columns">
- {{ Form::input('email', 'email', null, ['placeholder' => 'E-mail', 'aria-invalid' => 'false', 'id' => 'email'] ) }}
- </div>
- <div class="large-12 columns">
- {{ Form::input('password', 'password', null, ['placeholder' => 'Password', 'id' => 'password'] ) }}
- </div>
- <div class="large-12 columns">
- <button id="submit" class="button large-12" type="submit" name="btn-submit">Login</button>
- </div>
- </form>
- </div>
- @stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement