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
130
Laravel Live Vietnam 2022: Laravel Eloquent Performance
dinhquochan
0
77
Other Decks in Technology
See All in Technology
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
170
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
530
Essential architectural thinking (revised edition)
ufried
0
110
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
0
140
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
240
おそらく日本で唯一のDevRelインターン生として
husengs7
0
170
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
550
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
150
Snapshot Testing in Practice: Predictable and Reliable SwiftUI Views
fespinoza
0
170
LocalStack を使ったサーバーレスアプリケーション開発 / Serverless Development with LocalStack
kakakakakku
1
340
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
160
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
140
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
470
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
490
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
420
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
560
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
610
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Designing for Timeless Needs
cassininazir
1
520
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
400
Designing Powerful Visuals for Engaging Learning
tmiket
1
600
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
480
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