%PDF- %PDF-
Direktori : /www/loslex/demo/app/Models/ |
Current File : /www/loslex/demo/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); } }