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...