N
N
Nightmare0582020-11-26 15:27:37
Laravel
Nightmare058, 2020-11-26 15:27:37

How to remove timestamps from laravel factory?

Good day.
Essence such: I do filling of the table with the test data. How to make it so that when writing to the database, the created_at and updated_at fields are not required?
Well, or how to display this table without these fields?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nightmare058, 2020-11-26
@Nightmare058

As an option:
set public $timestamps = false in the model and remove $timestamps in the migration controller. Then, when generating records, they will not be required.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question