abschlussprojekt-device-man.../device-app/app/Models/PurchasingInformation.php
2023-03-30 15:16:38 +02:00

40 lines
1.0 KiB
PHP

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