
Request & Response
Request object, input handling, file uploads, response types, redirects, JSON responses, cookies, sessions
1Which method of the Request object allows retrieving the value of a form field?
Which method of the Request object allows retrieving the value of a form field?
Antwoord
The input() method of the Request object allows retrieving data sent via GET, POST, or any other HTTP method. It accepts a field name as a parameter and returns its value, or null if the field does not exist. A default value can be passed as a second parameter to avoid null values.
2Which method allows checking if a specific field is present in the request?
Which method allows checking if a specific field is present in the request?
Antwoord
The has() method checks if one or more fields are present in the request and contain a non-empty value. It returns a boolean. To simply check for field presence even if empty, use filled() which checks the field exists AND is not empty, or exists() to only check presence without validating the value.
3Which method allows retrieving all request fields as an array?
Which method allows retrieving all request fields as an array?
Antwoord
The all() method returns all request data as an associative array. Unlike only() which filters specific fields, or except() which excludes certain fields, all() returns all submitted data. This method is useful for passing all data to validation or for global processing.
How to retrieve only specific fields from a request?
How to retrieve an uploaded file from an HTTP request?
+17 gespreksvragen
Andere Laravel-sollicitatieonderwerpen
PHP Basics
PHP OOP Essentials
Composer & Autoloading
Laravel Fundamentals
Laravel Routing
Blade Templates
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
Beheers Laravel voor je volgende gesprek
Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.
Begin gratis