first commit

This commit is contained in:
2025-04-24 23:28:22 +03:30
commit c0d0b95442
116 changed files with 14014 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Models;
use App\Traits\HasUuid;
use DateTimeInterface;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Model;
class Transaction extends Model
{
use HasUuid, Filterable;
protected $guarded = [];
const STATUSES = [
'pending' => 1,
'success' => 2,
'consumed' => 3,
'failed' => 3,
];
const GATEWAYS = [
'asanpardakht' => 1,
'zarinpal' => 2,
'digipay' => 3,
'cafe' => 4,
'myket' => 5,
];
public function user()
{
return $this->belongsTo(User::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
}