| @@ 7-48 (lines=42) @@ | ||
| 4 | ||
| 5 | use Webfactor\Laravel\Generators\Contracts\NamingAbstract; | |
| 6 | ||
| 7 | class Factory extends NamingAbstract | |
| 8 | { | |
| 9 | /** | |
| 10 | * @return string | |
| 11 | */ | |
| 12 | public function getName(): string | |
| 13 |     { | |
| 14 | return ucfirst($this->entity) . 'Factory'; | |
| 15 | } | |
| 16 | ||
| 17 | /** | |
| 18 | * @return string | |
| 19 | */ | |
| 20 | public function getFileName(): string | |
| 21 |     { | |
| 22 | return $this->getName() . '.php'; | |
| 23 | } | |
| 24 | ||
| 25 | /** | |
| 26 | * @return string | |
| 27 | */ | |
| 28 | public function getPath(): string | |
| 29 |     { | |
| 30 |         return database_path('factories'); | |
| 31 | } | |
| 32 | ||
| 33 | /** | |
| 34 | * @return string | |
| 35 | */ | |
| 36 | public function getRelativeFilePath(): string | |
| 37 |     { | |
| 38 | return 'database/factories/'.$this->getFileName(); | |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * @return string | |
| 43 | */ | |
| 44 | public function getStub(): string | |
| 45 |     { | |
| 46 | return __DIR__ . '/../../../stubs/factory.stub'; | |
| 47 | } | |
| 48 | } | |
| 49 | ||
| @@ 7-56 (lines=50) @@ | ||
| 4 | ||
| 5 | use Webfactor\Laravel\Generators\Contracts\NamingAbstract; | |
| 6 | ||
| 7 | class Seeder extends NamingAbstract | |
| 8 | { | |
| 9 | /** | |
| 10 | * @return string | |
| 11 | */ | |
| 12 | public function getName(): string | |
| 13 |     { | |
| 14 | return ucfirst($this->entity); | |
| 15 | } | |
| 16 | ||
| 17 | /** | |
| 18 | * @return string | |
| 19 | */ | |
| 20 | public function getClassName(): string | |
| 21 |     { | |
| 22 | return ucfirst($this->entity) . 'Seeder'; | |
| 23 | } | |
| 24 | ||
| 25 | /** | |
| 26 | * @return string | |
| 27 | */ | |
| 28 | public function getFileName(): string | |
| 29 |     { | |
| 30 | return $this->getName() . 'Seeder.php'; | |
| 31 | } | |
| 32 | ||
| 33 | /** | |
| 34 | * @return string | |
| 35 | */ | |
| 36 | public function getPath(): string | |
| 37 |     { | |
| 38 |         return database_path('seeds'); | |
| 39 | } | |
| 40 | ||
| 41 | /** | |
| 42 | * @return string | |
| 43 | */ | |
| 44 | public function getRelativeFilePath(): string | |
| 45 |     { | |
| 46 | return 'database/seeds/'.$this->getFileName(); | |
| 47 | } | |
| 48 | ||
| 49 | /** | |
| 50 | * @return string | |
| 51 | */ | |
| 52 | public function getStub(): string | |
| 53 |     { | |
| 54 | return __DIR__ . '/../../../stubs/seeder.stub'; | |
| 55 | } | |
| 56 | } | |
| 57 | ||