Livewire 3 Crash Course | CRUD project | Laravel

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

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

  • @syedriyaas5668
    @syedriyaas5668 3 месяца назад +8

    Use for implementing confirmation tab when deleting.

    • @ankitkaushikx
      @ankitkaushikx 3 месяца назад

      Thanks Buddy, Just used it and worked. gonna implement it in every major action from now.

  • @siberfx-dev
    @siberfx-dev Год назад +18

    instead using;
    @if ($todo->completed)

    @else

    @endif
    use the syntax of laravel as;
    completed)>

    • @yelocode
      @yelocode  Год назад +1

      Great Tip, Thanks for sharing.

  • @pal722000
    @pal722000 7 месяцев назад +3

    Thank you so much. An easy to understand approach to CRUD. I can follow it. And at each stage I have a working application. Far better than some of the other examples I tried on the web (some of those miss a small item or other, and their example fails - difficult to solve for a beginner).

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

      Thanks for watching. Glad the video was helpful.

  • @JonBrookes
    @JonBrookes 7 месяцев назад +1

    I got a lot of pointers from your video which is extremely useful and well crafted content. Thanks for this and this series. Your channel is also full of great content. I'm going to look at sweet alerts as you suggest. The classic todo with other platforms often leave out persistence as an exercise for the user but Laravel does this out of the box if you use sqlite or sail or both and of course you cover all this and more.

  • @373323
    @373323 Год назад +2

    nice, now i have a very cool todo app that runs with livewire 3 , thank you.

    • @yelocode
      @yelocode  Год назад +2

      Great to hear! Thank you for watching.

  • @Tunerini
    @Tunerini Год назад +3

    Thank you. Very easy to grasp and implement. I will be building more projects with Livewire now.

    • @yelocode
      @yelocode  Год назад

      Great to hear. Thank you for watching.

  • @kouzokiodin3623
    @kouzokiodin3623 2 месяца назад +1

    Thank you so much you're doing the best work

    • @yelocode
      @yelocode  2 месяца назад

      Thank you for the support.

  • @chulopapi812
    @chulopapi812 9 месяцев назад +1

    Thank you for the tutorial. I have been trying to do it but your method is a lot more simple, readable and easy to understand. My code look so messy lmao

    • @yelocode
      @yelocode  8 месяцев назад +1

      Thanks for watching, glad the video was helpful.

  • @IgnasiTort
    @IgnasiTort 5 месяцев назад +2

    I value a lot the effort put in this kind of frameworks, but I miss some feedback for beginner errors. In this example , I forgot to add the method like this '

  • @marconeumann7027
    @marconeumann7027 8 месяцев назад +1

    Like your videos and the way you explain the stuff.
    Tanks for your efforts.!

    • @yelocode
      @yelocode  8 месяцев назад

      Thanks for watching

  • @letm0uin
    @letm0uin 11 месяцев назад +1

    Super awesome! Easy to follow since content is given clearly and objectively! Thank You! I am new to Laravel, and I am already in love with this powerful framwwork, and now learning on how to user livewire with blade, things are really getting interesting ! thanks once again!

  • @tahaali1666
    @tahaali1666 8 месяцев назад +1

    just i can say u are great

    • @yelocode
      @yelocode  8 месяцев назад

      Thanks for watching.

  • @GaBlack-wo9vx
    @GaBlack-wo9vx 10 месяцев назад +1

    Bro, you are talented! I thank you for your amazing courses. They helped me a lot

    • @yelocode
      @yelocode  10 месяцев назад

      Thanks for watching. Happy to hear that.

  • @kamaaoApp
    @kamaaoApp Год назад +2

    it was a greate video to learn some basics of livewire, i think you should create a playlist creating a complete CRM type admin pannel where u get mouch more thing to cover. i could not find any good video for that . Thanks

    • @yelocode
      @yelocode  Год назад +1

      Thank you for watching. Will put that on the list of videos to make.

  • @arifbudimanarrosyid
    @arifbudimanarrosyid Год назад +2

    Thanks for the video, help me so much!
    33:51 if you use model binding, you should pass the parameter like this,
    Update
    because mine is not working, with that work like a charm
    40:54 if you use model bindings, then you won't get an error of 500 it should not be error 500, but 404, that's more logical because the data is not found its 404 not found,

    • @yelocode
      @yelocode  Год назад +1

      Thank you for watching.
      Yes in the video I didn't use the model binding for the update, thanks for pointing that out for people who want to use model binding.
      Yea I agree on the 404 error findOrFail might also give same results but model binding is a lot cleaner.

  • @pkiorpes
    @pkiorpes Год назад +4

    Great job.
    I have to report an issue
    search problem with pagination
    If I choose not the first page and try to search, the result was not what one would expect.
    While the list may appear empty, I have to click on the first page for results to appear

    • @yelocode
      @yelocode  Год назад +4

      Thank you for reporting this.
      Great catch . An easy fix would be to reset to page 1 when $search property is updated. Livewire has hook functions to get notified of property updates.
      public function updatedSearch(){
      $this->resetPage();
      }
      Adding a method like above to the component should help fix it.
      Thank you for watching.

  • @lgoddo3
    @lgoddo3 5 месяцев назад +1

    thankyou!!!! great video thank thankyou !!!! youre amazing!

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

      Thanks for watching.

  • @noushedakib1658
    @noushedakib1658 8 месяцев назад +1

    great video

  • @nextebiz6897
    @nextebiz6897 4 месяца назад +1

    liked and subscribed. thank you sir

  • @PiotrMajdykowski
    @PiotrMajdykowski 11 месяцев назад +1

    Great tutorial!

    • @yelocode
      @yelocode  11 месяцев назад

      Thank you!

  • @syedjackson6931
    @syedjackson6931 Год назад +1

    Great job mate

  • @pkiorpes
    @pkiorpes Год назад +2

    The code below
    completed ? 'checked' : ''}} >
    works as whel as
    @if ($todo->completed)

    @else

    @endif

    • @yelocode
      @yelocode  Год назад +1

      Looks way better, thanks for sharing man. I didn't notice this when recording the video.

    • @kreaweb-be
      @kreaweb-be 11 месяцев назад

      completed) checked @endif />

  • @chetandayalani6948
    @chetandayalani6948 Год назад +1

    Thanks for the useful information

  • @AMoktar
    @AMoktar 7 месяцев назад +1

    Thanks

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

      Thanks for watching

  • @BBaloa
    @BBaloa 10 месяцев назад +1

    thank you so much, very helpful.

    • @yelocode
      @yelocode  10 месяцев назад +1

      Thanks for watching. Glad it was helpful.

  • @alikaram98
    @alikaram98 9 месяцев назад +1

    wow so good bro
    Please also record a comprehensive course for inertiajs + vue3

    • @yelocode
      @yelocode  9 месяцев назад

      Thanks for watching. Will for sure try making a vue and inertiajs course in the future.

  • @alidahmani7319
    @alidahmani7319 Год назад +1

    Great job.

    • @yelocode
      @yelocode  Год назад

      Thank you

    • @alidahmani7319
      @alidahmani7319 Год назад

      @@yelocode thank you, just i have some question, livewire can replace angular or react. can i do complex project with livewire. can work like any project developped by react or angular i spok about performance , diffrence og performance when return json data to handle it in frontend and handle dta in backend and return view to frontend, or livewire just for small project.

    • @yelocode
      @yelocode  Год назад +1

      Livewire is not a 1 to 1 replacement for Vue or React.
      It's main use case is for websites with crud like elements that need to be interactive, for more complex projects you will have a really hard time using livewire or just impossible to build some behaviours unless you write javascript on the side.
      In terms of performance and website size, livewire can scale well as long as you use the best practices and it's used in big sites too.
      If you have a very complex front end app, you might want to take a look at inertia js.

  • @HamadAbdulla_7
    @HamadAbdulla_7 Год назад +1

    thank you

    • @yelocode
      @yelocode  Год назад

      Thanks for watching.

  • @batlin
    @batlin 3 месяца назад

    16:10 -- I'm not sure if it's supposed to be this way, but it worked fine for me without adding "use WithPagination". Maybe it's supported in Component by default now, I dunno.

  • @eramitgupta271
    @eramitgupta271 Год назад +1

    Thank you Sir there is something left to make a video, when will that video come? how did Loading States, navigate there is more

    • @yelocode
      @yelocode  Год назад

      Next video is about file uploads but will cover loading states and navigate in the next coming days,

  • @tobiasalexander4491
    @tobiasalexander4491 8 месяцев назад

    This series is brilliant - I've nearly completed a basic single-value CRUD based on this and it works great... except...
    I want all my ToDos to be completely unique. Adding a new Todo is fine, and so is editing - but the edit fails if I try and validate it as unique because it thinks editingToDoName is a column in the db. Any thoughts on the best way to get around this? Can't wait to get on with the rest of the series!

  • @isaachatilima
    @isaachatilima 6 месяцев назад

    I am told that type of validation above the variable is a premium feature

  • @kyawkaungset
    @kyawkaungset 9 месяцев назад

    I have an issue when I insert the new record for todo and the list card not update immediately and that just update after next create done.

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

    How do you make the tasklist update/renew when creating a new task?

  • @zawnaing8357
    @zawnaing8357 11 месяцев назад

    Thank You.I have a little problem that i click edit button and i remove default value and then i click cancel button, the validation message is show.why?.i try to fix this bug but i can't

  • @ezequieldossantos6317
    @ezequieldossantos6317 6 месяцев назад

    why my button on livewire appears as if it were a link, it does not appear as a button structure, how to solve

  • @kadirertan8664
    @kadirertan8664 8 месяцев назад +1

    Thanks for this great video! I have a small issue about pagination. Page is scrolling back to top after pagination. Any solution for this?

    • @yelocode
      @yelocode  8 месяцев назад

      Thanks for watching.
      This is a new change in recent updates, it scrolls to top by default but you can disable it using a code like below :
      {{ $todos->links(data: ['scrollTo' => false]) }}

    • @kadirertan8664
      @kadirertan8664 8 месяцев назад

      @@yelocode Thank you so much!

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

    I don't know why, but when I got to the last part my "create" didn't work anymore!
    Create
    this seems not work anymore, i have tryied so many things, and nothing make works again!
    someone has some provavel causes?

  • @gaton313
    @gaton313 11 месяцев назад

    Hey Yelo, am really grateful for all the tall stack tutorials. What could cause livewire component not to auto refresh after data being submitted or updated? That data will not show until I refresh manually. Please 🙏 help on this.

  • @romanbush5164
    @romanbush5164 4 месяца назад +1

    we can replace @include with laravel components is there a big difference in these hikes?
    for example filament 3 uses them together Livewire 3

    • @yelocode
      @yelocode  3 месяца назад

      No it's gonna be the same. I just use @include in the video since more people are familiar with it. But you can use which ever you prefer. I myself use x-component on my personal project.

    • @ralhanani
      @ralhanani 2 месяца назад

      @@yelocode Hi and thank you for this tutorial , it must be a laravel or livewire component to use , not just a blade file, is it?

  • @gbengaomoyeni4
    @gbengaomoyeni4 9 месяцев назад

    Where is the source code link because I am only seeing index.html on the repo.

  • @niamatullah6588
    @niamatullah6588 11 месяцев назад

    sir by following your course with wonderful content but unfortunately $this->reset() method is not working. what can be issue

  • @ajimuhammadsofwan1865
    @ajimuhammadsofwan1865 3 месяца назад

    Hello is possible to make $todos as a public properties and set it on mount?
    I try like this but get error:
    public ?Todo $todos;
    public function mount():void
    {
    $this->todos = // set todos with pagination and search
    }

  • @ionutrobertbalasoiu5737
    @ionutrobertbalasoiu5737 Год назад +1

    Hi Martin, it's pretty nice to see such well-made and easy to follow tutorial videos. Keep up the good work!
    I am pretty new to Livewire and I can barely find any info online on the issue that I've been facing, related to the editing part in a CRUD:
    I have some bound to wire:models. Whenever I render the edit form, those fields never preload the dates from the database. The datepicker would show today's date by default although there is a date passed by wire:model back into the input field. I simply cannot figure out how to make those show the dates coming from the model. I tried "value=" field of course, as well as some nasty javascript ways to turn the field type to date only on focus.
    Any idea how to make a date input show the data in an editing situation? Livewire 3, Jetstream, Laravel 10
    Have a nice day!

    • @yelocode
      @yelocode  Год назад +1

      Thanks for watching. For type="date" inputs, you will have to ensure your property value is in the "Y-m-d" format.
      You can do something like below in your mount function or where you are setting the initial values on Edit:
      public function mount()
      {
      $this->testDate = Carbon::now()->addDays(-3000)->format('Y-m-d');
      }
      Hope this can help solve your issue, please do let me know if you found some other or easier solution , since i think it might be a common issue.

    • @ionutrobertbalasoiu5737
      @ionutrobertbalasoiu5737 Год назад +2

      That's embarassing!
      Was so focused on making this date show that I did not realize that the data I am using which I seeded (from a different PHP application) was in many different formats, yet I did not convert it to some universal format / pass it through Carbon (some are dd/mm/YYYY, others are YYYY/mm/dd and even dd.mm.YYYY).
      Glad I asked since it saved me a lot of time haha.. I was about to make a custom livewire x-date-input + jQuery. 😂
      The first 100+ entries in the database were Y-m-d and while editing through livewire I was always selecting the last entries in the db, followed by a few hours of debugging it as if it was AJAX. My date input fields are dd/mm/YYYY (due to browser / location I'm guessing) to make it more confusing...
      Thanks again and keep up the good work!
      @@yelocode

  • @AllenCohen-m5k
    @AllenCohen-m5k 10 месяцев назад

    great tutorial, easy to follow. I use herd with breeze volt stack, although no volt components. at the end of the video my try catch returns a 404, not the exception.
    public function delete($todoId)
    {
    try {
    Todo::findOrFail($todoId)->delete();
    } catch (Exception $e) {
    session()->flash('error', 'Failed to delete todo!');
    return;
    }
    }
    Any ideas?

    • @vanjasavic3712
      @vanjasavic3712 10 месяцев назад

      try this
      "use Illuminate\Database\Eloquent\ModelNotFoundException;
      // ...
      public function delete($todoId)
      {
      try {
      Todo::findOrFail($todoId)->delete();
      } catch (ModelNotFoundException $e) {
      session()->flash('error', 'Todo not found!');
      return;
      } catch (Exception $e) {
      session()->flash('error', 'Failed to delete todo!');
      return;
      }
      }"

    • @AllenCohen-m5k
      @AllenCohen-m5k 10 месяцев назад

      @@vanjasavic3712
      That did not work for me still getting 404. If I dd($todoId) in try, it does return correct id. U hv a second (original) catch block included. I tried with that and also with removing the original catch block ??

  • @berthojoris
    @berthojoris Год назад +1

    Hi martin...what's plugin for VSC to autocomplete php 8 attributes and auto import that?

    • @yelocode
      @yelocode  Год назад

      Hi, I use this PHP plugin : PHP Intelephense

    • @berthojoris
      @berthojoris Год назад

      Hi@@yelocode I already installed, but autocomplete not fired when I type # for start? What did you press to bring it up?

  • @HarshGuptaWebExpert
    @HarshGuptaWebExpert Год назад

    If you type the value manually in the input text box, then Livewire is unable to update the value dynamical.
    We are using Livewire 3.0 for this example.
    Livewire Component

    • @yelocode
      @yelocode  Год назад

      You don't need 'value="{{ $count }}"', can remove it from the input. wire:model="count" automatically updates the value.
      If you like the input value to also update the h1 tag, switch wire:model to this wire:model.live. It will also update the h1 tag

  • @Sh1nitsu
    @Sh1nitsu 8 месяцев назад

    Hello, I have a problem, the $this->reset('name') does not work to me, after creating a user the value inside the textbox is still there, but when i click the create again it applies the validation "The name field is required." even tho the uncleared value is still there.

    • @Sh1nitsu
      @Sh1nitsu 8 месяцев назад

      it only resets the Livewire property but does not clear the input field in the HTML.

  • @arifbudimanarrosyid
    @arifbudimanarrosyid Год назад +1

    I found an issue
    if i do paginate 3 and than create data more than 3, it will render pagination 2x, how to fix that?

    • @yelocode
      @yelocode  Год назад

      Do you get 6 results? or do you get 2 copies of pagination buttons?

    • @arifbudimanarrosyid
      @arifbudimanarrosyid Год назад

      ​@@yelocode 2 copies of pagination button

    • @yelocode
      @yelocode  Год назад

      Interesting, I'm unable to replicate this on my side unfortunately. This might be because of how livewire renders changes to the page livewire.laravel.com/docs/morphing.
      If you have your code on github I can take a look and find the issue if you want.

  • @BrunoVinicius-ix8wt
    @BrunoVinicius-ix8wt Год назад +1

    What is the name of your vscode theme? It's pretty cool =D

    • @yelocode
      @yelocode  Год назад +1

      It's called Monokai Pro. I'm using the Octagon version.

  • @373323
    @373323 Год назад +1

    php artisan livewire:make TodoList and php artisan make:livewire TodoList both are nogo. how to fix?

    • @yelocode
      @yelocode  Год назад

      Can I please know what error message you get when you run them in the terminal?

    • @373323
      @373323 Год назад

      @@yelocode here are no commands defined in the "livewire" namespace. and Command "make:livewire" is not defined. Did you mean one of these?

    • @yelocode
      @yelocode  Год назад +1

      Interesting, was livewire successfully installed? Maybe you got an error during the installation.
      I had another viewer have installation issues and they used composer require livewire/livewire "^3.0.0@beta" to fix it. adding an extra .0 to the "^3.0@beta"

    • @373323
      @373323 Год назад

      @@yelocode ok, that did the trick, you have to have the composer require livewire/livewire "^3.0.0@beta"

    • @yelocode
      @yelocode  Год назад +1

      @@373323 Awesome, glad that fixed the issue.

  • @jhanremerata973
    @jhanremerata973 Год назад +1

    what extension do you use to give clue about the code you want to type?

    • @yelocode
      @yelocode  Год назад +1

      The plugin is called : PHP Intelephense. It does auto suggestion as well many other useful things needed for PHP.

    • @jhanremerata973
      @jhanremerata973 Год назад

      @@yelocode This is the second time i ask in your videos. Thank you so much. I will ask more if there are things i won't understand.

  • @pickinodenero9593
    @pickinodenero9593 11 месяцев назад +1

    thanks brother

    • @yelocode
      @yelocode  11 месяцев назад

      Thanks for watching

  • @lexxkrt
    @lexxkrt Год назад +1

    кнопку удаление можно сделать что-то типа
    Delete

  • @fahvygaming1118
    @fahvygaming1118 6 месяцев назад

    I stumbled on a bug while following the tutorial. When you click on the update button and the validation fails, then you select another todo to edit, the same validation error message pops up

  • @mhammedbahjet570
    @mhammedbahjet570 5 месяцев назад

    thank you :)
    error handling show 404 page not the message in the exception ?

  • @shickler
    @shickler 10 месяцев назад +1

    Hello! Been following your tutorial and tried CRUD like yours but there seems to be delays when adding, editing and deleting, is this normal?

    • @yelocode
      @yelocode  10 месяцев назад +1

      If you have it deployed on a server, there should be some slight delay, basically the time it takes for the requests to reach your server and back. Some delay is normal.
      On local development, it should be instant, unless you are performing a computationally expensive task or db operation.

    • @shickler
      @shickler 10 месяцев назад

      @@yelocode i see now, thanks!

  • @Nazrulislam-qv4mi
    @Nazrulislam-qv4mi 11 месяцев назад +1

    Really awesome content ! Keep up the great work ! Your teaching process really easy Learning a lot ! I'm From Bangladesh. Please take Love💕

    • @yelocode
      @yelocode  11 месяцев назад +1

      Thanks for watching. Glad the videos are helpful 💚.

  • @charbel12334
    @charbel12334 Год назад +2

    very informative course thank you!!

    • @yelocode
      @yelocode  Год назад

      Glad it was helpful!

  • @etekumoses3320
    @etekumoses3320 7 месяцев назад +1

    i am loving every bit fo this tutorials ..keep up sir thanks

    • @yelocode
      @yelocode  7 месяцев назад +1

      Thanks for watching 🙏

  • @ijsljr
    @ijsljr 3 месяца назад

    amazing tutorial

  • @malaak1h
    @malaak1h Год назад +1

    Thanks for this simple and clear turorial

    • @yelocode
      @yelocode  Год назад

      Glad it was helpful!

  • @MaythamMahdi-v5c
    @MaythamMahdi-v5c Месяц назад

    Thank you

  • @dienn
    @dienn Год назад +1

    Thank you very much. I learn so much.

    • @yelocode
      @yelocode  Год назад

      Glad to hear that! Thank you for watching.

  • @matezito
    @matezito 9 месяцев назад +1

    Awesome! thank you!!!!!!!!!!!!!!

    • @yelocode
      @yelocode  9 месяцев назад

      You're welcome!

  • @Mahdi.jafari3
    @Mahdi.jafari3 5 месяцев назад +1

    Awesome 👍

  • @MarcMiroManuel
    @MarcMiroManuel 2 месяца назад

    Nice!

  • @MarcMiroManuel
    @MarcMiroManuel 2 месяца назад

    Nice

  • @deogratiasniyitanga4248
    @deogratiasniyitanga4248 10 месяцев назад +1

    Awesome!!!!!

  • @clericslash3250
    @clericslash3250 Год назад +1

    thank you, very clear explanation

    • @yelocode
      @yelocode  Год назад

      Thank you for watching

  • @th3ja
    @th3ja Год назад +1

    Really awesome content ! Keep up the great work ! Learning a lot !

  • @villarmaryan6577
    @villarmaryan6577 8 месяцев назад

    This video is great, thank you for your effort to teach, hope to see you cover SPA using livewire 3.

  • @Walid11ez
    @Walid11ez 11 месяцев назад +1

    good stuff man keep it up

    • @yelocode
      @yelocode  11 месяцев назад

      Thank you

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

    nice explanation thanks for uploading!

  • @rickybarabba7866
    @rickybarabba7866 Год назад +1

    Bravo!!!

  • @ivanbarta2821
    @ivanbarta2821 Год назад +1

    very good turorial 👍

    • @yelocode
      @yelocode  Год назад

      Glad you liked it, Thank you for watching Ivan.

  • @abrhambitew7936
    @abrhambitew7936 Год назад +1

    Thank U

  • @eramitgupta271
    @eramitgupta271 Год назад +1

    livewire 3 stable release ?

    • @alexandrepellegrino2699
      @alexandrepellegrino2699 Год назад +1

      nope, they not released the stable version at moment but the beta is working absolutely good

    • @eramitgupta271
      @eramitgupta271 Год назад

      @@alexandrepellegrino2699 i know beta version is to much good but stable release?

    • @yelocode
      @yelocode  Год назад +2

      Stable release is out now

  • @ousssika5359
    @ousssika5359 Год назад

    thanks for the series man