Cannot use highlight \ Databasemodel \ Model as Model because name is already in use

I have some data in my database that I want to persist through a migration and I am using iSeed to help me produce seeds from the data. However, when I try to start seeds using

php artisan db:seed

      

I am getting the error:

PHP Fatal error: Can't use Illuminate \ DatabaseModel \ Model as model because name is already used in laravel / app / User.php on line 7

So, I went into User.php and changed this line (actually it is line 6, not line 7):

   use Illuminate\Database\Eloquent\Model;

      

:

   use Illuminate\Database\Eloquent\Model as BaseModel;

      

I also changed it to extend BaseModel instead of Model. The weird thing is that I still get the same error, still for User.php. I tried to run composer dumpautoload but it didn't help. As I understand it, using this as a BaseController should have fixed the problem, but it doesn't. What am I doing wrong? Thanks for the help.

Edit: including the complete code for the model

<?php
namespace App;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\DatabaseModel\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
    use Authenticatable, CanResetPassword;
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'email', 'password'];
    /**
     * The attributes excluded from the model JSON form.
     *
     * @var array
     */
    protected $hidden = ['password', 'remember_token'];
}

      

+3


source to share





All Articles