<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class LeasingProfile extends Model
{
    use \Illuminate\Database\Eloquent\Factories\HasFactory;

    protected $fillable = ['user_id', 'company_name', 'address', 'logo', 'website'];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function getOwnerAttribute()
    {
        return $this->user;
    }

    public function branches()
    {
        return $this->hasMany(Branch::class);
    }

    public function records()
    {
        return $this->hasMany(LeasingRecord::class);
    }

    public function uploads()
    {
        return $this->hasMany(LeasingDataUpload::class);
    }
}
