/** * Handle the event. * * @param RegistrationStepChanged $event * @return void */ public function handle(RegistrationStepChanged $event) { $registration = $event->registration; $extra = $event->extra; $history = new RegistrationHistory(); $history->registration_id = $registration->id; $history->registration_step_id = $registration->registration_step_id; $history->created_by = user() ? user()->id : NULL; if (!empty($extra['comment'])) { $history->comment = $extra['comment']; } if (!empty($extra['registration_step_note_id'])) { $history->registration_step_note_id = $extra['registration_step_note_id']; } $history->save(); }
/** * Create a new event instance. * * @param Registration $registration * @return void */ public function __construct(Registration $registration) { $this->histories = RegistrationHistory::with('step')->where('registration_id', $registration->id)->get(); $this->step = RegistrationStep::find($registration->registration_step_id); $this->registration = $registration; // $this->profile = $profile->pluck(''); }
public function history($registration_id = 0) { $registration = Registration::find($registration_id); $histories = RegistrationHistory::with('notes', 'step', 'creator')->where('registration_id', $registration_id)->orderBy('id', 'desc')->get(); return view('registration::histories.index', compact('histories', 'registration')); }
public function status(History $History) { $histories = $History->with('creator', 'step', 'registration', 'notes')->where('registration_id', registrar()->id)->get(); return view('registration::registrar.status', compact('histories')); }