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

SameOldNick / SameOldWebsite / 21471360437

29 Jan 2026 08:41AM UTC coverage: 87.487% (-0.02%) from 87.511%
21471360437

push

github

web-flow
Continues to next action if tests fail

28499 of 32575 relevant lines covered (87.49%)

696.55 hits per line

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

94.44
/app/Models/FilesystemConfiguration.php
1
<?php
2

3
namespace App\Models;
4

5
use App\Components\Backup\Contracts\FilesystemConfiguration as FilesystemConfigurationContract;
6
use Illuminate\Database\Eloquent\Casts\Attribute;
7
use Illuminate\Database\Eloquent\Factories\HasFactory;
8
use Illuminate\Database\Eloquent\Model;
9

10
/**
11
 * @property int $id
12
 * @property string $name
13
 * @property string $disk_type
14
 * @property bool $is_active
15
 * @property string $configurable_type
16
 * @property int $configurable_id
17
 * @property string $driver_name
18
 * @property-read ?Model $configurable
19
 * @property ?Carbon $created_at
20
 * @property ?Carbon $updated_at
21
 */
22
class FilesystemConfiguration extends Model implements FilesystemConfigurationContract
23
{
24
    /** @use HasFactory<\Database\Factories\FilesystemConfigurationFactory> */
25
    use HasFactory;
26

27
    /**
28
     * The attributes that are mass assignable.
29
     *
30
     * @var array<int, string>
31
     */
32
    protected $fillable = [
33
        'name',
34
        'disk_type',
35
        'is_active',
36
    ];
37

38
    /**
39
     * The relations to eager load on every query.
40
     *
41
     * @var array
42
     */
43
    protected $with = [
44
        'configurable',
45
    ];
46

47
    public function configurable()
48
    {
49
        return $this->morphTo();
66✔
50
    }
51

52
    /**
53
     * {@inheritDoc}
54
     */
55
    public function getFilesystemConfig(): array
56
    {
57
        $options =
39✔
58
            $this->configurable instanceof FilesystemConfigurationContract ?
39✔
59
            $this->configurable->getFilesystemConfig() :
39✔
60
            [];
×
61

62
        return [
39✔
63
            'name' => $this->name,
39✔
64
            'driver' => $this->disk_type,
39✔
65
            ...$options,
39✔
66
        ];
39✔
67
    }
68

69
    /**
70
     * Gets the driver name
71
     * Used to pull the configuration from the filesystem manager
72
     */
73
    protected function driverName(): Attribute
74
    {
75
        return Attribute::get(fn ($value, $attributes = []) => "dynamic-{$attributes['name']}");
30✔
76
    }
77

78
    public function toArray()
79
    {
80
        return [
54✔
81
            $this->getKeyName() => $this->getKey(),
54✔
82
            'is_active' => $this->is_active,
54✔
83
            'name' => $this->name,
54✔
84
            'type' => $this->disk_type,
54✔
85
            ...$this->configurable->toArray(),
54✔
86
        ];
54✔
87
    }
88
}
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