<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

class Branch extends Model
{
    //
    use SoftDeletes;
    protected $fillable = [
        'phone',	'email',	'latlng'	,'image'
        ];
    /**
     * Get the description of the category.
     * @return HasMany
     */
    public function descriptions($language_id= 0) :HasMany
    {
        if ($language_id) {
            return $this->hasMany(CategoryDescription::class)->where('language_id', $language_id);
        }
        return $this->hasMany(CategoryDescription::class);
    }
}
