저는 Laravel 5.5에 GraphQL API를 구축하고 있는데 제가 말한 오류가 User::create()
에서 나옵니다. 내가 확실히 했어도 '비밀번호'열에 값을 제공하지 않습니다. 이 User::create()
에서 전체 메시지입니다 :Laravel : 암호가 정확하게 제공 되더라도 '열의 null 값이 암호가 아닙니다'암호가 "null이 아닙니다."
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column \"password\" violates not-null constraint
DETAIL: Failing row contains (507, null, null, 2017-09-23 14:12:11, 2017-09-23 14:12:11, 658495, 56854685, Joe, Appleseed, royal, 1970-01-01, +31684736248, null, Poplar St, 14a, 1012AB, London, null, [email protected], [email protected], null). (SQL: insert into \"users\" (\"wid\", \"unumber\", \"first_name\", \"last_name\", \"civil_status\", \"birthdate\", \"phone_number\", \"street\", \"street_number\", \"postal_code\", \"city\", \"email_address_overwatch\", \"email_address_mindef\", \"updated_at\", \"created_at\") values (658495, 56854685, Joe, Appleseed, royal, 1970-01-01, +31684736248, Poplar St, 14a, 1012AB, London, [email protected], [email protected], 2017-09-23 14:12:11, 2017-09-23 14:12:11) returning \"id\")
을 그리고 여기에 내부를 생성하는 코드는 내 UserRepository
: 나는 확실히에 대한 값을 제공하고 있습니다로
/**
* Creates a new User with $data
*
* @param array $data
* @return User
*/
public function create(array $data): User
{
$data['password'] = bcrypt($data['password']);
$user = User::create($data);
$this->log(Auth::user(), $user, 'created');
return $user;
}
나는이 믿을 수 없을만큼 이상한 찾기 암호. 나는 dd($data)
를 사용하여 해당를 볼 수 있습니다 (오른쪽에서 볼 수 있듯이 $data['password'] = bcrypt($data'password');
array:15 [
\"wid\" => \"658495\"
\"unumber\" => \"56854685\"
\"first_name\" => \"Joe\"
\"last_name\" => \"Appleseed\"
\"civil_status\" => \"royal\"
\"birthdate\" => \"1970-01-01\"
\"phone_number\" => \"+31684736248\"
\"street\" => \"Poplar St\"
\"street_number\" => \"14a\"
\"postal_code\" => \"1012AB\"
\"city\" => \"London\"
\"email\" => \"[email protected]\"
\"email_address_overwatch\" => \"[email protected]\"
\"email_address_mindef\" => \"[email protected]\"
\"password\" => \"$2y$10$FdLbx/dYkdrjhGNcuCWKkO.bg013Gn0mhs7nKN.nyNztlykWx4jDC\"
]
에서,이 배열의 password
필드 확실히이 어떻게이 오류를 얻을 것이 가능하다
일부 환경.? 정보 : 내가 암호를 추측하고있어
PHP 7.1.9-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Sep 2 2017 05:56:43) (NTS)
psql (PostgreSQL) 9.5.8
Laravel Framework 5.5.2
'Hash :: make ($ data [ 'password'])'를 사용해서는 안됩니까? –
@lawrencecherone 나는 그렇게 생각하지 않는다. 표준 laravel auth scaffolding은 bcrypt –