I am creating an API with php laravel and MySql; and I'm creating migrations and seeders. I have this table:
Schema::create('schedules', function (Blueprint $table) {
$table->engine='InnoDB';
$table->increments('schedule_id');
$table->date('time_to_open'); //<----- esta
$table->date('time_to_close'); //<----- y esta
$table->boolean('is_active');
$table->string('created_by');
$table->timestamps();
});
And I have two fields time_to_open
and time_to_close
, in those I am only interested in saving a time example: 22:00
o 14:30
o 07:40
but I don't know how to put those fields only TIME because when I leave them DateTime or Date it brings me the information of the dates and that doesn't interest me here.
and be able to load the data from a seeder.
Thank you
Good day,
You can use
That creates a column of type time, there is also a type timeTz if you want to use it with timezone
Full documentation is here