Skip to content

Commit

Permalink
Catch meta, tweak auth (#1654)
Browse files Browse the repository at this point in the history
* Catch meta, tweak auth

* composer fix-style

* Catch meta, tweak auth

---------

Co-authored-by: laravel-ide-helper <laravel-ide-helper@users.noreply.github.com>
  • Loading branch information
barryvdh and laravel-ide-helper authored Jan 8, 2025
1 parent 088968c commit 55268cd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Console/MetaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ protected function getExpectedArguments()
],
[
'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',
],
[
Expand Down Expand Up @@ -308,7 +313,13 @@ protected function loadTemplate($name)
{
if (!isset($this->templateCache[$name])) {
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
$value = $this->files->requireOnce($file) ?: [];
try {
$value = $this->files->requireOnce($file) ?: [];
} catch (\Throwable $e) {
$value = [];
$this->warn('Cannot load template for ' . $name . ': ' . $e->getMessage());
}

if (!$value instanceof Collection) {
$value = collect($value);
}
Expand Down

0 comments on commit 55268cd

Please sign in to comment.