Skip to content

Commit 51527ad

Browse files
cesarMtorrescesar molina
andauthored
fix: Update construct Base Repository (#1004)
* feat: spanish locate support added * fix: update contruct Base Repository Co-authored-by: cesar molina <cmolina@promarketingchile.com>
1 parent 6e54266 commit 51527ad

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

templates/base_repository.stub

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace $NAMESPACE_APP$\Repositories;
44

5-
use Illuminate\Container\Container as Application;
65
use Illuminate\Database\Eloquent\Model;
76

87

@@ -13,19 +12,12 @@ abstract class BaseRepository
1312
*/
1413
protected $model;
1514

16-
/**
17-
* @var Application
18-
*/
19-
protected $app;
2015

2116
/**
22-
* @param Application $app
23-
*
2417
* @throws \Exception
2518
*/
26-
public function __construct(Application $app)
19+
public function __construct()
2720
{
28-
$this->app = $app;
2921
$this->makeModel();
3022
}
3123

@@ -52,7 +44,7 @@ abstract class BaseRepository
5244
*/
5345
public function makeModel()
5446
{
55-
$model = $this->app->make($this->model());
47+
$model = app($this->model());
5648

5749
if (!$model instanceof Model) {
5850
throw new \Exception("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model");

0 commit comments

Comments
 (0)