コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 /**
  * 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('');
 }
コード例 #3
0
 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'));
 }
コード例 #4
0
 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'));
 }