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