1. Go to this page and download the library: Download moonshiner/safe-queuing library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Moonshiner\SafeQueuing\HasTimeslots;
//...
class Event extends Model
{
use HasTimeslots;
public function timeslotStartDate(){
return \Carbon\Carbon::now();
}
public function timeslotEndDate(){}
public function timeslotStartTime(){}
public function timeslotEndTime(){}
public function timeslotDuration(){}
public function timeslotBreak(){}
public function timeslotAvailableDays(){}
public function timeslotExcludedDates(){}
public function timeslotIncludedDates(){}
public function timeslotExcludedTimes(){}
use Carbon\Carbon;
$event = Event::first();
// timeslots after some date
dd($event->timeslots()->findSlot(['start'=>Carbon::now(), 'end'=>Carbon::now()->addMinutes('30')]));
// only timeslots on a specific date
dd($event->timeslots()->onDay(Carbon::today()));
// timeslots after some date
dd($event->timeslots()->afterDate(Carbon::yesterday()));
// timeslots that end before given time
dd($event->timeslots()->beforeDate(Carbon::tomorrow()));