/** * Display the specified resource. * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // $merchant = Merchant::find($id); /*$mybuses = DB::table('accounts') ->join('merchants', 'merchants.id', '=', 'accounts.merchant_id') ->join('busstops', 'accounts.station_id', '=', 'busstops.id') ->select('busstops.*', 'accounts.id','accounts.balance')->where("merchants.id","=","accounts.merchant_id") ->get();*/ $mybuses = DB::table('accounts')->join('busstops', function ($join) use($id) { $join->on('accounts.station_id', '=', 'busstops.id')->where('accounts.merchant_id', '=', $id); })->get(); return View("merchants.merchantdetails", ["title" => "Merchant Details", "subtitle" => $merchant->c_fname, "merchant" => $merchant, "busstops" => Busstop::all(), "mybusstops" => $mybuses]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // return View("tickets.index", ["title" => "Ticket Generator", "stacks" => Ticketstack::all(), "busstops" => Busstop::all()]); }