Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ It should **only** be used on a fresh installation.
- Fresh installation of Laravel 8
- Laravel Fortify _(optional)_
- Laravel Jetstream _(optional)_
- Laravel Pest _(optional)_

## Installation
You can install the package via composer:
Expand Down
12 changes: 9 additions & 3 deletions src/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Cbaconnier\LaravelMvcToDdd\Installers\FortifyInstaller;
use Cbaconnier\LaravelMvcToDdd\Installers\JetstreamInstaller;
use Cbaconnier\LaravelMvcToDdd\Installers\LaravelInstaller;
use Cbaconnier\LaravelMvcToDdd\Installers\PestInstaller;
use Illuminate\Console\Command;
use Illuminate\Support\Composer;

Expand All @@ -17,13 +18,12 @@ class InstallCommand extends Command
public function handle(
LaravelInstaller $laravelInstaller,
FortifyInstaller $fortifyInstaller,
JetstreamInstaller $jetstreamInstaller
JetstreamInstaller $jetstreamInstaller,
PestInstaller $pestInstaller
) {
$this->info('Installing for Laravel...');
$laravelInstaller->install();



if ($fortifyInstaller->enabled()) {
$this->info('Installing for Fortify...');
$fortifyInstaller->install();
Expand All @@ -34,6 +34,12 @@ public function handle(
$jetstreamInstaller->install();
}


if ($pestInstaller->enabled()) {
$this->info('Installing for Pest...');
$pestInstaller->install();
}

$this->info('Running composer dump autoload...');
$this->updateComposer();

Expand Down
33 changes: 33 additions & 0 deletions src/Installers/PestInstaller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Cbaconnier\LaravelMvcToDdd\Installers;

use Illuminate\Filesystem\Filesystem;

class PestInstaller extends Installer
{

public function enabled(): bool
{
return file_exists(base_path('tests/Pest.php'));
}

public function install(): void
{
$this->configureFiles();
}


protected function configureFiles()
{
/* Actions */

$this->replaceAllInFile([
"->in('Feature')" => "->in('App', 'Domain', 'Support')",

], base_path('tests/Pest.php'));

}


}