Advertisement
Guest User

routes.php

a guest
Jan 22nd, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2. Route::pattern('nama', '[A-Za-z]+');
  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. Route::get('/', function () {
  15. return view('welcome');
  16. });
  17.  
  18. // Route::post('kontak-post', function() {
  19. // return 'Anda mengirim pesan "' . $_POST['pesan'] . '"';
  20. // });
  21.  
  22. // Route::match(['get', 'post'], 'kontak', function() {
  23. // $html = '<h1>halaman kontak</h1>';
  24. // if (isset($_REQUEST['pesan'])) {
  25. // $html .= 'Anda mengirim pesan ' . $_REQUEST['pesan'];
  26. // }
  27. // return $html;
  28. // });
  29.  
  30. // Route::get('welcome/{nama?}', ['as'=>'home.welcome', function($nama = 'Pengunjung') {
  31. // return "Selamat datang " . $nama . ". Anda luar biasa!";
  32. // }]);
  33.  
  34. Route::group(['middleware' => 'web'], function(){
  35. Route::auth();
  36. Route::get('/home', 'HomeController@index');
  37. Route::resource('categories', 'CategoriesController');
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement