I have made a class CustomDB in CustomDB.php file which have simillar functions of DB built in laravel, I can't find the path where I can put the file CustomDB.php so I can easily write use CustomDB;
like use DB;
in either view or controller to have the ability to use this CustomDB class functions
Asked
Active
Viewed 28 times
0
-
1Possible duplicate of [How to add my own custom class in Laravel 5?](https://stackoverflow.com/questions/26942390/how-to-add-my-own-custom-class-in-laravel-5) – Indrasinh Bihola Nov 27 '18 at 11:43
1 Answers
0
DB is a Facade and you should add Facades namespace in your application (app/Facades/CustomDB.php). Next, add the following changes in config/app.php.
From:
'DB' => Illuminate\Support\Facades\DB::class,
To:
'DB' => App\Facades\CustomDB::class,

Serhii Andriichuk
- 898
- 10
- 6