destroy joined
This commit is contained in:
parent
4a6bba437d
commit
5bff8d70a0
2 changed files with 10 additions and 0 deletions
|
@ -44,5 +44,7 @@ public function update(UpdateJoinedRequest $request, Joined $joined)
|
|||
|
||||
public function destroy(Joined $joined)
|
||||
{
|
||||
$joined->remove();
|
||||
return redirect()->route('admin.joined.index')->with('success', 'Fanlisting removed.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,4 +84,12 @@ public function patch(array $validated) : Joined
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------ remove ---- */
|
||||
|
||||
public function remove() : void
|
||||
{
|
||||
$this->categories()->detach();
|
||||
$this->delete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue