Livewire Code Review: Likeable Component - 10 Improvements

Livewire Code Review: Likeable Component - 10 Improvements

This is a code review of a Livewire component, which is actually optimization of the PHP class. Will you join me?

00:00 Introducing Component
01:31 Code Overview
03:01 Undefined Class Properties
03:51 Dynamic Class Names
05:45 Unnecessary Variable/Query
07:30 Formatting the Code
07:47 Config Default Values
09:15 Public or Private Methods
10:40 Wait, THAT many DB Queries??
15:17 Remove Duplicate Methods
15:57 Eloquent create() vs save()
17:07 Remove Even More Methods

Related links:
- Laravel and PHP Try-Catch: Exceptions VS Errors? https://www.youtube.com/watch?v=NyPsSNrfYCo
- My Course "Practical Laravel Livewire from Scratch" https://laraveldaily.teachable.com/p/practical-laravel-livewire-from-scratch
- My Livewire Kit: Set of Components https://livewirekit.com/

- - - - -
Support the channel by checking out our products:
- Enroll in my Laravel courses: https://laraveldaily.teachable.com
- Try our Laravel QuickAdminPanel: https://bit.ly/quickadminpanel
- Purchase my Livewire Kit: https://livewirekit.com
- View Laravel Code Examples: https://laravelexamples.com
- Subscribe to my weekly newsletter: http://bit.ly/laravel-newsletter

LivewireReview:Likeable

Post a Comment

0 Comments