How to check request is Ajax or not in Laravel 5?By Hardik Savani | August 13, 2016 | | 1780 Viewer | Category : Laravel Ajax
Share this post:
Sometimes, we need to check request is ajax or not in laravel 5. If you want to call same method but if request is ajax then you perform different, then you can do by using $request object.
In Laravel 5 $request object provide method to check request is ajax or not, In following example you can see how it's works.
You can check directly from Request facade and also from request object, both are same, so let's see bellow example.
public function index(Request $request)
public function index()
- Bootstrap progress bar animate example using bootstrap-progressbar.js
- Laravel 5.3 - image dimension validation rules example
- Laravel 5.3 - Customize pagination templates example from scratch
- PHP - multiple file uploading dropzone js example
- Laravel - How to get current URL in controller or view?
- PHP - Bootstrap autocomplete tokenfield with Ajax Example
- How to redirect route with querystring in Laravel 5?
- Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin