Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with notification displaying when redirect #156

Open
forexknight opened this issue Sep 13, 2023 · 0 comments
Open

Issue with notification displaying when redirect #156

forexknight opened this issue Sep 13, 2023 · 0 comments
Labels
findapr help wanted Extra attention is needed

Comments

@forexknight
Copy link

forexknight commented Sep 13, 2023

Hi,

I have an issue in my dockerized Laravel 10 app and flasher 1.15.3. The issue is that notifications are not displayed when I'm using something like this:

    public function customRoute(Request $request): RedirectResponse
    {
        // action
        flash()->addSuccess('Success notification.');

        return redirect()->back();
    }

When I'm redirecting notification won't be displayed, but when directly returning view it works.
It behaves like that because of this part of code in your package:

final class StorageBag implements StorageInterface
{
    /**
     * @var BagInterface
     */
    private $bag;

    public function __construct(BagInterface $bag = null)
    {
        $this->bag = null !== $bag && 'cli' !== \PHP_SAPI ? $bag : new ArrayBag();
    }

especially this 'cli' !== \PHP_SAPI because since we are using docker our app is in CLI mode. Can anoyone tell my why this PHP_SAPI check has to be present here?

@forexknight forexknight changed the title Issue with notification display when redirect Issue with notification displaying when redirect Sep 13, 2023
@yoeunes yoeunes added help wanted Extra attention is needed findapr labels Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
findapr help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants