mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
39 lines
733 B
PHP
39 lines
733 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Reward extends AbstractModel
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'rewards';
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'deleted_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function milestones()
|
|
{
|
|
return $this->belongsToMany(Milestone::class, MilestoneReward::class);
|
|
}
|
|
|
|
/**
|
|
* @return HasMany
|
|
*/
|
|
public function users(): HasMany
|
|
{
|
|
return $this->HasMany(UserReward::class, 'reward_id', 'id');
|
|
}
|
|
}
|