koel/app/Http/Requests/API/UploadRequest.php
2020-06-07 22:43:04 +02:00

26 lines
536 B
PHP

<?php
namespace App\Http\Requests\API;
use App\Http\Requests\AbstractRequest;
use Illuminate\Http\UploadedFile;
/** @property-read UploadedFile $file */
class UploadRequest extends AbstractRequest
{
public function authorize(): bool
{
return auth()->user()->is_admin;
}
public function rules(): array
{
return [
'file' => [
'required',
'file',
'mimetypes:audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac'
],
];
}
}