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