Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsam726 authored and github-actions[bot] committed Apr 6, 2024
1 parent b0ff44d commit 2581b61
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Commands/ControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
namespace Savannabits\Modular\Commands;

use Savannabits\Modular\Support\Concerns\GeneratesModularFiles;

use function Laravel\Prompts\confirm;

class ControllerMakeCommand extends \Illuminate\Routing\Console\ControllerMakeCommand
{
use GeneratesModularFiles;

protected $name = 'modular:make-controller';

protected $description = 'Create a new controller class in a modular package';

protected function getRelativeNamespace(): string
{
return '\\Http\\Controllers';
Expand Down Expand Up @@ -40,16 +43,13 @@ protected function buildParentReplacements(): array

/**
* Build the model replacement values.
*
* @param array $replace
* @return array
*/
protected function buildModelReplacements(array $replace): array
{
$modelClass = $this->parseModel($this->option('model'));

if (! class_exists($modelClass, false) && confirm("A {$modelClass} model does not exist. Do you want to generate it?", default: true)) {
$this->call('modular:make-model', ['name' => $modelClass,'module' => $this->getModule()->name()]);
$this->call('modular:make-model', ['name' => $modelClass, 'module' => $this->getModule()->name()]);
}

$replace = $this->buildFormRequestReplacements($replace, $modelClass);
Expand Down Expand Up @@ -102,11 +102,8 @@ protected function buildFormRequestReplacements(array $replace, $modelClass): ar
}

/**
* @param $modelClass
* @param $storeRequestClass
* @param $updateRequestClass
* @return string[]
* TODO: Replace this with a call to the modular:make-request command
* TODO: Replace this with a call to the modular:make-request command
*/
protected function generateFormRequests($modelClass, $storeRequestClass, $updateRequestClass): array
{
Expand Down

0 comments on commit 2581b61

Please sign in to comment.