public function show($id) { $infoConfig = InfoConfig::first()->toArray(); $object = Model::find($id); if ($object) { return view('info.promo', ['object' => $object, 'type' => 'vacancies', 'title' => LANG . '_title', 'text' => LANG . '_text', 'requirements' => LANG . '_requirements', 'infoConfig' => $infoConfig]); } return redirect('info-center'); }
public function show($id) { $infoConfig = InfoConfig::first()->toArray(); $object = Model::find($id); if ($object) { return view('news', ['objects' => $object, 'type' => 'tenders', 'title' => LANG . '_title', 'description' => LANG . '_description', 'text' => LANG . '_text', 'requirements' => LANG . '_requirements', 'contacts' => LANG . '_contacts', 'infoConfig' => $infoConfig]); } return redirect(LANG . '/tenders'); }
public function show($id) { $infoConfig = InfoConfig::first()->toArray(); $object = Model::find($id); if (!$object) { $object = Model::where('alias', $id)->first(); } if ($object) { return view('info.expert-advice', ['object' => $object, 'type' => 'expert_advices', 'infoConfig' => $infoConfig]); } return redirect('info-center'); }
public function show($id) { $infoConfig = InfoConfig::first()->toArray(); $object = Model::find($id); if (!$object) { $object = Model::where('alias', $id)->first(); } if ($object) { return view('info.vacancy', ['object' => $object, 'type' => 'vacancies', 'title' => LANG . '_title', 'description' => LANG . '_description', 'text' => LANG . '_text', 'requirements' => LANG . '_requirements', 'contacts' => LANG . '_contacts', 'infoConfig' => $infoConfig]); } return redirect('info-center'); }
public function update(Request $request) { $object = InfoConfig::first(); if ($object) { $params = $request->only('news', 'tenders', 'vacancies', 'promos', 'expert-advices'); $params['news'] = $params['news'] ? true : false; $params['tenders'] = $params['tenders'] ? true : false; $params['vacancies'] = $params['vacancies'] ? true : false; $params['promos'] = $params['promos'] ? true : false; $params['expert-advices'] = $params['expert-advices'] ? true : false; $object->fill($params); $object->save(); return redirect('admin/info-config'); } return redirect('admin'); }
/** * Run the database seeds. * * @return void */ public function run() { $infoConfig = ['news' => 0, 'tenders' => 0, 'vacancies' => 0, 'promos' => 0, 'expert-advices' => 0]; $object = InfoConfig::create($infoConfig); $object->save(); }