|
2 | 2 |
|
3 | 3 | namespace Statamic\Eloquent; |
4 | 4 |
|
| 5 | +use Illuminate\Foundation\Console\AboutCommand; |
5 | 6 | use Statamic\Contracts\Assets\AssetContainerRepository as AssetContainerRepositoryContract; |
6 | 7 | use Statamic\Contracts\Assets\AssetRepository as AssetRepositoryContract; |
7 | 8 | use Statamic\Contracts\Entries\CollectionRepository as CollectionRepositoryContract; |
@@ -112,6 +113,8 @@ public function boot() |
112 | 113 | Commands\ImportRevisions::class, |
113 | 114 | Commands\ImportTaxonomies::class, |
114 | 115 | ]); |
| 116 | + |
| 117 | + $this->addAboutCommandInfo(); |
115 | 118 | } |
116 | 119 |
|
117 | 120 | public function register() |
@@ -370,4 +373,36 @@ protected function migrationsPath($filename) |
370 | 373 | { |
371 | 374 | return database_path('migrations/'.date('Y_m_d_His', time() + (++$this->migrationCount + 60))."_{$filename}.php"); |
372 | 375 | } |
| 376 | + |
| 377 | + protected function addAboutCommandInfo() |
| 378 | + { |
| 379 | + if (! class_exists(AboutCommand::class)) { |
| 380 | + return; |
| 381 | + } |
| 382 | + |
| 383 | + AboutCommand::add('Statamic Eloquent Driver', collect([ |
| 384 | + 'Asset Containers' => config('statamic.eloquent-driver.asset_containers.driver', 'file'), |
| 385 | + 'Assets' => config('statamic.eloquent-driver.assets.driver', 'file'), |
| 386 | + 'Blueprints' => config('statamic.eloquent-driver.blueprints.driver', 'file'), |
| 387 | + 'Collections' => config('statamic.eloquent-driver.collections.driver', 'file'), |
| 388 | + 'Collection Trees' => config('statamic.eloquent-driver.collection_trees.driver', 'file'), |
| 389 | + 'Entries' => config('statamic.eloquent-driver.entries.driver', 'file'), |
| 390 | + 'Forms' => config('statamic.eloquent-driver.forms.driver', 'file'), |
| 391 | + 'Global Sets' => config('statamic.eloquent-driver.global_sets.driver', 'file'), |
| 392 | + 'Navigations' => config('statamic.eloquent-driver.navigations.driver', 'file'), |
| 393 | + 'Navigation Trees' => config('statamic.eloquent-driver.navigation_trees.driver', 'file'), |
| 394 | + 'Revisions' => config('statamic.eloquent-driver.revisions.driver', 'file'), |
| 395 | + 'Taxonomies' => config('statamic.eloquent-driver.taxonomies.driver', 'file'), |
| 396 | + 'Terms' => config('statamic.eloquent-driver.terms.driver', 'file'), |
| 397 | + ])->map(fn ($value) => $this->applyAboutCommandFormatting($value))->all()); |
| 398 | + } |
| 399 | + |
| 400 | + private function applyAboutCommandFormatting($config) |
| 401 | + { |
| 402 | + if ($config == 'eloquent') { |
| 403 | + return ' <fg=yellow;options=bold>'.$config.'</>'; |
| 404 | + } |
| 405 | + |
| 406 | + return $config; |
| 407 | + } |
373 | 408 | } |
0 commit comments