You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+80-1Lines changed: 80 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,86 @@ public $crudField = [
124
124
125
125
## Naming
126
126
127
-
`// to be written`
127
+
You can provide your own naming convention classes by registering them in the config file. This classes should extend `Webfactor\Laravel\Generators\Contracts\NamingAbstract` to provide a certain base functionality.
128
+
129
+
Example for `Webfactor\Laravel\Generators\Schemas\Naming\CrudController`:
All naming classes defined in the config file will be parsed and saved with their keys to the `$naming`-array of the command. As the entire command is available in each service class, you can access ALL naming conventions everywhere!
183
+
184
+
For example you need the `Request`-namespace in the CrudController: `$this->command->naming['crudRequest']->getNamespace()`.
185
+
186
+
Furthermore there is a helper to keep things a bit simpler if you are IN the service class of the coresponding naming class! Just define `$key` and you can access the naming conventions directly through `$this->naming`:
187
+
188
+
```php
189
+
<?php
190
+
191
+
namespace Webfactor\Laravel\Generators\Services;
192
+
193
+
class MyService extends ServiceAbstract implements ServiceInterface
0 commit comments