1
0
Fork 0
forked from mirror/pixelfed
pixelfed/app/User.php
2018-08-28 03:07:36 +00:00

52 lines
1,020 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable, SoftDeletes;
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['deleted_at', 'email_verified_at'];
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'username', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
public function profile()
{
return $this->hasOne(Profile::class);
}
public function url()
{
return url(config('app.url').'/'.$this->username);
}
public function settings()
{
return $this->hasOne(UserSetting::class);
}
}