Yasaman Noveiry
Yasaman Noveiry

Reputation: 1

Laravel seeder issue1

i use php artisan db:seed --class UsersSeeder in cmd and it gives me error. here is my code. can anyone help me out?

<?php

namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;

class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        DB::table('users')->insert([
            'name'=>'Yasaman',
            'email'=>'[email protected]',
            'password'=>Hash::make('1234')
        ]);

    }
}

this is the error:

https://www.mediafire.com/file/5an383p1j4sm5m1/image.png/file

Upvotes: 0

Views: 149

Answers (1)

Moreira
Moreira

Reputation: 31

You probably have created_at and updated_at columns on your User db Table. Just give them a value and see if it works.

Upvotes: 1

Related Questions