Last active
June 9, 2024 06:28
-
-
Save POMXARK/eee9e1ea54e00cf38b98ac7c800223a6 to your computer and use it in GitHub Desktop.
phpstorm file templates -> Laravel DDD Domain Service
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
// app/Repositories/${NAME}Repository | |
<?php | |
#parse("PHP File Header.php") | |
namespace App\Repositories; | |
class ${NAME}Repository implements ${NAME}RepositoryInterface | |
{ | |
} |
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
// app/Repositories/${NAME}RepositoryInterface | |
<?php | |
#parse("PHP File Header.php") | |
namespace App\Repositories; | |
interface ${NAME}RepositoryInterface | |
{ | |
} |
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
// app/Services/Domains/${NAME}Service | |
<?php | |
#parse("PHP File Header.php") | |
namespace App\Services\Domains; | |
use App\Repositories\\${NAME}RepositoryInterface; | |
/** | |
* @see ${NAME}ServiceTest | |
*/ | |
readonly class ${NAME}Service | |
{ | |
public function __construct(private ${NAME}RepositoryInterface ${DS}${NAME.toLowerCase()}Repository) | |
{ | |
} | |
} |
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
// tests/App/Services/Domains/${NAME}ServiceTest | |
<?php | |
#parse("PHP File Header.php") | |
namespace Tests\App\Services\Domains; | |
use PHPUnit\Framework\TestCase; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use PHPUnit\Framework\Attributes\Group; | |
/** | |
* @see ${NAME}Service | |
*/ | |
#[Group('${NAME}Service')] | |
final class ${NAME}ServiceTest extends TestCase | |
{ | |
use DatabaseTransactions; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment