Laravel 5 interview questions

  1. How much laravel experience do you have?
  2. How to check request is ajax or not ?
  3. Explain Named Routes in Laravel ?
  4. What are Macros in Laravel?
  5. What is difference between Implicit and Explicit route Binding in Laravel ?
  6. How to get current Url in Laravel ?
  7. What are middlewares in Laravel ?
  8. How to create custom Middleware in Laravel ?
  9. How to register a middleware in Laravel ?
  10. Can we assign multiple middlewares to a route.
  11. How to add a middleware in route group?
  12. What are Terminable Middlewares ?
  13. How to add CSRF Protection in Laravel ?
  14. How can you Exclude URIs From CSRF Protection in Laravel ?
Laravel 5 interview questions

Laravel is one of the most popular frameworks on Github. On Github, Laravel has 54,843+ stars which is growing day by day. Here you can 100+ Laravel interview questions that are taken from various open-source places like quora, Github, and StackOverflow

Download Laravel 5 interview questions PDF

Tell the recruiter about the number of years of Laravel experience do you have. You can also tell the number of projects you have done in Laravel.

In Laravel, we can use $request->ajax() method to check request is ajax or not.

Example:

      public function saveData(Request $request)
        {
            if($request->ajax()){
                return "Request is of Ajax Type";
            }
            return "Request is of Http type";
        }

Named routes allow the convenient generation of URLs or redirects for specific routes. You may define a name for a path by chaining the name process onto the path definition.

Example

Route::get('user/registration', function () {
    //
})->name('registration');

Macros provide a way to add functionality to the classes wherein you do not have that function. It can help you to create a small reusable component that'll be possible to use it everywhere on your application.