Complete migration of node controllers/repositories to new service structure

This commit is contained in:
Dane Everitt 2017-08-08 21:21:10 -05:00
parent 669119c8f8
commit 7277f728a9
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 40 additions and 36 deletions

View file

@ -119,11 +119,19 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
*/
public function delete($id, $destroy = false)
{
if ($destroy) {
return $this->getBuilder()->where($this->getModel()->getKeyName(), $id)->forceDelete();
}
$instance = $this->getBuilder()->where($this->getModel()->getKeyName(), $id);
return $this->getBuilder()->where($this->getModel()->getKeyName(), $id)->delete();
return ($destroy) ? $instance->forceDelete() : $instance->delete();
}
/**
* {@inheritdoc}
*/
public function deleteWhere(array $attributes, $force = false)
{
$instance = $this->getBuilder()->where($attributes);
return ($force) ? $instance->forceDelete() : $instance->delete();
}
/**