File tree 5 files changed +5
-8
lines changed
5 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ public function users()
63
63
*
64
64
* @param string $name
65
65
*
66
- * @return Role
67
- *
68
66
* @throws RoleDoesNotExist
67
+ *
68
+ * @return Role
69
69
*/
70
70
public static function findByName ($ name )
71
71
{
Original file line number Diff line number Diff line change @@ -44,11 +44,9 @@ public function registerPermissions()
44
44
{
45
45
try {
46
46
$ this ->getPermissions ()->map (function ($ permission ) {
47
-
48
47
$ this ->gate ->define ($ permission ->name , function ($ user ) use ($ permission ) {
49
48
return $ user ->hasPermissionTo ($ permission );
50
49
});
51
-
52
50
});
53
51
54
52
return true ;
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ protected function registerModelBindings()
60
60
protected function registerBladeExtensions ()
61
61
{
62
62
$ this ->app ->afterResolving ('blade.compiler ' , function (BladeCompiler $ bladeCompiler ) {
63
-
64
63
$ bladeCompiler ->directive ('role ' , function ($ role ) {
65
64
return "<?php if(auth()->check() && auth()->user()->hasRole( {$ role })): ?> " ;
66
65
});
Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ protected function getEnvironmentSetUp($app)
63
63
64
64
$ app ['config ' ]->set ('database.default ' , 'sqlite ' );
65
65
$ app ['config ' ]->set ('database.connections.sqlite ' , [
66
- 'driver ' => 'sqlite ' ,
66
+ 'driver ' => 'sqlite ' ,
67
67
'database ' => $ this ->getTempDirectory ().'/database.sqlite ' ,
68
- 'prefix ' => '' ,
68
+ 'prefix ' => '' ,
69
69
]);
70
70
71
71
$ app ['config ' ]->set ('view.paths ' , [__DIR__ .'/resources/views ' ]);
Original file line number Diff line number Diff line change 3
3
namespace Spatie \Permission \Test ;
4
4
5
5
use Illuminate \Auth \Authenticatable ;
6
+ use Illuminate \Contracts \Auth \Access \Authorizable as AuthorizableContract ;
6
7
use Illuminate \Contracts \Auth \Authenticatable as AuthenticatableContract ;
7
8
use Illuminate \Database \Eloquent \Model ;
8
9
use Illuminate \Foundation \Auth \Access \Authorizable ;
9
10
use Spatie \Permission \Traits \HasRoles ;
10
- use Illuminate \Contracts \Auth \Access \Authorizable as AuthorizableContract ;
11
11
12
12
class User extends Model implements AuthorizableContract, AuthenticatableContract
13
13
{
You can’t perform that action at this time.
0 commit comments