1
0
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:
David Bomba 2016-03-13 23:34:42 +11:00
parent 13b425853e
commit 3279b26bef

View File

@ -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);