Files
online.tbbank.gov.tm-larave…/app/Models/Branch/Branch.php
2025-03-12 11:12:57 +05:00

60 lines
1.1 KiB
PHP

<?php
namespace App\Models\Branch;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Spatie\Translatable\HasTranslations;
class Branch extends Model
{
use HasFactory;
use HasTranslations;
/**
* Table name
*
* @var string
*/
protected $table = 'branches';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'region',
'province_id',
'unique_code',
'billing_username',
'billing_password',
'address',
'phone_numbers',
'active',
];
/**
* Translatable fields
*
* @var array<string>
*/
public $translatable = [
'name',
'address',
];
/**
* Branches associated with user
*
* @return BelongsToMany<User>
*/
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class);
}
}