php - Syntax error, concatenate string inside array -


in user model file want define rules validation.

public function getuserid(){     return auth::id(); }  private $rules = array(     'name' => 'required|alpha|max:255',     'email' => 'required|email|max:255|unique:users,email,' . $this->getuserid(),  ); 

i

      fatalerrorexception in user.php line 162: syntax error, unexpected '.', expecting ')'  

i have included: use auth;

you should fill $rules in method __construct.
dangerous use $this in declaration, since object may not exist...


Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -