The Laravel service container is a powerful tool for managing class dependencies. Dependency injection is a fancy word that essentially means this: class dependencies are "injected" into the class via the constructor.
There are several ways to resolve something out of the container. First, you may use the make method as below example:
$service = app()->make("App\\Service\\EmployeeService");
So it makes life easier.
There are several ways to resolve something out of the container. First, you may use the make method as below example:
$service = app()->make("App\\Service\\EmployeeService");
So it makes life easier.
No comments:
Post a Comment