芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/myvyralapp.com/bck/app/Traits/User/RegisteredUsers.php
roleHasOne()->pluck("id")->toArray(); $wallets = []; foreach($currencies as $currency_id) { $wallets[] = [ 'user_id' => $user->id, 'currency_id' => $currency_id, 'balance' => 0, 'status' => true, 'created_at' => now(), ]; } try{ UserWallet::insert($wallets); }catch(Exception $e) { // handle error $this->guard()->logout(); $user->delete(); return $this->breakAuthentication("Faild to create wallet! Please try again"); } } protected function breakAuthentication($error) { return back()->with(['error' => [$error]]); } }