| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function execute($request) |
||
| 14 | { |
||
| 15 | $name = $request['name']; |
||
| 16 | $namespace = config('schematics.namespace'); |
||
| 17 | $stub = __DIR__ . '/../../resources/stubs/model.stub'; |
||
| 18 | $path = app_path(str_replace(['App\\', '\\'], ['', '/'], $namespace) . "{$name}.php"); |
||
| 19 | |||
| 20 | File::put($path, str_replace( |
||
| 21 | ['$namespace$', '$model$', '$fillables$'], |
||
| 22 | [rtrim($namespace, '\\'), $name, $this->getFillables($request['fields'])], |
||
| 23 | File::get($stub) |
||
| 24 | )); |
||
| 25 | } |
||
| 26 | |||
| 48 |