1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Client extends Model
- {
- protected $table = "client";
- public function notes()
- {
- return $this->hasMany(Note::class, 'client_id', 'id');
- }
- public function duplicateOfClient(){
- return $this->hasOne(Client::class, 'id', 'duplicate_of_client_id');
- }
- public function mcpPro(){
- return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
- }
- public function cmPro(){
- return $this->hasOne(Pro::class, 'id', 'cm_pro_id');
- }
- public function rmePro(){
- return $this->hasOne(Pro::class, 'id', 'rme_pro_id');
- }
- public function rmmPro(){
- return $this->hasOne(Pro::class, 'id', 'rmm_pro_id');
- }
- public function name_display(){
- return $this->name_first . ' '.$this->name_last;
- }
- public function careMonth(){
- return $this->hasOne(CareMonth::class, 'client_id', 'id');
- }
- }
|