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
Flash message doesn't show in livewire without reloading #161
Comments
Did you found any solution or any alternative? |
I made this solution until update come for supporting livewire 3 dispatch logic :1. add an envent listener in app.layout.blade.php at the bottom of body<script type="text/javascript">
window.addEventListener('php-flasher-js', event => {
flasher.render(JSON.parse(event.detail[0]));
});
</script> 2. add Helper functionuse Livewire\Component;
if (!function_exists('flashDispatch')) {
function flashDispatch(Component $component, $message = null, $type = 'success', array $options = array(), array $stamps = array())
{
$flasher = flash($message, $type, $options, $stamps);
$component->dispatch('php-flasher-js', json_encode(app('flasher.response_manager')->render([],'array')));
return $flasher;
}
} 3. in component use like this<?php
namespace App\Livewire;
use Livewire\Component;
class Test extends Component
{
public function test() {
flashDispatch($this, "working fine !", 'warning');
}
public function render()
{
return view('livewire.test');
}
} |
Hello guys, I've just released PHPFlasher v1.15.5 with support for Livewire v3. It's not fully tested yet, so I'd appreciate if you could test it in your environment. Please update using: composer require php-flasher/flasher-laravel ^1.15.5 Let me know if there are any issues. Your feedback will help in deciding whether to close this issue. Thanks! |
Good job, thanks |
there is a problem that drove me crazy 😄 , inside component i have this function : public function resetForum()
{
$this->dispatch('refreshListOpened');
flash()->addSuccess("Done !");
} in this form the dispatched event not received in the other component, but when i comment the flash line : public function resetForum()
{
$this->dispatch('refreshListOpened');
//flash()->addSuccess("Done !");
} the dispatched event received fine 😄 |
Hi @gaiththewolf i just released v1.15.7, this should fix the problem |
Hi @yoeunes when using default => 'flasher' that working fine, but when using notyf as default when change page that using wire:navigate notyf not showing. Example:
Dashboard-Garuda-Indonesia-Virtual-Group.mp4 |
Hello @donnebanget, can you create a repo on github so i can reproduce the issue ? |
Hi @yoeunes please check this: |
Hello @donnebanget, Can you please upgrade to version If you're not using a CDN, please ensure to manually copy the new assets into your Best regards, |
Hello @yoeunes , sorry for late respond. I have upgrade to the v.1.15.8 and i back to use cdn but this issue still persist when using notyf. when using default flasher its okay before and after upgrade. Notes: i re-clone repository than composer upgrade Thanks for the awesome project! Update: |
This flash message doesn't show up until I reload the page
If I reload the page then what's is the point of using livewire
The text was updated successfully, but these errors were encountered: