PHP code example of d4ve-r / livewire-resource-time-grid
1. Go to this page and download the library: Download d4ve-r/livewire-resource-time-grid 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/ */
d4ve-r / livewire-resource-time-grid example snippets
public function resources()
{
// must return a Laravel collection
}
public function events()
{
// must return a Laravel collection
}
public function hourSlotClick($resourceId, $hour, $slot)
{
// This event is triggered when a time slot is clicked.//
// You'll get the resource id as well as the hour and minute
// clicked by the user
}
public function onEventClick($event)
{
// This event will fire when an event is clicked. You will get the event that was
// clicked by the user
}
public function onEventDropped($eventId, $resourceId, $hour, $slot)
{
// This event will fire when an event is dragged and dropped into another time slot
// You will get the event id, the new resource id + hour + minute where it was
// dragged to
}
public function isEventForResource($event, $resource)
{
// Must return true or false depending if the $resource is the owner of the $event
}
return $event['resource_id'] == $resource['id'];
bash
php artisan make:livewire AppointmentsGrid
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.