label('Название занятия') ->required() ->reactive() ->afterStateUpdated(function (Closure $set, $state) { $set('slug', Str::slug($state)); }), TextInput::make('slug') ->required() ->label('Название в url-ссылке'), MarkdownEditor::make('body') ]; } public function create() { Lesson::create(array_merge($this->form->getState(), ['course_id' => $this->course->id])); return redirect()->route('course-edit', ['course' => $this->course]); } public function render() { return view('livewire.lesson.lesson-create')->layout('layouts.base'); } }