jeudi 6 février 2020

Mews\Purifier\Purifier::__construct() must be an instance of Illuminate\Filesystem\Filesystem

I installed Mews-Purifier on laravel 5.1 I used Froala Editor.

https://stackoverflow.com/



<script>asdfasdfasdf</script>

<iframe>qwerqwerqwer</iframe>

I expect result.

<p><a href="https://stackoverflow.com/">https://stackoverflow.com/</a></p>

<p>qwerqwerqwer</p>

but, I am not see it.

when save it,

$data['detail'] = app('purifier')->clean($data['detail']);

if use Purifier::clean($data['detail']), It send error message me.

Non-static method Mews\Purifier\Purifier::clean() should not be called statically

so, It changed.

$data['detail'] = (new \Mews\Purifier\Purifier)->clean($data['detail']);

send error message too.

Type error: Too few arguments to function Mews\Purifier\Purifier::__construct(),

so I do changed.

(new Mews\Purifier\Purifier($data['detail'], ['AutoFormat.DisplayLinkURI' => true] ))->clean($data['detail');

Type error: Argument 1 passed to Mews\Purifier\Purifier::__construct() must be an instance of Illuminate\Filesystem\Filesystem, string given, called in

what Filesystem? what file??

Let me know How should I use it? If I wasn't good at installing, what would it be?

Oh the installation did the following.

  1. terminal

    composer require mews/purifier
    
  2. /config/app.php

    'providers' => [
            // ...
            Mews\Purifier\PurifierServiceProvider::class,
        ],
    'aliases' => [
            // ...
            'Purifier' => Mews\Purifier\Facades\Purifier::class,
        ]
    
  3. terminal

    php artisan vendor:publish
    
  4. check created file. /config/purifier.php

Thanks for watching Please let me know if you know.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire