diff --git a/src/Commands/stubs/repository.stub b/src/Commands/stubs/repository.stub index 87744e9..021733b 100644 --- a/src/Commands/stubs/repository.stub +++ b/src/Commands/stubs/repository.stub @@ -72,9 +72,7 @@ class {{class}} extends BaseRepository */ public function update(Model ${{variable}}, array $input) { - ${{variable}} = $this->createAgencyStub($input); - - if (${{variable}}->save()) { + if (${{variable}}->update($input)) { //event(new {{model}}Updated(${{variable}})); return ${{variable}}; @@ -105,7 +103,8 @@ class {{class}} extends BaseRepository */ private function create{{model}}Stub($input) { - ${{variable}} = new self::MODEL; + ${{variable}} = self::MODEL; + ${{variable}} = new ${{variable}}; foreach (${{variable}}->getFillable() as $column) { if (array_key_exists($column, $input)) {