Skip to content

Commit 13e3b65

Browse files
committed
formatting
1 parent 0ee21ed commit 13e3b65

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/Illuminate/Foundation/Console/PolicyMakeCommand.php

+4-11
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,11 @@ protected function userProviderModel()
7777
{
7878
$config = $this->laravel['config'];
7979

80-
if ($this->option('any-guard')) {
81-
return Authorizable::class;
82-
}
83-
84-
$guard = $this->option('guard')
85-
? $this->option('guard')
86-
: $config->get('auth.defaults.guard');
80+
$guard = $this->option('guard') ?: $config->get('auth.defaults.guard');
8781

88-
$provider = $config->get('auth.guards.'.$guard.'.provider');
89-
90-
return $config->get("auth.providers.{$provider}.model");
82+
return $config->get(
83+
"auth.providers.".$config->get('auth.guards.'.$guard.'.provider').".model"
84+
);
9185
}
9286

9387
/**
@@ -184,7 +178,6 @@ protected function getOptions()
184178
return [
185179
['model', 'm', InputOption::VALUE_OPTIONAL, 'The model that the policy applies to'],
186180
['guard', 'g', InputOption::VALUE_OPTIONAL, 'The guard that the policy relies on'],
187-
['any-guard', null, InputOption::VALUE_NONE, 'Allow use with any authorizable model (overrides --guard)'],
188181
];
189182
}
190183
}

0 commit comments

Comments
 (0)