Laravel 8 tutorial - Delete method API

  Рет қаралды 26,959

Code Step By Step

Code Step By Step

Күн бұрын

Пікірлер: 26
@laibagillani2905
@laibagillani2905 3 жыл бұрын
Man thankyou for these tutorials. u teach everything soo well that now i am able to do these CRUD functions myself within 2 days.
@moemengaballa
@moemengaballa 3 жыл бұрын
thank you very much good tutorial
@GGSoft2009
@GGSoft2009 2 жыл бұрын
Yes its awesome!!!! THanks
@tariqkhan5206
@tariqkhan5206 3 жыл бұрын
We can pass multiple ids in URL and explode the comma from $id and pass this in the whereIn function and then delete().
@moustaphamangane5390
@moustaphamangane5390 4 жыл бұрын
Bonne continuation frère
@tellavenky5079
@tellavenky5079 3 жыл бұрын
Can you please tell me DB:: query also sir in all apis like get,post,put,delete sir
@nitishpathak6375
@nitishpathak6375 4 жыл бұрын
we can pass the array for deleting multiple data, am I right?
@mahi59288
@mahi59288 4 жыл бұрын
can you please add Eloquent orm tutorial
@mohdizwadi
@mohdizwadi 3 жыл бұрын
Try this.. function delete($id) { $ids = explode(' ',$id); foreach($ids as $id) { Device::where('id',$id)->delete(); } }
@umranjabbar3853
@umranjabbar3853 2 жыл бұрын
my delete and put api works fine it never shows me any kind of error code working fine but recoced form database never update and deleted Final $result variable also return True value ?? Post and get work fine
@asadrehman6684
@asadrehman6684 3 жыл бұрын
can someone suggest a tutorial for multiple delete in laravel 8 using postman
@shocchosolutions6275
@shocchosolutions6275 4 жыл бұрын
bro react real project needed
@tellavenky5079
@tellavenky5079 3 жыл бұрын
One doubt sir why your using api.php sir your not using web.php why sir..
@codestepbystep
@codestepbystep 3 жыл бұрын
we can also use web.php for api but api.php recommend for APIs and it add /api in your url also
@ektapatel_18
@ektapatel_18 3 жыл бұрын
@@codestepbystep please give me answer of todays question sir: multiple ids delete using api how?
@shashankgarg2418
@shashankgarg2418 3 жыл бұрын
@@ektapatel_18 $ids = $request->ids; DB::table("products")->whereIn('id',explode(",",$ids))->delete(); return response()->json(['success'=>"Products Deleted successfully."]);
@mikhailrudoy8068
@mikhailrudoy8068 3 жыл бұрын
@@ektapatel_18 public function deleteapis(Request $request) { $id = $request->id; \DB::table("tblname")->whereIn('id',explode(",",$id))->delete(); return response()->json(['success'=>"Products Deleted successfully."]); } Route::delete('mobile/{id}',[MobileController::class,'deleteapis']);//for multiple
@mohammedhusain6446
@mohammedhusain6446 3 жыл бұрын
@@mikhailrudoy8068 what if id number is 2 and 17, explaod will seperate all 3 into 2,1,7 and will delete wrong record..
@Server400-y5k
@Server400-y5k Жыл бұрын
For controller function multidelete($name){ $device = Employee::where("employee","like","%".$name."%"); $result = $device->delete(); if($result){ return["output"=>"rows deleted"]; }else{ return["output"=>"rows not deleted"]; } } For route Route::delete("deletebyletter/{name}",[ApiController::class,'multidelete']);
@sagarpandey4873
@sagarpandey4873 3 жыл бұрын
yes public function destroy($data) { foreach($data as $id) { $data = Organizations::find($id); $data->delete(); } }
@davidfelipehuertas2458
@davidfelipehuertas2458 4 жыл бұрын
I was getting a 404, until I changed the path from "delete" to "delete / {id}"
@mahemudhasanvadhaniya9485
@mahemudhasanvadhaniya9485 2 жыл бұрын
Because Both URL is different If you Don't want this error try this in Route delete/{id?} it means id is optional
@saifesmail6888
@saifesmail6888 2 жыл бұрын
$ids = explode(",",$id); $result = Device::whereIn('id',$ids)->delete();
@abdulbasitsalah2918
@abdulbasitsalah2918 3 жыл бұрын
you make the url like this 127.0.0.1:8000/api/students/5,6,7 sperate ids with the comma $ids = explode(",", $id); return Student::destroy($ids);
@subratajana1031
@subratajana1031 2 жыл бұрын
it's not a good practice to use comma in url
Laravel 8 tutorial -  Search API
5:58
Code Step By Step
Рет қаралды 38 М.
Laravel 8 tutorial -  Post method API
10:31
Code Step By Step
Рет қаралды 65 М.
Mom had to stand up for the whole family!❤️😍😁
00:39
Synyptas 4 | Арамызда бір сатқын бар ! | 4 Bolim
17:24
ROSÉ & Bruno Mars - APT. (Official Music Video)
02:54
ROSÉ
Рет қаралды 86 МЛН
SISTER EXPOSED MY MAGIC @Whoispelagheya
00:45
MasomkaMagic
Рет қаралды 13 МЛН
Laravel 8 tutorial -  Put method API
8:50
Code Step By Step
Рет қаралды 39 М.
How to use soft deletes in Laravel
10:35
Andrew Schmelyun
Рет қаралды 7 М.
Laravel 8 tutorial -  API Validation
10:48
Code Step By Step
Рет қаралды 36 М.
Laravel 8 tutorial -  API authentication with Sanctum
15:51
Code Step By Step
Рет қаралды 81 М.
Laravel 8 tutorial -  Upload file with API
7:03
Code Step By Step
Рет қаралды 40 М.
Laravel 8 tutorial -  API with Resource
7:14
Code Step By Step
Рет қаралды 31 М.
Mom had to stand up for the whole family!❤️😍😁
00:39