# fluent-cart/1.3.23/app/Models/TaxRate.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.3.23. 57 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.3.23/code/app/Models/TaxRate.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.3.23/raw/app/Models/TaxRate.php
- Modified: 2025-11-20T13:11:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.3.23/code/app/Models/TaxRate.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Models;

use FluentCart\App\Helpers\AddressHelper;

/**
 *  Meta Model - DB Model for Meta table
 *
 *  Database Model
 *
 * @package FluentCart\App\Models
 *
 * @version 1.0.0
 */
class TaxRate extends Model
{
	protected $table = 'fct_tax_rates';

    public $timestamps = false;

	protected $primaryKey = 'id';

	protected $guarded = [ 'id' ];

	protected $fillable = [
		'class_id',
		'country',
		'state',
		'postcode',
		'city',
		'rate',
		'name',
        'group',
		'priority',
		'is_compound',
		'for_shipping',
		'for_order',
		'class_id'
	];

    protected $appends = ['formatted_state'];

	public function tax_class() {
		return $this->belongsTo( TaxClass::class, 'class_id', 'id' );
	}

    public function getFormattedStateAttribute()
    {
        if (!empty($this->state)) {
            return AddressHelper::getStateNameByCode($this->state, $this->country);
        }
        return '';
    }

}

```
