Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Laravel Vietnam Meetup 2022: Your code is simpl...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Dinh Quoc Han
March 25, 2023
Technology
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel Vietnam Meetup 2022: Your code is simplify or complexity?
Laravel Vietnam Meetup (August 2022) at Ho Chi Minh City, Vietnam
Dinh Quoc Han
March 25, 2023
More Decks by Dinh Quoc Han
See All by Dinh Quoc Han
Laravel Live Vietnam 2022: Laravel Eloquent Performance
dinhquochan
0
73
Laravel Offline Sharing (March 2023) at Ho Chi Minh City, Vietnam
dinhquochan
0
58
Other Decks in Technology
See All in Technology
Agile and AI Redmine Japan 2026
hiranabe
4
480
アジャイルな経理と Claude Code と経営の未来
kawaguti
PRO
3
190
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
330
GitHub Copilot app最速の発信の裏側
tomokusaba
1
250
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
540
AIAU_UMEMOGU_ninomiya_slide
ninomiya_ii
0
260
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
180
AIはどのように 組織のアジリティを変えるのか?
junki
4
1.4k
自分が詳しくない領域でAIを使う #プロヒス2026
konifar
20
7.4k
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
310
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
120
ロボティクスの技術 / Robotics Technology
ks91
PRO
0
130
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Crafting Experiences
bethany
1
190
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
490
How to Think Like a Performance Engineer
csswizardry
28
2.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Context Engineering - Making Every Token Count
addyosmani
9
980
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
230
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Building the Perfect Custom Keyboard
takai
2
800
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Transcript
Your Code Is SIMPLIFY Or COMPLEXITY? with Dinh Quoc Han
Code Của Bạn ĐƠN GIẢN Hay PHỨC TẠP? với Đinh
Quốc Hân
Who Am I? PHP Lover, Artisan 6 years experience Currently
working at SHIFT ASIA Admin at Laravel Viet Nam
Overview 1. Problems 2. Coding Standards 3. CRUD 4. Complexity?
5. Q&A
1. Problems!
2. Coding Standards
PSR-12
None
None
How to follow PSR-12?
None
PSR-12
composer require --dev laravel/pint
3. CRUD Create - Read - Update - Delete 😎
How Many?
M-V-C
M-V-C but by Packages
Domain Oriented Design Not ‘DDD’ - Domain Driven Design 🤣
…
Basic Example
routes/web.php
app/Http/Controllers/UserController.php
app/Http/Controllers/UserController.php
Write all business logic in controller?
None
Why?
Controller should hold ZERO logic!
Controller only bring logic together!
Easy apply design patterns, structures!
Easy to reuse, maintenance, testing
1. Fat Model - Thin Controller
None
None
None
2. Repository Class or Service Class
None
None
3. Actions/Commands Class (CQRS)
None
None
4. Together
Example From Laravel
None
None
Next: Controller!
Cruddy by Design Adam Wathan
"More controllers doing less work obviates need for many other
fancy patterns!" David Heinemeier Hansson - Creator of RoR
7 Standard Actions in Laravel
1. Index 2. Create 3. Store 4. Show 5. Edit
6. Update 7. Destroy
NEVER write CUSTOM ACTION
None
None
None
Tip #1: Nested Resource? Create New Controller
None
None
Tip #2: Edited Dependently? Create New Controller
None
None
Tip #3: Touches Pivot Records? Create New Controller
None
None
Tip #4: Transitions State? Create New Controller
Example From Laravel
None
None
Or Single Action Controller? Invokable Controller
None
None
4. Complexity?
YAGNI "You aren't gonna need it"
Back To The BASIC
app/Http/Controllers/UserController.php
1 Phút Quảng Cáo!
None
Thank You Q&A