Skip to content

Commit

Permalink
fix: providers
Browse files Browse the repository at this point in the history
  • Loading branch information
regnerisch committed Dec 18, 2023
1 parent 3582596 commit 7ea9477
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 121 deletions.
54 changes: 14 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This package will help you with `beyond:make` commands to easily create classes
inspired application.
We try to implement commands as near as possible on their original `make` counterparts.

In version 7 we completely changed the way how Laravel Beyond works. We now do no longer change Laravels default
directory structure, instead we place the DDD structure inside a separate `modules` directory. This ensures
In version 7 we changed the way how Laravel Beyond works. We now do no longer change Laravels default
directory structure, instead we place the DDD structure inside a separate `src` directory. This ensures
compatibility with any other (Laravel related) package.

## Upgrade Guide
Expand All @@ -23,7 +23,7 @@ Install laravel-beyond with composer
composer require --dev akrillia/laravel-beyond
```

After this you need to register the `Modules` namespace inside your `composer.json`.
After this you need to register the namespaces inside your `composer.json`.
```json
{
// ...
Expand All @@ -32,7 +32,9 @@ After this you need to register the `Modules` namespace inside your `composer.js
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Modules\\": "modules/"
"Application\\": "src/Application",
"Domain\\": "src/Domain",
"Infrastructure\\": "src/Infrastructure"
}
},
// ...
Expand All @@ -43,66 +45,38 @@ Now you still have to run `composer dump-autoload` and everything is set up for

## Structure
```
|- modules
| |- Payment
| | |- App
|- src
| |- Application
| | |- Admin
| | | |- Controllers
| | | | |- PaymentController.php
| | | |- Commands
| | | | |- GroupPaymentsCommand.php
| | | |- Filters
| | | | |- PaymentStatusFilter.php
| | | |- Jobs
| | | | |- PaymentSyncronisationJob.php
| | | |- Middleware
| | | | |- PaymentVerificationMiddleware.php
| | | |- Providers
| | | |- Queries
| | | | |- PaymentIndexQuery.php
| | | |- Requests
| | | | |- PaymentStoreRequest.php
| | | |- Resources
| | | | |- PaymentResource.php
| | | |- routes.php
| | |- Domain
| |- Domain
| | |- User
| | | |- Actions
| | | | |- PaymentStoreAction.php
| | | |- Collections
| | | | |- PaymentCollection.php
| | | |- DataTransferObjects
| | | | |- PaymentData.php
| | | |- Events
| | | | |- PaymentSucceededEvent.php
| | | |- Exceptions
| | | | |- PaymentFailedException.php
| | | |- Listeners
| | | | |- PaymentSucceededListener.php
| | | |- Models
| | | | |- Payment.php
| | | |- Observers
| | | | |- PaymentObserver.php
| | | |- Policies
| | | | |- PaymentPolicy.php
| | | |- Rules
| | | | |- PaymentRule.php
| | | |- States
| | | | |- PaymentState.php
| | | |- ValueObjects
| | | | |- Price.php
| | |- Infrastructure
| |- Infrastructure
| | |- User
| | | |- Factories
| | | | |- PaymentFactory.php
| | | |- Migrations
| | | | |- create_payments_table.php
| | | |- Seeders
| | | | |- PaymentSeeder.php
| | |- Providers
| | | |- PaymentAuthServiceProvider.php
| | | |- PaymentEventServiceProvider.php
| | | |- PaymentRouteServiceProvider.php
| | | |- PaymentServiceProvider.php
| | |- Tests
| | | |- Feature
| | | |- Unit
```

## Usage
Expand Down
26 changes: 0 additions & 26 deletions stubs/App/Providers/AppAuthServiceProvider.stub

This file was deleted.

32 changes: 0 additions & 32 deletions stubs/App/Providers/AppEventServiceProvider.stub

This file was deleted.

18 changes: 0 additions & 18 deletions stubs/App/Providers/AppRouteServiceProvider.stub

This file was deleted.

7 changes: 2 additions & 5 deletions stubs/App/Providers/AppServiceProvider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ final class {{ module }}ServiceProvider extends ServiceProvider
*/
public function register(): void
{
$this->app->register({{ module }}AuthServiceProvider::class);
$this->app->register({{ module }}EventServiceProvider::class);
$this->app->register({{ module }}RouteServiceProvider::class);
//
}

/**
* Bootstrap any application services.
*/
public function boot(): void
{
$this->loadRoutesFrom(__DIR__ . '/../App/routes.php');
$this->loadMigrationsFrom(__DIR__ . '/../Infrastructure/Database/Migrations');
$this->loadRoutesFrom(__DIR__ . '/../routes.php');
}
}

0 comments on commit 7ea9477

Please sign in to comment.