samedi 6 octobre 2018

Using Laravel and including a package, why would I get Call to undefined method

I am running laravel 5+ and included a package in my composer. It installed fine.

The package is simple, it allows me to add small bits of pseudo code into a given view and it renders a preset thing.

In my AppServiceProvider register() I am running:

 Shortcode::add('date', function($atts, $content, $name){
        return date('Y-m-d');
    });

and yes I included: use Shortcode; in the top of the AppServiceProvider.

I also reviewed the actual code and the add method is in there just fine.

In my config/app.php I have included:

Gornymedia\Shortcodes\ShortcodesServiceProvider::class, in the providers array.

I also included:

'Shortcode' => Gornymedia\Shortcodes\Facades\Shortcode::class,

in the alias array.

Why would this not simply work?

I know this is not a perfect question for stack. Just been stuck for awhile.

thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire