Laravel routing, controllers, Eloquent ORM, Blade templates, migrations, middleware and artisan commands.
35 cards · basic cards · AI-written, checked twice. Edit anything.
- Route parameter syntax in Laravel
Show answer
Enclosed in curly braces, like {id} in /posts/{id}
- Define a POST route in Laravel
Show answer
Use Route::post() method
- Purpose of route groups in Laravel
Show answer
Apply common middleware, prefixes, or namespaces to multiple routes
- Named routes in Laravel
Show answer
Routes given aliases with ->name() for generating URLs and redirects
- Apply middleware to a single route
Show answer
Use ->middleware() when defining the route
- Where to store controller classes
Show answer
app/Http/Controllers/ directory
- Controller naming convention
Show answer
PascalCase class names ending with Controller
- Dependency injection in controller methods
Show answer
Type-hint dependencies as parameters for automatic service container resolution
- Seven resource controller actions
Show answer
index, show, create, store, edit, update, destroy
- Purpose of __construct() in a controller
Show answer
Initialize class properties or dependencies before any action method runs
- What Eloquent is
Show answer
Laravel's Object-Relational Mapping (ORM) library
- Eloquent Model
Show answer
A class representing a database table with query and relationship methods
- Fetch all records from a table using Eloquent
Show answer
Model::all() returns a collection of all records
- Difference between hasMany and belongsTo
Show answer
hasMany: one model has many others; belongsTo: inverse, many belong to one
- N+1 query problem in databases
Show answer
Running one query per related model instead of loading all relationships at once