Client.php 564 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Client extends Model
  5. {
  6. protected $table = "client";
  7. public function notes()
  8. {
  9. return $this->hasMany(Note::class, 'client_id', 'id');
  10. }
  11. public function duplicateOfClient(){
  12. return $this->hasOne(Client::class, 'id', 'duplicate_of_client_id');
  13. }
  14. public function mcpPro(){
  15. return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
  16. }
  17. public function name_display(){
  18. return $this->name_first . ' '.$this->name_last;
  19. }
  20. }