<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\BilletController;
use App\Http\Controllers\ChauffeurController;
use App\Http\Controllers\ScheduleController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();
Route::resource('billets', BilletController::class);
Route::resource('chauffeurs', ChauffeurController::class);

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::get('billets/{id}/send-email', [App\Http\Controllers\BilletController::class, 'sendEmail'])->name('billets.send-email');
Route::get('billets/{id}/generate-pdf', [App\Http\Controllers\BilletController::class, 'generatePDF'])->name('billets.generate-pdf');

// routes/web.php

Route::delete('chauffeurs/{chauffeur}',  [App\Http\Controllers\ChauffeurController::class, 'destroy'])->name('chauffeurs.destroy');
Route::delete('chauffeurs/{chauffeur}/confirm-delete', [App\Http\Controllers\ChauffeurController::class, 'confirmDelete'])->name('chauffeurs.confirm-delete');


Route::get('/sendemail', [App\Http\Controllers\BilletController::class, 'printAndEmail'])->name('billets.sendemail');




Route::get('fullcalender', [ScheduleController::class, 'index'])->name('fullcalendar');;
Route::get('/events', [ScheduleController::class, 'getEvents']);
Route::delete('/schedule/{id}', [ScheduleController::class, 'deleteEvent']);
Route::put('/schedule/{id}', [ScheduleController::class, 'update']);
Route::put('/schedule/{id}/resize', [ScheduleController::class, 'resize']);
Route::get('/events/search', [ScheduleController::class, 'search']);

Route::view('add-schedule', 'schedule.add');
Route::resource('evenst', ScheduleController::class);
Route::get('/evenst/update/{id}', [ScheduleController::class, 'edit']);
Route::get('/evenst/delete/{id}', [ScheduleController::class, 'delete']);

Route::post('/evenst/{evenst}', [ScheduleController::class, 'update'])->name('evenst.update');


Route::post('create-schedule', [ScheduleController::class, 'create']);
