selects de projets par ordre alpha

This commit is contained in:
Olivier Legat 2021-06-21 14:59:25 +02:00
parent f770e77d98
commit f69f19b57c

View file

@ -54,7 +54,7 @@ class TicketController extends Controller
$tickets = $this->filterTickets($tickets, $request);
$tickets = $tickets->paginate();
$projects = Project::select('id', 'name')->get();
$projects = Project::select('id', 'name')->orderBy('name')->get();
return view('ticket.index', compact('tickets', 'projects'));
}
@ -141,7 +141,7 @@ class TicketController extends Controller
public function create()
{
$projects = Project::all();
$projects = Project::orderBy('name')->get();
if (!count($projects)) {
return redirect()->route('project.create')
->with('warning', 'Vous devez tout d\'abord créer un projet pour y ajouter un ticket');