<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Foto extends Model
{
    use HasFactory;
    protected $table = 'fotos';
    
    protected $fillable = [
        'extension',
        'tamanio_bytes',
        'nombre',
        'mime_type',
        'ruta',
    ];

    public function persona() 
    {
        return $this->hasMany(Persona::class, 'foto_id', 'id');
    }

    public function servicio()
    {
        return $this->hasMany(Servicio::class, 'foto_id', 'id');
    }

}
