From 9883f65f4f1c0bcc225f737999357b38c36cc434 Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Fri, 2 Jun 2017 01:08:56 +0800 Subject: [PATCH] Remove contract --- src/Commands/AppRepositoryCommand.php | 4 +--- src/Commands/stubs/repository.stub | 14 +++++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Commands/AppRepositoryCommand.php b/src/Commands/AppRepositoryCommand.php index 538598e..4addab5 100644 --- a/src/Commands/AppRepositoryCommand.php +++ b/src/Commands/AppRepositoryCommand.php @@ -52,9 +52,7 @@ protected function getStub() */ public function handle() { - if (parent::handle() !== false) { - $this->call('app:contract', ['name' => $this->argument('name')]); - } + parent::handle(); } /** diff --git a/src/Commands/stubs/repository.stub b/src/Commands/stubs/repository.stub index 5fb278b..5d59ffe 100644 --- a/src/Commands/stubs/repository.stub +++ b/src/Commands/stubs/repository.stub @@ -3,10 +3,22 @@ namespace {{namespace}}; use App\Models\{{model}}\{{model}}; +use Illuminate\Support\Facades\DB; +use App\Repositories\BaseRepository; use App\Exceptions\GeneralException; +use Illuminate\Database\Eloquent\Model; -class {{class}} implements {{model}}RepositoryContract +class {{class}} extends BaseRepository { + /** + * Associated Repository Model. + */ + const MODEL = {{model}}::class; + + /** + * @return mixed + */ + public function getForDataTable() {} {{all}} /** * Get all instance of {{model}}.