Categories
Laravel

How to Detect Ajax Request in Laravel 4

Laravel’s Request class provides many methods for reading the HTTP request of the current request. One of these function is named ajax(). Using this function We can check the request type under controllers or route filters..etc. See the below example script.

Check for Ajax request in Laravel application

That’s it.

By Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

Leave a Reply

Your email address will not be published. Required fields are marked *