| @@ 7-48 (lines=42) @@ | ||
| 4 | ||
| 5 | use Webfactor\Laravel\Generators\Contracts\NamingAbstract; |
|
| 6 | ||
| 7 | class CrudController extends NamingAbstract |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * @return string |
|
| 11 | */ |
|
| 12 | public function getNamespace(): string |
|
| 13 | { |
|
| 14 | return $this->getAppNamespace() . 'Http\\Controllers\\Admin'; |
|
| 15 | } |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @return string |
|
| 19 | */ |
|
| 20 | public function getClassName(): string |
|
| 21 | { |
|
| 22 | return ucfirst($this->entity) . 'CrudController'; |
|
| 23 | } |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @return string |
|
| 27 | */ |
|
| 28 | public function getFileName(): string |
|
| 29 | { |
|
| 30 | return $this->getClassName() . '.php'; |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @return string |
|
| 35 | */ |
|
| 36 | public function getPath(): string |
|
| 37 | { |
|
| 38 | return app_path('Http/Controllers/Admin'); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @return string |
|
| 43 | */ |
|
| 44 | public function getStub(): string |
|
| 45 | { |
|
| 46 | return __DIR__ . '/../../../stubs/crud-controller.stub'; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 8-51 (lines=44) @@ | ||
| 5 | use Illuminate\Console\DetectsApplicationNamespace; |
|
| 6 | use Webfactor\Laravel\Generators\Contracts\NamingAbstract; |
|
| 7 | ||
| 8 | class CrudModel extends NamingAbstract |
|
| 9 | { |
|
| 10 | use DetectsApplicationNamespace; |
|
| 11 | ||
| 12 | /** |
|
| 13 | * @return string |
|
| 14 | */ |
|
| 15 | public function getNamespace(): string |
|
| 16 | { |
|
| 17 | return $this->getAppNamespace() . 'Models'; |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @return string |
|
| 22 | */ |
|
| 23 | public function getClassName(): string |
|
| 24 | { |
|
| 25 | return ucfirst($this->entity); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return string |
|
| 30 | */ |
|
| 31 | public function getFileName(): string |
|
| 32 | { |
|
| 33 | return $this->getClassName() . '.php'; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @return string |
|
| 38 | */ |
|
| 39 | public function getPath(): string |
|
| 40 | { |
|
| 41 | return app_path('Models'); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @return string |
|
| 46 | */ |
|
| 47 | public function getStub(): string |
|
| 48 | { |
|
| 49 | return __DIR__ . '/../../../stubs/crud-model.stub'; |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 8-51 (lines=44) @@ | ||
| 5 | use Illuminate\Console\DetectsApplicationNamespace; |
|
| 6 | use Webfactor\Laravel\Generators\Contracts\NamingAbstract; |
|
| 7 | ||
| 8 | class CrudRequest extends NamingAbstract |
|
| 9 | { |
|
| 10 | use DetectsApplicationNamespace; |
|
| 11 | ||
| 12 | /** |
|
| 13 | * @return string |
|
| 14 | */ |
|
| 15 | public function getNamespace(): string |
|
| 16 | { |
|
| 17 | return $this->getAppNamespace() . 'Http\\Requests\\Admin'; |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * @return string |
|
| 22 | */ |
|
| 23 | public function getClassName(): string |
|
| 24 | { |
|
| 25 | return ucfirst($this->entity) . 'Request'; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return string |
|
| 30 | */ |
|
| 31 | public function getFileName(): string |
|
| 32 | { |
|
| 33 | return $this->getClassName() . '.php'; |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @return string |
|
| 38 | */ |
|
| 39 | public function getPath(): string |
|
| 40 | { |
|
| 41 | return app_path('Http/Requests/Admin'); |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @return string |
|
| 46 | */ |
|
| 47 | public function getStub(): string |
|
| 48 | { |
|
| 49 | return __DIR__ . '/../../../stubs/crud-request.stub'; |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||