コード例 #1
0
ファイル: Sale.php プロジェクト: sebalb/shopapp
 public function show(UserAuth $user, $uid, $sid)
 {
     return $user->sells()->with(['product' => function ($q) {
         $q->select('id', 'title');
     }, 'seller' => function ($q) {
         $q->select('id', 'username');
     }, 'buyer' => function ($q) {
         $q->select('id', 'username');
     }])->find($sid) ?: $this->notFoundJson();
 }