Crack interview | Top Laravel Questions and Answers for developer - part 2

preview_player
Показать описание
12. 0:03 - What are factories in Laravel?
Factories are a way to put values in fields of a particular model automatically. Like, for testing when we add multiple fake records in the database, we can use factories to generate a class for each model and put data in fields accordingly.

13. 2:19 - How to implement soft delete in Laravel?
Soft Delete means when any data row is deleted by any means in the database, we are not deleting the data but adding a timestamp of deletion.

14. 4:42 - What are Models?
With Laravel, each database table can have a model representation using a model file which can be used to interact with that table using Laravel Eloquent ORM.

15. 7:24 - What are Relationships in Laravel?
Relationships in Laravel are a way to define relations between different models in the applications. It is the same as relations in relational databases.

Different relationships available in Laravel are:

One to One
One to Many
Many to Many
Has One Through
Has Many Through
One to One (Polymorphic)
One to Many (Polymorphic)
Many to Many (Polymorphic)

16. 10:46 - What is Eloquent in Laravel?
Eloquent is the ORM used to interact with the database using Model classes. It gives handy methods on class objects to make a query on the database.

17. 13:26 - What is throttling and how to implement it in Laravel?
Throttling is a process to rate-limit requests from a particular IP. This can be used to prevent DDOS attacks as well. For throttling, Laravel provides a middleware that can be applied to routes and it can be added to the global middlewares list as well to execute that middleware for each request.

18. 16:47 - What are facades?
Facades are a way to register your class and its methods in Laravel Container so they are available in your whole application after getting resolved by Reflection.

19. 18:28 - What are Events in Laravel?
In Laravel, Events are a way to subscribe to different events that occur in the application. We can make events to represent a particular event like user logged in, user logged out, user-created post, etc. After which we can listen to these events by making Listener classes and do some tasks like, user logged in then make an entry to audit logger of application.

20. 21:29 - Explain logging in Laravel?
Laravel Logging is a way to log information that is happening inside an application. Laravel provides different channels for logging like file and slack. Log messages can be written on to multiple channels at once as well.

21. 22:51 - What is Localization in Laravel?

22. 24:36 - What are Requests in Laravel?
Requests in Laravel are a way to interact with incoming HTTP requests along with sessions, cookies, and even files if submitted with the request.

23. 27:27 - How to do request validation in Laravel?
Request validation in laravel can be done with the controller method or we can create a request validation class that holds the rules of validation and the error messages associated with it.

24. 30:22 - What is a Service Container in Laravel?
Service Container or IoC in laravel is responsible for managing class dependencies meaning not every file needs to be injected in class manually, but is done by the Service Container automatically. Service Container is mainly used in injecting class in controllers like Request object is injected.

25. 34:18 - What is a Service Provider?
A Service Provider is a way to bootstrap or register services, events, etc before booting the application. Laravel’s own bootstrapping happens using Service Providers as well. Additionally, registers service container bindings, event listeners, middlewares, and even routes using its service providers.

26. 35:53 - What is the register and boot method in the Service Provider class?
The register method in the Service Provider class is used to bind classes or services to the Service Container. It should not be used to access any other functionality or classes from the application as the service you are accessing may not have loaded yet into the container.

Reference on resource:

SUBSCRIBE TO CHANNEL:

Don't forget pls to click on 'Like', its giving additional motivation to work on channel.
Thank you for watching, for subscription and see you soon.

#laravel #mlaautomation #interview #questions #answers #developer #programmer
Рекомендации по теме