Creating Models (Crud) | Laravel 10 Tutorial : #9

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 30

  • @NasserAl-Abdullah
    @NasserAl-Abdullah 4 місяці тому +2

    Bro you explain the course in a very simple way, super right on timing and the flow of the course its not fast and its not slow and your voice is easy on the ears, moreover you deliver the ideas pretty well, keep up the good work brother and thank you so much for this valuable course

  • @beingSupraa
    @beingSupraa 5 місяців тому +6

    bro u are so underrated

  • @kouzokiodin3623
    @kouzokiodin3623 5 місяців тому +1

    Well Explained! Thank u sir!

  • @marconarca-d8i
    @marconarca-d8i 8 місяців тому

    can you show your blade formatting setting in the setting.json ?

  • @moechris6445
    @moechris6445 Рік тому +1

    I've got a question, instead of orderby can't we use sortBy? Do they work in the same manner or could we have problems if we use sortBy?
    Thank you so much for this tutorial ❤.

    • @yelocode
      @yelocode  Рік тому +5

      Thank you for watching.
      They do similar things, however.
      sortBy is only available on collections, meaning you can only call it after ->get() and it sorts using php code
      while orderBy is available before ->get() and it's sorted on the database level (it's added to the sql query).
      Generally speaking, OrderBy is preferred since it's done at the database level and would be faster, especially if you have an index on your table.
      OrderBy()->get() is generally faster and better (done on Database layer)
      ->get()->sortBy() is done in PHP ( generally would be slower), but it does have it's uses
      One more point is if you have pagination, it's harder to order using sortBy(), it's way easier to user OrderBy().
      I hope it helps clarify the main difference.

    • @moechris6445
      @moechris6445 Рік тому +1

      ​@@yelocode Oh okay, I totally get it now. Thank you so much for explaining it thoroughly.

  • @itsyuupi
    @itsyuupi 7 місяців тому

    This should be a Udemy course.

  • @nephisto2
    @nephisto2 10 місяців тому +1

    Any ideas on why intellisense doesn't pick up ->create() method, or Idea::create(), at 9:25?

    • @Pablo-ts9dv
      @Pablo-ts9dv 9 місяців тому

      ->save() worked for me

  • @grecueduardionut5204
    @grecueduardionut5204 5 місяців тому

    I followed everything thoroughly and even used the template in the video instead of my own pages, but the entries are not saved in the data base, and not even the record works. i haven't skipped anything, I don't know why this is the case

  • @BuhuuRecords
    @BuhuuRecords Рік тому +1

    Hello sir, could you explain why it is working when you have in Idea.php 'like' in protected instead of 'likes' ? Shouldn't it be named identically ?

    • @toeoo6973
      @toeoo6973 Рік тому +1

      Yes, it should be named identically. For why it is working, he didn't use "likes" => 0 or something in the array. He only used "content" => "test". Since the "likes" array isn't being filled, it worked and the default value he gave in the Idea model which is 0 will be assigned automatically. (I may be wrong)

    • @yelocode
      @yelocode  Рік тому +1

      Thanks for watching. Yes, it's a typo in the video, since we have a default value on our database, it's not giving any error message. This is something we fix in future episodes when implementing like button. Sorry for the confusion.

  • @ivanmagtoto8728
    @ivanmagtoto8728 11 місяців тому +2

    hi, how can i fix undefined variables on my blade file? im trying to do a foreach on my $ideas and it doesnt recognize it even tho i have the right code on controller

    • @serefakboga3965
      @serefakboga3965 8 місяців тому

      did you fix it or not ? because ı have same problem

    • @marvinjohn237
      @marvinjohn237 3 місяці тому

      same problem as mine. How did you fix it bro?

  • @antoninonicosia5366
    @antoninonicosia5366 6 місяців тому +1

    I have a little problem: I use the commands php artisan migrate, but It give an error cause It does not find sessions.

  • @jeffjoves5085
    @jeffjoves5085 Рік тому +3

    Nothing Works I don't know why , but I followed everything right since the tutorial 1

    • @yelocode
      @yelocode  Рік тому +1

      Thanks for watching Jeff. You can find the full code over at github github.com/yelocode/ideas/tree/91718b8d905747382c30d6f02697ac1d08fe1930
      To check if there is something missing

    • @yelocode
      @yelocode  Рік тому +1

      if you are getting any error message you can also share here, I might be able to help you fix it

  • @Mr.Capone-
    @Mr.Capone- Рік тому +1

    please give a link to the template

    • @yelocode
      @yelocode  Рік тому +1

      Here is the template link:
      github.com/yelocode/bootstrap5-twitter-clone-template
      Thanks for watching

  • @dominicdeheuer937
    @dominicdeheuer937 Рік тому

    where to find Model.php??

    • @toeoo6973
      @toeoo6973 Рік тому +3

      in your file, vendor/laravel/framework/(src/illuminate)/Database/Eloquent/Model.php (or) you can just ctrl + click on the Model which will bring you directly to it.

  • @Ahmar-ir4ek
    @Ahmar-ir4ek 8 місяців тому

    😬🤐🤐🤐🤐🤐🤐🤐🤐🤐

  • @rodainaomaer2260
    @rodainaomaer2260 4 місяці тому

    so basically u were gonna talk about model but then you left it and talked about something else and went on explaining controller

  • @mehrabrafi9496
    @mehrabrafi9496 14 днів тому +1

    Bro this isn't good practise