Explore tweets tagged as #practicalLaravelDocs
Laravel tip. Use `response()->streamDownload()` to create downloads without writing to disk. Generate files on-the-fly and stream directly to user. Link to the docs: https://t.co/wo0zt604xC
#practicalLaravelDocs
6
22
199
Laravel tip. Need to protect sensitive routes like making repositories public or deleting accounts? Add `password.confirm` middleware to ANY route. Users will need to re-enter their password before proceeding. Link to docs: https://t.co/RT9TJN0mjW
#practicalLaravelDocs
5
10
148
Laravel tip. Combine route name prefixes with route groups for consistent naming! Use `Route::name()` to automatically prefix all route names in a group. Also, did you know about nested prefixes? Link to the docs: https://t.co/8SN2ZP0ieT
#practicalLaravelDocs
3
9
89
Laravel tip. Need to validate only when a field is present but allow it to be optional? Use the `sometimes` rule! It only validates when the field exists in the request data. Link to the docs: https://t.co/39RyVCL0aZ
#practicalLaravelDocs
3
8
88
Laravel tip. Need to validate multiple validation rule sets where only one needs to pass? Use `Rule::anyOf()` to create flexible validation that accepts different valid formats for the same field. Link to the docs: https://t.co/HNJmi1nbjq
#practicalLaravelDocs
1
5
54
Laravel tip. Need to validate custom attribute names in error messages? Override the `attributes()` method in Form Requests to replace field names with user-friendly labels in validation messages. Link to the docs: https://t.co/mBUXtkIW2M
#practicalLaravelDocs
2
4
65
Laravel tip. Want to check if a field exists in another array field's values? Use `in_array` validation to ensure a value exists within another field's array data. Link to the docs: https://t.co/49SvsAmO2x
#practicalLaravelDocs
2
5
44
Laravel tip. Need tasks to run faster than every minute? Laravel scheduler supports sub-minute intervals down to every second! Link to the docs: https://t.co/My3O0FeWSG
#practicalLaravelDocs
3
5
46
Laravel tip. Working with PHP Enums? Route parameters can automatically validate and inject Enum values! Laravel returns 404 for invalid enum values, keeping your controllers clean. Link to the docs: https://t.co/PSM0VZdNzF
#practicalLaravelDocs
2
15
129
Accomplished one of my long-term missions. I tweeted the tips with hashtag #practicalLaravelDocs daily for ~4 months, now finished going through ALL docs. All ~100 tips here: https://t.co/cu1B6NIHqS Will move to different formats now. Like, retweeting my old best tweets :)
1
0
20
Laravel tip. Skip writing controllers for simple redirects and static pages! Use `Route::redirect()` for redirects and `Route::view()` for returning views directly. Link to docs: https://t.co/zvcFRLx11h
#practicalLaravelDocs
1
6
75
Recently I found a cool way to write routes Not to repeat the controller name every line in Laravel It is fast to write and simple to look First photo is old way Second a new way #Laravel
#practicalLaravelDocs
2
0
5
Laravel tip. Want to include soft-deleted models in route model binding? Use `withTrashed()` to allow access to deleted records through routes. Link to the docs: https://t.co/QWMOAWpmiv
#practicalLaravelDocs
0
4
55
Laravel tip. Need different behavior for different subdomains? Use subdomain routing to handle multi-tenant apps, API versions, or region-specific content. Link to the docs: https://t.co/AAjDvieHar
#practicalLaravelDocs
1
4
95
Laravel tip. Handle 404s gracefully with fallback routes! Instead of showing generic error pages, create custom fallback routes that execute when no other route matches. Link to the docs: https://t.co/bIEPo8LB3d
#practicalLaravelDocs
0
4
70
Laravel tip. Need conditional task execution based on environment, time, or custom logic? Use `when()`, `between()`, `environments()`, and other constraint methods to run tasks only when conditions are met. Link to the docs: https://t.co/usu6KIZYUE
#practicalLaravelDocs
0
5
82
Laravel tip. Need to validate route parameters format? Use `where()` constraints with regex patterns or helper methods to ensure clean URLs and prevent invalid data from reaching your controllers. Link to the docs: https://t.co/td2rq7NP9X
#practicalLaravelDocs
0
7
75
Laravel tip. Need to validate array keys exist in your input? Use `required_array_keys` to ensure specific keys are present in array data, perfect for API endpoints expecting exact structure. Link to the docs: https://t.co/ToVoofq0ul
#practicalLaravelDocs
1
7
57
Laravel tip. Customize your application's route loading with `withRouting()` in `bootstrap/app.php`! Create custom route files, change API prefixes, or take complete control over route registration. Link to the docs: https://t.co/ofHrTdDJtQ
#practicalLaravelDocs
0
4
55
Laravel tip. Need to validate distinct values in array input but ignore case differences? Use the `distinct` rule with `ignore_case` parameter to prevent duplicate values regardless of capitalization. Link to the docs: https://t.co/s9zwqqLKbT
#practicalLaravelDocs
0
4
19