Ignore:
Timestamp:
11/23/21 22:01:52 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
master
Children:
dbc5976
Parents:
4d73966
Message:

bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Models/Department.php

    r4d73966 r0a1fb54  
    99class Department extends Model
    1010{
    11     use Notifiable;
    1211    use HasFactory;
    1312
     
    2019    ];
    2120
    22     public function getCreatedByName()
    23     {
    24         return User::where('id', $this->user_id)->pluck('username')->first();
    25     }
    26 
    2721    public function folder(){
    2822        return $this->hasMany(Folder::class);
    2923    }
    3024
    31 //    public function getDeptId(){
    32 //        return Department::where('id', $this->id)->get();
    33 //    }
     25    public function user(){
     26        return $this->belongsTo(User::class);
     27    }
     28
    3429}
Note: See TracChangeset for help on using the changeset viewer.