1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Models;
- # use Illuminate\Database\Eloquent\Model;
- class Segment extends Model
- {
- protected $table = 'segment';
- public function segmentTemplate() {
- return $this->hasOne(SegmentTemplate::class, 'id', 'segment_template_id');
- }
- public function note() {
- return $this->hasOne(Note::class, 'id', 'note_id');
- }
- public function client() {
- return $this->hasOne(Client::class, 'id', 'client_id');
- }
- public function shortName(){
- return trim(array_reverse(explode('>', $this->display_title))[0]);
- }
- }
|