I have table with ID, Category_id, title etc... I need to output every category except nr. "10"
I allready outputted only category_id = 10, but dont know how to output others except category 10.
Here is controller:
public function index()
{
$sponsored = Raksti::where('category_id', '10')->get();
$kat = RakstuKategorijas::all();
$raksts = Raksti::all();
$raksti = collect($raksts)->except('category_id', '10');
return view('home',[
'sponsored' => $sponsored,
'kat' => $kat,
'raksti' => $raksti,
]);
}
}
I don't get any errors - code output all posts including category 10
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire