|
- <?php
-
- namespace App\Models\HtpmsCustomer\Existing;
-
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Query\Builder;
- use Illuminate\Support\Facades\DB;
-
- class Parking extends Model
- {
- const COL_NAME_PARKING_MANAGEMENT_CODE = 'park_code';
- const COL_NAME_PARKING_NAME = 'park_name';
-
- protected $connection = 'htpms_customer';
- protected $table = 'tbl_park';
- protected $fillable = []; // 参照専用
-
- protected $visible = [
- self::COL_NAME_PARKING_MANAGEMENT_CODE,
- self::COL_NAME_PARKING_NAME,
- ];
-
-
- public static function getBuilder(string $name = 'main'): Builder
- {
- $instance = new static();
- return DB::connection($instance->getConnectionName())->table(static::getTableName(), $name);
- }
-
- public static function getTableName(): string
- {
- return (new static)->getTable();
- }
- }
|