Stars: 193
Forks: 22
Pull Requests: 55
Issues: 41
Watchers: 7
Last Updated: 2023-08-15 17:47:51
Laravel package to transform your Laravel application to DDD (inspired by Laravel beyond CRUD by Spatie)
License: ISC License
Languages: PHP
This package is heavily inspired by "Laravel Beyond CRUD" from Spatie. You should check out their website.
This package will help you with beyond:make commands to easily create classes inside your "Laravel Beyond CRUD"
inspired application.
We try to implement commands as near as possible on their original make counterparts.
Please read our Upgrade Guide in case you are using an older version or regnerisch/laravel-beyond.
Install laravel-beyond with composer
composer require --dev akrillia/laravel-beyondAfter this you can setup it by running
php artisan beyond:setupThis moves everything to the correct place and deletes the app folder afterwards. You can also choose to skip this
by adding the --skip-delete flag.
Please ensure that you add the following into one of your service providers (e.g. AppServiceProvider):
\Illuminate\Database\Eloquent\Factories\Factory::guessFactoryNamesUsing(function (string $modelName) {
return '\Database\Factories\\' . class_basename($modelName) . 'Factory';
});Do not forget to run composer dump-autoload after. So the new namespaces can be found properly.
beyond:make:actionThis command will create a new action class inside your domain.
php artisan beyond:make:action Users/CreateUserActionOptions
| Name | Description |
|---|---|
--force |
Create the class even if the action already exists |
beyond:make:builderThis command will create a new eloquent builder class inside your domain.
php artisan beyond:make:builder Users/UserBuilderOptions
| Name | Description |
|---|---|
--force |
Create the class even if the eloquent builder already exists |
beyond:make:collectionThis command will create a new collection class inside your domain.
php artisan beyond:make:collection Users/UserCollectionOptions
| Name | Description |
|---|---|
--model= |
Will create a model related collection |
--force |
Create the class even if the collection already exists |
beyond:make:commandThis command will create a new command class inside your console application.
php artisan beyond:make:command SyncUsersCommandOptions
| Name | Description |
|---|---|
--command= |
Will use given command:name schema for new command |
--force |
Create the class even if the command already exists |
beyond:make:controllerThis command will create a new action class inside your application.
php artisan beyond:make:controller Admin/Users/UserControllerOptions
| Name | Description |
|---|---|
--api |
Will overwrite an API controller |
-i, --invokable |
Generate a single method, invokable controller class. |
--force |
Create the class even if the controller already exists |
beyond:make:enumThis command will create a new enum class inside your domain.
php artisan beyond:make:enum Users/UserStatusEnumOptions
| Name | Description |
|---|---|
--force |
Create the class even if the enum already exists |
beyond:make:eventThis command will create a new event class inside your application.
php artisan beyond:make:event Users/UserCreatedEventOptions
| Name | Description |
|---|---|
--force |
Create the class even if the event already exists |
beyond:make:dtoThis command will create a new data transfer object class inside your domain.
php artisan beyond:make:dto Users/UserDataOptions
| Name | Description |
|---|---|
--force |
Create the class even if the data transfer object already exists |
beyond:make:dto-factory Admin/User/UserDataFactoryThis command will create a new data transfer object factory class inside your application.
php artisan beyond:make:dto-factory Admin/User/UserDataFactoryOptions
| Name | Description |
|---|---|
--dto |
Generate a DTO factory for the given DTO |
--force |
Create the class even if the DTO factory already exists |
beyond:make:jobThis command will create a new job class inside your application.
php artisan beyond:make:job Admin/Users/SyncUsersJobOptions
| Name | Description |
|---|---|
--force |
Create the class even if the job already exists |
beyond:make:listenerThis command will create a new listener class inside your domain.
php artisan beyond:make:listener Users/UserCreatedListenerOptions
| Name | Description |
|---|---|
--force |
Create the class even if the listener already exists |
beyond:make:middlewareThis command will create a new middleware class inside your application.
php artisan beyond:make:middleware Admin/Users/IdentifyUserMiddlewareOptions
| Name | Description |
|---|---|
--force |
Create the class even if the middleware already exists |
--support |
Will create a middleware in Support namespace |
beyond:make:modelThis command will create a new model class inside your domain.
php artisan beyond:make:model Users/UserOptions
| Name | Description |
|---|---|
-f, --factory |
Will create a factory for this model |
-m, --migration |
Will create a migration for this model |
--force |
Create the class even if the model already exists |
beyond:make:observerThis command will create a new observer class inside your domain.
php artisan beyond:make:observer Users/UserObserverOptions
| Name | Description |
|---|---|
--force |
Create the class even if the observer already exists |
beyond:make:policyThis command will create a new policy class inside your domain.
php artisan beyond:make:policy Users/UserPolicyOptions
| Name | Description |
|---|---|
--model= |
Will create a policy for the given model |
--force |
Create the class even if the policy already exists |
beyond:make:query requires spatie/laravel-query-builderThis command will create a new query class inside your domain.
php artisan beyond:make:query Admin/Users/UserIndexQueryOptions
| Name | Description |
|---|---|
--force |
Create the class even if the query builder already exists |
beyond:make:requestThis command will create a new request class inside your application.
php artisan beyond:make:request Admin/Users/CreateUserRequestOptions
| Name | Description |
|---|---|
--force |
Create the class even if the request already exists |
beyond:make:resourceThis command will create a new resource class inside your application.
php artisan beyond:make:resource Admin/Users/UserResourceOptions
| Name | Description |
|---|---|
--collection |
Will create a collection |
--force |
Create the class even if the resource already exists |
beyond:make:routeThis command will create a new route file inside your routes folder.
php artisan beyond:make:route UsersOptions
| Name | Description |
|---|---|
--force |
Create the class even if the route already exists |
beyond:make:ruleThis command will create a new rule class inside your application.
php artisan beyond:make:rule Admin/Users/IsAdminRuleOptions
| Name | Description |
|---|---|
--force |
Create the class even if the rule already exists |
--support |
Will create a middleware in Support namespace |
beyond:make:traitThis command will create a new trait class inside your application.
php artisan beyond:make:trait HasActivationCodeTraitOptions
| Name | Description |
|---|---|
--force |
Create the trait even if the trait already exists |
beyond:make:providerThis command will create a new service provider class.
php artisan beyond:make:provider UserServiceProviderOptions
| Name | Description |
|---|---|
--force |
Create the class even if the service provider already exists |
beyond:setupThis command will setup a default Laravel installation into a DDD structure.
php artisan beyond:setupOptions
| Name | Description |
|---|---|
--force |
Create the class even if the class already exists |
--skip-delete |
Will skip the deletion of app directory |