File manager - Edit - /home/autoph/public_html/projects/aha-api/app/Models/OldDB2/Vehicle.php
Back
<?php namespace App\Models\OldDB2; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Str; class Vehicle extends Model { use HasFactory; protected $connection = 'old_db2'; protected $table = 'vehicle'; public $timestamps = false; protected $keyType = 'int'; public $incrementing = false; protected static function boot() { parent::boot(); static::creating(function ($model) { if (empty($model->id)) { $model->id = \DB::selectOne('SELECT UUID_SHORT() AS uuid')->uuid; } }); } protected $guarded = [ ]; public function brand() { return $this->hasOne(\App\Models\OldDB2\Brand::class,'id','brand_id'); } public function car_model() { return $this->hasOne(\App\Models\OldDB2\CarModel::class,'id','model_id'); } public function owner() { return $this->hasOne(\App\Models\OldDB2\Customer::class,'id','customer_record_id'); } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings