我希望从数据库中获取activationCode的值,然后将其存储到一个.txt文件中。
这是我到目前为止尝试过的内容。
请帮忙!
registerController.php
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'phone' => $data['phone'],
'password' => bcrypt($data['password']),
'activationCode' => rand(1000,9999),
]);
}
public function put() {
$user = User::where('is_active', 0)->get();
$file = Storage::put( 'myfile.txt', $user);
}