Laravel 5 interview questions

Laravel 5 interview questions
  1. How to check request is ajax or not ?
  2. Explain Named Routes in Laravel ?
  3. What are Macros in Laravel?
  4. What is difference between Implicit and Explicit route Binding in Laravel ?
  5. How to get current Url in Laravel ?
  6. What are middlewares in Laravel ?
  7. How to create custom Middleware in Laravel ?
  8. How to register a middleware in Laravel ?
  9. Can we assign multiple middlewares to a route.
  10. How to add a middleware in route group?
  11. What are Terminable Middlewares ?
  12. How to add CSRF Protection in Laravel ?
  13. How can you Exclude URIs From CSRF Protection in Laravel ?
  14. What is X-CSRF-TOKEN , How it is different from CSRF Tokens ?
  15. What are Controllers in Laravel ?
  16. How to create a controller in Laravel ?
  17. How to register a middlewares in Laravel controller ?
  18. How to generate a controller with resources in Laravel ?
  19. How to Localize Resource URIs in Laravel ?
  20. How to do Dependency Injection in Laravel Controllers?
  21. How to get requested path in Laravel ?
  22. How to retrive all requested data in Laravel ?
  23. How to check an Input value is present or not in Laravel ?
  24. What are Cookies ? How to get , set , distroy cookies in Laravel ?
  25. Write code to upload a file in Laravel 5?
  26. How to redirect user with Flashed Session Data in Laravel?
  27. How to serve sites on Valet ?
  28. What does valet park and link command do?
  29. How to Serve sites with TLS on Valet ?
  30. How to Share Sites with external world on valet ?
  31. List some use Valet Commands?
  32. Explain Request life cycle of laravel.
  33. What is name of first file that loaded in Laravel?
  34. What is HTTP / Console Kernels in laravel?
  35. Explain Service Container ?
  36. How to bind a service container to a service provide.
  37. What is Contextual Binding ?
  38. How to resolve class instance out of the container in Laravel ?
  39. Explain Automatic Injection in Laravel ?
  40. How can you write your own service provider in laravel.
  41. What service provider’s Register Method does ?
  42. How to register a service provider in laravel ?
  43. What are Deferred Providers in laravel ?
  44. How to register a service provider via composer in Laravel ?
  45. What are Laravel Facades?
  46. How Facades are different from Dependency injection ?
  47. What getFacadeAccessor method does?
  48. Explain Laravel Contracts?
  49. Differce between Contracts and Facades?
  50. How to do 301 redirects in Laravel ?
  51. How to generate Urls from named named Routes?
  52. How to do subdomain routing in Laravel ?
  53. What are Route Prefixes ?
  54. How to return a view from route in Laravel ?
  55. How to configure route cache and clear route cache in Laravel ?
  56. How to list all routes in Laravel ?
  57. What Route Model Binding ?
  58. In which directory laravel configartion files are kept.
  59. How to do Environment Configuration in Laravel.
  60. How can you retrieve values for laravel configration files.
  61. How to retrive/get current environment in Laravel.
  62. How to get/set configuration values in laravel?
  63. How to enable or disable maintaince mode in Laravel.
  64. Explain the directory structure of laravel 5.6.
  65. List out the plateforms Laravel Homestead supports ?
  66. List the Software’s included in Laravel Homestead ?
  67. How to install Homestead Vagrant Box ?
  68. Please provide steps to Configure Homestead ?
  69. How to launch Vagrant Box ?
  70. What is Vagrantfile and Homestead.yaml ,
  71. How to generate it on Homestead ?
  72. How to install Installing MariaDB on Homestead ?
  73. Command to connect vagrant via ssh ?
  74. How to add Additional Sites in Homestead environment?
  75. List Site Types supported by Homestead?
  76. How to configure Cron jobs in Homestead ?
  77. List the default ports that are forwarded to your Homestead environment?
  78. How to share your Homestead with others.
  79. Is Multiple PHP Versions are supported by Homestead ?
  80. How to enable Multiple PHP Versions in Homestead ?
  81. How to configure network interfaces in Homestead ?
  82. How can you update Homestead ?
  83. List the applications supported by Valet?
  84. Is Valet supports windows or Ubuntu environment?
  85. List the requirements to install Valet ?
  86. What is Homebrew ?
  87. How to install Valet ?
  88. How to start and stop Valet ?
  89. By default Valet serve your app on which TLD? How to configure it to use another domain ?
  90. How to install and start, stop mysql on Valet?
  91. How to upgrade Valet To Valet 2.0 ?
  92. How to create a Laravel Project using composer.
  93. What is Laravel Homestead ?
  94. How to start laravel Local Development Server.
  95. Explain What is Valet?
  96. List the steps to Configure Laravel application.
  97. In order to run Laravel. What permissions are required to be on storage and the bootstrap/cache directories ?
  98. How to generate Application Key in laravel ? why it is neccessary ?
  99. How to generate Pretty URLs in Laravel?
  100. List Server Requirements for installing Laravel 5.5

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.

Download Laravel 5 interview questions PDF