Changeset 24a616f for app/Models


Ignore:
Timestamp:
10/13/21 15:44:57 (3 years ago)
Author:
Berat Kjufliju <kufliju@…>
Branches:
develop, master
Children:
120759b
Parents:
194a359
Message:

added documents crud, added last_seen_to_user, edited views

Location:
app/Models
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • app/Models/Department.php

    r194a359 r24a616f  
    33namespace App\Models;
    44
     5use Illuminate\Database\Eloquent\Factories\HasFactory;
    56use Illuminate\Database\Eloquent\Model;
    67use Illuminate\Notifications\Notifiable;
     
    910{
    1011    use Notifiable;
     12    use HasFactory;
    1113
    1214    protected $table = "departments";
    1315
    14     protected $fillable = ["name", "code", "user_id"];
     16    protected $fillable = ["name", "code", "location", "user_id"];
    1517
    1618    protected $casts = [
     
    2224        return User::where('id', $this->user_id)->pluck('username')->first();
    2325    }
     26
     27    public function document(){
     28        return $this->hasMany(Document::class);
     29    }
    2430}
  • app/Models/User.php

    r194a359 r24a616f  
    2525        "email",
    2626        "mobile_number",
     27        "avatar",
    2728        "role_id"
    2829    ];
     
    126127        return Str::random($length);
    127128    }
    128 
    129129}
Note: See TracChangeset for help on using the changeset viewer.