]> BookStack Code Mirror - bookstack/blob - app/References/Reference.php
Added reference storage system, and command to re-index
[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 function from(): MorphTo
18     {
19         return $this->morphTo('from');
20     }
21
22     public function to(): MorphTo
23     {
24         return $this->morphTo('to');
25     }
26 }