I made the role based laravel api by using laravel spatie only the user which has particular permission, he can only access that api. For validate the api permission I use l