SHARE
TWEET

Untitled

a guest Aug 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Route::get('/','MainController@Date');
  2. Route::post('/','MainController@Date');
  3.      
  4. Route::any('/','MainController@Date');
  5.      
  6. $date1 = $request->get ( 'date1' );
  7. $date2 = $request->get ( 'date2' );
  8.      
  9. $date1 = will calculate using date function
  10. $date2 = will calculate using date function
  11.      
  12. <?php
  13.  
  14. namespace AppHttpControllers;
  15.  
  16. use IlluminateHttpRequest;
  17. use IlluminateRoutingController;
  18.  
  19. class SmeController extends Controller
  20. {
  21.     /**
  22.      * Do somthing
  23.      * @param  Request  $request
  24.      */
  25.     public function update(Request $request)
  26.     {
  27.         if ($request->isMethod('post')) {
  28.     //
  29.         }
  30.         if ($request->isMethod('get')) {
  31.     //
  32.         }
  33.     }
  34. }
  35.      
  36. public function someMethod(Request $request)
  37. {
  38.         $method = $request->method();
  39.  
  40.         // to check if its a post method
  41.         if ($request->isMethod('post')) {
  42.             //
  43.         }
  44.  
  45.         // to check if its a get method
  46.         if ($request->isMethod('get')) {
  47.             //
  48.         }
  49. }
  50.      
  51. $request->query();//return only GET param
  52. $request->request->all()// POST param
  53. $request->input();//all
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top