💲
Laravel Payable
  • Laravel Payable
  • Introduction
  • Installation
  • Usages
  • Fiscal
  • Payment
  • Payment History
  • Payment Gateway
  • Payabel Facade
  • Configurations
Powered by GitBook
On this page
  • HasPayable Available methods

Usages

Payment is polymorphic, hence with the use of trait HasPayable can be used with any model.

use Pratiksh\Payable\Traits\HasPayable;

class Product extends Model
{
    use  HasPayable;
}

HasPayable Available methods

payments

returns Illuminate\Database\Eloquent\Relations\MorphMany

Retrieves the model payments record. payments is polymorphic relation

$product->payments;

pay

parameter

  • amount (float) : Payment amount to be registered

returns

  • Pratiksh\Payable\Models\Payment

$product->pay(100)

modifyPay

parameter

  • payment(Pratiksh\Payable\Models\Payment) : Payment instance to be updated

  • amount (float) : Payment amount to be updated

returns

  • Pratiksh\Payable\Models\Payment

$product->modifyPay($product->payments()->latest()->first(),200) // Modified from 100 to 200

PreviousInstallationNextFiscal

Last updated 1 year ago