File tree 3 files changed +23
-18
lines changed
3 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,4 @@ class Types extends Enum
10
10
public const Write = 'Write ' ;
11
11
public const Delete = 'Delete ' ;
12
12
public const Link = 'Link ' ;
13
-
14
- protected static function data (): array
15
- {
16
- return [
17
- 'Read ' => self ::Read,
18
- 'Write ' => self ::Write,
19
- 'Delete ' => self ::Delete,
20
- 'Link ' => self ::Link,
21
- 'HEAD ' => self ::Read,
22
- 'OPTIONS ' => self ::Read,
23
- 'GET ' => self ::Read,
24
- 'POST ' => self ::Write,
25
- 'PATCH ' => self ::Write,
26
- 'PUT ' => self ::Write,
27
- 'DELETE ' => self ::Delete,
28
- ];
29
- }
30
13
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace LaravelEnso \Permissions \App \Enums ;
4
+
5
+ use LaravelEnso \Enums \App \Services \Enum ;
6
+
7
+ class Verbs extends Enum
8
+ {
9
+ protected static function data (): array
10
+ {
11
+ return [
12
+ 'HEAD ' => Types::Read,
13
+ 'OPTIONS ' => Types::Read,
14
+ 'GET ' => Types::Read,
15
+ 'POST ' => Types::Write,
16
+ 'PATCH ' => Types::Write,
17
+ 'PUT ' => Types::Write,
18
+ 'DELETE ' => Types::Delete,
19
+ ];
20
+ }
21
+ }
Original file line number Diff line number Diff line change 6
6
use Illuminate \Support \Facades \Route ;
7
7
use LaravelEnso \Menus \App \Models \Menu ;
8
8
use LaravelEnso \Permissions \App \Enums \Types ;
9
+ use LaravelEnso \Permissions \App \Enums \Verbs ;
9
10
use LaravelEnso \Permissions \App \Exceptions \Permission as Exception ;
10
11
use LaravelEnso \Roles \App \Models \Role ;
11
12
use LaravelEnso \Roles \App \Traits \HasRoles ;
@@ -42,7 +43,7 @@ public function getTypeAttribute()
42
43
43
44
public function type ()
44
45
{
45
- return Types ::get ($ this ->method ()) ?? Types::Link;
46
+ return Verbs ::get ($ this ->method ()) ?? Types::Link;
46
47
}
47
48
48
49
public function method ()
You can’t perform that action at this time.
0 commit comments