Добавить
Уведомления

#11 Laravel API Tutorial | Create Laravel DELETE API | Laravel Delete API with Param / Json

In Part-11 of Laravel 8 API Tutorial, we will create Laravel Delete API. Laravel Delete API is used to delete the specific records with Delete method. We can delete single or multiple records with Delete API using Delete Method. In the tutorial, we will create below Delete API in Laravel 8 :- 1) Delete API for deleting single record with param 2) Delete API for deleting single record with json We have 3 types of response codes / status codes for Delete API :- 202 :- Response will come and will show as "Accepted" 204 :- No Response will come at all 200 :- Response will come and will show as "Successful" For deleting Single record :- // DELETE API - Delete single user with param Route::delete('delete-user/{id}','APIController@deleteUser'); Delete API :- http://127.0.0.1:8000/api/delete-user/6 No Response if 204 status will be send ------------------------------------------------- Delete Multiple Records / Users or Delete Array We can also delete multiple records with Delete API using Delete Method by sending id's of multiple records as params In example, we are deleting multiple users by sending user id's in Delete API param // DELETE API - Delete multiple users with param Route::delete('delete-multiple-users/{ids}','APIController@deleteMultipleUsers'); Delete API :- http://127.0.0.1:8000/api/delete-multiple-users/1,3,4 ---------------------------------------------------------------------------------- Delete Multiple Records / Users Array with Json We can also delete multiple records or arrays by using json in Delete API by sending id's of multiple records within array in json Delete API :- http://127.0.0.1:8010/api/delete-multiple-users-with-json // DELETE API - Delete multiple users with json Route::delete('delete-multiple-users-with-json','APIController@deleteMultipleUsersJson'); -------------------------------------------------------------------------- Delete Multiple Records / Users or Delete Array We can also delete multiple records with Delete API using Delete Method by sending id's of multiple records as params In example, we are deleting multiple users by sending user id's in Delete API param Delete API :- http://127.0.0.1:8010/api/delete-multiple-users/1,3,4 // DELETE API - Delete multiple users with param Route::delete('delete-multiple-users/{ids}','APIController@deleteMultipleUsers'); #laravelapitutorial #laravel8api #laravelapitypes #laravelapiexamples #laravelapi Learn to make e-commerce website in Laravel 6 / 7 / 8 :- https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u

Иконка канала JavaScript С Основами
20 подписчиков
12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

In Part-11 of Laravel 8 API Tutorial, we will create Laravel Delete API. Laravel Delete API is used to delete the specific records with Delete method. We can delete single or multiple records with Delete API using Delete Method. In the tutorial, we will create below Delete API in Laravel 8 :- 1) Delete API for deleting single record with param 2) Delete API for deleting single record with json We have 3 types of response codes / status codes for Delete API :- 202 :- Response will come and will show as "Accepted" 204 :- No Response will come at all 200 :- Response will come and will show as "Successful" For deleting Single record :- // DELETE API - Delete single user with param Route::delete('delete-user/{id}','APIController@deleteUser'); Delete API :- http://127.0.0.1:8000/api/delete-user/6 No Response if 204 status will be send ------------------------------------------------- Delete Multiple Records / Users or Delete Array We can also delete multiple records with Delete API using Delete Method by sending id's of multiple records as params In example, we are deleting multiple users by sending user id's in Delete API param // DELETE API - Delete multiple users with param Route::delete('delete-multiple-users/{ids}','APIController@deleteMultipleUsers'); Delete API :- http://127.0.0.1:8000/api/delete-multiple-users/1,3,4 ---------------------------------------------------------------------------------- Delete Multiple Records / Users Array with Json We can also delete multiple records or arrays by using json in Delete API by sending id's of multiple records within array in json Delete API :- http://127.0.0.1:8010/api/delete-multiple-users-with-json // DELETE API - Delete multiple users with json Route::delete('delete-multiple-users-with-json','APIController@deleteMultipleUsersJson'); -------------------------------------------------------------------------- Delete Multiple Records / Users or Delete Array We can also delete multiple records with Delete API using Delete Method by sending id's of multiple records as params In example, we are deleting multiple users by sending user id's in Delete API param Delete API :- http://127.0.0.1:8010/api/delete-multiple-users/1,3,4 // DELETE API - Delete multiple users with param Route::delete('delete-multiple-users/{ids}','APIController@deleteMultipleUsers'); #laravelapitutorial #laravel8api #laravelapitypes #laravelapiexamples #laravelapi Learn to make e-commerce website in Laravel 6 / 7 / 8 :- https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u

, чтобы оставлять комментарии