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

@include('sweetalert::alert') not working in Master View #66

Closed
afrasiyabhaider opened this issue Jan 12, 2020 · 5 comments
Closed

@include('sweetalert::alert') not working in Master View #66

afrasiyabhaider opened this issue Jan 12, 2020 · 5 comments

Comments

@afrasiyabhaider
Copy link

afrasiyabhaider commented Jan 12, 2020

  • Package Version: 3.1
  • Laravel Version: 6.10

Description:

@include('sweetalert::alert') not working in Master View. It didnt include .js and .css files and I dont want to use cdn, @realrashid please tell me the solution and guide me where is the mistake

I've performed following steps but it didn't worked

  • Removed sweetalert.min.js file from public/vendors

  • php artisan config:cache

  • php artisan cache:clear

  • php artisan sweetalert:publish

  • php artisan vendor:publish --provider="RealRashid\SweetAlert\SweetAlertServiceProvider" --force

  • composer dumpautoload

@realrashid
Copy link
Owner

Hi,
Is it possible to share your repo or any remote assistance if not then follow below step?

Run the below command

php artisan vendor:publish --provider="RealRashid\SweetAlert\SweetAlertServiceProvider" --force

and include the sweet-alert view in your master layout before closing body tag.

....
@include('sweetalert::alert')
</body>

after completing all steps must run composer dump-autoload command.

Let me know if the above steps solve your issue.

@afrasiyabhaider
Copy link
Author

I've found solution @realrashid thank you for always being so helpful

I put the following code into my public/.htaccess and now its running at rocket speed :D

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

@aaron-za-dev
Copy link

aaron-za-dev commented Jan 14, 2020

(Updated) I have the same problem, @include ('sweetalert :: alert') doesn't load the sweetalert2 script, i'm using Laravel 6.11 on laragon environment.

Code view:
code

Compiled view:
comp

After few test @include ('sweetalert :: alert') only works on master layout, not on child layout.

@realrashid
Copy link
Owner

Hey @aaron-za-dev ,
Can you please share the repo? if it's public then i dive deep to investigate what's wrong.

@realrashid
Copy link
Owner

This issue will closed due to no activity ☹️

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