How to check request is Ajax or not in Laravel 5?By Hardik Savani | August 13, 2016 | | 9471 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()
- Jquery - draggable sortable table rows example demo with bootstrap
- How to get product using rakuten marketing api in PHP?
- How to get ip address using php code?
- Laravel 5 Redirect to URL using redirect() helper
- How to get gravatar image from email using Jquery?
- How to solve "Cannot find module 'bplist-parser'" ?
- Jquery - Animated typing effect using typed js example with demo
- How to clear log file using command in laravel 5 ?