lumen-5.2

How to use multiple database in Lumen

旧巷老猫 提交于 2019-12-03 08:47:40
We've using Lumen for building API's , Now we need to access multiple databases. Currently using .env for database config but unable to found the way to multiple databases in .env where we need to read 2nd connection ... First, you'll need to configure your connections. If you don't already have one you'll need to create a config directory in your project and add the file config/database.php . It might look like this: <?php return [ 'default' => 'accounts', 'connections' => [ 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST'), 'port' => env('DB_PORT'), 'database' => env('DB_DATABASE'),

Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null

痴心易碎 提交于 2019-12-02 11:06:39
问题 Hi I got this errors in Lumen 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}() Here the code which throws the error: return redirect('formular') ->withErrors($validator) ->withInput(); The error comes from withInput() 回答1: The error is happening because Lumen 5.2 does not support sessions

Lumen FatalErrorException in RedirectResponse.php line 75: Call to a member function flashInput() on null

拥有回忆 提交于 2019-12-02 03:10:42
Hi I got this errors in Lumen 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}() Here the code which throws the error: return redirect('formular') ->withErrors($validator) ->withInput(); The error comes from withInput() The error is happening because Lumen 5.2 does not support sessions. The withErrors() and withInput() methods attempt to set values on the session attribute on the redirector,