Elhebert/laravel-sri

Non-static method

Closed this issue · 1 comments

Hi
I have laravel 5.5 and try to use your package/
in blade view I have "@assetSri( "/css/all.css")"

and this produce error
Non-static method Elhebert\SubresourceIntegrity\Sri::html() should not be called statically (View: /home/pol/www/crypto-cloud-site/resources/views/layouts/main.blade.php)
in …
/vendor
/elhebert
/laravel-sri
/src
/SriServiceProvider.php
48

Hi,

🤔 I'll check this. Most probably an issue with the Blade directive instantiation in my service provider.

You can use this in the mean time

<link
    href="{{ asset('css/all.css') }}"
    rel="stylesheet"
    integrity="{{ Sri::hash('css/all.css') }}"
    crossorigin="anonymous"
>

or

<link
    href="{{ asset('css/all.css') }}"
    rel="stylesheet"
    {{ Sri::html('css/all.css') }}
>