public function index($leadership_event_id, $activity_id) { $event = LeadershipEvent::find($leadership_event_id); $activity = Activity::find($activity_id); $this->layout->with('subtitle', $event->name()); $this->layout->content = View::make('signup.index')->with('event', $event)->with('activity', $activity); }
public function register($leadership_event_id, $booking_id) { $input = Input::all(); $validator = Validator::make($input, Booking::$rules); if ($validator->passes()) { $booking = Booking::findOrFail($booking_id); $booking->registration_date = new Datetime(); $booking->first = Input::get('first'); $booking->last = Input::get('last'); $booking->email = Input::get('email'); $booking->contact_number = Input::get('contact_number'); $booking->church = Input::get('church'); $booking->role = Input::get('role'); $booking->notes = Input::get('notes'); $booking->save(); return Redirect::route('registration', array($leadership_event_id))->with('info', 'Registration complete!'); } else { $event = LeadershipEvent::find($leadership_event_id); $bookings = Booking::where('id', $booking_id)->get(); $bookings->each(function ($booking) { // Should actually only be one... $booking->first = Input::get('first'); $booking->last = Input::get('last'); $booking->email = Input::get('email'); $booking->contact_number = Input::get('contact_number'); $booking->church = Input::get('church'); $booking->role = Input::get('role'); $booking->notes = Input::get('notes'); }); $this->layout->with('subtitle', $event->name()); $this->layout->withErrors($validator); $this->layout->content = View::make('registration.index')->with('event', $event)->with('bookings', $bookings)->with('errors', $validator->messages()); } }
public function edit($leadership_event_id, $id) { $event = LeadershipEvent::find($leadership_event_id); $activity = Activity::findOrFail($id); $this->layout->with('subtitle', $event->name()); $this->layout->content = View::make('activities.edit')->with('activity', $activity); }
public function edit($leadership_event_id, $id) { $event = LeadershipEvent::find($leadership_event_id); $booking = Booking::findOrFail($id); $this->layout->with('subtitle', $event->name()); $this->layout->content = View::make('bookings.edit')->with('booking', $booking); }