Laravel Code Review: Multi-Tenancy, Events and Queues

preview_player
Показать описание
Another code review, this time it's not junior code: it's an interesting multi-tenancy and multi-DB solution, with events and listeners.

00:00 Intro
03:20 Sign Up: How Multi-Tenancy Works
06:08 Let's Try it Out
06:41 Bug: .env and config
08:15 Tenant Routes: IT WORKS!
09:30 Validation and Subdomain
10:20 Two Events and Two Listeners?
11:01 Events or Jobs and Queues?
12:30 Why Artisan Command?

- - - - -
Support the channel by checking out our products:
Рекомендации по теме
Комментарии
Автор

Overall the code was amazing and your review tought me like hundred new thing

Just wow

mohammadoulabi
Автор

The way you read and breakdown the codebase is like a Symphony performance... Thankx for the video

jeevachaithanyansivanandan
Автор

Can't believe this was from 3 months ago and I missed it. Looks like a great project, well done that developer. One thing I was surprised you didn't mention was the importance of using config variables rather than env ones direct, because once you go to a production environment you should really be running config:cache, at which point all the env based bits stop working.

AndyTalbot
Автор

I learned a lot from your videos regarding code standards and all. You are doing such great work. Thank you Povilas for giving your contribution to the laravel community. Great work. Keep it up.

urvishpatel
Автор

Good review as always. And very nice work done by this developer.

igbokwelaurence
Автор

Interesting.
Events/Listeners are great as well.
And they focus on things where one event can be used to fire different Listeners.
You said to use Job as they are queueable.

But the fact is Event is only fired. And most time consuming things are done in Listeners (which are obviously queueable)

khanalpride
Автор

thats review of code make me understand to make each other can read my code

fajarsetiawansiagian
Автор

Thanks a lot for that advices, that a good point of view for everyone

topx
Автор

Very Nice, and touch many ways of do it same thing.

heyyy
Автор

09:30

line 52: should go to FormRequest->authorize (user->can('create_project') or route middleware (can:create_project)

line 58, 59, 60: not needed

line 61: should go to static boot of Models\Project. Something like that: static::creating( fn ($project) => $project->created_by_id = auth()->id() );

Also, it advised to pass the guard to auth() since he/she's probably implementing multi guard authentication.

Автор

This is really amazing. It helps me a lot

TheMarvelsWorld
Автор

Very interesting, a course of this topic multitenancy saas, would be a very good one, i'm willing to buy the yearly membership, maybe this idea of new course can be a thing

enriquerobledo
Автор

Super interesting, thanks for this review. I noticed in the mapTenantRoutes function a reference to subdomain and saw that the subdomain was not used in the tenant routes file to wrap the routes. My question is, where comes from the subdomain value? Thanks!

lucchateauvert
Автор

Can you create tests for GitHub CI in multiple sub domain?

veds-art-world
Автор

If you were to run a migration in a job, how would you do that?

What if a job fails, how do you catch the exception and display the error.

hadesinferno
Автор

Hi, you have censored the information of the person who sent the email, but the email address appears in the search bar of the browser.

aytacmalkoc
Автор

Thanks for the review, Using this pattern, is there a way we can scale up for a single tenant?

ayubadauda
Автор

How do you set your database connection for each tenant?

hadesinferno
Автор

Hi, can you please create video on laravel installation like cms WordPress and Drupal etc
Configure db details etc from browser form

naviji
Автор

thanks, do you suggest a specific multi tenant package to use ?

ahmad.ms