/** * Display a listing of the resource. * * @return Response */ public function index() { $products = DB::table('products')->where('is_active', 1)->orderBy('product_name', 'ASC')->get(); // Get max invoice id $data = new Sale(); $invoice_id = $data->get_invoice_id(); $invoice_id++; // Shop code $shop_data = $data->get_shop_code(); $shop_code = $shop_data[0]->shop_code; $shop_name = $shop_data[0]->shop_name; //print_r($shop_code); die; return View('sale', compact('products', 'invoice_id', 'shop_code', 'shop_name')); }