@@ -77,23 +77,23 @@ public function provides()
7777 */
7878 protected function registerRepositoryInterfaces ()
7979 {
80- $ this ->app ->bind ('Artesaos\Defender\Contracts\Permission ' , 'Artesaos\Defender\Permission ' );
81- $ this ->app ->bind ('Artesaos\Defender\Contracts\Role ' , 'Artesaos\Defender\Role ' );
80+ $ this ->app ->bind ('Artesaos\Defender\Contracts\Permission ' , function ($ app ) {
81+ return $ app ->make ($ this ->app ['config ' ]->get ('defender.permission_model ' ));
82+ });
83+ $ this ->app ->bind ('Artesaos\Defender\Contracts\Role ' , function ($ app ) {
84+ return $ app ->make ($ this ->app ['config ' ]->get ('defender.role_model ' ));
85+ });
8286
8387 $ this ->app ->singleton ('defender.role ' , function ($ app ) {
84- $ roleModel = $ app ['config ' ]->get ('defender.role_model ' );
85-
86- return new EloquentRoleRepository ($ app , $ app ->make ($ roleModel ));
88+ return new EloquentRoleRepository ($ app , $ app ->make (\Artesaos \Defender \Contracts \Role::class));
8789 });
8890
8991 $ this ->app ->singleton ('Artesaos\Defender\Contracts\Repositories\RoleRepository ' , function ($ app ) {
9092 return $ app ['defender.role ' ];
9193 });
9294
9395 $ this ->app ->singleton ('defender.permission ' , function ($ app ) {
94- $ permissionModel = $ app ['config ' ]->get ('defender.permission_model ' );
95-
96- return new EloquentPermissionRepository ($ app , $ app ->make ($ permissionModel ));
96+ return new EloquentPermissionRepository ($ app , $ app ->make (\Artesaos \Defender \Contracts \Permission::class));
9797 });
9898
9999 $ this ->app ->singleton ('Artesaos\Defender\Contracts\Repositories\PermissionRepository ' , function ($ app ) {
0 commit comments