MOON
Server: Apache
System: Linux 101-53-147-124.cprapid.com 4.18.0-553.121.1.el8_10.x86_64 #1 SMP Thu Apr 30 09:06:34 EDT 2026 x86_64
User: clientsoftwares (1005)
PHP: 8.2.30
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/clientsoftwares/public_html/stocky.clientsoftwares.com/app/SuperAdmin/Models/Subscription.php
<?php

namespace App\SuperAdmin\Models;

use App\Models\Company;
use Illuminate\Database\Eloquent\Builder;
use Laravel\Cashier\Subscription as CashierSubscription;

class Subscription extends CashierSubscription
{

    protected static function boot()
    {
        parent::boot();

        static::addGlobalScope('stripe', function (Builder $builder) {
            $builder->where('subscriptions.payment_method', 'stripe');
        });
    }

    public function scopePaypal($query)
    {
        return $query->where('payment_method', 'paypal');
    }

    // public function scopeStripe($query)
    // {
    //     return $query->where('payment_method', 'stripe');
    // }

    public function scopeRazorpay($query)
    {
        return $query->where('payment_method', 'razorpay');
    }

    public function scopePaystack($query)
    {
        return $query->where('payment_method', 'paystack');
    }

    public function scopeMollie($query)
    {
        return $query->where('payment_method', 'mollie');
    }

    public function scopeAuthorize($query)
    {
        return $query->where('payment_method', 'authorize');
    }

    public function company()
    {
        return $this->belongsTo(Company::class);
    }
}