1.lumen Controllers structure
<code> Controllers --Test --TestController.php </code>
2. Register route
<code>$app->get("test",'Test\TestController@est'); </code>
3.lumen reports an error;
<code> lumen.ERROR: ReflectionException: Class App\Http\Controllers\Test\TestController does not exist in /Users/shumingjian/Desktop/www/lumen/vendor/illuminate/container/Container.php:734 </code>
4.Testcontroller code:
<code> <?php </code>
namespace AppHttpControllersTest;
use AppHttpControllersController as Controller;
class TestController extends Controller
{
<code>public function test(){ echo 1132; }</code>
}
?>
This code can be output normally under Controllers, but it is abnormal under the ControllersTest folder
lumen version 5.2.9
1.lumen Controllers structure
<code> Controllers --Test --TestController.php </code>
2. Register route
<code>$app->get("test",'Test\TestController@est'); </code>
3.lumen reports an error;
<code> lumen.ERROR: ReflectionException: Class App\Http\Controllers\Test\TestController does not exist in /Users/shumingjian/Desktop/www/lumen/vendor/illuminate/container/Container.php:734 </code>
4.Testcontroller code:
<code> <?php </code>
namespace AppHttpControllersTest;
use AppHttpControllersController as Controller;
class TestController extends Controller
{
<code>public function test(){ echo 1132; }</code>
}
?>
This code can be output normally under Controllers, but it is abnormal under the ControllersTest folder
lumen version 5.2.9
It seems that the AppHttpControllersTestTestController class cannot be found. The route definition is correct. It should be a class loading problem.
You try running php artisan tinker, and then run $foo = new AppHttpControllersTestTestController;
in the shell to see if you can find this class.