@@ -9,8 +9,7 @@ discard block |
||
9 | 9 | use Illuminate\Contracts\Auth\MustVerifyEmail; |
10 | 10 | use Illuminate\Foundation\Auth\User as Authenticatable; |
11 | 11 | |
12 | -class Doctor extends Authenticatable |
|
13 | -{ |
|
12 | +class Doctor extends Authenticatable { |
|
14 | 13 | use Notifiable; |
15 | 14 | |
16 | 15 | protected $guard = 'doctor'; |
@@ -72,15 +71,18 @@ discard block |
||
72 | 71 | return $this->belongsTo('App\DoctorSpecialization', 'specialization_id'); |
73 | 72 | } |
74 | 73 | |
75 | - public function city() { |
|
74 | + public function city() |
|
75 | + { |
|
76 | 76 | return $this->belongsTo('App\City', 'city_id'); |
77 | 77 | } |
78 | 78 | |
79 | - public function thread() { |
|
79 | + public function thread() |
|
80 | + { |
|
80 | 81 | return $this->hasMany('App\Thread', 'doctor_id'); |
81 | 82 | } |
82 | 83 | |
83 | - public function hospital() { |
|
84 | + public function hospital() |
|
85 | + { |
|
84 | 86 | return $this->belongsToMany('App\Hospital', 'doctor_details', 'doctor_id', 'hospital_id'); |
85 | 87 | } |
86 | 88 |
@@ -4,8 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | 6 | |
7 | -class Hospital extends Model |
|
8 | -{ |
|
7 | +class Hospital extends Model { |
|
9 | 8 | /** |
10 | 9 | * @var string |
11 | 10 | */ |
@@ -40,7 +39,8 @@ discard block |
||
40 | 39 | /** |
41 | 40 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
42 | 41 | */ |
43 | - public function doctor() { |
|
42 | + public function doctor() |
|
43 | + { |
|
44 | 44 | return $this->belongsToMany('App\Doctor', 'doctor_details', 'hospital_id', 'doctor_id'); |
45 | 45 | } |
46 | 46 |