Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined method Michelf\Markdown::isDeferred() in Laravel 5.2

I am going to use michelf/php-markdown package in my Laravel 5.2 application.
To install this package I added "michelf/php-markdown": "~1.6.0" to composer.json file and then I ran composer update command.
After this, I changed app.php file and added Michelf\Markdown::class to Providers array and 'Markdown' => Michelf\Markdown::class to aliases array.

But when I want to use this class:

public function store($request)
{
    $title = $request->title;
    $text= $request->text;
    $transformedText = Markdown::defaultTransform($text);
    dd($transformedQuestion);
}

I face this error:

FatalErrorException in C:\wamp\www\projects\stackoverflow\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php line 119:  

Call to undefined method Michelf\Markdown::isDeferred()

Is my way to install a package in Laravel wrong?

like image 429
Alireza Sadeghian Avatar asked Oct 15 '25 19:10

Alireza Sadeghian


1 Answers

I think it was my misunderstand about providers in Laravel.
I removedMichelf\Markdown::class from Providers array in app.php file and it worked.

like image 143
Alireza Sadeghian Avatar answered Oct 18 '25 10:10

Alireza Sadeghian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!