abschlussprojekt-device-man.../device-app/app/Models/PurchasingInformation.php

40 lines
1.0 KiB
PHP
Raw Normal View History

2023-03-28 22:17:54 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
2023-03-28 22:17:54 +02:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
2023-03-29 22:32:49 +02:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2023-03-28 22:17:54 +02:00
class PurchasingInformation extends Model
{
use HasFactory, HasUuids;
2023-03-28 22:17:54 +02:00
2023-03-29 22:32:49 +02:00
/**
* The table associated with the model.
* @var string
*/
protected $table = 'purchasing_information';
2023-03-28 22:17:54 +02:00
/**
* 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'];
2023-03-29 22:32:49 +02:00
public function device(): BelongsTo {
return $this->belongsTo(Device::class, 'device_id', 'device_id');
2023-03-28 22:17:54 +02:00
}
2023-03-29 22:32:49 +02:00
//Timestamps are disabled.
public $timestamps = false;
2023-03-28 22:17:54 +02:00
}