Skip to content

Commit

Permalink
feat: Add DownloadableProduct model with relations
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent ffce159 commit 637f1d7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/Models/DownloadableProduct.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class DownloadableProduct extends Model
{
protected $fillable = [
'product_id',
'file_url',
'download_limit',
'expiration_time',
];

public function product(): BelongsTo
{
return $this->belongsTo(Product::class, 'product_id');
}
}

0 comments on commit 637f1d7

Please sign in to comment.