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!
@hassamulhaq77622 ай бұрын
it seems i also followed the best practices, such videos makes me confident.
@adammenczykowski2 ай бұрын
Great summary Povilas! I like this sort of approach. I have done very similar myself before for a charity web app
@SilindokuhleMapiyeye2 ай бұрын
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Ай бұрын
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 🙌
@martinladipo20462 ай бұрын
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.
@ilyasmohetna36482 ай бұрын
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.
@LaravelDaily2 ай бұрын
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.
@rolomtech2 ай бұрын
@@LaravelDailythanks for all you do sir, much love from Nigeria
@ryiad20102 ай бұрын
the video is very helpful thanks Master
@CodeWithJagadishАй бұрын
Where can I find this project? I need to check out the models and migrations.
@LaravelDailyАй бұрын
The repository is in the premium course: laraveldaily.com/course/roles-permissions
@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?
@WellnessAndFitnessHub2 ай бұрын
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?
@LaravelDaily2 ай бұрын
No, that's for single database. Can't answer about multiple databases, need to create a separate project and try it out
@davidsonzed28 күн бұрын
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.
@LaravelDaily28 күн бұрын
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.
@davidsonzed27 күн бұрын
@@LaravelDaily THANK YOU
@juliaof.kataleko75952 ай бұрын
Hello! Will you continue with this projet?? (Complex multi clinic)
@LaravelDaily2 ай бұрын
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.kataleko75952 ай бұрын
@@LaravelDaily I imagined you would finish the clinic system.
@TotallyNotZoid2 ай бұрын
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.
@LaravelDaily2 ай бұрын
I haven't used Frankenphp myself, so can't make a video about it, sorry.
@martinsinansky28172 ай бұрын
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?
@LaravelDaily2 ай бұрын
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.
@martinsinansky28172 ай бұрын
@@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...
@LaravelDaily2 ай бұрын
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.
@krekas2 ай бұрын
if you had multiple models you would create a trait or a global observer and would use on every model
@IlPandax2 ай бұрын
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?
@LaravelDaily2 ай бұрын
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".
@martinsinansky28172 ай бұрын
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.
@IlPandax2 ай бұрын
@@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. ;)
@IlPandax2 ай бұрын
@@LaravelDaily Thanks! 👍
@DanielŚmigiela2 ай бұрын
Graet!
@BelgranoK2 ай бұрын
I think that in tkzbin.info/www/bejne/fJaTh4atpb-jl7c you may use 'match' that is more convinient than 'switch'