Skip to content

Commit 3544c1d

Browse files
committed
add model name
1 parent a72f425 commit 3544c1d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Commands/MakeRepository.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ private function createRepository(string $className, $isDefault = true)
109109
"{repositoryName}" => $repositoryName,
110110
"{repositoryInterfaceNamespace}" => $this->getRepositoryInterfaceNamespace($className),
111111
"{repositoryInterfaceName}" => $className . "RepositoryInterface",
112+
"{ModelName}" => $className
112113
];
113114

114115
$stubName = $isDefault ? "eloquent-repository.stub" : "custom-repository.stub";

src/Commands/stubs/eloquent-repository.stub

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace {namespace};
44

55
use LaravelEasyRepository\Implementations\Eloquent;
66
use {repositoryInterfaceNamespace}\{repositoryInterfaceName};
7+
use App\Models\{ModelName};
78

89
class {repositoryName} extends Eloquent implements {repositoryInterfaceName}{
910

@@ -14,7 +15,7 @@ class {repositoryName} extends Eloquent implements {repositoryInterfaceName}{
1415
*/
1516
protected $model;
1617

17-
public function __construct(Model $model)
18+
public function __construct({ModelName} $model)
1819
{
1920
$this->model = $model;
2021
}

0 commit comments

Comments
 (0)