Lint
This commit is contained in:
parent
51af9d427e
commit
722237f486
|
@ -74,20 +74,20 @@ class Form extends Model implements HasMedia
|
||||||
{
|
{
|
||||||
$this->addMediaCollection('headerImage')
|
$this->addMediaCollection('headerImage')
|
||||||
->singleFile()
|
->singleFile()
|
||||||
->maxWidth(fn () => 500)
|
->maxWidth(fn() => 500)
|
||||||
->forceFileName(fn (Form $model, string $name) => $model->slug)
|
->forceFileName(fn(Form $model, string $name) => $model->slug)
|
||||||
->convert(fn () => 'jpg')
|
->convert(fn() => 'jpg')
|
||||||
->registerMediaConversions(function (Media $media) {
|
->registerMediaConversions(function (Media $media) {
|
||||||
$this->addMediaConversion('square')->fit(Fit::Crop, 400, 400);
|
$this->addMediaConversion('square')->fit(Fit::Crop, 400, 400);
|
||||||
});
|
});
|
||||||
$this->addMediaCollection('mailattachments')
|
$this->addMediaCollection('mailattachments')
|
||||||
->withDefaultProperties(fn () => [
|
->withDefaultProperties(fn() => [
|
||||||
'conditions' => [
|
'conditions' => [
|
||||||
'mode' => 'all',
|
'mode' => 'all',
|
||||||
'ifs' => []
|
'ifs' => []
|
||||||
],
|
],
|
||||||
])
|
])
|
||||||
->withPropertyValidation(fn () => [
|
->withPropertyValidation(fn() => [
|
||||||
'conditions.mode' => 'required|string|in:all,any',
|
'conditions.mode' => 'required|string|in:all,any',
|
||||||
'conditions.ifs' => 'array',
|
'conditions.ifs' => 'array',
|
||||||
'conditions.ifs.*.field' => 'required',
|
'conditions.ifs.*.field' => 'required',
|
||||||
|
@ -101,7 +101,7 @@ class Form extends Model implements HasMedia
|
||||||
*/
|
*/
|
||||||
public function getRegistrationRules(): array
|
public function getRegistrationRules(): array
|
||||||
{
|
{
|
||||||
return $this->getFields()->reduce(fn ($carry, $field) => [
|
return $this->getFields()->reduce(fn($carry, $field) => [
|
||||||
...$carry,
|
...$carry,
|
||||||
...$field->getRegistrationRules($this),
|
...$field->getRegistrationRules($this),
|
||||||
], []);
|
], []);
|
||||||
|
@ -112,7 +112,7 @@ class Form extends Model implements HasMedia
|
||||||
*/
|
*/
|
||||||
public function getRegistrationMessages(): array
|
public function getRegistrationMessages(): array
|
||||||
{
|
{
|
||||||
return $this->getFields()->reduce(fn ($carry, $field) => [
|
return $this->getFields()->reduce(fn($carry, $field) => [
|
||||||
...$carry,
|
...$carry,
|
||||||
...$field->getRegistrationMessages($this),
|
...$field->getRegistrationMessages($this),
|
||||||
], []);
|
], []);
|
||||||
|
@ -123,7 +123,7 @@ class Form extends Model implements HasMedia
|
||||||
*/
|
*/
|
||||||
public function getRegistrationAttributes(): array
|
public function getRegistrationAttributes(): array
|
||||||
{
|
{
|
||||||
return $this->getFields()->reduce(fn ($carry, $field) => [
|
return $this->getFields()->reduce(fn($carry, $field) => [
|
||||||
...$carry,
|
...$carry,
|
||||||
...$field->getRegistrationAttributes($this),
|
...$field->getRegistrationAttributes($this),
|
||||||
], []);
|
], []);
|
||||||
|
|
Loading…
Reference in New Issue