1If you have a custom file containing some classes/functions that need to be\
2 loaded for every request, you need to make sure its added to the autoloader.
3
4In your composer.json add the following in your autoload section:
5
6"autoload": {
7 "files": [
8 "path/to/your/File.php"
9 ]
10}
11
12OR
13
14First, make sure you have a namespace declaration at the top of your included
15file - say namespace Your\Namespace. In order to avoid conflicts, you need
16to explicitly tell PHP which class you mean when you reference it in the code. You mentioned your file contains a Response class that also exists in Laravel. In order to be able to use both, you need to alias one of them:
17
18use Illuminate\Http\Response as LaravelResponse;
19use Your\Namespace\Response;