Controllers

A controller groups the request-handling logic of a single resource in methods. It receives the request, calls the model or services, then returns a view or a response. It should stay thin, with business logic going into dedicated classes.

Example

public function show(Produit $produit)
{
  return view('produits.show', compact('produit'));
}

Related concepts

The whole glossary