Merge remote-tracking branch 'origin/nLucas' into giane

This commit is contained in:
gianella
2026-04-04 21:00:59 -03:00
12 changed files with 826 additions and 319 deletions
+32
View File
@@ -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'));
}
}
@@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use App\Models\Appointment;
use Illuminate\Http\Request;
class AppointmentController extends Controller
{
public function show(Appointment $appointment)
{
return view('appointments.show', compact('appointment'));
}
}