generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into beyond-data
# Conflicts: # CHANGELOG.md
- Loading branch information
Showing
18 changed files
with
808 additions
and
283 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Commands | ||
weight: 15 | ||
--- | ||
|
||
## make:data | ||
|
||
You can easily generate new data objects with the artisan command `make:data`: | ||
|
||
```shell | ||
php artisan make:data PostData | ||
``` | ||
|
||
By default, this command puts data objects in the `App\Data` namespace, this can be changed as such: | ||
|
||
```shell | ||
php artisan make:data PostData --namespace=DataTransferObjects | ||
``` | ||
|
||
By default, the command creates a new data object within the `\App\Data` namespace and suffixes the class with `Data`, this can be changed by adding the following lines to the `data.php` config file: | ||
|
||
```php | ||
'commands' => [ | ||
/* | ||
* Provides default configuration for the `make:data` command. These settings can be overridden with options | ||
* passed directly to the `make:data` command for generating single Data classes, or if not set they will | ||
* automatically fall back to these defaults. See `php artisan make:data --help` for more information | ||
*/ | ||
'make' => [ | ||
/* | ||
* The default namespace for generated Data classes. This exists under the application's root namespace, | ||
* so the default 'Data` will end up as '\App\Data', and generated Data classes will be placed in the | ||
* app/Data/ folder. Data classes can live anywhere, but this is where `make:data` will put them. | ||
*/ | ||
'namespace' => 'DataTransferObjects', | ||
|
||
/* | ||
* This suffix will be appended to all data classes generated by make:data, so that they do are less likely | ||
* to conflict with other related classes, controllers, or models with a similar name without resorting | ||
* to adding an alias on to the end of the Data object. Set to a blank string (not null) to disable. | ||
*/ | ||
'suffix' => 'DTO', | ||
], | ||
] | ||
``` |
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
Oops, something went wrong.