/** * Display the homepage. */ public function show() { $events = Event::where('secret', false)->where('start', '>=', date('U'))->orderBy('start')->limit(5)->get(); $companies = Company::where('in_logo_bar', true)->get(); if (Auth::check()) { $message = WelcomeMessage::where('user_id', Auth::user()->id)->first(); return view('website.home.members', ['events' => $events, 'companies' => $companies, 'message' => $message]); } else { return view('website.home.external', ['events' => $events, 'companies' => $companies]); } }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $company = Company::findOrFail($id); Session::flash("flash_message", "The company '" . $company->name . "' has been deleted."); $company->delete(); return Redirect::route('companies::admin'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $joboffer = Joboffer::findOrFail($id); $companies = Company::all(); return view("companies.joboffers.edit", ['joboffer' => $joboffer, 'companies' => $companies]); }