¿Cómo resolver el argumento 1 que falta para App \ Repositories \ FavoriteRepository :: delete ()? (Laravel 5.3)
Mi servicio es así:
public function delete($store_id)
{
$result = $this->favorite_repository->delete($store_id);
dd($result);
}
Mi repositorio es así:
public function delete($store_id)
{
$data = self::where('favoritable_id', $store_id)->delete();
return $data;
}
Existe un error:
Falta el argumento 1 para App \ Repositories \ FavoriteRepository :: delete (), llamado en C: \ xampp \ htdocs \ mysystem \ app \ Repositories \ FavoriteRepository.php en la línea 45 y definido
¿Me puedes ayudar?
ACTUALIZAR
La función de eliminación en el EloquentRepository es así:
public function delete($id)
{
// Find the given instance
$deleted = false;
$instance = $id instanceof Model ? $id : $this->find($id);
if ($instance) {
// Delete the instance
$deleted = $instance->delete();
// Fire the deleted event
$this->getContainer('events')->fire($this->getRepositoryId().'.entity.deleted', [$this, $instance]);
}
return [
$deleted,
$instance,
];
}