source: app/Models/Manager.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 691 bytes
RevLine 
[dfae77e]1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7use Illuminate\Database\Eloquent\Relations\BelongsTo;
8use Illuminate\Database\Eloquent\Relations\HasMany;
9
10class 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.