- SOAP 기반 BarobillSoapService 생성 (MNG 코드 포팅) - BarobillMember, BarobillConfig 모델 생성 - BarobillController 7개 메서드 (login, signup, status, URL 조회) - FormRequest 검증 클래스 3개 생성 - 라우트 등록 (POST /barobill/login, /signup, GET /status 등) - i18n 메시지 키 추가 (ko/en) - config/services.php에 barobill 설정 추가
41 lines
854 B
PHP
41 lines
854 B
PHP
<?php
|
|
|
|
namespace App\Models\Tenants;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class BarobillConfig extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'environment',
|
|
'cert_key',
|
|
'corp_num',
|
|
'base_url',
|
|
'description',
|
|
'is_active',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public static function getActiveTest(): ?self
|
|
{
|
|
return self::where('environment', 'test')->first();
|
|
}
|
|
|
|
public static function getActiveProduction(): ?self
|
|
{
|
|
return self::where('environment', 'production')->first();
|
|
}
|
|
|
|
public static function getActive(bool $isTestMode = false): ?self
|
|
{
|
|
return $isTestMode ? self::getActiveTest() : self::getActiveProduction();
|
|
}
|
|
}
|