laravel how to get all the models except one
laravel, laravel-4, php
Solution
Why not just use a regular where?
$res = Restaurant::find(4);
$allWaitingTimesForThisRestaurant = $res->waitingtimes()->where('id', '!=', $res)->get();
Edit: Also, see Hailwood's comment below for a good addendum.
Problem
I have a `restaurant` model and a `waitingtime` model. the relationship is one to many, everything is working , I am able to update, edit and delete I can get all the waitingtimes for a specific restaurant like this ``` public function edit($id) { $res = Restaurant::find(4); $allWaitingTimesForThisRestaurant = $res->waitingtimes()->get(); ``` That gives me an array and I am happy with using it in my jquery when the page return. My question is there any way so I still able to get all the waitingtimes for a specific restuarant but without a specific waitingtime for example, the input to the edit function is `$id`, and this `$allWaitingTimesForThisRestaurant = $res->waitingtimes()->get();` returns an array of waitingtimes, so I need that array but without the waitingtime with the `id=$id` can you help me please? I feel that I didn't explain my problem well, if so kindly tell me to explain more. many tnanks