2017-09-23 10 views
1

を使用してLaravel 5.5 *と役割と権限のために、このhttps://github.com/artesaos/defenderパッケージをインストールし、すべてのものは、細かい作業が、私は打撃のエラーを取得許可私はlaravel 5.5を使用していartesaos /ディフェンダー

$permissions = array_map(function ($permission) { 
     return $permission['name']; 
    }, $user->getAllPermissions()->toArray()); 

を取得しよう:。

"Symfony\Component\Debug\Exception\FatalThrowableError" file : H:\xampp\htdocs\LaraVueAdmin\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php" line: 147 message : "Type error: Argument 1 passed to Illuminate\Database\Eloquent\Model::__construct() must be of the type array, object given, called in H:\xampp\htdocs\LaraVueAdmin\vendor\artesaos\defender\src\Defender\Traits\Models\Permission.php on line 75"

+0

'返すPermissionUserPivot :: fromRawAttributes($親、$属性、$表、$存在、$使用); ' –

答えて

0

Muzafarアリのこのソリューションは、私の仕事:

を私はを交換することにより、解決策を見つけました私はhttps://github.com/artesaos/defender/blob/master/src/Defender/Traits/Models/Permission.php:75 を交換することで解決策を見つける

return PermissionUserPivot::fromRawAttributes($parent, $attributes, $table, $exists, $using);

+0

これは質問への答えを提供しません。十分な[評判](https://stackoverflow.com/help/whats-reputation)があれば、[投稿にコメントする]ことができます(https://stackoverflow.com/help/privileges/comment)。代わりに、[質問者からの明確化を必要としない回答を提供する](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- i-do-代わりに)。 - [レビューから](/レビュー/低品質の投稿/ 18683192) –

関連する問題