43 lines
1.6 KiB
PHP
43 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Bo;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\StoreWhoareweIconDetailRequest;
|
|
use App\Models\WhoareweIconDetail;
|
|
|
|
class WhoareweIconDetailsController extends Controller
|
|
{
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*
|
|
* @param WhoareweIconDetail $whoareweicondetail
|
|
* @return \Illuminate\Contracts\View\View
|
|
* @ignore phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
|
*/
|
|
public function edit(WhoareweIconDetail $whoareweicondetail): \Illuminate\Contracts\View\View
|
|
{
|
|
return view('bo.whoarewe_icon_details.edit', compact('whoareweicondetail'));
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param StoreWhoareweIconDetailRequest $request
|
|
* @param WhoareweIconDetail $whoareweicondetail
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
* @ignore phpcs:disable Generic.Files.LineLength.TooLong
|
|
*/
|
|
public function update(StoreWhoareweIconDetailRequest $request, WhoareweIconDetail $whoareweicondetail): \Illuminate\Http\RedirectResponse
|
|
{
|
|
$whoareweicondetail->fill($request->validated());
|
|
|
|
if (!$whoareweicondetail->saveOrFail()) {
|
|
return redirect()->route('bo.whoareweicondetails.edit', $whoareweicondetail->slug)
|
|
->with('error', trans(__('Modification_failed')));
|
|
}
|
|
|
|
return redirect()->route('bo.whoareweicondetails.edit', $whoareweicondetail->slug)
|
|
->with('success', trans(__('Changes_saved')));
|
|
}
|
|
}
|