29 lines
586 B
PHP
29 lines
586 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class ServiceTicket extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = [
|
||
|
|
'user_id', 'tool_id', 'contact', 'requirement', 'quote_cents', 'status', 'delivery_note',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected function casts(): array
|
||
|
|
{
|
||
|
|
return ['quote_cents' => 'integer'];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function user(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function tool(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Tool::class);
|
||
|
|
}
|
||
|
|
}
|