|
|
|
@ -7,11 +7,23 @@ use Illuminate\Http\Request; |
|
|
|
|
|
|
|
class CouplesController extends Controller |
|
|
|
{ |
|
|
|
/** |
|
|
|
* Display the specified Couple. |
|
|
|
* |
|
|
|
* @param \App\Couple $couple |
|
|
|
* @return \Illuminate\View\View |
|
|
|
*/ |
|
|
|
public function show(Couple $couple) |
|
|
|
{ |
|
|
|
return view('couples.show', compact('couple')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Show the form for editing the specified Couple. |
|
|
|
* |
|
|
|
* @param \App\Couple $couple |
|
|
|
* @return \Illuminate\View\View |
|
|
|
*/ |
|
|
|
public function edit(Couple $couple) |
|
|
|
{ |
|
|
|
$this->authorize('edit', $couple); |
|
|
|
@ -19,6 +31,12 @@ class CouplesController extends Controller |
|
|
|
return view('couples.edit', compact('couple')); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Update the specified Couple in storage. |
|
|
|
* |
|
|
|
* @param \App\Couple $couple |
|
|
|
* @return \Illuminate\Http\RedirectResponse |
|
|
|
*/ |
|
|
|
public function update(Couple $couple) |
|
|
|
{ |
|
|
|
$this->authorize('edit', $couple); |
|
|
|
@ -32,6 +50,6 @@ class CouplesController extends Controller |
|
|
|
$couple->divorce_date = $coupleData['divorce_date']; |
|
|
|
$couple->save(); |
|
|
|
|
|
|
|
return redirect()->route('couples.show', $couple->id); |
|
|
|
return redirect()->route('couples.show', $couple); |
|
|
|
} |
|
|
|
} |