Last change
on this file since dfae77e was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago |
|
-
Property mode
set to
100644
|
File size:
691 bytes
|
Rev | Line | |
---|
[dfae77e] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace App\Models;
|
---|
| 4 |
|
---|
| 5 | use Illuminate\Database\Eloquent\Factories\HasFactory;
|
---|
| 6 | use Illuminate\Database\Eloquent\Model;
|
---|
| 7 | use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
---|
| 8 | use Illuminate\Database\Eloquent\Relations\HasMany;
|
---|
| 9 |
|
---|
| 10 | class Manager extends User
|
---|
| 11 | {
|
---|
| 12 | use HasFactory;
|
---|
| 13 |
|
---|
| 14 | protected $table = 'managers';
|
---|
| 15 |
|
---|
| 16 | protected $primaryKey = 'user_id';
|
---|
| 17 |
|
---|
| 18 | public $incrementing = false;
|
---|
| 19 |
|
---|
| 20 | public $timestamps = false;
|
---|
| 21 |
|
---|
| 22 | protected $fillable = [
|
---|
| 23 | 'user_id'
|
---|
| 24 | ];
|
---|
| 25 |
|
---|
| 26 | public function user(): BelongsTo
|
---|
| 27 | {
|
---|
| 28 | return $this->belongsTo(User::class);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | public function artists(): HasMany
|
---|
| 32 | {
|
---|
| 33 | return $this->hasMany(Artist::class, 'manager_id');
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.