Laravel Roles/Permissions: Complex Multi-Clinic Project

  Рет қаралды 11,425

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер: 37
@sandip7794
@sandip7794 2 ай бұрын
I was struggling with how to handle roles and permissions in my CRM project, but I came across your KZbin tutorial, and it was exactly what I needed. Thanks for sharing your knowledge-it's going to be a huge help!
@hassamulhaq7762
@hassamulhaq7762 2 ай бұрын
it seems i also followed the best practices, such videos makes me confident.
@adammenczykowski
@adammenczykowski 2 ай бұрын
Great summary Povilas! I like this sort of approach. I have done very similar myself before for a charity web app
@SilindokuhleMapiyeye
@SilindokuhleMapiyeye 2 ай бұрын
Thanks a lot! I started a project a few months ago, and I'm on the right track, but I need to fix the global scope on my models. All thanks to your help
@andreashesse1653
@andreashesse1653 Ай бұрын
The RILT stack is just the best of both worlds! And inertia 2 has no breaking changes 🫠 almost too good to be true. Thanks for your always hi-q videos 🙌
@martinladipo2046
@martinladipo2046 2 ай бұрын
Soooo timely!!!! This is one of my major concerns in the new project I'm working on cause i last watched a similar tutorial on this far back as 2019.... But I forgot how to implement it.
@ilyasmohetna3648
@ilyasmohetna3648 2 ай бұрын
Hello! Thanks for all the effort you put into these videos, I really appreciate it. I wanted to ask if you could show how to create a more complex, scalable project in Laravel, beyond the usual CRUD apps. For example, it would be great to see something that includes SSO with Keycloak or Laravel Socialite and Passport for authentication. Also, using services or actions instead of controllers would be amazing. What I’m hoping for is a project that combines all the best practices you know into one high-level project.
@LaravelDaily
@LaravelDaily 2 ай бұрын
I don't imagine "all the best practices" in one project, as every project is individual. Using services/actions instead of controllers are shown MULTIPLE times on my channel, just search for services/actions. With SSO/Keycloak/Passport, it's a separate BIG topic in itself, with also multiple ways/tools to implement it. But actually needed for a very small part of developers. So, for now, I'm postponing such videos. But will try to come up with something more complex.
@rolomtech
@rolomtech 2 ай бұрын
​@@LaravelDailythanks for all you do sir, much love from Nigeria
@ryiad2010
@ryiad2010 2 ай бұрын
the video is very helpful thanks Master
@CodeWithJagadish
@CodeWithJagadish Ай бұрын
Where can I find this project? I need to check out the models and migrations.
@LaravelDaily
@LaravelDaily Ай бұрын
The repository is in the premium course: laraveldaily.com/course/roles-permissions
@CodeWithJagadish
@CodeWithJagadish Ай бұрын
​@@LaravelDaily If team_id is nullable in the roles table, how should the team_id in the model_has_roles table handle null values? Is the nullable() missing on it? I mean, should a user still have roles even if they are not part of any teams? If that's not the case, then what's the purpose of having team_id as nullable in the roles table?
@WellnessAndFitnessHub
@WellnessAndFitnessHub 2 ай бұрын
Will this work in multi-database tenancy? Where do I place the roles and permissions tables in multi-database scenario, is it within the landlord or tenant database?
@LaravelDaily
@LaravelDaily 2 ай бұрын
No, that's for single database. Can't answer about multiple databases, need to create a separate project and try it out
@davidsonzed
@davidsonzed 28 күн бұрын
Hello Sir, can you please tell me one simple thing, is livewire a truly SPA style? can it be as fast as Inertia/vuejs? I will love to hear your opinion.
@LaravelDaily
@LaravelDaily 28 күн бұрын
Define "truly". It's "SPA style" - yes. But it works differently by sending requests to the SERVER which, in some people's opinions, disqualifies it from SPA, by definition. But it actually depends on what is your project, its goals, and components on the page.
@davidsonzed
@davidsonzed 27 күн бұрын
@@LaravelDaily THANK YOU
@juliaof.kataleko7595
@juliaof.kataleko7595 2 ай бұрын
Hello! Will you continue with this projet?? (Complex multi clinic)
@LaravelDaily
@LaravelDaily 2 ай бұрын
I don't have any more plans here, I just wanted to show roles/permissions/teams. What other features you're suggesting that would be useful to others?
@juliaof.kataleko7595
@juliaof.kataleko7595 2 ай бұрын
@@LaravelDaily I imagined you would finish the clinic system.
@TotallyNotZoid
@TotallyNotZoid 2 ай бұрын
Hey, love your videos man! I would love if you can make a video about FrankenPhp, how to actually write a caddyfile with frankenphp and create your app for production. I have setup my Laravel development with Sail but cannot figure out how to use Frankenphp and apply all the migrations, run workers and so on and go to production.
@LaravelDaily
@LaravelDaily 2 ай бұрын
I haven't used Frankenphp myself, so can't make a video about it, sorry.
@martinsinansky2817
@martinsinansky2817 2 ай бұрын
Wouldn't checking the team be cleaner if it was done in middleware that would be applied to all related routes? With global scope I expect you would need to define it for every single model. If you manage a clinic and you have models like patients, health records, prescriptions and such, that would make quite a lot of repetition. Or am I missing something?
@LaravelDaily
@LaravelDaily 2 ай бұрын
Good point. Both can work, in my opinion, global scope in each Model feels pretty clear to me, not sure how the same/similar code in Middlewares would look less repetitive. I guess a head-to-head comparison would be an interesting topic for a future video.
@martinsinansky2817
@martinsinansky2817 2 ай бұрын
@@LaravelDaily I am not used to scopes yet, but , I only assume here, a simple check you added to the gate might be enough in the middleware. I expect with multiple models you could provide a trait like BelongsToTeam... Hmm, as I am thinking about it right now, I am getting what you mean. Might need an extra step in model inheritance to be able to check it for all models in a single method...
@LaravelDaily
@LaravelDaily 2 ай бұрын
Yeah, that's an interesting point of "I am not used to scopes yet": it's a good example of developers using what they are more comfortable with. Which is perfectly fine! Laravel allows multiple ways to implement the same thing, in many places.
@krekas
@krekas 2 ай бұрын
if you had multiple models you would create a trait or a global observer and would use on every model
@IlPandax
@IlPandax 2 ай бұрын
Great video! Is it ok to name enums without the word "enum" in it? I mean, when I write controllers I name them like "ExampleController" or when I write actions their name would be "ExampleAction". So "Permission" should be "PermissionEnum" and "Role" should be "RoleEnum". No?
@LaravelDaily
@LaravelDaily 2 ай бұрын
It's a personal preference, but yes, now I regret NOT using that suffix here. In this project specifically, I even had a problem of app/Enums/Role conflicting with Role Model from Spatie package, so I needed to make alias like "use App\Enums\Role as RoleEnum".
@martinsinansky2817
@martinsinansky2817 2 ай бұрын
It is totally OK, we use enums in multiple projects without naming them as SomethingSomethingEnum. Symfony and Laravel do some magic in the background with some classes like FormRequest, Action, Controller and such, that's why it is better to suffix the classes. It is not a requirement but the suffixes are helpful in navigating the code.
@IlPandax
@IlPandax 2 ай бұрын
​@@martinsinansky2817 I don't think this is correct. Controllers extend "app/Http/Controllers/Controller", that has traits and extends "BaseController", so this is the "magic" you a talking about. There is no "magic" related to names. So you could name your controller as you want, but we all agree that it's wrong. About enums, you can name them without suffix but, as Mr. Povilas said, you could have issues with other classes that could have similar names (my first thought would be Models names). So you can, but I don't think you should, IMHO. ;)
@IlPandax
@IlPandax 2 ай бұрын
@@LaravelDaily Thanks! 👍
@DanielŚmigiela
@DanielŚmigiela 2 ай бұрын
Graet!
@BelgranoK
@BelgranoK 2 ай бұрын
I think that in tkzbin.info/www/bejne/fJaTh4atpb-jl7c you may use 'match' that is more convinient than 'switch'
@LaravelDaily
@LaravelDaily 2 ай бұрын
Yes, good point, it's a personal preference.
So I've tried 3 popular Laravel CMSs...
17:53
Laravel Daily
Рет қаралды 10 М.
Got a New Laravel Job? 3 Tips to Analyze Project Codebase Fast
7:23
Laravel Daily
Рет қаралды 1,2 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Laravel Roles and Permissions: All CORE Things You Need To Know
16:32
Laravel Daily
Рет қаралды 227 М.
PHP 8.4 Is Good
15:18
ThePrimeTime
Рет қаралды 131 М.
Laravel Mini CRM for Beginners in 1 Hour: Step-by-Step
1:12:57
Laravel Daily
Рет қаралды 15 М.
Successful Laravel Project: THE PROCESS (Part 1)
16:10
Laravel Daily
Рет қаралды 5 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
I was too dumb for Laravel. Then they fixed it.
10:33
Theo - t3․gg
Рет қаралды 76 М.
So I've Analyzed 100+ Laravel Open-Source Projects...
11:40
Laravel Daily
Рет қаралды 6 М.
5 Must-Haves in My Laravel AppServiceProvider
3:10
Nuno Maduro
Рет қаралды 7 М.