/** * Get the o shops list * @return $this */ public function index() { $merchants = Merchant::orderBy('company_name', 'ASC')->get(); $firstLetter = ''; $firstRun = true; $letters['AD'] = array('A', 'B', 'C', 'D'); $letters['EH'] = array('E', 'F', 'G', 'H'); $letters['IL'] = array('I', 'J', 'K', 'L'); $letters['MP'] = array('M', 'N', 'O', 'P'); $letters['QT'] = array('Q', 'R', 'S', 'T'); $letters['UX'] = array('U', 'V', 'W', 'X'); $letters['YZ'] = array('Y', 'Z'); return view('shops.oshoplist')->with('merchants', $merchants)->with('firstLetter', $firstLetter)->with('firstRun', $firstRun)->with('letters', $letters); }