Top 20 Laravel Interview Questions and Answers–
Question 1. What is full form of CSRF in Laravel?
Answer – The full form of CSRF/ is Cross-Site Request Forgery ( क्रॉस साइट अनुरोध जालसाजी ).
Question 2. What is full form of MVC in programming?
Answer – The MVC is stand for Model-View-Controller.
Question 3. What is .env file in Laravel?
Answer – The “.env” file called an environment file. It is a text file used for store configuration settings of a web application.
Question 4. What is the full form of API in programming?
Answer – The full form of API is Application Programming Interface (एप्लीकेशन प्रोग्रामिंग इंटरफ़ेस).
Question 5. Define the routes in Laravel?
Answer – Routes define the URLs of your web applications in Laravel. It is written in “web.php” file as –
Curly Braces – Route :: get( ‘posts/{postId}’, [ControllerName :: class, ‘MethodName’ ] );
Question 6. What is the role of middleware in Laravel?
Answer – The role of middleware is HTTP Request Filtering, Response Handling, Request Modification, Security and permissions etc.
Question 7. What is helper and roles in Laravel?
Answer – The main function of Laravel Helper is encapsulate code into reusable functions, reduce programming code and globally accessible in whole application.
Question 8. What is the work of CSRF protection in Laravel?
Answer – In the Laravel, every form uses CSRF tokens for protect against the CSRF attacks. It is written @csrf in Blade file.
Question 9. What is the MVC architecture in Laravel?
Answer – Laravel is fully Model-View-Controller (MVC) web programming PHP framework. In the Laravel, “Views” present data for the user, “Models” handle the data and “Controllers” manage requests & bind the view and the model.
Question 10. In which file, the database connection is written in Laravel?
Answer – The configuration file of database is database.php of Laravel. The path of file is config/database.php
Top 20 Laravel Interview Questions and Answers