<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Church extends Model
{

    protected $table = 'churchs';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'address','colony','city','state','country','postal_code','member_id'
    ];

    public function member()
    {
        return $this->belongsTo('App\Member', 'member_id', 'id');
    }

    public function estado()
    {
        return $this->belongsTo('App\Estado', 'estado_id', 'id');
    }

    public function municipio()
    {
        return $this->belongsTo('App\Municipio', 'municipio_id', 'id');
    }
}