File: /var/www/vhost/disk-apps/comfama.sports-crowd.com/app/Models/Membership.php
<?php
namespace App\Models;
use App\Models\Concerns\PageSize;
use App\PaymentTransaction;
use App\Tag;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Membership extends Model
{
use PageSize;
protected $fillable = [
'name',
'description',
'price',
'billing_interval',
'conditions',
'terms_text',
'terms_confirm',
'terms_and_conditions',
'action',
'deliverable',
];
protected $casts = [
'price' => 'float',
'active' => 'boolean',
'deliverable' => 'boolean',
];
public function tags(): BelongsToMany
{
return $this->belongsToMany(Tag::class, 'membership_tags')->withTimestamps();
}
function payment_transaction(): BelongsTo
{
return $this->belongsTo(PaymentTransaction::class)->with('gateway_payments');
}
}