Skip to content

Commit 55268cd

Browse files
barryvdhlaravel-ide-helper
andauthored
Catch meta, tweak auth (#1654)
* Catch meta, tweak auth * composer fix-style * Catch meta, tweak auth --------- Co-authored-by: laravel-ide-helper <laravel-ide-helper@users.noreply.github.com>
1 parent 088968c commit 55268cd

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Console/MetaCommand.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ protected function getExpectedArguments()
233233
],
234234
[
235235
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth', 'Illuminate\Foundation\Auth\Access\Authorizable'],
236-
'method' => ['can', 'cannot'],
236+
'method' => ['can', 'cannot', 'cant'],
237+
'argumentSet' => 'auth',
238+
],
239+
[
240+
'class' => ['Illuminate\Contracts\Auth\Access\Authorizable'],
241+
'method' => ['can'],
237242
'argumentSet' => 'auth',
238243
],
239244
[
@@ -308,7 +313,13 @@ protected function loadTemplate($name)
308313
{
309314
if (!isset($this->templateCache[$name])) {
310315
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
311-
$value = $this->files->requireOnce($file) ?: [];
316+
try {
317+
$value = $this->files->requireOnce($file) ?: [];
318+
} catch (\Throwable $e) {
319+
$value = [];
320+
$this->warn('Cannot load template for ' . $name . ': ' . $e->getMessage());
321+
}
322+
312323
if (!$value instanceof Collection) {
313324
$value = collect($value);
314325
}

0 commit comments

Comments
 (0)