Laravel and PHP Refactor: If-Else to Switch or Match
I’ve received an email asking how to shorten the code with if-else statements. Let’s try to optimize.
Related video - Laravel and PHP Try-Catch: Exceptions VS Errors?
- - - - -
Support the channel by checking out our products:
- Enroll in my Laravel courses:
- Try our Laravel QuickAdminPanel:
- Purchase my Livewire Kit:
- View Laravel Code Examples:
- Subscribe to my weekly newsletter:
16 views
105
26
4 months ago 00:10:02 7
We Love PHP Attributes
4 months ago 00:26:22 1
156 Large file uploads, scrambled spotlights, and preparing for Laracon AU
4 months ago 00:07:17 9
Code Review of Pan: Repositories, ENUMs, Value Objects
4 months ago 00:05:27 1
Let’s build a CMS with Filament 3 and Laravel 11 | #32 - Carousel block part 2
4 months ago 00:11:39 1
Let’s build a CMS with Filament 3 and Laravel 11 | #31 - Carousel block
4 months ago 00:05:12 1
Laravel Separate Admin Model and Guard: WHY?
4 months ago 00:16:31 6
Vectors in SQLite! (with libSQL)
4 months ago 01:45:29 11
Laravel Creator talks PHP, Lambos, and VC
4 months ago 00:05:25 1
How does the Laravel defer helper work? (Plain PHP example included!)
4 months ago 00:39:12 6
, Inertia v2, Sublime vs. VS code, and More Laravel Cloud Updates
4 months ago 01:05:02 2
55: Try Hard Empire
4 months ago 00:04:36 1
Design at Laravel | David Hill at Laracon US 2024 in Dallas, TX
4 months ago 00:05:11 1
Let’s build a CMS with Filament 3 and Laravel 11 | #30 - Email Builder part 2
4 months ago 00:03:50 1
Laravel Validation: required_with and required_without_all
4 months ago 00:02:59 1
Let’s build a CMS with Filament 3 and Laravel 11 | #29 - Email Builder
4 months ago 00:08:18 1
Let’s build a CMS with Filament 3 and Laravel 11 | #28 - Small improvements
4 months ago 00:54:50 1
Queues, busses and the messenger component / Tobias Nyholm (Happyr AB)
4 months ago 00:33:21 1
Laracon US 2024: Introducing Pest 3.0
4 months ago 00:11:46 1
Build a Dynamic Multi-Step Form with & Laravel Blade
4 months ago 00:07:06 1
Let’s build a CMS with Filament 3 and Laravel 11 | #27- Menu Builder part 4
4 months ago 00:01:40 1
Why We’re Using Composer Scripts on Laravel Cloud (And You Should Too!)
4 months ago 00:07:33 1
Let’s build a CMS with Filament 3 and Laravel 11 | #26- Menu Builder part 3
4 months ago 00:12:52 3
Let’s Dive Into Pan: A Chill Review of Modern PHP Code (2024)
4 months ago 00:45:13 1
How to make Legacy Refactoring Fun Again / Tomáš Votruba (Czech & Slovak PHP Community Pehapkari)