Skip to content

Commit

Permalink
Remove stray methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Oct 14, 2024
1 parent 1239847 commit a383b87
Showing 1 changed file with 0 additions and 87 deletions.
87 changes: 0 additions & 87 deletions src/Commands/DomainMailMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,11 @@
namespace Lunarstorm\LaravelDDD\Commands;

use Illuminate\Foundation\Console\MailMakeCommand;
use Illuminate\Support\Str;
use Lunarstorm\LaravelDDD\Commands\Concerns\ResolvesDomainFromInput;

class DomainMailMakeCommand extends MailMakeCommand
{
use ResolvesDomainFromInput;

protected $name = 'ddd:mail';

/**
* Create a model factory for the model.
*
* @return void
*/
protected function createFactory()
{
$factory = Str::studly($this->argument('name'));

$this->call('ddd:factory', [
'name' => "{$factory}Factory",
'--domain' => $this->domain->dotName,
'--model' => $this->qualifyClass($this->getNameInput()),
]);
}

/**
* Create a migration file for the model.
*
* @return void
*/
protected function createMigration()
{
$table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));

if ($this->option('pivot')) {
$table = Str::singular($table);
}

$this->call('make:migration', [
'name' => "create_{$table}_table",
'--create' => $table,
]);
}

/**
* Create a seeder file for the model.
*
* @return void
*/
protected function createSeeder()
{
$seeder = Str::studly(class_basename($this->argument('name')));

$this->call('make:seeder', [
'name' => "{$seeder}Seeder",
]);
}

/**
* Create a controller for the model.
*
* @return void
*/
protected function createController()
{
$controller = Str::studly(class_basename($this->argument('name')));

$modelName = $this->qualifyClass($this->getNameInput());

$this->call('make:controller', array_filter([
'name' => "{$controller}Controller",
'--model' => $this->option('resource') || $this->option('api') ? $modelName : null,
'--api' => $this->option('api'),
'--requests' => $this->option('requests') || $this->option('all'),
'--test' => $this->option('test'),
'--pest' => $this->option('pest'),
]));
}

/**
* Create a policy file for the model.
*
* @return void
*/
protected function createPolicy()
{
$policy = Str::studly(class_basename($this->argument('name')));

$this->call('ddd:policy', [
'name' => "{$policy}Policy",
'--domain' => $this->domain->dotName,
'--model' => $this->qualifyClass($this->getNameInput()),
]);
}
}

0 comments on commit a383b87

Please sign in to comment.