]> BookStack Code Mirror - bookstack/blob - app/References/Reference.php
5a490b5b52cdb4ab8f06858248075aa8e3c298a1
[bookstack] / app / References / Reference.php
1 <?php
2
3 namespace BookStack\References;
4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
7 use Illuminate\Database\Eloquent\Relations\MorphTo;
8
9 /**
10  * @property int $from_id
11  * @property string $from_type
12  * @property int $to_id
13  * @property string $to_type
14  */
15 class Reference extends Model
16 {
17     public $timestamps = false;
18
19     public function from(): MorphTo
20     {
21         return $this->morphTo('from');
22     }
23
24     public function to(): MorphTo
25     {
26         return $this->morphTo('to');
27     }
28 }