<?php

namespace App\Models;

use App\Models\Backoffice\Support\ContentTypeModel;
use App\Models\Backoffice\Traits\LanguageSupportTrait;

class GlobalConfiguration extends ContentTypeModel
{
    use LanguageSupportTrait;

    protected $hidden = ['languages', "websites"];
    protected $with = ['languages', "websites"];

    protected $casts = [
    ];

    public function competitionsTopAds()
    {
        return $this->belongsToMany(Advertisement::class, 'ads_global_conf_competitions_top', 'global_configuration_id', 'advertisement_id');
    }

    public function resultsTopAds()
    {
        return $this->belongsToMany(Advertisement::class, 'ads_global_conf_results_top', 'global_configuration_id', 'advertisement_id');
    }

    public function jobsTopAds()
    {
        return $this->belongsToMany(Advertisement::class, 'ads_global_conf_jobs_top', 'global_configuration_id', 'advertisement_id');
    }

    public function officeProfilesTopAds()
    {
        return $this->belongsToMany(Advertisement::class, 'ads_global_conf_office_profiles_top', 'global_configuration_id', 'advertisement_id');
    }
}
