<?php
namespace App\Http\Requests\Admin\Account;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
class UpdateProfileRequest 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(Request $request)
{
return [
'admin_id' => 'required|exists:admins,id',
'name' => 'max:191',
'email' => $request->admin_id ? 'email|max:191|unique:admins,email,'.$request->admin_id : 'email|max:191|unique:admins,email,NULL',
'picture' => 'mimes:jpeg,jpg,png',
'about' => 'max:3000'
];
}
}