I have a question on which is the better way of doing things.
Controller
public function __construct(User $user)
{
$this->users = $user;
........................
}
public function index()
{
$users = array();
//I did this, cause a user class has been instantiated already in the construct function.
$users = $this->users->all();
//This is what I read on the docs, static method of calling records
$users = User::all();
}
The question is which is the laravel way of doing things?