SUBD_Transport_Company/app/Models/Car.php

24 lines
416 B
PHP
Raw Normal View History

2024-01-10 11:38:25 +04:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2024-01-10 11:38:25 +04:00
class Car extends Model
{
use HasFactory;
protected $fillable = [
'name',
'number',
'driver_id',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
2024-01-10 11:38:25 +04:00
}