File tree Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Expand file tree Collapse file tree 3 files changed +17
-19
lines changed Original file line number Diff line number Diff line change 16
16
],
17
17
"require" : {
18
18
"php" : " ^7.4|^8.0" ,
19
- "tipoff/authorization" : " ^1.0.1 " ,
20
- "tipoff/refunds " : " ^1.1.1 " ,
21
- "tipoff/support " : " ^1.4.3 " ,
22
- "tipoff/locations " : " ^2.2.1 "
19
+ "tipoff/authorization" : " ^2.3.0 " ,
20
+ "tipoff/locations " : " ^2.3.2 " ,
21
+ "tipoff/refunds " : " ^2.0.0 " ,
22
+ "tipoff/support " : " ^1.5.5 "
23
23
},
24
24
"require-dev" : {
25
- "tipoff/test-support" : " ^1.0.5 "
25
+ "tipoff/test-support" : " ^1.1.2 "
26
26
},
27
27
"autoload" : {
28
28
"psr-4" : {
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- use Illuminate \Database \Migrations \Migration ;
6
- use Spatie \Permission \Contracts \Permission ;
7
- use Spatie \Permission \PermissionRegistrar ;
5
+ use Tipoff \Authorization \Permissions \BasePermissionsMigration ;
8
6
9
- class AddPaymentPermissions extends Migration
7
+ class AddPaymentPermissions extends BasePermissionsMigration
10
8
{
11
9
public function up ()
12
10
{
13
- if (app ()->has (Permission::class)) {
14
- app (PermissionRegistrar::class)->forgetCachedPermissions ();
15
-
16
- foreach ([
17
- 'view payments ' ,
18
- 'update payments ' ,
19
- ] as $ name ) {
20
- app (Permission::class)::findOrCreate ($ name , null );
21
- };
22
- }
11
+ $ permissions = [
12
+ 'view payments ' ,
13
+ 'update payments ' ,
14
+ ];
15
+
16
+ $ this ->createPermissions ($ permissions );
23
17
}
24
18
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace Tipoff \Payments \Tests ;
6
6
7
+ use Spatie \Permission \PermissionServiceProvider ;
8
+ use Tipoff \Authorization \AuthorizationServiceProvider ;
7
9
use Tipoff \Locations \LocationsServiceProvider ;
8
10
use Tipoff \Payments \PaymentsServiceProvider ;
9
11
use Tipoff \Support \SupportServiceProvider ;
@@ -15,6 +17,8 @@ protected function getPackageProviders($app)
15
17
{
16
18
return [
17
19
SupportServiceProvider::class,
20
+ AuthorizationServiceProvider::class,
21
+ PermissionServiceProvider::class,
18
22
PaymentsServiceProvider::class,
19
23
LocationsServiceProvider::class,
20
24
];
You can’t perform that action at this time.
0 commit comments