laravel save timestamp code example
Example 1: laravel model without timestamps
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
public $timestamps = false;
//
}
Example 2: laravel add timestamps to existing table
$table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
$table->dateTime('updated_at')->nullable();
Example 3: laravel insert timestamp now
Information::create([
'data_now'=>Carbon\Carbon::now()
])