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

Update 2.1.9 error #52

Closed
nam-co opened this issue Nov 8, 2021 · 3 comments
Closed

Update 2.1.9 error #52

nam-co opened this issue Nov 8, 2021 · 3 comments

Comments

@nam-co
Copy link
Contributor

nam-co commented Nov 8, 2021

Hi, I've been using Livewire-alert and it worked excellent, but I just updated to 2.1.9 and starting getting the error "Method App\Http\Livewire\XXXX\XXXX::alert does not exist", so I went to the readme and saw I need it to add this that I didn't have before:

use Jantinnerezo\LivewireAlert\WithAlert;
use LivewireAlert;

I added them and now Im getting a
"Trait 'App\Http\Livewire\PageMaker\LivewireAlert' not found"

Appreciate any help
Regards
Michael

@anthony-brindley
Copy link

Hi Michael, I was getting the same issue. If you look at your code, you need to use use Jantinnerezo\LivewireAlert\LivewireAlert; and then include the trait inside the class. There is no 'WithAlert' include that I can see. I've just done this and the alerts work fine.

e.g

<?php

namespace {your-namespace-here}

use Jantinnerezo\LivewireAlert\LivewireAlert;

class {yourClassName} 
{

use LivewireAlert;

//...

@nam-co
Copy link
Contributor Author

nam-co commented Nov 9, 2021

Hi @anthony-brindley , your solution works, everything is ok now, thanks a lot

@nam-co nam-co closed this as completed Nov 9, 2021
@nam-co nam-co reopened this Nov 9, 2021
@nam-co
Copy link
Contributor Author

nam-co commented Nov 9, 2021

Hi @jantinnerezo I just notice the "$this->confirm" shows up, but 'onConfirmed' it doesn't run the function, I. tried changing to ->alert but is the same, the 'onConfirmed' => 'confirmedClearAll' still doesn't work, the listener is in place

Appreciate any help
Regards
Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants