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

text in toast or alerts not working #171

Open
VitorReisWebuzz opened this issue Apr 8, 2024 · 2 comments
Open

text in toast or alerts not working #171

VitorReisWebuzz opened this issue Apr 8, 2024 · 2 comments

Comments

@VitorReisWebuzz
Copy link

  • Package Version: 7.1
  • Laravel Version: 10.8

Description:

When i call a toast or a alert in controller the title works fine but the text shows "Hello" if i check the js part it has the text: "Correct text" but when it pops up doesnt show correct.

Steps To Reproduce:

Just called normaly

the popup
image
controller
image
js code in view but the popup just says hello
image

if in console i call in the browser console it works fine
Swal.fire({ title: "Good job!", text: "You clicked the button!", icon: "success" });

@VitorReisWebuzz
Copy link
Author

noticed 2 things

in the swal there is "html:hello"
and i call in the controller a alert::html it works fine

@VitorReisWebuzz
Copy link
Author

temped fixed by editing the toaster.php and adding on the function html the following code
public function html($title = '', $code = '', $icon = '')
{

    $this->config['title'] = $title;
    if ( $code != "hello") {
        $this->config['html'] = $code;
    }
    if (!is_null($icon)) {
        $this->config['icon'] = $icon;
    }

    $this->flash();
    return $this;
}

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

1 participant