Skip to main content

Wrapping it Up: Repeat Same Logic for Admin Area

Premium
6 min read
Makhmudov Murodjon avatar

Great Course, simle and practical, thank you!

Bassam A. avatar

Thank you for this good course

Franklin Amaral avatar

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.

Povilas Korop avatar

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

👍 1
Franklin Amaral avatar

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.

Povilas Korop avatar

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.

👍 1
Franklin Amaral avatar

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.

👍 1
Richard A. Hoyle avatar

Can you do something similar to this using Filament?

Modestas avatar

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
Richard A. Hoyle avatar

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

Richard A. Hoyle avatar

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

Richard A. Hoyle avatar

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

Richard A. Hoyle avatar

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.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.