public function updateSelected(Request $request) { $infoColl = info::where('name', $request->input('name'))->limit(1)->get(); echo $infoColl[0] . '<br>'; $infoColl[0]->update($request->all()); return redirect('/'); }
public function contactId($id) { $info = info::where('name', 'contact')->limit(1)->get()[0]; $helps = help::all(); $events = event::all(); $services = service::all(); $checkServiceArray = eventServices::where('event_id', $id)->get(); $checkService; $currEvent = event::find($id); foreach ($checkServiceArray as $check) { $checkService[] = $check->service_id; } if (!empty($currEvent)) { return view('pages.contact', compact('helps', 'events', 'services', 'checkService', 'currEvent', 'info')); } return redirect('/contact'); }
public function index() { $info = info::where('name', 'agreement')->limit(1)->get()[0]; $agreements = agreement::all(); return view('agreement.index', compact('agreements', 'info')); }
public function __construct() { $this->middleware('Admin', ['except' => ['index', 'show']]); $this->info = info::where('name', 'services')->get()[0]; }