File manager - Edit - /home/autoph/public_html/projects/aha-api/app/Models/OldDB2/Customer.php
Back
<?php namespace App\Models\OldDB2; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Customer extends Model { use HasFactory; protected $connection = 'old_db2'; protected $table = 'customer'; public $incrementing = false; protected $keyType = 'string'; protected $appends = [ 'dms_id', ]; // Automatically generate UUID when creating a new model instance protected static function boot() { parent::boot(); static::creating(function ($model) { if (empty($model->{$model->getKeyName()})) { $model->{$model->getKeyName()} = (string) Str::uuid(); } }); } public function getDmsIdAttributes() { $id = null; $dms = \App\Models\OldDb2\CustomerDMS::where('customer_record_id', $this->id)->first(); if($dms) $id = $dms->customer_dms_id; return $id; } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings