abschlussprojekt-device-man.../device-app/app/Models/OwnerTransaction.php
2023-03-29 22:32:49 +02:00

40 lines
930 B
PHP

<?php
namespace App\Models;
use App\Models\Device;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class OwnerTransaction extends Model
{
use HasFactory;
/**
* The table associated with the model.
* @var string
*/
protected $table = 'owner_transactions';
/**
* The primary key associated with the devices table.
* @var string
*/
protected $primaryKey = 'owner_transaction_id';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = ['owner_transaction_id', 'rz_username', 'timestamp_owner_since', 'device_id'];
public function device(): BelongsTo {
return $this->belongsTo(Device::class, 'device_id', 'device_id');
}
//Timestamps are disabled.
public $timestamps = false;
}