*/ protected $with = ['prize']; // * EVENTS /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { static::creating(function () { InstantWin::removeCached(); Prize::removeCached(); }); static::updating(function () { InstantWin::removeCached(); Prize::removeCached(); }); static::deleting(function () { InstantWin::removeCached(); Prize::removeCached(); }); } // * RELATIONSHIPS /** * BelongsTo Prize relation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function prize(): BelongsTo { return $this->belongsTo(Prize::class, 'prize_id'); } /** * One to one relation participation * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function participation(): BelongsTo { return $this->belongsTo(Participation::class); } /** * Activities logs One-to-many relationship. * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function activityLogs(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(ActivityLog::class); } }