Completed
Push — development ( a546b2...2b11c6 )
by Ashutosh
09:55
created

TaxOption::getDescriptionForEvent()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0
cc 4
nc 4
nop 1
1
<?php
2
3
namespace App\Model\Payment;
4
5
use App\BaseModel;
6
use Spatie\Activitylog\Traits\LogsActivity;
7
8
class TaxOption extends BaseModel
9
{
10
	use LogsActivity;
11
    protected $table = 'tax_rules';
12
    protected static $logName = 'Tax Class';
13
    protected static $logAttributes = ['tax_enable', 'inclusive', 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no'];
14
     protected static $logOnlyDirty = true;
15
    protected $fillable = ['tax_enable', 'inclusive', 'shop_inclusive', 'cart_inclusive', 'rounding', 'Gst_no'];
16
17
  
18
   public function getDescriptionForEvent(string $eventName): string
19
    {
20
        if ($eventName == 'created') {
21
            return 'Tax Rule  <strong> '.$this->name.' </strong> was created';
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on App\Model\Payment\TaxOption. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
22
        }
23
24
        if ($eventName == 'updated') {
25
            return 'Tax Rule<strong> '.$this->name.'</strong> was updated';
26
        }
27
28
        if ($eventName == 'deleted') {
29
            return 'Tax Rule<strong> '.$this->name.' </strong> was deleted';
30
        }
31
32
        return '';
33
    }
34
}