get(); return Inertia::render('BesoinsInformatiques/Index', [ 'besoins' => $besoins ]); } public function create() { return Inertia::render('BesoinsInformatiques/Create'); } public function store(Request $request) { $validated = $request->validate([ 'collectivite' => 'nullable|string|max:255', 'nom_referent' => 'nullable|string|max:255', 'descriptif_projet' => 'nullable|string', 'materiels_support' => 'nullable|array', 'licences_bureautique' => 'nullable|array', 'equipements_reseaux' => 'nullable|string', 'cablage_reseau' => 'nullable|string', 'telephonie_ip' => 'nullable|string', 'nouveau_batiment' => 'nullable|string', 'logiciels_metiers' => 'nullable|string', 'licences_projets' => 'nullable|array', 'date_validation' => 'nullable|date', 'validation_dgs' => 'nullable|string|max:255', ]); BesoinInformatique::create($validated); return redirect()->route('besoins-informatiques.index')->with('success', 'Besoin informatique créé avec succès.'); } public function show(BesoinInformatique $besoinInformatique) { return Inertia::render('BesoinsInformatiques/Show', [ 'besoin' => $besoinInformatique ]); } public function edit(BesoinInformatique $besoinInformatique) { return Inertia::render('BesoinsInformatiques/Edit', [ 'besoin' => $besoinInformatique ]); } public function update(Request $request, BesoinInformatique $besoinInformatique) { $validated = $request->validate([ 'collectivite' => 'nullable|string|max:255', 'nom_referent' => 'nullable|string|max:255', 'descriptif_projet' => 'nullable|string', 'materiels_support' => 'nullable|array', 'licences_bureautique' => 'nullable|array', 'equipements_reseaux' => 'nullable|string', 'cablage_reseau' => 'nullable|string', 'telephonie_ip' => 'nullable|string', 'nouveau_batiment' => 'nullable|string', 'logiciels_metiers' => 'nullable|string', 'licences_projets' => 'nullable|array', 'date_validation' => 'nullable|date', 'validation_dgs' => 'nullable|string|max:255', ]); $besoinInformatique->update($validated); return redirect()->route('besoins-informatiques.index')->with('success', 'Besoin informatique mis à jour avec succès.'); } public function destroy(BesoinInformatique $besoinInformatique) { $besoinInformatique->delete(); return redirect()->route('besoins-informatiques.index')->with('success', 'Besoin informatique supprimé avec succès.'); } }