Jun 9, 2017
0
Level 1
How to add timestamp in moloquent
when creating a migration in SQL we write something like this to create timestamp
Schema::create('users', function (Blueprint $table) {$table->timestamps();});
when creating for mongo i dont have any idea how to do it. though moloquent doc say i should write this protected $dates = ['created_at','updated_at'];
I was told, laravel automatically updates the 'update_at' column in SQL database but mongo will i manually do so?. The problem is how do i add timestamps and laravel will automatically update them. thanks in advance
Please or to participate in this conversation.