File: /home/imensosw/www/ezwork/app/Http/Controllers/TimeSlotController.php
<?php
/**
* TimeSlotController class file
*
* PHP Version 7.2
*
* @category Controller
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\TimeSlot;
/**
* TimeSlotController class
*
* The class manage the Time Slot
*
* @category TimeSlotController
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
class TimeSlotController extends Controller
{
/**
* GetTimeSlots function gets the list of time slots and
* return it in json format.
*
* @param void
* @return json
*/
public function getTimeSlots(): \Illuminate\Http\JsonResponse
{
$timeSlots = TimeSlot::get();
return response()->json(
[
'status' => 'success',
'timeSlots' => $timeSlots->toArray(),
],
200
);
}
// end getTimeSlots()
}
// end class