public static function boot() { parent::boot(); User::created(function ($user) { // Setup default user settings for the new user $usettings = UserSetting::lists('default', 'id')->toArray(); if ($usettings) { foreach ($usettings as $id => $value) { $user_settings[$id] = ['value' => $value]; } $user->settings()->sync($user_settings); } }); }