Files
kopalnia_2026/app/Models/Engine.php
T
2026-09-03 12:21:17 +02:00

29 lines
746 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/** Silnik - katalog (legacy site204). Tabela seg_engines (database-first). */
class Engine extends Model
{
protected $connection = 'softspm';
protected $table = 'seg_engines';
protected $primaryKey = 'ENG_ID';
public $timestamps = false;
protected $guarded = [];
public function manufacturer(): BelongsTo
{
return $this->belongsTo(Manufacturer::class, 'ENG_MCF_ID', 'MCF_ID');
}
/** Tylko widoczne (ENG_STATUS='1'). */
public function scopeVisible(Builder $q): Builder
{
return $q->where('ENG_STATUS', '1');
}
}