Model binding
public function mount(?SomeEloquentModel $model) {
$this->mount_form($model);
}Examples
In a view
<livewire:some-component :model="$some_model" />public function mount($model) {
$this->mount_form($model);
}Route model binding
Route::get('/user/{user}', UserForm::class);public function mount(User $user) {
$this->mount_form($user);
}Optional model binding
Last updated
Was this helpful?