Hi, I have just solved this problem. This is because I overwrite the constructor of model but did not invoke parent's constructor. After I add parent::__construct(); everything is OK. I think this should add to the document because this statement doesn't matter in earlier versions.
I have same issue,
On laravel 4.2, User::all() line gets all model adding soft deleted models..
Before laravel 4.2 Same code - User::all() - only gets model is not soft deleted...
In this case, I have to use my basic method:
/**
* To remove model that has been removed
*
* @param object $models models
* @return object only model wasn't removed
*/
public function RemoveSoftDeleted($models) {
foreach ($models as $k => $v) {
if ($v->deleted_at !== null) {
unset($models[$k]);
}
}
return $models;
}
Thank you for the tip on parent::__construct() ... I had the same problem, and it was so annoying!
Niels.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community