BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
app
/
Models
/
Team
📤 Upload
📝 New File
📁 New Folder
Close
Editing: Team.php
<?php namespace App\Models\Team; use App\Models\User; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; class Team extends Model { protected $fillable = [ 'user_id', 'is_shared', 'name', 'allow_seats', 'used_image_credit', 'word_credit', 'entity_credits', ]; protected $casts = [ 'entity_credits' => 'array', ]; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function members(): HasMany { return $this->hasMany(TeamMember::class, 'team_id'); } public function getCredit(string $engineKey, string $entityKey): array { return $this->entity_credits[$engineKey][$entityKey] ?? [ 'credit' => 0, 'isUnlimited' => false, ]; } }
Save
Cancel