mirror of
https://github.com/koel/koel
synced 2024-12-24 03:23:06 +00:00
27 lines
564 B
PHP
27 lines
564 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
use App\Http\Requests\AbstractRequest;
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
/** @property UploadedFile $file */
|
|
class UploadRequest extends AbstractRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return auth()->user()->is_admin;
|
|
}
|
|
|
|
/** @return array<mixed> */
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'file' => [
|
|
'required',
|
|
'file',
|
|
'mimetypes:audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac',
|
|
],
|
|
];
|
|
}
|
|
}
|