/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { if (in_array(Auth::user()->individual_id, explode(',', Helpers::getSetting('site_editors')))) { $data['guests'] = Guest::orderBy('surname')->orderBy('firstname')->get(); return View::make('guests.index', $data); } else { return View::make("shared.unauthorised"); } }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($society, $series, $id) { if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) { $data['society'] = $society; $data['allseries'] = Series::where('society_id', '=', $society)->lists('series', 'id')->toArray(); $data['series'] = $series; $data['seriesname'] = Series::find($series)->series; $data['ministers'] = Minister::has('individual')->get(); $data['preachers'] = Preacher::has('individual')->get(); $data['guests'] = Guest::orderBy('surname')->orderBy('firstname')->get(); $data['sermon'] = Sermon::find($id); return view('sermons.edit', $data); } else { return view('shared.unauthorised'); } }