J
J
juan_chikatilo2022-03-29 21:36:03
Laravel
juan_chikatilo, 2022-03-29 21:36:03

How to deny access to some requests in api in laravel?

Hello!
Maybe I do not quite understand, but how can I deny access to some api requests.
Those. let's say I have this api.php

Route::apiResource('products',ProductsController::class);
Route::apiResource('cart',CartController::class);
Route::apiResource('admin',AdminController::class);


And yet I can use api admin through the same postman. To deny access to this api, I must hang an intermediary on it, which will check whether the user is authorized as an admin?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question