Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
A practical look at multitenancy in Laravel (Laracon US)
Freek Van der Herten
August 26, 2020
Programming
0
340
A practical look at multitenancy in Laravel (Laracon US)
Freek Van der Herten
August 26, 2020
Tweet
Share
More Decks by Freek Van der Herten
See All by Freek Van der Herten
freekmurze
0
63
freekmurze
0
220
freekmurze
1
370
freekmurze
1
190
freekmurze
0
110
freekmurze
1
320
freekmurze
0
310
freekmurze
0
100
freekmurze
0
46
Other Decks in Programming
See All in Programming
showwin
0
130
tommykw
1
370
mraible
PRO
0
280
hollodotme
1
110
hanakla
2
3.1k
line_developers_tw
0
550
masayaaoyama
4
550
ufoo68
1
180
fuga0618
1
160
akatsukinewgrad
0
220
yokaze
0
440
yshrsmz
1
460
Featured
See All Featured
lemiorhan
627
43k
jacobian
255
20k
62gerente
587
200k
trallard
13
650
addyosmani
1348
190k
paulrobertlloyd
71
1.4k
roundedbygravity
241
21k
garrettdimon
287
110k
holman
448
130k
afnizarnur
176
14k
jponch
103
5k
malarkey
393
60k
Transcript
A practical look at multitenancy in Laravel
About me Freek Van der Herten @freekmurze spatie.be mailcoach.app laravelpackage.training
ohdear.app flareapp.io
spatie.be/open-source
spatie.be/videos
spatie.be/videos
Multitenancy in Laravel
What is multitenancy? A single application that serves several (groups
of) users Users/teams cannot see data of other users/teams Multiple approaches: single database, multiple databases Tom Schlick at Laracon US: youtube.com/watch?v=T-gHOXFpZvg
spatie.be/docs/laravel-multitenancy
spatie/laravel-multitenancy 1. Determine which tenant should be made current 2.
Dynamically change configuration when switching tenant 3. Light tooling for migrations and running artisan commands
Multi DB Demo & Source Dive
Laravel Multitenancy A lightweight package Adapt to your own needs
Single and multiple databases strategies spatie.be/docs/laravel-multitenancy github.com/spatie/laravel-multitenancy#alternatives
Do you really need a package for multitenancy? Multitenancy seems
daunting, but can be simple Take care of it yourself Steal the implementation of the package One less dependency to worry about
One more thing…
Do you ever work on client projects?
Mostly very large ones that take months or years to
complete laravel-multitenancy, laravel-event-sourcing, laravel-view-models, … Good way of building larger than average apps
laravel-beyond-crud.com
laravel-beyond-crud.com Book + premium video course A way of building
large maintainable Laravel apps Many principles applicable to smaller projects as well 15% discount: LARACON-BEYOND-CRUD-LAUNCH
Thank you! spatie.be/docs/laravel-multitenancy freek.dev/1661-multitenancy-in-laravel Mohamed on multitenancy: youtube.com/watch?v=592EgykFOz4 laravelpackage.training laravel-beyond-crud.com