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 Offline Sharing (March 2023) at Ho Chi ...
Search
Dinh Quoc Han
March 25, 2023
Technology
0
52
Laravel Offline Sharing (March 2023) at Ho Chi Minh City, Vietnam
Dinh Quoc Han
March 25, 2023
Tweet
Share
More Decks by Dinh Quoc Han
See All by Dinh Quoc Han
Laravel Vietnam Meetup 2022: Your code is simplify or complexity?
dinhquochan
0
120
Laravel Live Vietnam 2022: Laravel Eloquent Performance
dinhquochan
0
54
Other Decks in Technology
See All in Technology
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
120
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
1
140
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
190
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
990
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
740
What happened to RubyGems and what can we learn?
mikemcquaid
0
210
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
データの整合性を保ちたいだけなんだ
shoheimitani
4
1.4k
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
340
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
73k
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
190
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
62
Information Architects: The Missing Link in Design Systems
soysaucechin
0
760
Embracing the Ebb and Flow
colly
88
5k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Visualization
eitanlees
150
17k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
From π to Pie charts
rasagy
0
120
Ethics towards AI in product and experience design
skipperchong
2
190
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Transcript
Laravel Việt Nam - 19 Tháng 3, 2023 Laravel Offline
Sharing Hồ Chí Minh, Việt Nam
Được Tổ Chức Bởi Laravel Việt Nam
Nhà Tại Trợ Địa Điểm
Lịch trình sự kiện • TechTalk 😎 • Các cấu
trúc thường gặp khi triển khai ứng dụng trên Laravel • Những cách triển khai nghiệp vụ logic phổ biến trên Laravel • Triển khai dynamic route trong Laravel • … • Beer Party 🥳
Discuss; Sharing TL;DR
1. Các bạn thường cấu trúc ứng dụng Laravel như
thế nào?
“Cho sao để vậy, thay đổi chi?” Giữ Nguyên
Không có gì phải bàn 🥲
“Phá luật thì lúc nào cũng sẽ vui hơn tí
:)” Bóc Tách
App in App Design
None
None
None
Packages Design
None
Đọc kỹ HDSD trước khi dùng https://laravel.com/docs/10.x/packages
None
None
None
CMS-like & Plugins/Addons
Botble CMS
None
Plugins Loader & Theme Loader
Domain-oriented Design
Domain-driven Design • Application • Domain • Infrastucture • Interface
(UI)
None
Tham khảo mô hình hướng miền https://github.com/qh-8/skeleton
…
Vậy có nên thay đổi cấu trúc mặc định khi
triển khai ứng dụng?
Nên hoặc không tùy vào quy mô ứng dụng của
bạn
Q&A “Giải lao tí trước khi vào section 2 nha
các bạn 🥶”
2. Triển khai logic trong Laravel
- một ai đó đã từng nói vậy và tôi
thấy nó đúng “Controller không nên chứa bất kỳ nghiệp vụ logic nào.”
“chỗ này năm ngoái (2022) mình có nói rồi hihi”
Tại Sao?
Fat model & Thin controller
$user->changePassword($request->input(‘password’)); “Dễ nhất, nhanh nhất, gọn nhất. Cái gì khó
để model lo, controller gọi là xong 😅”
None
Service Classes
$userService->create($userStoreRequest); “Đại khái là gom cụm tính năng của 1
thằng vô 1 lớp.” $userService->update($currentUser, $userUpdateRequest);
None
Action/Command Classes
$createUser->handle($userStoreRequest); “Tách riêng từng nghiệp vụ một thành 1 lớp.”
$updateUser->handle($currentUser, $userUpdateRequest);
None
None
“Nhớ tận dụng dependency injection & service container của Laravel”
“Sẵn tiện giải lao vài phút trước khi vào phần
3 nha 🥹” Còn bạn?
3. Triển khai thực tiễn tính năng dynamic route trong
Laravel
Đặt vấn đề
SlugHandlerManager
/blog/abc-xyz-123 SlugController SlugHandlerManager BlogSlugHandler
Database Scheme
None
Hình dung cách sử dụng
None
SlugController
None
None
Create interfaces
None
None
Implementation
None
None
None
/sp/{year}/{month}/{name}-{id}.html
`findHandler(…)`
Template Regexr Find Handler
None
… đa ngôn ngữ 🤪
Hết
Q&A / Sharing
Cảm ơn mọi người đã lắng nghe và chia sẻ
Thanks