<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Log extends Model
{
    protected $fillable = [
        'user_id',
        'trip_report_id',
        'description',
        'done',
        'date_climbed',
        'mountain_id'
    ];

    /**
     * Get the trip report that owns the log.
     */
    public function tripReport(): BelongsTo
    {
        return $this->belongsTo(TripReport::class);
    }

    /**
     * Get the mountain for this log.
     */
    public function mountain(): BelongsTo
    {
        return $this->belongsTo(Mountain::class);
    }

    /**
     * Get the user that owns the log.
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
}
