Skip to content

Commit

Permalink
fix: Update construct Base Repository (#1004)
Browse files Browse the repository at this point in the history
* feat: spanish locate support added

* fix: update contruct Base Repository

Co-authored-by: cesar molina <[email protected]>
  • Loading branch information
cesarMtorres and cesar molina authored Jun 29, 2022
1 parent 6e54266 commit 51527ad
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions templates/base_repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace $NAMESPACE_APP$\Repositories;

use Illuminate\Container\Container as Application;
use Illuminate\Database\Eloquent\Model;


Expand All @@ -13,19 +12,12 @@ abstract class BaseRepository
*/
protected $model;

/**
* @var Application
*/
protected $app;

/**
* @param Application $app
*
* @throws \Exception
*/
public function __construct(Application $app)
public function __construct()
{
$this->app = $app;
$this->makeModel();
}

Expand All @@ -52,7 +44,7 @@ abstract class BaseRepository
*/
public function makeModel()
{
$model = $this->app->make($this->model());
$model = app($this->model());

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

0 comments on commit 51527ad

Please sign in to comment.