Author: Not specified Language: php
Description: Not specified Timestamp: 2017-07-15 04:48:20 +0000
View raw paste Reply
  1. <?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Web Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register web routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | contains the "web" middleware group. Now create something great!
  11. |
  12. */
  13.  
  14. Route::get('/', function () {
  15.     return view('welcome');
  16. });
  17.  
  18. Route::get('kac', function (){
  19.     return 'Tac';
  20. })->name('name');
  21.  
  22. // Truyn tham so
  23.  
  24. Route::get('hello/{ten}', function($ten) {
  25.     return 'Xin Chao '.$ten;
  26. })->where(['ten'=>'[a-zA-Z ]{6,100}']);
  27.  
  28. Route::get('call', function(){
  29.     return redirect()->route('name');
  30. });
  31.  
  32. Route::group(['prefix'=>'Lop'], function(){
  33.     route::get('HS1', function(){
  34.         return 'HS1: ';
  35.     });
  36.     route::get('HS2', function(){
  37.         return 'HS2: ';
  38.     });
  39.     route::get('HS3', function(){
  40.         return 'HS3: ';
  41.     });
  42. });
  43.  
  44.  
  45.  
  46. Route::get('controller','MyController@XinChao');
  47.  
  48. Route::get('request','MyController@check');
  49.  
  50. Route::get('uploadFile','MyController@uploadForm');
  51.  
  52. Route::post('postFile','MyController@postFiler')->name('postFile');
View raw paste Reply