Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Models;
- use Illuminate\Notifications\Notifiable;
- use Illuminate\Foundation\Auth\User as Authenticatable;
- class User extends Authenticatable
- {
- use Notifiable;
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $fillable = [
- 'name', 'email', 'password', 'phone', 'province_id', 'regency_id', 'district_id', 'village_id', 'description'
- ];
- /**
- * The attributes that should be hidden for arrays.
- *
- * @var array
- */
- protected $hidden = [
- 'password'
- ];
- public function province()
- {
- return $this->belongsTo('App\Models\Province');
- }
- public function regency()
- {
- return $this->belongsTo('App\Models\Regency');
- }
- public function district()
- {
- return $this->belongsTo('App\Models\District');
- }
- public function village()
- {
- return $this->belongsTo('App\Models\Village');
- }
- public function comments()
- {
- return $this->hasMany('App\Models\Comment');
- }
- public function subcomments()
- {
- return $this->hasMany('App\Models\SubComment');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement