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