File "MediaCast.php"
Full Path: /var/www/html/back/app/DtoCasts/MediaCast.php
File size: 369 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
declare(strict_types=1);
namespace App\DtoCasts;
use Illuminate\Http\UploadedFile;
use WendellAdriel\ValidatedDTO\Casting\Castable;
final class MediaCast implements Castable
{
public function cast(string $property, mixed $value): mixed
{
if ($value instanceof UploadedFile) {
return $value;
}
return null;
}
}