fix: 🎨 resolve phpcs errors
This commit is contained in:
parent
467478a8ba
commit
05e667df5b
6 changed files with 26 additions and 10 deletions
|
|
@ -96,14 +96,18 @@ class ApproachController extends Controller
|
|||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('success', trans('crud.messages.has_been_created', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans('crud.messages.cannot_be_created', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
});
|
||||
|
|
@ -136,14 +140,18 @@ class ApproachController extends Controller
|
|||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('success', trans('crud.messages.has_been_updated', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->route('bo.approaches.edit', $approach)
|
||||
->with('error', trans('crud.messages.cannot_be_updated', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
});
|
||||
|
|
@ -166,14 +174,18 @@ class ApproachController extends Controller
|
|||
$previousQueries
|
||||
))->with('success', trans('crud.messages.has_been_deleted', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
return redirect()->back()
|
||||
->with('error', trans('crud.messages.cannot_be_deleted', [
|
||||
'model' => Str::ucfirst(
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type) ? 'validation.custom.demarche' : 'validation.custom.label')
|
||||
trans(ApproachTypeEnum::demarche->equals($approach->type)
|
||||
? 'validation.custom.demarche'
|
||||
: 'validation.custom.label')
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ class UpdateApproachRequest extends StoreApproachRequest
|
|||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
/** @var \App\Models\Approach $approachModel */
|
||||
$approachModel = $this->route()->parameter('approach');
|
||||
$this->merge([
|
||||
'type' => intval($this->route()->parameter('approach')->type->value),
|
||||
'type' => intval($approachModel->type->value),
|
||||
'published' => $this->boolean('published')
|
||||
]);
|
||||
$this->mergePicture('picture');
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use Illuminate\Support\Str;
|
|||
class UpdateStaticPageRequest extends FormRequest
|
||||
{
|
||||
use HasPicture;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class Approach extends Model
|
|||
static::creating(function (self $approach) {
|
||||
$approach->picture = FileStorageHelper::storeFile($approach, $approach->picture, true);
|
||||
});
|
||||
static::updated(function (self $approach) {
|
||||
static::updating(function (self $approach) {
|
||||
$approach->picture = FileStorageHelper::storeFile($approach, $approach->picture, true);
|
||||
});
|
||||
static::updated(function (self $approach) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
<file>config/</file>
|
||||
<file>database/factories</file>
|
||||
<file>routes/</file>
|
||||
<exclude-pattern type="relative">*/vendor/*</exclude-pattern>
|
||||
<rule ref="PSR1" />
|
||||
<rule ref="PSR12" />
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue