source: app/Models/Department.php@ 194a359

develop
Last change on this file since 194a359 was 194a359, checked in by beratkjufliju <kufliju@…>, 3 years ago

added departments, edited users and added user settings

  • Property mode set to 100644
File size: 467 bytes
RevLine 
[194a359]1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Model;
6use Illuminate\Notifications\Notifiable;
7
8class Department extends Model
9{
10 use Notifiable;
11
12 protected $table = "departments";
13
14 protected $fillable = ["name", "code", "user_id"];
15
16 protected $casts = [
17 'created_at' => 'datetime:d-m-Y',
18 ];
19
20 public function getCreatedByName()
21 {
22 return User::where('id', $this->user_id)->pluck('username')->first();
23 }
24}
Note: See TracBrowser for help on using the repository browser.