hi guys, I will let you know how to detect if request is ajax or not in Laravel.

Sometime you need to check if request is ajax then response data only and if request is not ajax then response complete view in your application.

By usingย ajax()ย method in Laravel, you can check request is ajax or not.

Example 1:


Example 2:

I hope it would be useful for you.

Read Also  How To Log All SQL Queries In Laravel

No Comments

Leave a Reply

your email address will not be published. required fields are marked *