mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
re-working validation
This commit is contained in:
parent
13b425853e
commit
3279b26bef
@ -15,6 +15,10 @@ class RegisterRequest extends Request
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function authorize()
|
||||
{
|
||||
@ -26,8 +30,10 @@ class RegisterRequest extends Request
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
public function rules(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
|
||||
$rules = [
|
||||
'email' => 'required|unique:users',
|
||||
'first_name' => 'required',
|
||||
@ -40,10 +46,9 @@ class RegisterRequest extends Request
|
||||
|
||||
public function response(array $errors)
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
Log::info($request->api_secret);
|
||||
Log::info($request->email);
|
||||
Log::info($this->request->api_secret);
|
||||
Log::info($this->request->email);
|
||||
|
||||
if(!isset($this->request->api_secret))
|
||||
return parent::response($errors);
|
||||
|
Loading…
Reference in New Issue
Block a user