Esempio n. 1
0
 /**
  * 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]);
     }
 }
Esempio n. 2
0
 /**
  * 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');
 }
Esempio n. 3
0
 /**
  * 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]);
 }