Changeset 24a616f for app/Models
- Timestamp:
- 10/13/21 15:44:57 (3 years ago)
- Branches:
- develop, master
- Children:
- 120759b
- Parents:
- 194a359
- Location:
- app/Models
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Models/Department.php
r194a359 r24a616f 3 3 namespace App\Models; 4 4 5 use Illuminate\Database\Eloquent\Factories\HasFactory; 5 6 use Illuminate\Database\Eloquent\Model; 6 7 use Illuminate\Notifications\Notifiable; … … 9 10 { 10 11 use Notifiable; 12 use HasFactory; 11 13 12 14 protected $table = "departments"; 13 15 14 protected $fillable = ["name", "code", " user_id"];16 protected $fillable = ["name", "code", "location", "user_id"]; 15 17 16 18 protected $casts = [ … … 22 24 return User::where('id', $this->user_id)->pluck('username')->first(); 23 25 } 26 27 public function document(){ 28 return $this->hasMany(Document::class); 29 } 24 30 } -
app/Models/User.php
r194a359 r24a616f 25 25 "email", 26 26 "mobile_number", 27 "avatar", 27 28 "role_id" 28 29 ]; … … 126 127 return Str::random($length); 127 128 } 128 129 129 }
Note:
See TracChangeset
for help on using the changeset viewer.