Merge pull request #529 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2018-10-24 12:21:11 -06:00 committed by GitHub
commit 40cc14fa2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -6,6 +6,7 @@ use App\Jobs\AvatarPipeline\CreateAvatar;
use App\Profile;
use App\User;
use App\UserSetting;
use DB;
class UserObserver
{
@ -41,9 +42,11 @@ class UserObserver
}
if (empty($user->settings)) {
$settings = new UserSetting();
$settings->user_id = $user->id;
$settings->save();
DB::transaction(function() use($user) {
UserSetting::firstOrCreate([
'user_id' => $user->id
]);
});
}
}
}

View file

@ -6,5 +6,5 @@ use Illuminate\Database\Eloquent\Model;
class UserSetting extends Model
{
//
protected $fillable = ['user_id'];
}