mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Test dynamic relationships (#1017)
* Test dynamic * Try/catch relationships * Update snapshot * Test output
This commit is contained in:
@@ -570,7 +570,11 @@ class ModelsCommand extends Command
|
||||
// can cause errors. Since we don't need constraints we can
|
||||
// disable them when we fetch the relation to avoid errors.
|
||||
$relationObj = Relation::noConstraints(function () use ($model, $method) {
|
||||
return $model->$method();
|
||||
try {
|
||||
return $model->$method();
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
if ($relationObj instanceof Relation) {
|
||||
|
||||
Reference in New Issue
Block a user