Это видео недоступно.
Сожалеем об этом.

Laravel 8 tutorial - Update Data in Database

Поделиться
HTML-код
  • Опубликовано: 18 сен 2020
  • In this laravel 8 video tutorial, we learn how to update data and record in the database in a simple way. This video is made by anil Sidhu in the English language. This tutorial will also work in laravel 9 version
    steps of video
    Make HTML form in view
    Make Model
    Make Controller
    Make routes
    delete record in DB
    check record is deleted on not
    Interview Question over Model
    Laravel 9
    Laravel tutorial for beginners
    Laravel 9 tutorial playlist • Laravel 9 tutorial

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

  • @codestepbystep
    @codestepbystep  2 года назад +2

    Please support me by subscribe, like and comment :) thank you

  • @user-gr2dx6is5t
    @user-gr2dx6is5t 6 месяцев назад

    9:59 was life saver for me, it took 4 hours for me to find the solution

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

    Saved a bro👌

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

    great

  • @tellavenky5079
    @tellavenky5079 3 года назад

    Very good explination sir i have learn so many things in this video very thanks sir ...

  • @OkaeriSuits
    @OkaeriSuits 3 года назад

    Solo este video me sirvio señor usted es un crack muchas gracias, lo hamo.

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

    Thank you. Great work.

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

    thank you. you saved me.

  • @JacquesvanWyk
    @JacquesvanWyk 3 года назад

    Thank you this method help me solve my problem.

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

    I am learning alot from you, thank you

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

    Thanks, very helpful man

  • @saurabhgaonkar4487
    @saurabhgaonkar4487 3 года назад +3

    getting error can not use post method even if i mention post in both form method and route method

  • @mohammadashrafomid4491
    @mohammadashrafomid4491 3 года назад +2

    Anil thank you so much, appreciate it. This tutorial helped me a lot

    • @tahaakbari66
      @tahaakbari66 3 года назад

      You all understand bro, there is no error update here

    • @tahaakbari66
      @tahaakbari66 3 года назад

      :D:D:D

  • @efremkeleab3300
    @efremkeleab3300 3 года назад

    Really greate work.

  • @dianaeftaiha
    @dianaeftaiha 3 года назад

    I've learnt a lot from you. Thanks Anil

    • @mahsakhodabakhsh3728
      @mahsakhodabakhsh3728 3 года назад +2

      Diana, Is it work for you?! I have a problem, when I just clicked on the update button nothing happened and I redirected to the table.

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

    Gracias crack

  • @PriyankaKumari-bp9bd
    @PriyankaKumari-bp9bd 3 года назад +1

    hey, i am trying to update data same as you . but while i am clicking on update it's not updating and redirecting to the page. everything is working fine data is coming from also it is connected to the modal, but only not updating.
    function saveeditpagedata(Request $req)
    {
    $data = Member::find($req->mem_id);
    $data->Name=$req->name;
    $data->Email=$req->email;
    $data->Address=$req->address;
    $data->save();
    return redirect('lists');
    }
    can you please solve the issue why its not updating the data.

  • @MiHaIpIn
    @MiHaIpIn 3 года назад +3

    Ok, so the corection for this code is in the routing. In web.php use in post code edit/edit, because for some reason the redirect won't work.
    Route::post('edit/edit', [MemberController::class, 'update']);

    • @dianaeftaiha
      @dianaeftaiha 3 года назад +2

      if you add a / in your form action you won't need to use edit/edit (i.e. NOT )

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

      thanks a lot to solve this error. i spend more then 1 hour to solve it after that i came to commemnt section hahah.

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

      @@codingwithamit5100 me too

  • @aryan78085
    @aryan78085 3 года назад

    Thank u sir it helps me

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

    Grande amigo Hindú

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

    Do you think foreach Loop will be created in edit.blade.php??)

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

    You could do that with a JavaScript prompt, it would be shorter and better to edit the field in the same page

  • @adesarva
    @adesarva 3 года назад

    Thank you. really helpful :)

  • @ghadabenhmida6609
    @ghadabenhmida6609 3 года назад

    Really greate work.
    thx

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

    Why when i update, the data move to the last row? and when i delete the data, the id not automatically replace with the one that i've deleted? Do i make mistake anywhere?

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

    Good Day! sir you have a video instead of update ill add another data in another table in database?

  • @brajeshyadav6491
    @brajeshyadav6491 3 года назад

    Shows undefined index tno error when switch on view showdata while in delete it is showing perfectly. Please sove my problem

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

    Why we are not using Route::delete and Route::PUT for deleting and updating data? can you please explain?

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

    *GX40 Official sender is the best.*

  • @RMCMC-YugantMahajan
    @RMCMC-YugantMahajan 3 года назад +1

    I am getting error of trying to access array offset on value of type null plzz sir reply

  • @SagarSingh-kk2sl
    @SagarSingh-kk2sl 3 года назад +3

    I am getting error of creating default object from empty value

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

      did you solve this problem? i'm getting the same thing.

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

      I fixed my problem. there was a mistake in my edit.blade.php file just look if every field is written correctly.

  • @ghazalafazal4370
    @ghazalafazal4370 3 года назад +2

    Respected teacher
    in this video the function in controller showData($id){
    $data= Member::find($id);
    return view('edit',[data=>$data]);
    in this last line 'edit' belongs to what? is it a 'view' name or some 'function' name or link name?
    }

  • @rezwansaki
    @rezwansaki 3 года назад

    Thanks :)

  • @contravetile
    @contravetile 3 года назад

    Instead of reposting the content like we do to create a new post, do you know how to use the PUT/PATCH method?

  • @ameename4425
    @ameename4425 3 года назад

    Sir I'm a big fan of you anyway...Everything works fine but I'm not able to set input value or get values with {{ $something['title'] }}...But the thing is, I'm able to get Id with that but nothing else...How to solve this

  • @asferpangilinan8812
    @asferpangilinan8812 3 года назад

    Hi i hope u can help me with my problem.
    ErrorException (E_WARNING)
    Creating default object from empty value

    • @asferpangilinan8812
      @asferpangilinan8812 3 года назад

      public function edit(Request $req)
      {
      $data = queadd::find($req->id);
      $data->QID=$req->QID;
      $data->DeptAgencyComp=$req->DeptAgencyComp;
      $data->QDesc=$req->QDesc;
      $data->save();
      return redirect('queuewindow.index');
      }

  • @Sanjay-gf1wd
    @Sanjay-gf1wd 2 года назад

    Hi sir, how can i edit form without showing id no in browser...

  • @ashutoshmehere5915
    @ashutoshmehere5915 3 года назад

    sir please provide update with search functionality

  • @lucylocket118
    @lucylocket118 3 года назад

    how can I make the form editable instead of going onto another form to edit it??

  • @quocdattranquoc1832
    @quocdattranquoc1832 3 года назад

    i have a problem which error"" *The POST method is not supported for this route. Supported methods: GET, HEAD.* "
    even if i mention post in both form method and route method
    i need your help
    Thanks a lot

    • @sonamchoki5853
      @sonamchoki5853 3 года назад

      how were you able to solve that problem?

    • @nomanbosal8204
      @nomanbosal8204 3 года назад

      then used 'get' method instead 'post'

  • @abdulwadoodkhan826
    @abdulwadoodkhan826 3 года назад

    The POST method is not supported for this route. Supported methods: GET, HEAD.

  • @julesruzindana-rukundo6254
    @julesruzindana-rukundo6254 2 года назад

    Hi everyone.I need help.how can i get the value of my input field and add it to the href url to use it later ?
    Acheter

  • @Dreamerstube-ot8fj
    @Dreamerstube-ot8fj 7 месяцев назад

    the model does not work on me

  • @sazidfahim8334
    @sazidfahim8334 3 года назад

    sir how to solve this error?
    SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'address' cannot be null (SQL: update `members` set `address` = ? where `id` = 1)

    • @youmiyouminem8832
      @youmiyouminem8832 3 года назад

      the column adresse cant be null as said, so you have to fill your address column with a value, or if you dont want to, you can make a default value for the column in your database by setting the default value = Null
      if you are using phpmyadmin, just go to your table, modify the column, default value: NULL

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

    I dont know why: model->delete() not worked for me. Then I tried : User::where('id',$id)->delete(); ... And it worked.

  • @Emon_Lusk_
    @Emon_Lusk_ 3 года назад

    im getting the error The POST method is not supported for this route. even tho I write the same code as you did

  • @saisatishethreyas9025
    @saisatishethreyas9025 3 года назад

    Attempt to read property "username" on null
    The above error is coming while updating the form pls can you make it fix this error.
    This is my Usercontroller code
    function update(Request $req ) {
    $data =member::find($req->id);
    $data->username=$req->username;
    $data->password=$req->password;
    $data->save();
    return redirect('list');
    }

  • @ALLinONE-zg6fi
    @ALLinONE-zg6fi 3 года назад

    When I update record my location url is change to like edit/edit and get error

  • @saurabhgaonkar4487
    @saurabhgaonkar4487 3 года назад

    plz reply getting frustated cant get soln whole day why its showing post method is not supported for this route even if i mention post for both in form and route method also.....even i use @csrf and input field for passing id

    • @codestepbystep
      @codestepbystep  3 года назад

      Show my your code

    • @saurabhgaonkar4487
      @saurabhgaonkar4487 3 года назад

      @@codestepbystep
      update member
      @csrf
      name:
      email:
      address:

    • @saurabhgaonkar4487
      @saurabhgaonkar4487 3 года назад

      here is the code sir

    • @carvalhosantosmarcio
      @carvalhosantosmarcio 3 года назад

      @@saurabhgaonkar4487 please, show me the error message, maybe i can help you

    • @quocdattranquoc1832
      @quocdattranquoc1832 3 года назад

      i have a problem which error"" *The POST method is not supported for this route. Supported methods: GET, HEAD.* "
      even if i mention post in both form method and route method
      i need your help
      Thanks a lot

  • @kamalCode
    @kamalCode 3 года назад

    Sir, laravel का documentation कैसे पढ़ें और समझें और वेब application development start करें। Sir, new developers can't understand documentation

  • @mahsakhodabakhsh3728
    @mahsakhodabakhsh3728 3 года назад

    Update button didn't work, when I just clicked on the update button nothing happened and I redirected to the table.

    • @khadizakhanom3741
      @khadizakhanom3741 3 года назад

      I am facing the same problem. did u solve it?

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

      In model file define your primary key
      protected $primaryKey = "Id";
      It''s work for me :)

  • @tanveershaikhoffcial
    @tanveershaikhoffcial 3 года назад

    Error :The POST method is not supported for this route. Supported methods: GET, HEAD...
    Anyone found a solution for this?Plz Help

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

      same error here 😢

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

      @@abutahersaikat9051 in web.php write like this Route::post("edit/edit",[MemberController::class,'update']);
      and form action write like this

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

      Thanks.

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

    BadMethodCallException
    Method Illuminate\Http\Request::save does not exist.

  • @balramkaundal2598
    @balramkaundal2598 3 года назад

    i am use your code but is not work .

  • @saurabhgaonkar4487
    @saurabhgaonkar4487 3 года назад

    getting error