Reputation: 32038
According to Laravel documentation:
$table->timestamps();
Adds nullable created_at
and updated_at
columns.$table->nullableTimestamps();
Nullable versions of the timestamps()
columns.I don't understand. In other words, what I read is:
A
creates nullable columnsB
is like A
but it creates nullable columnsWhat did I miss?
Upvotes: 0
Views: 528
Reputation: 92805
Since Laravel 5.2 there is no difference. If you look at the source you'll see that nullableTimestamps()
is an alias for timestamps()
/**
* Add nullable creation and update timestamps to the table.
*
* @return void
*/
public function timestamps()
{
$this->timestamp('created_at')->nullable();
$this->timestamp('updated_at')->nullable();
}
/**
* Add nullable creation and update timestamps to the table.
*
* Alias for self::timestamps().
*
* @return void
*/
public function nullableTimestamps()
{
$this->timestamps();
}
Upvotes: 2