Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Laravel Offline Sharing (March 2023) at Ho Chi ...
Search
Dinh Quoc Han
March 25, 2023
Technology
61
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Laravel Offline Sharing (March 2023) 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 Vietnam Meetup 2022: Your code is simplify or complexity?
dinhquochan
0
140
Laravel Live Vietnam 2022: Laravel Eloquent Performance
dinhquochan
0
78
Other Decks in Technology
See All in Technology
自律的なチームを作るためにTechPMがやらないこと
ny7760
0
490
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
6
3.5k
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
180
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
900
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
200
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
110
AI時代の開発はウォーターフォールに回帰する? / development-with-ai-back-to-wf
okamototakuyasr2
0
170
Patterns in AI Driven Software Development
akosma
PRO
0
450
生き様としてのSRE
hokkai7go
1
160
LLMの知識とAIエージェント
happysamurai294
0
150
コードレビューをなくして見えたもの
henteko
0
130
詳解 never 型 - ボトム型の性質を深掘り
nealle
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
510
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
350
It's Worth the Effort
3n
188
29k
Code Review Best Practice
trishagee
74
20k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
470
Abbi's Birthday
coloredviolet
4
11k
WENDY [Excerpt]
tessaabrams
14
40k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
500
ラッコキーワード サービス紹介資料
rakko
5
5.6M
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
360
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