Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 04f4b3d

Browse files
committed
cs fixes and reduce tokens lifetime.
1 parent eb91c58 commit 04f4b3d

File tree

12 files changed

+17
-28
lines changed

12 files changed

+17
-28
lines changed

app/Contracts/Users/UsersServiceContract.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ public function update($id, array $attributes = []);
4444
* @return bool
4545
*/
4646
public function delete($id);
47-
48-
}
47+
}

app/Entities/Permission.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class Permission extends \Spatie\Permission\Models\Permission
1717
* @var array
1818
*/
1919
protected $fillable = ['name', 'uuid'];
20-
21-
}
20+
}

app/Entities/Role.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ class Role extends \Spatie\Permission\Models\Role
1717
* @var array
1818
*/
1919
protected $fillable = ['name', 'uuid'];
20-
21-
}
20+
}

app/Http/Middleware/CheckPermissionsMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class CheckPermissionsMiddleware
1818
*/
1919
public function handle($request, Closure $next, $permission)
2020
{
21-
if(!empty($permission)) {
22-
if(!Auth::user()->hasPermissionTo($permission)){
21+
if (!empty($permission)) {
22+
if (!Auth::user()->hasPermissionTo($permission)) {
2323
throw new AccessDeniedHttpException('Insufficient Permissions');
2424
}
2525
}

app/Providers/AuthServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function boot()
2626
{
2727
$this->registerPolicies();
2828
Passport::routes();
29-
Passport::tokensExpireIn(Carbon::now()->addDays(15));
30-
Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
29+
Passport::tokensExpireIn(Carbon::now()->addHours(10));
30+
Passport::refreshTokensExpireIn(Carbon::now()->addDays(3));
3131
}
3232
}

app/Services/Installation/AppInstallationService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ public function installApp(array $installationData = [])
4343
$this->bus->addHandler(InstallAppCommand::class, InstallAppHandler::class);
4444
return $this->bus->dispatch(InstallAppCommand::class, $installationData, $this->middleware);
4545
}
46-
47-
}
46+
}

app/Services/Installation/AppInstallationServiceContract.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Services\Installation;
44

5-
65
/**
76
* Class AppInstallationService
87
* @package App\Services\Installation
@@ -13,4 +12,4 @@ interface AppInstallationServiceContract
1312
* @return mixed
1413
*/
1514
public function installApp();
16-
}
15+
}

app/Services/Installation/Events/ApplicationWasInstalled.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,4 @@ public function __construct(User $adminUser, $roles, $permissions)
3939
$this->roles = $roles;
4040
$this->permissions = $permissions;
4141
}
42-
43-
44-
}
42+
}

app/Services/Installation/InstallAppCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace App\Services\Installation;
44

5-
65
/**
76
* Class InstallAppCommand
87
* @package App\Services\Installation
@@ -44,5 +43,4 @@ public function __construct($name = "Administrator", $email = "[email protected]",
4443
$this->password = $password;
4544
$this->password_confirmation = $password_confirmation;
4645
}
47-
48-
}
46+
}

app/Services/Installation/InstallAppHandler.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function handle(InstallAppCommand $command)
8585
*/
8686
public function createRoles()
8787
{
88-
$this->roles = $this->roles->map(function($role){
88+
$this->roles = $this->roles->map(function ($role) {
8989
return Role::create($role);
9090
});
9191
return $this;
@@ -97,7 +97,7 @@ public function createRoles()
9797
public function createPermissions()
9898
{
9999
$this->permissions = $this->permissions->map(function ($group) {
100-
return collect($group)->map(function($permission) {
100+
return collect($group)->map(function ($permission) {
101101
return Permission::create($permission);
102102
});
103103
});
@@ -140,5 +140,4 @@ public function assignAllPermissionsToAdminRole()
140140
});
141141
return $this;
142142
}
143-
144-
}
143+
}

0 commit comments

Comments
 (0)