I am trying to use Elequent ORM soft delete functionality in Laravel 4.1
Deleting records works as expected, however, when I search for results using Trashed () and then check if it was a soft remote record using trashed (), I get the following error:
Method call undefined Illuminate \ Database \ eloquent \ Collection :: Thugs ()
Here is my code. Any suggestions?
$product = Product::withTrashed()->where('url', Input::get("product_url.$key"))->where('prolist_id', $list->id)->get();
if($product->trashed())
{
$product->restore();
}
source
share