42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Bo;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\UpdatePictoBrandRequest;
|
|
use App\Models\PictoBrand;
|
|
|
|
class PictoBrandsController extends Controller
|
|
{
|
|
/**
|
|
* Show the form for editing the specified resource.
|
|
*
|
|
* @param PictoBrand $pictobrand
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
|
public function edit(PictoBrand $pictobrand)
|
|
{
|
|
return view('back.pictobrands.edit', compact('pictobrand'));
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param PictoBrand $pictobrand
|
|
* @param \Illuminate\Http\UpdatePictoBrandRequest $request
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(PictoBrand $pictobrand, UpdatePictoBrandRequest $request)
|
|
{
|
|
$pictobrand->fill($request->validated());
|
|
|
|
if (!$pictobrand->saveOrFail()) {
|
|
return redirect()->route('bo.pictobrands.edit', $pictobrand->id)
|
|
->with('error', trans('La modification a échoué'));
|
|
}
|
|
|
|
return redirect()->route('bo.pictobrands.edit', $pictobrand->id)
|
|
->with('success', trans('Modifications enregistrées !'));
|
|
}
|
|
}
|