Changeset 0a1fb54 for app/Models/Department.php
- Timestamp:
- 11/23/21 22:01:52 (3 years ago)
- Branches:
- master
- Children:
- dbc5976
- Parents:
- 4d73966
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Models/Department.php
r4d73966 r0a1fb54 9 9 class Department extends Model 10 10 { 11 use Notifiable;12 11 use HasFactory; 13 12 … … 20 19 ]; 21 20 22 public function getCreatedByName()23 {24 return User::where('id', $this->user_id)->pluck('username')->first();25 }26 27 21 public function folder(){ 28 22 return $this->hasMany(Folder::class); 29 23 } 30 24 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 34 29 }
Note:
See TracChangeset
for help on using the changeset viewer.