Laravel devs, streamline your localized routes with this gem! π
Use URL::defaults() to set request-wide default values for URL parameters. Perfect for simplifying route generation in multi-language apps.
Pro tip: Implement in middleware for dynamic defaults.
www.harrisrafto.eu/simplifying-route-parameters-with-laravels-url-defaults #Laravel
Harris Raftopoulos
@harris_rafto
Senior Software Engineer | 15+ years in PHP, 11+ with Laravel | Expert in Livewire, TailwindCSS & VueJS | DevOps Enthusiast | π€Speaker at Athens Laravel Meetup
β’ β’ 125 Posts β’ 41K Views
Laravel devs, boost your app's security with this gem! π
Use session()->regenerate() to refresh session IDs, preventing session fixation attacks. For a clean slate, use session()->invalidate() to regenerate and clear all data.
Pro tip: Regenerate after login for extra security.
www.harrisrafto.eu/enhancing-security-with-session-id-regeneration-in-laravel #Laravel
Laravel devs, enhance your form validation with this gem! π
Use the prohibited_if rule to conditionally prevent field input. Perfect for dynamic forms where some fields should be empty based on others.
Pro tip: Use Rule::prohibitedIf for complex logic.
www.harrisrafto.eu/enhancing-form-validation-with-laravels-prohibited_if-rule #Laravel
Laravel devs, prevent concurrent session writes with this gem! π
Use Route::post()->block() to implement session blocking. Perfect for avoiding data loss in high-concurrency scenarios.
Pro tip: Customize lock and wait times for fine-grained control.
www.harrisrafto.eu/enhancing-concurrency-control-with-laravels-session-blocking #Laravel
Laravel devs, secure your file uploads with this gem! π
Use mimes or mimetypes validation rules to verify file types. Perfect for ensuring only allowed file types are uploaded.
Pro tip: Combine with max file size validation for comprehensive upload security.
www.harrisrafto.eu/securing-file-uploads-mastering-file-type-validation-in-laravel #Laravel