Laravel Roles/Permissions: Complex Multi-Clinic Project

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 37

  • @sandip7794
    @sandip7794 Месяц назад +6

    I was struggling with how to handle roles and permissions in my CRM project, but I came across your RUclips 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.

  • @martinladipo2046
    @martinladipo2046 Месяц назад +1

    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.

  • @SilindokuhleMapiyeye
    @SilindokuhleMapiyeye Месяц назад +1

    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 24 дня назад +1

    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 🙌

  • @adammenczykowski
    @adammenczykowski Месяц назад +1

    Great summary Povilas! I like this sort of approach. I have done very similar myself before for a charity web app

  • @ryiad2010
    @ryiad2010 Месяц назад

    the video is very helpful thanks Master

  • @ilyasmohetna3648
    @ilyasmohetna3648 Месяц назад +1

    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 Месяц назад

      ​@@LaravelDailythanks for all you do sir, much love from Nigeria

  • @TotallyNotZoid
    @TotallyNotZoid Месяц назад

    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  Месяц назад

      I haven't used Frankenphp myself, so can't make a video about it, sorry.

  • @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?

  • @davidsonzed
    @davidsonzed 7 дней назад

    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  7 дней назад +1

      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 5 дней назад

      @@LaravelDaily THANK YOU

  • @juliaof.kataleko7595
    @juliaof.kataleko7595 Месяц назад +1

    Hello!
    Will you continue with this projet?? (Complex multi clinic)

    • @LaravelDaily
      @LaravelDaily  Месяц назад

      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 Месяц назад

      @@LaravelDaily I imagined you would finish the clinic system.

  • @WellnessAndFitnessHub
    @WellnessAndFitnessHub Месяц назад

    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  Месяц назад +1

      No, that's for single database. Can't answer about multiple databases, need to create a separate project and try it out

  • @DanielŚmigiela
    @DanielŚmigiela Месяц назад

    Graet!

  • @martinsinansky2817
    @martinsinansky2817 Месяц назад +1

    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  Месяц назад

      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 Месяц назад +1

      @@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  Месяц назад

      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 Месяц назад

      if you had multiple models you would create a trait or a global observer and would use on every model

  • @IlPandax
    @IlPandax Месяц назад

    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  Месяц назад +1

      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 Месяц назад

      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 Месяц назад

      ​@@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 Месяц назад

      @@LaravelDaily Thanks! 👍

  • @BelgranoK
    @BelgranoK Месяц назад +2

    I think that in truclips.net/video/Fe0VSwpZpaU/видео.html you may use 'match' that is more convinient than 'switch'

    • @LaravelDaily
      @LaravelDaily  Месяц назад +1

      Yes, good point, it's a personal preference.