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

PlanPrice::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 Illuminate\Database\Eloquent\Model;
6
use Spatie\Activitylog\Traits\LogsActivity;
7
8
class PlanPrice extends Model
9
{
10
	use LogsActivity;
11
    protected $table = 'plan_prices';
12
    protected $fillable = ['plan_id', 'currency', 'add_price', 'renew_price'];
13
     protected static $logName = 'Plan Price';
14
    protected static $logAttributes = ['plan_id', 'currency', 'add_price', 'renew_price'];
15
    protected static $logOnlyDirty = true;
16
17
    public function getDescriptionForEvent(string $eventName): string
18
    {
19
        if ($eventName == 'created') {
20
            return 'Plan Price with Id <strong> '.$this->plan_id.' </strong> was created';
21
        }
22
23
        if ($eventName == 'updated') {
24
            return 'Plan Price with Id<strong> '.$this->plan_id.'</strong> was updated';
25
        }
26
27
        if ($eventName == 'deleted') {
28
            return 'Plan Price with Id<strong> '.$this->plan_id.' </strong> was deleted';
29
        }
30
31
        return '';
32
33
        // return "Product  has been {$eventName}";
34
         // \Auth::user()->activity;
35
    }
36
}
37