28 lines
509 B
PHP
28 lines
509 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class EarningAccount extends Model
|
|
{
|
|
protected $fillable = [];
|
|
protected $guarded = [];
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
|
}
|
|
|
|
public function earnings()
|
|
{
|
|
return $this->hasMany(Earning::class, 'user_id', 'user_id');
|
|
}
|
|
|
|
public function withdraws()
|
|
{
|
|
return $this->hasMany(EarningWithdraw::class, 'user_id', 'user_id');
|
|
}
|
|
|
|
|
|
}
|