Advertisement
Guest User

Untitled

a guest
May 4th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. `<?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Application Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register all of the routes for an application.
  9. | It's a breeze. Simply tell Laravel the URIs it should respond to
  10. | and give it the controller to call when that URI is requested.
  11. |
  12. */
  13.  
  14.  
  15. Route::get('/', function()
  16. {
  17. return View::make('welcome');
  18. });
  19.  
  20. Route::get('registration', function()
  21. {
  22. return View::make('registration');
  23. });
  24.  
  25.  
  26.  
  27. Route::post('registration', function()
  28. {
  29. $user = new AppUser;
  30. $user->UserName = Input::get('UserName');
  31. $user->Password = Hash::make(Input::get('Password'));
  32. $user->FirstName = Input::get('FirstName');
  33. $user->LastName = Input::get('LastName');
  34. $user->Gender = Input::get('Gender');
  35. $user->Email = Input::get('Email');
  36. $user->Q1 = Input::get('Q1');
  37. $user->Q2 = Input::get('Q2');
  38. $user->Q3 = Input::get('Q3');
  39. $user->save();
  40. //return View::make('login');
  41. return redirect('login');
  42. });
  43.  
  44.  
  45. Route::get('login', function()
  46. {
  47. return View::make('login');
  48. });
  49.  
  50. Route::post('login', function()
  51. {
  52. $credentials = Input::only('UserName', 'Password');
  53. if(Auth::attempt($credentials)){
  54. return Redirect::intended('/');
  55. }
  56. return Redirect::to('login');
  57. });
  58.  
  59.  
  60. Route::get('logout', function()
  61. {
  62. Auth::logout();
  63. return View::make('logout');
  64. });
  65.  
  66.  
  67. Route::get('welcomepage', ['middleware' => 'auth', function()
  68. {
  69. return View::make('welcomepage');
  70. }]); `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement