any body can help me i wanna make a register which is have these parameter
this is my RegisterRequest for validation
public function rules()
{
return [
'name' => 'required',
'email' => 'required|email|unique:users,email',
'username' => 'nullable|string|min:5|unique:users,username',
'avatar' => 'nullable|mimes:jpge,jpg,png',
'password' => 'required|string|min:5',
];
}
and this is my Postman Setup Headers setup
and this is my register method dd()
code
public function register(RegisterRequest $request)
{
dd(
$request->all(),
$request->avatar,
$request->hasFile('avatar'),
$request->file('avatar')
);
}
and this is the result in the Postman
Its solved By removing
this from Headers
Content-Type : application/json