Skip to content

Commit

Permalink
Merge pull request #1 from grosv/laravel8
Browse files Browse the repository at this point in the history
Works with L8 now
  • Loading branch information
edgrosvenor authored Oct 13, 2020
2 parents 83ee8b7 + f050af4 commit 72d6826
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/StubbyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ public function handle(): int
$this->files->push(base_path('tests/Feature/Http/Livewire/'.$this->studlyName.'Test.php'));
break;
case 'model':
$this->call('make:model', ['name' => $this->studlyName, '-m' => true]);
$this->call('make:model', ['name' => $this->studlyName, '-m' => true, '-f' => true]);
// This didn't work
if (file_exists(app_path($this->studlyName.'.php'))) {
$this->files->push(app_path($this->studlyName.'.php'));
}
if (file_exists(app_path('Models/'.$this->studlyName.'.php'))) {
$this->files->push('Models/'.app_path($this->studlyName.'.php'));
else {
$this->files->push(app_path('Models/'.$this->studlyName.'.php'));
}
foreach (scandir(database_path('migrations/')) as $file) {
if (Str::contains($file, 'create_'.Str::snake(Str::plural($this->studlyName)))) {
$this->files->push(database_path('migrations/'.$file));
}
}
$this->call('make:factory', ['name' => $this->studlyName.'Factory', '--model' => 'App\\'.$this->studlyName]);
$this->files->push(database_path('factories/'.$this->studlyName.'Factory.php'));

break;
Expand Down

0 comments on commit 72d6826

Please sign in to comment.