57 lines
1.3 KiB
PHP
57 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\User;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class IncentiveNewPartner
|
|
*
|
|
* @property int $id
|
|
* @property int $participant_id
|
|
* @property int $user_id
|
|
* @property Carbon $registered_at
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
* @property-read IncentiveParticipant $participant
|
|
* @property-read User $user
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, IncentivePointsLog> $pointsLogs
|
|
*
|
|
* @mixin \Eloquent
|
|
*/
|
|
class IncentiveNewPartner extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'incentive_new_partners';
|
|
|
|
protected $casts = [
|
|
'participant_id' => 'int',
|
|
'user_id' => 'int',
|
|
'registered_at' => 'datetime',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'participant_id',
|
|
'user_id',
|
|
'registered_at',
|
|
];
|
|
|
|
public function participant()
|
|
{
|
|
return $this->belongsTo(IncentiveParticipant::class, 'participant_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function pointsLogs()
|
|
{
|
|
return $this->hasMany(IncentivePointsLog::class, 'incentive_new_partner_id');
|
|
}
|
|
}
|