There is a HomeController
in app/Http/Controllers
and a Player
model in app
.
HomeController:
namespace App\Http\Controllers;
Player:
namespace App;
use Illuminate\Database\Eloquent\Model;
Double-checked, the Player model gets PSR-4 autoloaded. I've tried to use
various versions in HomeController, but it keeps trying to look for Eloquent class (which Player extends) in wrong paths. Also, in the tested HomeController method, instantiating the model is foggy, do I need to prefix the namespace now? because with or without use
command it does not work.
Realized that I had to alias this path to Eloquent to make it work:
use Illuminate\Database\Eloquent\Model as Eloquent;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments