Closed chaseconey closed 3 years ago
When generating new components that have no items in the schema, the command errors out.
php artisan ls:block EmptyComponent
I expect a class representation of the component, but with no available attributes listed.
Command errors out with the following stack:
ErrorException Trying to access array offset on value of type null at vendor/riclep/laravel-storyblok/src/Console/BlockSyncCommand.php:154 150▕ 151▕ $component = $components->firstWhere('name', $name); 152▕ 153▕ $fields = []; ➜ 154▕ foreach ($component['schema'] as $name => $data) { 155▕ if ( ! $this->isIgnoredType($data['type'])) { 156▕ $fields[$name] = $this->convertToPhpType($data['type']); 157▕ } 158▕ } +29 vendor frames 30 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Overview
When generating new components that have no items in the schema, the command errors out.
Steps to Reproduce
Expected
I expect a class representation of the component, but with no available attributes listed.
Actual
Command errors out with the following stack: