*/ protected $casts = [ 'schema_json' => 'array', 'is_published' => 'boolean', ]; public function competition(): BelongsTo { return $this->belongsTo(Competition::class); } public function competitionsUsingAsForm(): HasMany { return $this->hasMany(Competition::class, 'form_schema_id'); } public function competitionsUsingAsReview(): HasMany { return $this->hasMany(Competition::class, 'review_form_schema_id'); } public function scopeSignup($query) { return $query->where('purpose', self::PURPOSE_SIGNUP); } public function scopeReview($query) { return $query->where('purpose', self::PURPOSE_REVIEW); } }