This commit is contained in:
Pranshu Tomar 2020-03-23 20:21:48 +05:30
parent f8194ff430
commit 7b88e20153
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterBookingProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('booking_products', function (Blueprint $table) {
$table->datetime('available_from')->change();
$table->datetime('available_to')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@ -37,7 +37,7 @@ class RentalSlot extends Booking
$timeDurations = $bookingProductSlot->same_slot_all_days
? $bookingProductSlot->slots
: $bookingProductSlot->slots[$requestedDate->format('w')];
: $bookingProductSlot->slots[$requestedDate->format('w')] ?? [];
if ($requestedDate < $availableFrom
|| $requestedDate > $availableTo