• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RonasIT / laravel-empty-project / 13411912453

19 Feb 2025 11:54AM UTC coverage: 97.421%. Remained the same
13411912453

Pull #119

github

web-flow
Merge 843fa04c3 into 1defefe39
Pull Request #119: #118: chore: remove unused fixed version from composer.json

340 of 349 relevant lines covered (97.42%)

10.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/app/Models/User.php
1
<?php
2

3
namespace App\Models;
4

5
use Illuminate\Database\Eloquent\Factories\HasFactory;
6
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
use Illuminate\Foundation\Auth\User as Authenticatable;
8
use Illuminate\Notifications\Notifiable;
9
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
10
use RonasIT\Support\Traits\ModelTrait;
11

12
class User extends Authenticatable implements JWTSubject
13
{
14
    use HasFactory;
15
    use ModelTrait;
16
    use Notifiable;
17

18
    protected $fillable = [
19
        'name',
20
        'email',
21
        'password',
22
        'role_id',
23
    ];
24

25
    protected $hidden = [
26
        'password',
27
        'remember_token',
28
    ];
29

30
    public function getJWTIdentifier(): int
31
    {
32
        return $this->getKey();
55✔
33
    }
34

35
    public function getJWTCustomClaims(): array
36
    {
37
        return [];
55✔
38
    }
39

40
    public function role(): BelongsTo
41
    {
42
        return $this->belongsTo(Role::class);
3✔
43
    }
44

45
    public function isAdmin(): bool
46
    {
47
        return $this->role_id === Role::ADMIN;
34✔
48
    }
49

50
    public function isUser(): bool
51
    {
52
        return $this->role_id === Role::USER;
×
53
    }
54

55
    protected function casts(): array
56
    {
57
        return [
61✔
58
            'password' => 'hashed',
61✔
59
        ];
61✔
60
    }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc