I have an application running Laravel 4.2
, I have a class that takes care of IP's
in blacklist
, and this is saved in the database.
I need when a user accesses my application the system validates if IP
is in blacklist
returns a 403 if it does not allow access. I'm trying to instantiate the BlackListIpController
class inside the file bootstrap/start.php
( file that starts the application ), but without success.
Code:
$model = new app\controllers\BlackListIPsController;
if($model::where('ip', $model->getIp())->first()) {
abort(403);
}
Error:
[Fri Jun 9 09:19:18 2017] PHP Fatal error: Undefined constant 'app \ controllers \ BlackListIPsController' in /home/user/projects/abc/bootstrap/start.php on line 16
[Fri Jun 9 09:36:53 2017] PHP Fatal error: Class 'app \ controllers \ BlackListIPsController' not found in /home/user/projects/abc/bootstrap/start.php on line 16