| Current Path : /home/users/unlimited/www/whatsapp-crm/app/Models/ |
| Current File : /home/users/unlimited/www/whatsapp-crm/app/Models/BillingPayment.php |
<?php
namespace App\Models;
use App\Helpers\DateTimeHelper;
use App\Http\Traits\HasUuid;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class BillingPayment extends Model {
use HasFactory;
use HasUuid;
protected $guarded = [];
public $timestamps = false;
public function listAll($searchTerm, $organizationId = null)
{
return $this->with(['organization'])
->when($organizationId !== null, function ($query) use ($organizationId) {
return $query->where('organization_id', $organizationId);
})
->latest()
->paginate(10);
}
public function organization()
{
return $this->belongsTo(Organization::class, 'organization_id', 'id');
}
}