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
8 months ago 00:10:02 8
We Love PHP Attributes
8 months ago 00:26:22 0
156 Large file uploads, scrambled spotlights, and preparing for Laracon AU
8 months ago 00:07:17 9
Code Review of Pan: Repositories, ENUMs, Value Objects
8 months ago 00:05:27 0
Let’s build a CMS with Filament 3 and Laravel 11 | #32 - Carousel block part 2
8 months ago 00:11:39 0
Let’s build a CMS with Filament 3 and Laravel 11 | #31 - Carousel block
8 months ago 00:05:12 1
Laravel Separate Admin Model and Guard: WHY?
8 months ago 00:16:31 8
Vectors in SQLite! (with libSQL)
8 months ago 01:45:29 18
Laravel Creator talks PHP, Lambos, and VC
8 months ago 00:05:25 1
How does the Laravel defer helper work? (Plain PHP example included!)
8 months ago 00:39:12 7
, Inertia v2, Sublime vs. VS code, and More Laravel Cloud Updates
8 months ago 01:05:02 2
55: Try Hard Empire
8 months ago 00:04:36 1
Design at Laravel | David Hill at Laracon US 2024 in Dallas, TX
8 months ago 00:05:11 0
Let’s build a CMS with Filament 3 and Laravel 11 | #30 - Email Builder part 2
8 months ago 00:03:50 2
Laravel Validation: required_with and required_without_all
8 months ago 00:02:59 0
Let’s build a CMS with Filament 3 and Laravel 11 | #29 - Email Builder
8 months ago 00:08:18 1
Let’s build a CMS with Filament 3 and Laravel 11 | #28 - Small improvements
8 months ago 00:54:50 0
Queues, busses and the messenger component / Tobias Nyholm (Happyr AB)
8 months ago 00:33:21 1
Laracon US 2024: Introducing Pest 3.0
8 months ago 00:11:46 1
Build a Dynamic Multi-Step Form with & Laravel Blade
8 months ago 00:07:06 0
Let’s build a CMS with Filament 3 and Laravel 11 | #27- Menu Builder part 4
8 months ago 00:01:40 1
Why We’re Using Composer Scripts on Laravel Cloud (And You Should Too!)
8 months ago 00:07:33 0
Let’s build a CMS with Filament 3 and Laravel 11 | #26- Menu Builder part 3
8 months ago 00:12:52 3
Let’s Dive Into Pan: A Chill Review of Modern PHP Code (2024)
8 months ago 00:45:13 0
How to make Legacy Refactoring Fun Again / Tomáš Votruba (Czech & Slovak PHP Community Pehapkari)