public function saveAudition($array) { $array = $this->processData($array); if ($this->user->auditions()->save(Audition::create($array))) { return true; } else { return false; } }
/** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { if (!($address = Auth::user()->address()->update(['user_id' => Auth::user()->id]))) { $address = Auth::user()->address()->create(['user_id' => Auth::user()->id]); } //reindex all users User::reindex(); $auditions = Audition::orderBy('created_at', 'DESC')->paginate(10); return view('home', compact('auditions')); }
public function showPastAuditions() { $auditionsStatuses = AuditionStatus::where('user_id', Auth::user()->id)->get(); $auditions = collect(); foreach ($auditionsStatuses as $audition) { $audition_details = Audition::find($audition->audition_id); if ($audition_details->ended) { $audition_details->status = $audition; $audition_details->notes = Note::where('audition_status_id', $audition->id)->get(); $auditions->push($audition_details); } } return view('past', ['auditions' => $auditions]); }
public function createAudition(Request $request) { $audition = new Audition(); if ($request->has('audition-name')) { $audition->name = $request->input('audition-name'); } if ($request->has('location')) { $audition->location = $request->input('location'); } if ($request->has('date')) { $audition->date = $request->input('date'); } if ($request->has('time')) { $audition->time = $request->input('time'); } if ($request->has('max_signups')) { $audition->max_signups = $request->input('max_signups'); } if ($request->has('description')) { $audition->description = $request->input('description'); } $audition->company_id = Auth::user()->company_id; $audition->save(); $request->session()->flash('success', 'Audition Created!'); return redirect()->route('manage-audition', ['audition' => $audition]); }
public function endAudition($id) { $audition = Audition::find($id); $audition->ended = true; $audition->save(); return redirect()->route('live-view', [$id]); }
public function searchBySalary(Request $request) { $query = intval($request->input('query')); $profession = Auth::user()->profession; switch ($profession) { case 'Director': $auditions = Audition::searchByQuery(['range' => ['pay_directors' => ['gte' => $query]]]); return view('search', compact('auditions')); break; case 'Producer': $auditions = Audition::searchByQuery(['range' => ['pay_producers' => ['gte' => $query]]]); return view('search', compact('auditions')); break; case 'Cameraman': $auditions = Audition::searchByQuery(['range' => ['pay_cameraman' => ['gte' => $query]]]); return view('search', compact('auditions')); break; case 'Film editor': $auditions = Audition::searchByQuery(['range' => ['pay_film_editors' => ['gte' => $query]]]); return view('search', compact('auditions')); break; case 'Sound designer': $auditions = Audition::searchByQuery(['range' => ['pay_sound_designers' => ['gte' => $query]]]); return view('search', compact('auditions')); break; case 'Actor': $auditions = Audition::searchByQuery(['range' => ['pay_actors' => ['gte' => $query]]]); return view('search', compact('auditions')); break; } }
public function listAppliedUsers($id) { $users = Audition::findOrFail($id)->users; return view('auditions.list_users', compact('users')); }