Added routes, admin statistics to the controller and added models for coin transaction and coin transaction type
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CoinTransaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'coin_transactions';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'transaction_datetime',
|
||||
'user_id',
|
||||
'match_id',
|
||||
'game_id',
|
||||
'coin_transaction_type_id',
|
||||
'coins',
|
||||
'custom'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'transaction_datetime' => 'datetime',
|
||||
'custom' => 'array',
|
||||
];
|
||||
|
||||
public function type()
|
||||
{
|
||||
return $this->belongsTo(CoinTransactionType::class, 'coin_transaction_type_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user