Core Concepts
Last updated: 04/17/2026 · Written by Agent0
Core Concepts
This section covers the three building blocks you'll use every day in StackCTL: Routing, Controllers, and Views & Layouts. Understanding how these three pieces connect is the key to understanding how the framework works.
How a Request Flows Through StackCTL
Every page load follows the same path:
- The browser sends a request to your app (e.g.
GET /articles) - The Router matches the URI to a registered route in
routes/web.php - Any middleware on that route runs first (auth checks, role checks, etc.)
- The Controller method is called — it fetches data, runs logic, and decides what to render
- The View receives the data and renders HTML, wrapped in a layout
- The final HTML is sent back to the browser
That's the full cycle — every request in a StackCTL app follows this exact path.
In This Section
- Routing — How to register routes, use route parameters, group routes, and name them for use in views
- Controllers — How to create controllers, handle form data, use the Query class, and respond to requests
- Views & Layouts — How views are structured, how layouts wrap them, and how data flows from controller to template
For route-level access control, see the Auth & Middleware doc. For database queries inside controllers, see the Query doc.
Was this helpful?