*/ public function handle(CourseMember $course, array $attributes): void { app(NamiSettings::class)->login()->updateCourse( $course->member->nami_id, $course->nami_id, [ ...$attributes, 'course_id' => Course::find($attributes['course_id'])->nami_id, ] ); $course->update($attributes); } /** * @return array */ public function rules() { return [ 'organizer' => 'required|max:255', 'event_name' => 'required|max:255', 'completed_at' => 'required|date', 'course_id' => 'required|exists:courses,id', ]; } public function asController(CourseMember $course, ActionRequest $request): JsonResponse { $this->startJob($course, $request->validated()); return response()->json([]); } /** * @param mixed $parameters */ public function jobState(WithJobState $jobState, ...$parameters): WithJobState { $member = $parameters[0]->member; return $jobState ->before('Ausbildung für ' . $member->fullname . ' wird gespeichert') ->after('Ausbildung für ' . $member->fullname . ' gespeichert') ->failed('Fehler beim Erstellen der Ausbildung für ' . $member->fullname) ->shouldReload(JobChannels::make()->add('member')->add('course')); } }