Skip to content

Commit

Permalink
Fix repository
Browse files Browse the repository at this point in the history
  • Loading branch information
hariadi committed Jun 5, 2017
1 parent b55b32b commit e6cda95
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Commands/stubs/repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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}};
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit e6cda95

Please sign in to comment.