mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
36e54ab9f1
* Use model::class instead of string for binding Originally from laravel shift Shift bindings PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser. * Shift cleanup
32 lines
754 B
PHP
32 lines
754 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NotificationAttrib extends Model
|
|
{
|
|
public $timestamps = false;
|
|
protected $table = 'notifications_attribs';
|
|
protected $primaryKey = 'attrib_id';
|
|
protected $fillable = ['notifications_id', 'user_id', 'key', 'value'];
|
|
|
|
// ---- Define Relationships ----
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function notification()
|
|
{
|
|
return $this->belongsTo(\App\Models\Notification::class, 'notifications_id');
|
|
}
|
|
}
|