nonamez123's avatar

Strange behavior in Lumen controller.

While studying the framework Lumen I encountered a strange problem in controller. For example if I need to use validator I need to declare it like use Validator;. If I use use Illuminate\Validation\Validator; as mentioned in documentation it provides an error: " Fatal error: Call to undefined method Illuminate\Validation\Validator::make() in /app/Http/Controllers/PanelController.php on line 39". But for example if i want to use Request I need to use use Illuminate\Http\Request; instead of use Request otherwise I got an error like: " Fatal error: Call to undefined method Illuminate\Support\Facades\Request::all() in app/Http/Controllers/PanelController.php on line 30". Facades in app.php are uncommented. How to properly use those things?

0 likes
2 replies
davorminchorov's avatar

Try using the Facade class path, instead of the normal class.

use Illuminate\Facades\Request; // example
santi's avatar

I have the same issue. Using use Validator for now. I'm pretty sure I'm missing something here ;)

Please or to participate in this conversation.