I have a piece of code like this:
$products = Product::all() if ($search_value) { $products = $products->where(\'name\', \'LIKE\', \"%$search_value%\
If you want to get the list of all data and grab it in descending order try this:
$post = Post::orderBy('id', 'DESC')->get();