Single Table Inheritance in Laravel - Part 2

Поделиться
HTML-код
  • Опубликовано: 17 июн 2021
  • 👨‍💻 Learn Test-Driven Development with Laravel!
    tddwithlaravel.com
    Sign up to 30 Days of Laravel 👉🏻 30daysoflaravel.com
    👨‍💻 Sign up to my newsletter and receive PHP, JS and Laravel news in a weekly-basis:
    subscribe.mateusguimaraes.com
    🎉 Party up:
    / mateusjatenee
    / mateusjatenee
    / mateusguimaraes
    Thanks for watching!

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

  • @neverything
    @neverything 3 года назад +1

    Love it, makes me more willing to check the underlaying magic that Laravel provides. Thanks for the video!

  • @skyniitzs5942
    @skyniitzs5942 2 года назад

    you are the best, until now no one had explained this in much time and you did it super well, as well as the syntax of laravel. thanks for the video

  • @theodoreasimeng1244
    @theodoreasimeng1244 4 месяца назад

    Thanks for the education. Please what VS code extension did you used for code to indicate whether an argument in the function is a callback or scope and the likes. Am searching for the name of that extension. It's behaving as PHP storm and I like it. 😊😊

    •  4 месяца назад

      Sorry, I can't recall. I've been using PHPStorm for awhile.

  • @vitaliy.artyukh
    @vitaliy.artyukh 2 года назад

    ok its awesome and useful, but if we need some method or attribute specify for one Model we must add method for both model seems to interface of add "if block" to prevent error that other method dont have such method? i hope you understand what i mean. how to specify models and use specify method/attributes?

  • @free2idol1
    @free2idol1 7 месяцев назад

    thanks for awesome video. I have a question:
    5:35: the $attributes param only has "type" as key right?
    If so, what is the point of passing that $attributes to `new $attributes['type']($attributes)`?

    •  7 месяцев назад

      No, $attributes hold all of the model's attribute.s $attributes['type'] is a class string, e.g "App\Models\Doctor". We instantiate that object and pass all of the attributes as an argument.

    • @free2idol1
      @free2idol1 7 месяцев назад

      @ but at 5:19 I noticed that you only passed ['type => $attributes['type'] ?? null] as first arg to `newInstance()`.

    •  7 месяцев назад

      You're right -- at newInstance it only includes the type. I don't remember from the top of my head, but if it's a parent method, it's probably to retain the same signature.

  • @e.nelson
    @e.nelson 3 года назад

    Could you share the link to Caleb's package?

    • @mabdullahsari
      @mabdullahsari 2 года назад +1

      Kinda late, but it's called "Parental".

  • @daniellandim
    @daniellandim 2 года назад

    Salve Mateus, poderia ajudar os BR ruim no ingles ...rs