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/User.php

    r4d73966 r0a1fb54  
    134134    }
    135135
     136    public function getCreatedByUsername()
     137    {
     138        return User::where('id', $this->created_by)->pluck('username')->first();
     139    }
     140
    136141    public function getCreatedByName()
    137142    {
    138         return User::where('id', $this->created_by)->pluck('username')->first();
     143        $name = User::where('id', $this->created_by)->pluck('name')->first();
     144        $surname = User::where('id', $this->created_by)->pluck('surname')->first();
     145
     146        return $name . " " . $surname;
    139147    }
    140148
     
    142150        return $this->hasMany(Folder::class);
    143151    }
     152
     153    public function department() {
     154        return $this->hasMany(Department::class);
     155    }
    144156}
Note: See TracChangeset for help on using the changeset viewer.