Data not saving in database table in real

Posted 4 days ago by engrlaravel

I use create method for mass assignment, the result also printed and showing, but when i check table in database, not data inserted. here is my code

            protected $fillable = [
    'first_name', 'last_name', 'role_id', 'email', 'username', 'mobile_country_code', 'mobile', 'password', 
           'status', 'gender','telephone'
       ];

           $users = User::create([
                'first_name'     => $row[1],
                'middle_name'    => $row[2],
                'last_name' => $row[3],
                'email' => $row[4],
                'role_id' => 6,//$row[5],
                'telephone' => $row[6],
                'mobile' => $row[7],

            ]);

            var_dump($users);// this shows result.

Now when i check database users table, not user insterted

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.