$services * @property-read int|null $services_count * @method static \Illuminate\Database\Eloquent\Builder|Membership newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|Membership newQuery() * @method static \Illuminate\Database\Eloquent\Builder|Membership query() * @method static \Illuminate\Database\Eloquent\Builder|Membership whereAdminId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereAmount($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereDeletedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereDolibarrId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereDolibarrUserId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereEndDate($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereMemberId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereNotePrivate($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereNotePublic($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership wherePackageId($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership wherePaymentMethod($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership wherePaymentStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereStartDate($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereStatus($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|Membership whereValidationDate($value) * @mixin \Eloquent */ class Membership extends Model { protected $fillable = [ 'member_id', 'admin_id', 'package_id', 'start_date', 'end_date', 'status', 'validation_date', 'payment_method', 'amount', 'payment_status', 'note_public', 'note_private', 'dolibarr_id', 'dolibarr_user_id' ]; public static function getAttributeLabel(string $attribute): string { return __("memberships.fields.$attribute"); } public function member(): BelongsTo { return $this->belongsTo(Member::class); } public function author(): BelongsTo { return $this->belongsTo(User::class, 'admin_id'); } public function package(): BelongsTo { return $this->belongsTo(Package::class); } public function services(): BelongsToMany { return $this->belongsToMany(Service::class, 'services_memberships', 'membership_id', 'service_id'); } }