In the documentation of migrations in Laravel 5.7 it indicates:
$table->timestamps();
// Adds nullable created_at and updated_at TIMESTAMP equivalent columns.
$table->nullableTimestamps();
// Alias of timestamps() method.
So I suppose that there is no difference between using one and the other and the second one will have been left over from old versions for compatibility or some other reason.
Reviewing the Laravel code, we see that there is no difference, it
nullableTimestamps()
callstimestamps()
with the same input parameters, however I usetimestamps()
, it is shorter and it is one less code instruction (although we know that this is negligible in terms of time).For more information on the code, check out: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Database/Schema/Blueprint.php#L953
Answering if there was any difference in previous versions, the answer is yes, in Laravel 5.1
nullableTimestamps()
it created fields that allowed null values, whiletimestamps()
, no:For more information on this Laravel 5.1 code: https://github.com/laravel/framework/blob/5.1/src/Illuminate/Database/Schema/Blueprint.php#L775