Return value of Maklad\Permission\Models\Role::permissions() must be an instance of Jenssegers\Mongodb\Relations\BelongsToMany, instance of Illuminate\Database\Eloquent\Relations\BelongsToMany returned #122
Hi there,
i install a fresh copy of laravel 8 for coreUI laravel-template-Vue. In this template some seeder files are in.
The Main tings works, but the permissionmodel not.
if i try to use givePermissonsTo i get this error. I don't know why.
> TypeError
>
> Return value of Maklad\Permission\Models\Role::permissions() must be an instance of Jenssegers\Mongodb\Relations\BelongsToMany, instance of Illuminate\Database\Eloquent\Relations\BelongsToMany returned
>
> at vendor/mostafamaklad/laravel-permission-mongodb/src/Traits/HasPermissions.php:49
> 45▕ * @return BelongsToMany
> 46▕ */
> 47▕ public function permissions(): BelongsToMany
> 48▕ {
> ➜ 49▕ return $this->belongsToMany(config('permission.models.permission'));
> 50▕ }
> 51▕
> 52▕ /**
> 53▕ * Grant the given permission(s) to a role.
>
> +1 vendor frames
> 2 database/seeders/MenusTableSeeder.php:105
> Maklad\Permission\Models\Role::givePermissionTo()
>
> 3 database/seeders/MenusTableSeeder.php:187
> Database\Seeders\MenusTableSeeder::insertLink()
Hi there, i install a fresh copy of laravel 8 for coreUI laravel-template-Vue. In this template some seeder files are in. The Main tings works, but the permissionmodel not. if i try to use givePermissonsTo i get this error. I don't know why.
THX for help