$users * @property-read int|null $users_count * @method static \Illuminate\Database\Eloquent\Builder|Inbox newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Inbox newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Inbox query() * @method static \Illuminate\Database\Eloquent\Builder|Inbox whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Inbox whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Inbox whereLastMessage($value) * @method static \Illuminate\Database\Eloquent\Builder|Inbox whereLastUserId($value) * @method static \Illuminate\Database\Eloquent\Builder|Inbox whereUpdatedAt($value) * @mixin \Eloquent */ class Inbox extends Model { protected $fillable = ['last_user_id', 'last_message']; public function users(): BelongsToMany { return $this->belongsToMany(User::class); } public function lastUser(): HasOne { return $this->hasOne(User::class, 'id', 'last_user_id'); } }