/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $phones = Phone::with(['company', 'category', 'paymentCompany'])->get(); return view('phone.index', compact('phones')); }
public function statisticsAction() { return Phone::with('order', 'ships', 'order.unit')->whereHas('order.purpose', function ($q) { $q->where('group', 'monitor'); })->where('status', 'success')->get(); }