1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Models;
- # use Illuminate\Database\Eloquent\Model;
- class Note extends Model
- {
- protected $table = "note";
- public function client()
- {
- return $this->hasOne(Client::class, 'id', 'client_id');
- }
- public function hcpPro()
- {
- return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
- }
- public function createdSession()
- {
- return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
- }
- public function allyPro()
- {
- return $this->hasOne(Pro::class, 'id', 'ally_pro_id');
- }
- public function bills()
- {
- return $this->hasMany(Bill::class, 'note_id', 'id');
- }
- public function addendums()
- {
- return $this->hasMany(NoteAddendum::class, 'note_id', 'id')->where('is_removed', false);
- }
- public function sections()
- {
- return $this->hasMany(Section::class, 'note_id', 'id')
- ->where('is_active', true)
- ->orderBy('position_index', 'asc');
- }
- }
|