| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCommunity\Modules\PushNotification; |
| 4 |
|
| 5 |
use FluentCommunity\App\Models\Model; |
| 6 |
use FluentCommunity\App\Models\SpaceUserPivot; |
| 7 |
|
| 8 |
/** |
| 9 |
* This is a placeholder model for Push Notification Subscriptions |
| 10 |
* |
| 11 |
* Database Model |
| 12 |
* |
| 13 |
* @package FluentCommunity\Modules\PushNotification |
| 14 |
* |
| 15 |
* @version 2.1.10 |
| 16 |
*/ |
| 17 |
class FnSubscriptionModel extends Model |
| 18 |
{ |
| 19 |
protected $table = 'fn_subscriptions'; |
| 20 |
|
| 21 |
protected $primaryKey = 'id'; |
| 22 |
|
| 23 |
protected $guarded = ['id']; |
| 24 |
|
| 25 |
protected $fillable = [ |
| 26 |
'user_id', |
| 27 |
'fcm_token', |
| 28 |
'browser', |
| 29 |
'device', |
| 30 |
'ip_address', |
| 31 |
'other_info', |
| 32 |
'user_agent', |
| 33 |
'platform', |
| 34 |
'status' |
| 35 |
]; |
| 36 |
|
| 37 |
/** |
| 38 |
* Relationship: User of this subscription |
| 39 |
*/ |
| 40 |
public function user() |
| 41 |
{ |
| 42 |
return $this->belongsTo('FluentCommunity\App\Models\User', 'user_id'); |
| 43 |
} |
| 44 |
|
| 45 |
public function space_pivot() |
| 46 |
{ |
| 47 |
return $this->belongsTo(SpaceUserPivot::class, 'user_id', 'user_id')->withoutGlobalScopes(); |
| 48 |
} |
| 49 |
|
| 50 |
public function xprofile() |
| 51 |
{ |
| 52 |
return $this->belongsTo('FluentCommunity\App\Models\XProfile', 'user_id', 'user_id'); |
| 53 |
} |
| 54 |
|
| 55 |
} |
| 56 |
|