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

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -