Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Wrapping it Up: Repeat Same Logic for Admin Area

Premium
6 min read

Comments & Discussion

MM
Makhmudov Murodjon ✓ Link copied!

Great Course, simle and practical, thank you!

BA
Bassam A. ✓ Link copied!

Thank you for this good course

FA
Franklin Amaral ✓ Link copied!

Very interesting course.

Considering cases in which a page should only display data related to the logged in user. What would you suggest? Traits? Maybe Scopes? It would be a good class to enhance this course

Thank you for your support as always.

PK
Povilas Korop ✓ Link copied!

You're talking about multi-tenancy, here's the material we have on that one: https://laraveldaily.com/tag/multi-tenancy

FA
Franklin Amaral ✓ Link copied!

Hi my friend, I hope you are well.

I was even referring to small applications like the one mentioned in the course where there would be no need for multi tenancy. For example:

Teacher view only disciplines/students of its scope. Student view only their courses. etc

Anyway, I managed to build here using scope to filter and trait to set user_id without the need to handle this in each data manipulation.

Thank you so much for your support as always.

PK
Povilas Korop ✓ Link copied!

Well yes, that's exactly what I'm talking about: "multi-tenancy" is a global term that can mean multiple implementations - from separate databases with complex solution, to an easy trait-scope based one like yours. It's still multi-tenancy :)

Just yesterday, we published the same trait-scope example based on Filament as a separate tutorial.

FA
Franklin Amaral ✓ Link copied!

Hello Povilas, I had read a tutorial https://laraveldaily.com/post/laravel-multi-tenancy-multi-database-example that made me think about the possibility of making this procedure a little simpler.

I just read the https://laraveldaily.com/post/multi-tenancy-laravel-filament-simple tutorial and it brings a simplified approach that fits these scenarios perfectly.

Thank you for your support as always.

RA
Richard A. Hoyle ✓ Link copied!

Can you do something similar to this using Filament?

M
Modestas ✓ Link copied!

What exactly you are looking for here? There is a few things shown in this.

But this might help you:

  • Admin, Teacher, User -> Different panels
  • Roles -> Policies in filament do the same limitation
RA
Richard A. Hoyle ✓ Link copied!

Yes like these using Different panels for three different types of users.

RA
Richard A. Hoyle ✓ Link copied!

Tried to get the profile to work after finishing this class but I cannot get it to work any suggestions?

RA
Richard A. Hoyle ✓ Link copied!

it has taken a lot of work but I got it to work. you can see what I did on my GitHub under branchTesting https://github.com/rhoyle/branchTesting

RA
Richard A. Hoyle ✓ Link copied!

Ok just found a nether hiccup in this Under the Delete User Account it does not work getting Error Method Illuminate\Auth\RequestGuard::logout does not exist.

Any help would be appreciated.