- Added standard Laravel directory structure and configuration. - Included Svelte and Tailwind configuration for the admin interface. - Added core PHPUnit and testing scripts.
32 lines
816 B
PHP
32 lines
816 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Media;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateMediaRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() && $this->user()->hasPermission('edit-media');
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'id' => 'required|exists:media,id',
|
|
'focal_x' => 'nullable|numeric|min:0|max:100',
|
|
'focal_y' => 'nullable|numeric|min:0|max:100',
|
|
'metadata' => 'nullable|array',
|
|
];
|
|
}
|
|
}
|