-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing generator commands (#25)
* add: `ValueCommand` command Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
- Loading branch information
Showing
13 changed files
with
564 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\PartitionCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\PartitionCommand | ||
*/ | ||
#[AsCommand(name: 'nova:partition', description: 'Create a new metric (partition) class')] | ||
class PartitionCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\ProgressCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\ProgressCommand | ||
*/ | ||
#[AsCommand(name: 'nova:progress', description: 'Create a new metric (progress) class')] | ||
class ProgressCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\RepeatableCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\RepeatableCommand | ||
*/ | ||
#[AsCommand(name: 'nova:repeatable', description: 'Create a new repeatable class')] | ||
class RepeatableCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getModelNamespace() | ||
{ | ||
return $this->generatorPreset()->modelNamespace(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\TableCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\TableCommand | ||
*/ | ||
#[AsCommand(name: 'nova:table', description: 'Create a new metric (table) class')] | ||
class TableCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\TrendCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\TrendCommand | ||
*/ | ||
#[AsCommand(name: 'nova:trend', description: 'Create a new metric (trend) class')] | ||
class TrendCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\DevTool\Console; | ||
|
||
use Laravel\Nova\Console\ValueCommand as Command; | ||
use Orchestra\Canvas\Core\Concerns\CodeGenerator; | ||
use Orchestra\Canvas\Core\Concerns\UsesGeneratorOverrides; | ||
use Symfony\Component\Console\Attribute\AsCommand; | ||
|
||
/** | ||
* @see Laravel\Nova\Console\ValueCommand | ||
*/ | ||
#[AsCommand(name: 'nova:value', description: 'Create a new metric (single value) class')] | ||
class ValueCommand extends Command | ||
{ | ||
use CodeGenerator; | ||
use UsesGeneratorOverrides; | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function configure() | ||
{ | ||
$this->addGeneratorPresetOptions(); | ||
|
||
parent::configure(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
public function handle() | ||
{ | ||
return $this->generateCode() ? self::SUCCESS : self::FAILURE; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function getPath($name) | ||
{ | ||
return $this->getPathUsingCanvas($name); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
#[\Override] | ||
protected function rootNamespace() | ||
{ | ||
return $this->rootNamespaceUsingCanvas(); | ||
} | ||
} |
Oops, something went wrong.