If I use the following code snippet in my model it inserts the data:
$fillable = ['email', 'username'];
$instance = DB::table('users')->insert(compact('email', 'username'));
But if I do this instead:
$fillable = ['email', 'username'];
$instance = static::create(compact('email', 'username'));
It inserts null, but created_at and updated_at are inserted.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community