2020-06-07 20:43:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\API;
|
|
|
|
|
|
|
|
use App\Http\Requests\AbstractRequest;
|
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
|
2020-09-06 21:20:42 +00:00
|
|
|
/** @property UploadedFile $file */
|
2020-06-07 20:43:04 +00:00
|
|
|
class UploadRequest extends AbstractRequest
|
|
|
|
{
|
|
|
|
public function authorize(): bool
|
|
|
|
{
|
|
|
|
return auth()->user()->is_admin;
|
|
|
|
}
|
|
|
|
|
2020-12-22 20:11:22 +00:00
|
|
|
/** @return array<mixed> */
|
2020-06-07 20:43:04 +00:00
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'file' => [
|
|
|
|
'required',
|
|
|
|
'file',
|
2020-09-06 21:20:42 +00:00
|
|
|
'mimetypes:audio/mpeg,audio/ogg,audio/x-flac,audio/x-aac',
|
2020-06-07 20:43:04 +00:00
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|