Agregue calendario, trendria q dejar de usar cdn y nose si algo mas.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Appointment;
|
||||
|
||||
class AgendaController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$all_appointments = Appointment::with('client')->get();
|
||||
|
||||
$appointments = [];
|
||||
|
||||
foreach($all_appointments as $appointment){
|
||||
$appointments[] = [
|
||||
'id' => $appointment->id,
|
||||
'title' => $appointment->scheduled_at->format('H:i') . ' - ' . $appointment->client->name,
|
||||
'start' => $appointment->scheduled_at->format('Y-m-d\TH:i:s'),
|
||||
'extendedProps' => [
|
||||
'description' => $appointment->problem_description,
|
||||
'status' => $appointment->status,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return view('agenda', compact('appointments'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user