Created
April 24, 2022 11:17
-
-
Save tkaratug/60170e6094a95de6f932c78ff5bbd46c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Models\Order; | |
use App\Http\Resources\OrderResource; | |
class OrderController extends Controller | |
{ | |
public function index() | |
{ | |
$orders = Order::query() | |
->paid() | |
->delivered() | |
->createdAtDesc() | |
->get(); | |
return OrderResource::collection($orders); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment