Type hint all device model relations (#12686)

This commit is contained in:
Jellyfrog
2021-03-31 17:28:47 +02:00
committed by GitHub
parent dc160c6813
commit 4b6efba040
28 changed files with 90 additions and 64 deletions

View File

@@ -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');
}