mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Type hint all device model relations (#12686)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class NotificationAttrib extends Model
|
||||
{
|
||||
@@ -13,18 +14,12 @@ class NotificationAttrib extends Model
|
||||
|
||||
// ---- Define Relationships ----
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function user()
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\User::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function notification()
|
||||
public function notification(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Notification::class, 'notifications_id');
|
||||
}
|
||||
|
Reference in New Issue
Block a user