I have an Eloquent model object: $user
, of class User
.
I want to make a method inside this model:
function sayHello($target)
{
$this->hello = MegaFacede::launch();
}
Facades are not IDE friendly, so I get services from the container:
function sayHello($target)
{
/** @var Mega $mega */
$mega = App::make('mega');
$this->hello = $mega->launch();
}
But how can I inject $mega instance to this object?