File manager - Edit - /home/autoph/public_html/projects/aha-api/app/Models/OldDB2/Company.php
Back
<?php namespace App\Models\OldDB2; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Company extends Model { use HasFactory; protected $connection = 'old_db2'; protected $table = 'source_company'; protected $guarded = [ ]; protected $appends = [ 'dealerships' ]; public function getDealershipsAttribute() { $records = \App\Models\OldDB2\Dealership::select('source_dealer.*') ->distinct('source_dealer.id') ->join('source_company_dealer', 'source_dealer.id', '=', 'source_company_dealer.dealer_id') ->where('source_company_dealer.company_id', $this->id) ->where('source_dealer.status', 1) ->get(); return $records; } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings