lundi 29 juillet 2019

how to use Laravel package in my own package?

I'm developing a Role-Permission package in Laravel and i want to use this package;

https://github.com/spatie/laravel-permission

Problem is I can not use some functions in the main project when I install this package in my own package. eg "HasRoles"

My packages composer.json file

 "require": {
        "spatie/laravel-permission": "dev-master"
    },
    "autoload": {
        "psr-4": {
            "Modul\\Permission\\": "src"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "Spatie\\Permission\\PermissionServiceProvider"
            ]
        }
    }

when i serve its show this error message

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) Trait 'Spatie\Permission\Traits\HasRoles' not found

What am I doing wrong here?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32Yjtac
via IFTTT

Aucun commentaire:

Enregistrer un commentaire