<?php

use App\Http\Controllers\DemandeController;
use App\Http\Controllers\UtilisateurController;
use Illuminate\Support\Facades\Route;



/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

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


Route::match(['get','post'],'/login',[UtilisateurController::class, 'connexion'])->name('connexion');

Route::get('/demandesencours',[DemandeController::class,'demande_en_cours'])->name('demande_en_cours');
Route::match(['get','post'],'/ajoutdemande',[DemandeController::class, 'ajout_demande'])->name('ajout_demande');
Route::match(['get','post'],'/getdemande',[DemandeController::class, 'get_demande'])->name('get_demande');
Route::delete('/supprimer',[DemandeController::class, 'delete_facture'])->name('delete_facture');
Route::match(['get','post'],'/editdemande',[DemandeController::class, 'modificationDemande'])->name('modificationDemande');
Route::delete('/supprimerdemande',[DemandeController::class, 'supprimeDemande'])->name('supprimeDemande');
Route::match(['get','post'],'/donedemande',[DemandeController::class, 'soumettreDemande'])->name('soumettreDemande');
Route::match(['get','post'],'/demande',[DemandeController::class, 'show_demande'])->name('show_demande');

Route::get('/demandesterminee',[DemandeController::class,'demande_terminees'])->name('demande_terminees');
Route::match(['get','post'],'/getfacture',[DemandeController::class, 'get_facture'])->name('get_facture');
Route::match(['get','post'],'/facture',[DemandeController::class, 'motif_facture'])->name('motif_facture');

Route::get('/demandes',[DemandeController::class,'demandes'])->name('demandes');