@@ 76-86 (lines=11) @@ | ||
73 | /** |
|
74 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Illuminate\Database\Eloquent\Relations\MorphTo |
|
75 | */ |
|
76 | public function from() |
|
77 | { |
|
78 | // check if on the configurations file there is the option |
|
79 | // polymorphic setted to true, if so Notifynder will work |
|
80 | // polymorphic. |
|
81 | if (config('notifynder.polymorphic') == false) { |
|
82 | return $this->belongsTo(config('notifynder.model'), 'from_id'); |
|
83 | } else { |
|
84 | return $this->morphTo(); |
|
85 | } |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Illuminate\Database\Eloquent\Relations\MorphTo |
|
@@ 91-101 (lines=11) @@ | ||
88 | /** |
|
89 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Illuminate\Database\Eloquent\Relations\MorphTo |
|
90 | */ |
|
91 | public function to() |
|
92 | { |
|
93 | // check if on the configurations file there is the option |
|
94 | // polymorphic setted to true, if so Notifynder will work |
|
95 | // polymorphic. |
|
96 | if (config('notifynder.polymorphic') == false) { |
|
97 | return $this->belongsTo(config('notifynder.model'), 'to_id'); |
|
98 | } else { |
|
99 | return $this->morphTo(); |
|
100 | } |
|
101 | } |
|
102 | ||
103 | /** |
|
104 | * Not read scope |