12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace App;
- use Illuminate\Notifications\Notifiable;
- use Illuminate\Contracts\Auth\MustVerifyEmail;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- class User extends Authenticatable
- {
- protected $table = 'wechat_fans';
- use Notifiable;
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- // protected $fillable = [
- // 'name', 'email', 'password',
- // ];
- protected $guarded = [];
- /**
- * The attributes that should be hidden for arrays.
- *
- * @var array
- */
- protected $hidden = [
- 'password', 'remember_token',
- ];
- public function sclass()
- {
- return $this->belongsTo(Sclass::class, 'class_id');
- }
- public function grade()
- {
- return $this->belongsTo(Grade::class);
- }
- public function school()
- {
- return $this->belongsTo(School::class);
- }
- public function score()
- {
- return $this->hasMany(Score::class);
- }
- public function clocked()
- {
- return $this->hasMany(Clocked::class);
- }
- public function getSchoolTextAttribute()
- {
- return $this->school->name;
- }
- public function getGradeTextAttribute()
- {
- return $this->grade->name;
- }
- public function getClassTextAttribute()
- {
- return $this->sclass->name;
- }
- }
|