<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Priorites;

class PrioriteController extends Controller
{
    public function create()
    {
        return view('priorites.create');
    }

    public function store(Request $request)
    {
        $request->validate(['etat' => 'required|string|in:Urgent,Tâche courante,Aucune pression']);
        Priorites::create($request->all());
        return redirect()->route('priorites.create')->with('success', 'Priorité créée avec succès.');
    }
}
