
Laravel Routing
Basic routes, parameters, named routes, route groups, middleware, resource routes, route model binding
1How to define a basic GET route in Laravel?
How to define a basic GET route in Laravel?
Odpowiedź
The Route::get() method defines a route that responds to HTTP GET requests. The first parameter is the URI, the second is either a closure or an array [Controller::class, 'method']. This approach is defined in routes/web.php or routes/api.php depending on the route type.
2Which method to use to create a route that responds to multiple HTTP verbs?
Which method to use to create a route that responds to multiple HTTP verbs?
Odpowiedź
Route::match() accepts an array of HTTP verbs as the first parameter, then the URI and action. This allows responding to GET and POST on the same route for example. Route::any() also exists to respond to all HTTP verbs, but match() offers more precise control.
3How to capture a parameter in a route URL?
How to capture a parameter in a route URL?
Odpowiedź
Route parameters are defined using curly braces {param} in the URI. They are automatically injected into the closure or controller method. Parameters can be made optional with {param?} and accept constraints with ->where().
How to add a regex constraint on a route parameter?
How to name a route for easy reuse?
+17 pytań z rozmów
Inne tematy rekrutacyjne Laravel
PHP Basics
PHP OOP Essentials
Composer & Autoloading
Laravel Fundamentals
Blade Templates
Request & Response
Eloquent ORM Basics
Eloquent Relationships
Migrations & Schema Builder
Validation & Forms
Authentication
Authorization & Policies
API Resources & Authentication
Middleware
Service Container & DI
Queues & Jobs
Events & Listeners
Notifications & Mail
File Storage
Testing & PHPUnit
Caching
Livewire & Inertia
Eloquent Advanced
Repository Pattern
Laravel Packages
Performance Optimization
Security Best Practices
Laravel Octane
Laravel Distributed Systems
Observability & Monitoring
Deployment & DevOps
Opanuj Laravel na następną rozmowę
Uzyskaj dostęp do wszystkich pytań, flashcards, testów technicznych, ćwiczeń code review i symulatorów rozmów.
Zacznij za darmo