Why don't you create a new instance of the Design
in the submit
method instead of the mount
method and assign it after saving it in the database?
public function submit()
{
$this->validate();
// Assign the selected project and post IDs to the design instance
$design = new Design;
$design->project_id = $this->selectedProjectId;
$design->post_id = $this->design->post_id;
$design->save();
$this->design=$design;
$this->syncMedia();
event(new DesignCreated($this->design));
return redirect()->route('admin.designs.index');
}
`````
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community