2018-05-09 08:05:17 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class NotificationAttrib extends Model
|
|
|
|
|
{
|
|
|
|
|
public $timestamps = false;
|
|
|
|
|
protected $table = 'notifications_attribs';
|
|
|
|
|
protected $primaryKey = 'attrib_id';
|
2018-09-11 07:51:35 -05:00
|
|
|
protected $fillable = ['notifications_id', 'user_id', 'key', 'value'];
|
2018-05-09 08:05:17 -05:00
|
|
|
|
|
|
|
|
// ---- Define Relationships ----
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
2020-04-21 14:28:48 +02:00
|
|
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
2018-05-09 08:05:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
|
|
|
|
public function notification()
|
|
|
|
|
{
|
2020-04-21 14:28:48 +02:00
|
|
|
return $this->belongsTo(\App\Models\Notification::class, 'notifications_id');
|
2018-05-09 08:05:17 -05:00
|
|
|
}
|
|
|
|
|
}
|