Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Załącznik wyposażenia (legacy seg_equipments_files) - plik trzymany jako BLOB
|
||||
* w bazie (EQF_FILE mediumblob). Rola pliku wynika z prefiksu MIME:
|
||||
* 'image/*' = zdjęcie, pozostałe (np. 'application/pdf') = dokumentacja.
|
||||
*/
|
||||
class EquipmentFile extends Model
|
||||
{
|
||||
protected $connection = 'softspm';
|
||||
protected $table = 'seg_equipments_files';
|
||||
protected $primaryKey = 'EQF_ID';
|
||||
public $timestamps = false;
|
||||
protected $guarded = [];
|
||||
|
||||
/** Czy to plik graficzny (zdjęcie). */
|
||||
public function isImage(): bool
|
||||
{
|
||||
return str_starts_with(strtolower((string) $this->EQF_FILE_TYPE), 'image/');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user