Whenever I try to load a class it will always display an error that Target Class is not found even I have specified the exact location of the file.
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
// This Will Work
// $api->get('hello', function() {
// return "hi";
// });
//Will not work
$api->get('hello', 'app\Http\Controllers\TestController@index');
// $api->get('hi','app\Api\Controllers\TestController@index');
});
Error Message:
message: "Target class [app\Http\Controllers\TestController] does not exist.", status_code: 500,
Screenshot of the File location
Expected Behaviour
In the TestController it should only display a "hi" text. However I can only display the "hi" text if I write in on the route api.php
Actual Behaviour
Whenever I try to load a class it will always display an error that Target Class is not found even I have specified the exact location of the file.
Error Message:
message: "Target class [app\Http\Controllers\TestController] does not exist.", status_code: 500,
Screenshot of the File location![image](https://user-images.githubusercontent.com/20100579/96420103-a23f1600-1227-11eb-95b5-5970d21e32b5.png)
Expected Behaviour
In the
TestController
it should only display a "hi" text. However I can only display the "hi" text if I write in on the route api.phpSteps to Reproduce
Possible Solutions
Not sure