Slide 1

Slide 1 text

A practical look at multitenancy in Laravel

Slide 2

Slide 2 text

About me Freek Van der Herten @freekmurze spatie.be mailcoach.app laravelpackage.training ohdear.app flareapp.io

Slide 3

Slide 3 text

spatie.be/open-source

Slide 4

Slide 4 text

spatie.be/videos

Slide 5

Slide 5 text

spatie.be/videos

Slide 6

Slide 6 text

Multitenancy in Laravel

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

spatie.be/docs/laravel-multitenancy

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

Multi DB Demo & Source Dive

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

One more thing…

Slide 14

Slide 14 text

Do you ever work on client projects?

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

laravel-beyond-crud.com

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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