63 lines
1.5 KiB
PHP
63 lines
1.5 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;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property null|string $address
|
|
* @property null|string $unique_code
|
|
* @property string $region
|
|
* @property null|int $province_id
|
|
* @property null|string $billing_username
|
|
* @property null|string $billing_password
|
|
* @property null|string $phone_numbers
|
|
* @property bool $active
|
|
* @property null|string $created_at
|
|
* @property null|string $updated_at
|
|
* @property null|string $billing_swift_username
|
|
* @property null|string $billing_swift_password
|
|
* @property null|string $billing_visa_master_username
|
|
* @property null|string $billing_visa_master_password
|
|
* @property null|string $billing_sber_username
|
|
* @property null|string $billing_sber_password
|
|
*/
|
|
class Branch extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasTranslations;
|
|
|
|
/**
|
|
* Table name
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'branches';
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
}
|