File manager - Edit - /home/autoph/public_html/projects/aha-api/app/Models/OldDB2/BatchUpload.php
Back
<?php namespace App\Models\OldDB2; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class BatchUpload extends Model { use HasFactory, SoftDeletes; protected $connection = 'old_db2'; protected $table = 'batch_uploads'; /** * The attributes that are NOT mass assignable. * */ protected $guarded = [ 'deleted_at', ]; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; protected $appends = [ 'total_records', 'need_updates', ]; public function getTotalRecordsAttribute() { $total = 0; $total = \App\Models\OldDB2\Service::where('batch_upload_id', $this->id)->count(); return $total; } public function getNeedUpdatesAttribute() { $total = 0; $total = \App\Models\OldDB2\Service::where('batch_upload_id', $this->id)->where('need_update', 1)->count(); return $total; } }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings