first commit
This commit is contained in:
48
app/Http/Requests/StoreTaskRequest.php
Normal file
48
app/Http/Requests/StoreTaskRequest.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreTaskRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'leads_id' => 'required',
|
||||
'subject' => 'required',
|
||||
'due_date' => 'required',
|
||||
'priority' => 'required',
|
||||
'owner' => 'required',
|
||||
'reminder' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(){
|
||||
return [
|
||||
'required' => 'The :attribute field must be required'
|
||||
];
|
||||
}
|
||||
|
||||
public function validated(){
|
||||
return array_merge(parent::validated(), [
|
||||
'status' => $this->status ? '1' : '0',
|
||||
'created_by' => auth()->user()->id
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user