$products = Product::orderBy('price', 'desc')->get();
$products = Product::orderBy('popularity', 'desc')->get();The orderBy function is a part of the Laravel framework for PHP, which is a popular package library used for web development. By using this function, developers are able to easily sort and organize products within a database, in order to better serve their customers.