The default Authentication model is app/models/User.php
, set by the config item auth.model
That worked fine. So of course I decided to follow a nice guide a make my own namespaced directory to keep all of my models, repos, etc.
I added the line to composer.json to autoload, changed the auth.model
setting to the path (model namespace is Models\User
), but upon removing the models/user.php
file, L4 kicks out a 502 with the (very brief) log entry of
...FatalErrorException' with message 'Class 'User' not found' in .../Illuminate/Database/Eloquent/Model.php:711
If I add back the models/User.php
file, everything works, except it uses the wrong model to log in, so I have to keep a copy in each place.
Am I missing something, some other setting? I can't imagine the path to the User model is hard-coded, but it's sure acting that way.
This is with a fairly fresh Homestead install with Vagrant.
Update #1
Relevant lines from composer.json
"autoload": {
"classmap": [
"app/EC"
Snippet of User class. They're the standard boilerplate User models, except I extend Eloquent with my ECBaseModel class, so the one in app/models
extends \Models\ECBaseModel
instead
<?php namespace Models;
use \Illuminate\Auth\UserInterface;
use \Illuminate\Auth\Reminders\RemindableInterface;
class User extends ECBaseModel implements UserInterface, RemindableInterface
{
getAuthIdentifier, getAuthPassword, getReminderEmail, getRememberTokens
}
Updated #2
[2014-07-01 20:04:09] homestead.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'User' not found' in /home/vagrant/Code/ec_api/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:711
Stack trace:
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []