source:
app/Models/Department.php@
c5e383e
Last change on this file since c5e383e was c5e383e, checked in by , 3 years ago | |
---|---|
|
|
File size: 585 bytes |
Rev | Line | |
---|---|---|
[194a359] | 1 | <?php |
2 | ||
3 | namespace App\Models; | |
4 | ||
[24a616f] | 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
[194a359] | 6 | use Illuminate\Database\Eloquent\Model; |
7 | use Illuminate\Notifications\Notifiable; | |
8 | ||
9 | class Department extends Model | |
10 | { | |
[24a616f] | 11 | use HasFactory; |
[194a359] | 12 | |
13 | protected $table = "departments"; | |
14 | ||
[4b7e2d3] | 15 | protected $fillable = ["name", "code", "location", "user_id", "no_of_folders"]; |
[194a359] | 16 | |
17 | protected $casts = [ | |
18 | 'created_at' => 'datetime:d-m-Y', | |
19 | ]; | |
20 | ||
[c6b84df] | 21 | public function folder(){ |
22 | return $this->hasMany(Folder::class); | |
[24a616f] | 23 | } |
[0df7a93] | 24 | |
[0a1fb54] | 25 | public function user(){ |
26 | return $this->belongsTo(User::class); | |
27 | } | |
[194a359] | 28 | } |
Note:
See TracBrowser
for help on using the repository browser.