I
I
Ivan2020-07-28 12:51:49
Laravel
Ivan, 2020-07-28 12:51:49

How to create a field in a database table through migration in Laravel that works like created_at, but only records the date?

Without the creation time of the entry, only the date.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2020-07-28
@Djonson86

It is impossible to do this through migration, because in the database the created_at field has no logic - it is all implemented inside the framework. Creating a column with a date through migration is elementary, but you will have to fill it in manually. Well, or specify a default value in the column.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question