39 lines
984 B
PHP
39 lines
984 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreBreederPortrait extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
if (!$this->status) {
|
|
$this->request->add(['status' => false]);
|
|
}
|
|
return auth()->check();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'title' => 'required|string|min:2|max:30',
|
|
'subtitle' => 'required|string|min:2|max:100',
|
|
'picture' => 'required|image|mimes:jpeg,png,jpg|max:2048',
|
|
'testimony' => 'required|string',
|
|
'latitude' => 'required|numeric|between:-99.99,99.99',
|
|
'longitude' => 'required|numeric|between:-99.99,99.99',
|
|
'status' => 'boolean',
|
|
];
|
|
}
|
|
}
|