Passed
Branch master (f937f1)
by Burak
05:52
created

JetstreamServiceProvider::configurePermissions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Providers;
4
5
use App\Actions\Jetstream\DeleteUser;
6
use Illuminate\Support\ServiceProvider;
7
use Laravel\Jetstream\Jetstream;
8
9
class JetstreamServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Register any application services.
13
     *
14
     * @return void
15
     */
16 18
    public function register()
17
    {
18
        //
19 18
    }
20
21
    /**
22
     * Bootstrap any application services.
23
     *
24
     * @return void
25
     */
26 18
    public function boot()
27
    {
28 18
        $this->configurePermissions();
29
30 18
        Jetstream::deleteUsersUsing(DeleteUser::class);
31 18
    }
32
33
    /**
34
     * Configure the permissions that are available within the application.
35
     *
36
     * @return void
37
     */
38 18
    protected function configurePermissions()
39
    {
40 18
        Jetstream::defaultApiTokenPermissions(['read']);
41
42 18
        Jetstream::permissions([
43 18
            'create',
44
            'read',
45
            'update',
46
            'delete',
47
        ]);
48 18
    }
49
}
50