Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `<?php
- /*
- |--------------------------------------------------------------------------
- | Application Routes
- |--------------------------------------------------------------------------
- |
- | Here is where you can register all of the routes for an application.
- | It's a breeze. Simply tell Laravel the URIs it should respond to
- | and give it the controller to call when that URI is requested.
- |
- */
- Route::get('/', function()
- {
- return View::make('welcome');
- });
- Route::get('registration', function()
- {
- return View::make('registration');
- });
- Route::post('registration', function()
- {
- $user = new AppUser;
- $user->UserName = Input::get('UserName');
- $user->Password = Hash::make(Input::get('Password'));
- $user->FirstName = Input::get('FirstName');
- $user->LastName = Input::get('LastName');
- $user->Gender = Input::get('Gender');
- $user->Email = Input::get('Email');
- $user->Q1 = Input::get('Q1');
- $user->Q2 = Input::get('Q2');
- $user->Q3 = Input::get('Q3');
- $user->save();
- //return View::make('login');
- return redirect('login');
- });
- Route::get('login', function()
- {
- return View::make('login');
- });
- Route::post('login', function()
- {
- $credentials = Input::only('UserName', 'Password');
- if(Auth::attempt($credentials)){
- return Redirect::intended('/');
- }
- return Redirect::to('login');
- });
- Route::get('logout', function()
- {
- Auth::logout();
- return View::make('logout');
- });
- Route::get('welcomepage', ['middleware' => 'auth', function()
- {
- return View::make('welcomepage');
- }]); `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement