2
respostas

Utilização do Request.

Estou fazendo o curso e me deparei com um problema, não estou conseguindo utilizar o Request:input(), me apresenta um erro, poderia me ajudar?

$nome = Request::input('nome');
Whoops, looks like something went wrong.

FatalErrorException in Handler.php line 25:
Uncaught TypeError: Argument 1 passed to estoque\Exceptions\Handler::report() must be an instance of Exception, instance of Error given, called in /Applications/MAMP/htdocs/estoque/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /Applications/MAMP/htdocs/estoque/app/Exceptions/Handler.php:25
Stack trace:
#0 /Applications/MAMP/htdocs/estoque/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): estoque\Exceptions\Handler->report(Object(Error))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#2 {main}
thrown
2 respostas

Parece ter relação com rodar Laravel feito para PHP 5.6 num ambiente com PHP 7.x. https://github.com/laravel/framework/issues/9601

Eu reparei no script que estava faltando usar o Request, ai começou a funcionar.