在ConfideUser.php中有一个变量$rules
public static $rules = array(
'username' => 'required|alpha_dash|unique:users,
'email' => 'required|email|unique:users',
'password' => 'required|min:4|confirmed',
'password_confirmation' => 'min:4',
);
我想动态地包含ConfideUser() - > id
public static $rules = array(
'username' => 'required|alpha_dash|unique:users,username,'.$this->id,
甚至
public static $rules = array(
'username' => 'required|alpha_dash|unique:users,username,'.Auth::user(),
但我不知道如何将模型传递给数组。有没有办法做到这一点?