Issues (77)

src/Models/Payroll/Payroll.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace CleaniqueCoders\OpenPayroll\Models\Payroll;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class Payroll extends Model
9
{
10
    use SoftDeletes;
11
12
    protected $guarded = ['id'];
13
14
    protected $casts = [
15
        'date' => 'datetime:Y-m-d',
16
    ];
17
18
    public function getTitleAttribute()
19
    {
20
        return 'Payroll for ' . \Carbon\Carbon::parse($this->year . '-' . $this->month . '-1')->format('M') . ' ' . $this->year;
0 ignored issues
show
The property month does not seem to exist on CleaniqueCoders\OpenPayroll\Models\Payroll\Payroll. 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...
The property year does not seem to exist on CleaniqueCoders\OpenPayroll\Models\Payroll\Payroll. 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...
21
    }
22
23
    public function user()
24
    {
25
        return $this->belongsTo(config('open-payroll.models.user'));
26
    }
27
28
    public function payslips()
29
    {
30
        return $this->hasMany(config('open-payroll.models.payslip'));
31
    }
32
33
    public function status()
34
    {
35
        return $this->hasOne(config('open-payroll.models.payroll_status'));
36
    }
37
}
38