app/Models/Note.php
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Class Note
*
* @property int id
* @property int user_id
* @property string text
* @property int edit_ser_id
* @property int updated_at
*/
class Note extends BaseModel
{
/**
* Indicates if the model should be timestamped.
*/
public $timestamps = false;
/**
* The attributes that aren't mass assignable.
*/
protected $guarded = [];
/**
* Возвращает связь пользователей
*/
public function editUser(): BelongsTo
{
return $this->belongsTo(User::class, 'edit_user_id')->withDefault();
}
}