I want to include an external PHP file into my service provider, that file is in a different folder. Like my file is in folder1 and this folder is at same level as laravel is.
C:\xampp\htdocs\registration\php\file.php //this is file
C:\xampp\htdocs\_problem_sharing\app\AppServiceProvider
This is how I am trying right now
include_once "/../../../registration/php/user_info.php";
include_once "../../registration/php/user_info.php";should be enought. Also, don't prepend the relative path with/.FatalErrorException in AppServiceProvider.php line 14: Class 'App\Providers\UserInfo' not foundwhere UserInfo is my class name in the file that I am trying to include. @Bogdan this happens when I try to make class object$this->userInfo = new UserInfo();App\Providers, you should either put this at the top of your provideor class fileuse UserInfo, or whenever using the class inside the code prepend it with a backslash which puts it in the global namespace (for ex:new \UserInfo()). If the problem persists, please post the contents of your provider.