Hi! I have problem with User model. My folder structure #app/ ##Snippet ###Providers ####Repositories #####Services ######Snippet.php #######User.php #bootstrap #public #vendor My problem is when i try to login ( if (Auth::attempt($credentials, $remember)) ) user i get Class '\User' not found error. I moved my Models from models folder to Snippet folder. Where i need to register that i moved my Model classes.
Have you searched the http://laravel.io/forum?tags=authentication,security section, there are several posts
where folks had similar problems and were solved. Are you using L4 or L5? Have you tried models just to verify it would work there? Have you dumped your autoloads, have you tried
use Snippet\User;
Did you check namespacing for Snippet, making it exactly like models is setup? etc etc etc.
Im using 4.2.* Laravel. I get my error here: /var/www/snippet/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function createModel()
{
$class = '\\'.ltrim($this->model, '\\');
return new $class; //\Snippet\User
}
but if i put \Snippet\User instead $class everything is fine.
Having the same problem right now, any updates on a solution?
UPDATE:
Have you tried to change the "model" in you auth.php config to Snippet\User ?
'model' => 'Snippet\User',
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community