Symfony\Component\Debug\Exception\FatalThrowableError : Class 'User' not found

Viewed 536
  public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');

            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->string('account_type');
            $table->string('user_name')->unique();
            $table->string('management')->nullable();
            $table->string('department')->nullable();
            $table->string('sefa');
            $table->string('mobile');
            $table->string('phone');
            $table->string('mail')->nullable();
            $table->string('civil_registry');
            $table->string('admin')->default(2);
            $table->string('status')->default(0);

            $table->rememberToken();
            $table->timestamps();
        });




public function run()
     {
         $user = new User;
         $user->name = 'Administrator';
         $user->password = bcrypt('abc123');
          $user->email = 'admin@admin.com';
          $user->account_type = 'admin';
            $user->user_name = 'mon';
           $user->management='1';
           $user->department='1';
           $user->sefa='';
         $user->mobile='77777';
           $user->phone='30';
         $user->mail='';
         $user->civil_registry='';
         $user->status = 'enable';
         $user->save();



    }

C:\Users\Montather\Downloads\Compressed\Education-Management-master\Education-Management-master>php artisan db:seed --class=DatabaseSeeder

Symfony\Component\Debug\Exception\FatalThrowableError : Class 'User' not found

at C:\Users\Montather\Downloads\Compressed\Education-Management-master\Education-Management-master\database\seeds\DatabaseSeeder.php:14 10| * @return void 11| */ 12| public function run() 13| {

14| $user = new User; 15| $user->name = 'Administrator'; 16| 17| $user->password = bcrypt('abc123'); 18| $user->email = 'admin@admin.com';

Exception trace:

1 DatabaseSeeder::run() C:\Users\Montather\Downloads\Compressed\Education-Management-master\Education-Management-master\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

2 call_user_func_array([]) C:\Users\Montather\Downloads\Compressed\Education-Management-master\Education-Management-master\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

Please use the argument -v to see more details.

0 Answers
Related