Skip to content

Commit

Permalink
cra image model
Browse files Browse the repository at this point in the history
  • Loading branch information
stazrouti committed Sep 16, 2024
1 parent 6153886 commit a0d903d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rental-car-backend/app/Models/CarImage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CarImage extends Model
{
use HasFactory;
protected $fillable = [
'car_id', 'image_path',
];

// An image belongs to a car
public function car()
{
return $this->belongsTo(Car::class);
}
}

0 comments on commit a0d903d

Please sign in to comment.