Micha93's avatar

Call to a member function flashInput() on null and Call to a member function flash() on null

I have done this in my Lumen-Project:

return redirect('formular')
    ->withErrors($validator)
    ->withInput();

And got this Errors:

FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null in RedirectResponse.php line 75
at Application->handleShutdown() in RegistersExceptionHandlers.php line 55
at Application->Laravel\Lumen\Concerns{closure}()
FatalErrorException in RedirectResponse.php line 119:
Call to a member function flash() on null in RedirectResponse.php line 119
at Application->handleShutdown() in RegistersExceptionHandlers.php line 55
at Application->Laravel\Lumen\Concerns\{closure}()
0 likes
2 replies
Micha93's avatar

At first I have to enable the middleware in the app.php. Then I have to update my composer:

composer require predis/predis
composer require illuminate/redis

And then I have to write the session manually? In Laravel this would done automatically?

I want to compare Lumen and Laravel. I think Lumen is much faster. But you have to do a lot more things. Am I wrong?

At first I have to write the "put" and then "get"?

In my routes.php I have done this:

$app->group(['namespace' => 'App\Http\Controllers'], function () use ($app) {
    $app->get('formular', 'FormularController@newForm');
    $app->post('formular', 'FormularController@validateForm');
});

Maybe is there my mistake or should I change anything there? And should I create a new Middleware? Is it really such more effort than in laravel?

Please or to participate in this conversation.