fix: correct polymorphic relations in comment, favorite and payment models

This commit is contained in:
2026-08-17 08:13:02 +03:30
parent 42be8ce894
commit ed02b45269
3 changed files with 82 additions and 74 deletions
+22 -17
View File
@@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Payment
*
*
* @property int $id
* @property int $user_id
* @property int $payable_id
@@ -26,22 +26,27 @@ use Illuminate\Database\Eloquent\Model;
*/
class Payment extends Model
{
protected $table = 'payments';
public static $snakeAttributes = false;
protected $table = 'payments';
public static $snakeAttributes = false;
protected $casts = [
'user_id' => 'int',
'payable_id' => 'int',
'amount' => 'float',
'status' => 'int'
];
protected $casts = [
'user_id' => 'int',
'payable_id' => 'int',
'amount' => 'float',
'status' => 'int'
];
protected $fillable = [
'user_id',
'payable_id',
'amount',
'authority',
'transaction_id',
'status'
];
protected $fillable = [
'user_id',
'payable_id',
'amount',
'authority',
'transaction_id',
'status'
];
public function user()
{
return $this->belongsTo(User::class);
}
}