The error message indicates that the "start_date" column in the "bookings" table is set to NOT NULL, but the insert statement is not providing a value for it. To solve this error, you need to make sure that a value for "start_date" is provided when inserting a new record into the "bookings" table.
For example, you can modify the insert statement to include a value for "start_date":
DB::table('bookings')->insert([
'apartment_id' => 1,
'user_id' => 2,
'start_date' => '2023-05-29', // add a value for start_date
'end_date' => '2023-06-05',
'guests_adults' => 2,
'guests_children' => 1,
'total_price' => 1000,
'created_at' => now(),
'updated_at' => now(),
]);
Alternatively, you can modify the migration file to provide a default value for "start_date" so that it is not required:
$table->date('start_date')->nullable()->default(null);