php - Laravel 8 Gate/Policy failed to open stream: Permission denied on Nginx server ← (PHP, Laravel, Bootstrap, Foundation, HTML)

one text

I'm new to laravel , I'm developing rest api using laravel 8, and I'm adding Gate's and User Policies to it for more secure , I'm using laravel passport for auth, It's working on local but not on nginx server,here is the error I'm having, I did tried give full permission for the fill too, but no luck :(

{
"message": "include(/var/www/html/social/vendor/composer/../../app/Policies/UserPolicy.php): failed to open stream: Permission denied",
"exception": "ErrorException",
"file": "/var/www/html/social/vendor/composer/ClassLoader.php",
"line": 444,
"trace": [
    {
        "file": "/var/www/html/social/vendor/composer/ClassLoader.php",
        "line": 444,
        "function": "handleError",
        "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/composer/ClassLoader.php",
        "line": 444,
        "function": "include"
    },
    {
        "file": "/var/www/html/social/vendor/composer/ClassLoader.php",
        "line": 322,
        "function": "Composer\\Autoload\\includeFile"
    },
    {
        "function": "loadClass",
        "class": "Composer\\Autoload\\ClassLoader",
        "type": "->"
    },
    {
        "function": "spl_autoload_call"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 631,
        "function": "class_exists"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Collections/Arr.php",
        "line": 179,
        "function": "Illuminate\\Auth\\Access\\{closure}",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Collections/Collection.php",
        "line": 361,
        "function": "first",
        "class": "Illuminate\\Support\\Arr",
        "type": "::"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 632,
        "function": "first",
        "class": "Illuminate\\Support\\Collection",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 597,
        "function": "guessPolicyName",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 554,
        "function": "getPolicyFor",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 475,
        "function": "resolveAuthCallback",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 372,
        "function": "callAuthCallback",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 337,
        "function": "raw",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 283,
        "function": "inspect",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php",
        "line": 271,
        "function": "Illuminate\\Auth\\Access\\{closure}",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 284,
        "function": "every",
        "class": "Illuminate\\Support\\Collection",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 258,
        "function": "check",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php",
        "line": 270,
        "function": "allows",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php",
        "line": 261,
        "function": "denies",
        "class": "Illuminate\\Auth\\Access\\Gate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/app/Http/Controllers/OraController.php",
        "line": 65,
        "function": "__callStatic",
        "class": "Illuminate\\Support\\Facades\\Facade",
        "type": "::"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
        "line": 54,
        "function": "destroy",
        "class": "App\\Http\\Controllers\\OraController",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
        "line": 45,
        "function": "callAction",
        "class": "Illuminate\\Routing\\Controller",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
        "line": 254,
        "function": "dispatch",
        "class": "Illuminate\\Routing\\ControllerDispatcher",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Route.php",
        "line": 197,
        "function": "runController",
        "class": "Illuminate\\Routing\\Route",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
        "line": 695,
        "function": "run",
        "class": "Illuminate\\Routing\\Route",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 128,
        "function": "Illuminate\\Routing\\{closure}",
        "class": "Illuminate\\Routing\\Router",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
        "line": 50,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
        "line": 127,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
        "line": 103,
        "function": "handleRequest",
        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
        "line": 55,
        "function": "handleRequestUsingNamedLimiter",
        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php",
        "line": 44,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Auth\\Middleware\\Authenticate",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 103,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
        "line": 697,
        "function": "then",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
        "line": 672,
        "function": "runRouteWithinStack",
        "class": "Illuminate\\Routing\\Router",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
        "line": 636,
        "function": "runRoute",
        "class": "Illuminate\\Routing\\Router",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
        "line": 625,
        "function": "dispatchToRoute",
        "class": "Illuminate\\Routing\\Router",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
        "line": 166,
        "function": "dispatch",
        "class": "Illuminate\\Routing\\Router",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 128,
        "function": "Illuminate\\Foundation\\Http\\{closure}",
        "class": "Illuminate\\Foundation\\Http\\Kernel",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
        "line": 21,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php",
        "line": 31,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
        "line": 21,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php",
        "line": 40,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\TrimStrings",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
        "line": 27,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php",
        "line": 86,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/fruitcake/laravel-cors/src/HandleCors.php",
        "line": 52,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Fruitcake\\Cors\\HandleCors",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/fideloper/proxy/src/TrustProxies.php",
        "line": 57,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 167,
        "function": "handle",
        "class": "Fideloper\\Proxy\\TrustProxies",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
        "line": 103,
        "function": "Illuminate\\Pipeline\\{closure}",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
        "line": 141,
        "function": "then",
        "class": "Illuminate\\Pipeline\\Pipeline",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
        "line": 110,
        "function": "sendRequestThroughRouter",
        "class": "Illuminate\\Foundation\\Http\\Kernel",
        "type": "->"
    },
    {
        "file": "/var/www/html/social/public/index.php",
        "line": 52,
        "function": "handle",
        "class": "Illuminate\\Foundation\\Http\\Kernel",
        "type": "->"
    }
]

}

Source