Это видео недоступно.
Сожалеем об этом.
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
Please support me by subscribe, like and comment :) thank you
9:59 was life saver for me, it took 4 hours for me to find the solution
Saved a bro👌
great
Very good explination sir i have learn so many things in this video very thanks sir ...
Solo este video me sirvio señor usted es un crack muchas gracias, lo hamo.
Thank you. Great work.
thank you. you saved me.
Thank you this method help me solve my problem.
I am learning alot from you, thank you
Thanks, very helpful man
getting error can not use post method even if i mention post in both form method and route method
Anil thank you so much, appreciate it. This tutorial helped me a lot
You all understand bro, there is no error update here
:D:D:D
Really greate work.
I've learnt a lot from you. Thanks Anil
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.
Gracias crack
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.
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']);
if you add a / in your form action you won't need to use edit/edit (i.e. NOT )
thanks a lot to solve this error. i spend more then 1 hour to solve it after that i came to commemnt section hahah.
@@codingwithamit5100 me too
Thank u sir it helps me
Grande amigo Hindú
Thank you :)
Do you think foreach Loop will be created in edit.blade.php??)
You could do that with a JavaScript prompt, it would be shorter and better to edit the field in the same page
Thank you. really helpful :)
Really greate work.
thx
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?
Good Day! sir you have a video instead of update ill add another data in another table in database?
Shows undefined index tno error when switch on view showdata while in delete it is showing perfectly. Please sove my problem
Why we are not using Route::delete and Route::PUT for deleting and updating data? can you please explain?
*GX40 Official sender is the best.*
I am getting error of trying to access array offset on value of type null plzz sir reply
i am also face the same issue
I am getting error of creating default object from empty value
did you solve this problem? i'm getting the same thing.
I fixed my problem. there was a mistake in my edit.blade.php file just look if every field is written correctly.
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?
}
return view('edit') is referring to the view
@@martinmunene8067 thank u
Thanks :)
Instead of reposting the content like we do to create a new post, do you know how to use the PUT/PATCH method?
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
Hi i hope u can help me with my problem.
ErrorException (E_WARNING)
Creating default object from empty value
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');
}
Hi sir, how can i edit form without showing id no in browser...
sir please provide update with search functionality
how can I make the form editable instead of going onto another form to edit it??
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
how were you able to solve that problem?
then used 'get' method instead 'post'
The POST method is not supported for this route. Supported methods: GET, HEAD.
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
the model does not work on me
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)
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
I dont know why: model->delete() not worked for me. Then I tried : User::where('id',$id)->delete(); ... And it worked.
im getting the error The POST method is not supported for this route. even tho I write the same code as you did
Yaa broo mee too
Do you get the reason?
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');
}
When I update record my location url is change to like edit/edit and get error
Did u solve it?
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
Show my your code
@@codestepbystep
update member
@csrf
name:
email:
address:
here is the code sir
@@saurabhgaonkar4487 please, show me the error message, maybe i can help you
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
Sir, laravel का documentation कैसे पढ़ें और समझें और वेब application development start करें। Sir, new developers can't understand documentation
ok, I will make a video on it
Update button didn't work, when I just clicked on the update button nothing happened and I redirected to the table.
I am facing the same problem. did u solve it?
In model file define your primary key
protected $primaryKey = "Id";
It''s work for me :)
Error :The POST method is not supported for this route. Supported methods: GET, HEAD...
Anyone found a solution for this?Plz Help
same error here 😢
@@abutahersaikat9051 in web.php write like this Route::post("edit/edit",[MemberController::class,'update']);
and form action write like this
Thanks.
BadMethodCallException
Method Illuminate\Http\Request::save does not exist.
i am use your code but is not work .
getting error