如何在livewire中获取CategoryID?
在通常的Route::get it worked -“public function__
第一个月
new #[Layout('layouts.app')] class extends Component {
public string $name = '';
public function createTopic(): void
{
$validated = $this->validate([
'name' => ['required', 'string', 'min:6', 'max:255']
]);
$topic = ForumTopicModel::create([
'name' => $validated['name'],
'category' => $categoryId,
'author' => Auth::id()
]);
?>
字符串
1条答案
按热度按时间kwvwclae1#
这是以同样的方式完成的。
在路线方面:
字符串
在组件中:
型
在组件方法中,
型
通过mount:
型