45 lines
787 B
PHP
45 lines
787 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class KarmaPointsTransaction extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'pointable_id',
|
|
'pointable_type',
|
|
'user_id',
|
|
'message',
|
|
'points',
|
|
'key',
|
|
'trasaction_type',
|
|
'properties',
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'properties' => 'json',
|
|
];
|
|
|
|
/**
|
|
* Get the parent pointable model.
|
|
*/
|
|
public function pointable()
|
|
{
|
|
return $this->morphTo();
|
|
}
|
|
}
|