mirror of
https://github.com/koel/koel
synced 2024-12-21 01:53:11 +00:00
23 lines
488 B
PHP
23 lines
488 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
use App\Rules\ImageData;
|
|
|
|
abstract class MediaImageUpdateRequest extends Request
|
|
{
|
|
/** @return array<mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
$this->getImageFieldName() => ['string', 'required', new ImageData()],
|
|
];
|
|
}
|
|
|
|
public function getFileContent(): string
|
|
{
|
|
return $this->{$this->getImageFieldName()};
|
|
}
|
|
|
|
abstract protected function getImageFieldName(): string;
|
|
}
|