2023-06-21 09:53:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Wallet extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
protected $table = 'wallets';
|
|
|
|
|
|
|
|
protected $dates = ['created_at', 'updated_at'];
|
|
|
|
|
2023-12-14 12:33:03 -05:00
|
|
|
protected $casts = [
|
|
|
|
'created_at' => 'datetime',
|
|
|
|
'updated_at' => 'datetime',
|
|
|
|
];
|
|
|
|
|
2023-06-21 09:53:21 -04:00
|
|
|
public function walletType()
|
|
|
|
{
|
|
|
|
return $this->hasOne(WalletType::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->hasOneThrough(User::class, Artist::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function artist()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Artist::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|