mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Catch meta, tweak auth (#1654)
* Catch meta, tweak auth * composer fix-style * Catch meta, tweak auth --------- Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
co-authored by
laravel-ide-helper
parent
088968c3fc
commit
55268cd47a
@@ -233,7 +233,12 @@ class MetaCommand extends Command
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth', 'Illuminate\Foundation\Auth\Access\Authorizable'],
|
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth', 'Illuminate\Foundation\Auth\Access\Authorizable'],
|
||||||
'method' => ['can', 'cannot'],
|
'method' => ['can', 'cannot', 'cant'],
|
||||||
|
'argumentSet' => 'auth',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => ['Illuminate\Contracts\Auth\Access\Authorizable'],
|
||||||
|
'method' => ['can'],
|
||||||
'argumentSet' => 'auth',
|
'argumentSet' => 'auth',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -308,7 +313,13 @@ class MetaCommand extends Command
|
|||||||
{
|
{
|
||||||
if (!isset($this->templateCache[$name])) {
|
if (!isset($this->templateCache[$name])) {
|
||||||
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
|
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
|
||||||
|
try {
|
||||||
$value = $this->files->requireOnce($file) ?: [];
|
$value = $this->files->requireOnce($file) ?: [];
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
$value = [];
|
||||||
|
$this->warn('Cannot load template for ' . $name . ': ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if (!$value instanceof Collection) {
|
if (!$value instanceof Collection) {
|
||||||
$value = collect($value);
|
$value = collect($value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user