Commit 4b4861f2 authored by Dzulfqar Ridha's avatar Dzulfqar Ridha

last

parent eab15229
...@@ -10,6 +10,7 @@ namespace App\Http\Controllers; ...@@ -10,6 +10,7 @@ namespace App\Http\Controllers;
use App\Classes\MResponse; use App\Classes\MResponse;
use App\Htpp\Request\UserCreateRequest; use App\Htpp\Request\UserCreateRequest;
use App\Htpp\Request\UserCreatesRequest;
use App\Http\Request\UserGetByUsernameRequest; use App\Http\Request\UserGetByUsernameRequest;
use App\Http\Request\UserGetByIdRequest; use App\Http\Request\UserGetByIdRequest;
use App\Http\Request\UserUpdateRequest; use App\Http\Request\UserUpdateRequest;
...@@ -73,7 +74,7 @@ class UserController extends BaseController ...@@ -73,7 +74,7 @@ class UserController extends BaseController
return response()->json($mResponse, $statusCode); return response()->json($mResponse, $statusCode);
} }
public function createUser(UserCreateRequest $request) public function createUser(UserCreatesRequest $request)
{ {
$mResponse = new MResponse(); $mResponse = new MResponse();
$statusCode = 200; $statusCode = 200;
......
<?php
/**
* Created by PhpStorm.
* User: gets
* Date: 4/4/2019
* Time: 3:45 PM
*/
namespace App\Http\Request;
class UserCreatesRequest extends FormRequestErrors
{
protected function validationData()
{
return $this->all();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'username' => 'required',
'email' => 'required',
'name' => 'required',
'password' => 'required'
];
}
/**
* Get custom messages for validator errors.
*
* @return array
*/
public function messages()
{
return [];
}
protected function modifyData()
{
$data = $this->validationData();
return $data;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment