You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Commands/LaravelAuthorizerCommand.php
+84-12Lines changed: 84 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,24 @@
13
13
14
14
class LaravelAuthorizerCommand extends Command
15
15
{
16
-
public$signature = 'authorizer:generate {name? : The name of the policy to generate} {--m|model= : The model to use for the policy}';
17
-
16
+
/**
17
+
* The name and signature of the console command.
18
+
*
19
+
* @var string
20
+
*/
21
+
public$signature = 'authorizer:generate {name? : The name of the policy to generate} {--m|model= : The model to use for the policy} {--f|force : Overwrite existing files}';
22
+
23
+
/**
24
+
* The console command description.
25
+
*
26
+
* @var string
27
+
*/
18
28
public$description = 'Generate authorizations for your application';
19
29
30
+
/**
31
+
* Run the command.
32
+
* @return int
33
+
*/
20
34
publicfunctionhandle(): int
21
35
{
22
36
$this->comment('Generating policies...');
@@ -45,6 +59,11 @@ public function handle(): int
45
59
returnself::SUCCESS;
46
60
}
47
61
62
+
/**
63
+
* Generate policies for all models.
64
+
*
65
+
* @return void
66
+
*/
48
67
publicfunctiongenerateAllPolicies(): void
49
68
{
50
69
$models = collect(File::allFiles(app_path()))
@@ -70,16 +89,26 @@ public function generateAllPolicies(): void
0 commit comments