Closed PerryvanderMeer closed 1 year ago
use view composer to pass session data to views via service provider:
public function boot()
{
view()->composer('*', function ($view) {
$view->with('test', session('test'));
});
}
Hey there,
While this may be a legitimate issue, can you first try posting your problem or question on one of the support channels below? Also do check if manually running the artisan command would fix the issue, which might mean that it only possible to run psql on CLI and not web requests.
If this issue can be definitively identified as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.
Thanks!
Thanks, @nunomaduro. I suspect that the problem is caused by the fact that the session has not yet started. The session is not started until https://github.com/laravel/folio/blob/5ade0ba20d6b85c88d386758d10239f9b7cb271b/src/RequestHandler.php#L67C1-L73C20
While the route is being resolved in https://github.com/laravel/folio/blob/5ade0ba20d6b85c88d386758d10239f9b7cb271b/src/RequestHandler.php#L38C39-L38C39
Folio Version
1.0.0
Laravel Version
10.20.0
PHP Version
8.2.4
Description
Folio returns a 404 when using a session within a Global Scope in an Eloquent model.
session('test')
returnsnull
; in plain Laravel it returns the actual session data.Steps To Reproduce