/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('admin.products.index', ['products' => Product::leftjoin('product_categories', 'product_categories.id', '=', 'products.product_category_id')->leftjoin('product_lines', 'product_lines.id', '=', 'products.product_line_id')->orderBy('product_categories.title')->orderBy('product_lines.title')->get(['products.*'])]); }