401 Unauthorized DELETE request to RESTful API in laravel via Ajax

前端 未结 2 1114
悲&欢浪女
悲&欢浪女 2021-01-03 06:23

I\'ve created a restful API using laravel controllers. I have a PhotosController which has a destroy($id) method for resource dele

2条回答
  •  轮回少年
    2021-01-03 07:02

    I think your system's requiring the authentication for controller action "destroy" method. So you need to login before calling that method.

    If you're using the middleware "auth" (app\Http\Middleware\Authenticate.php), you can easy find the "handle" function that returning "Unauthorized" error.

    Hope this will help.

提交回复
热议问题