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

visavi / rotor / 26723576697

31 May 2026 08:27PM UTC coverage: 14.172% (-0.4%) from 14.618%
26723576697

push

github

visavi
Перенес файлы обновлений бд в отдельную папку

785 of 5539 relevant lines covered (14.17%)

1.26 hits per line

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

0.0
/app/Models/Setting.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Models;
6

7
use Exception;
8
use Illuminate\Database\Eloquent\Model;
9
use Illuminate\Support\Facades\Cache;
10

11
/**
12
 * Class Setting
13
 *
14
 * @property string $name
15
 * @property string $value
16
 */
17
class Setting extends Model
18
{
19
    /**
20
     * Indicates if the model should be timestamped.
21
     */
22
    public $timestamps = false;
23

24
    /**
25
     * The attributes that aren't mass assignable.
26
     */
27
    protected $guarded = [];
28

29
    /**
30
     * Возвращает список допустимых страниц настроек
31
     */
32
    public static function getActions(): array
×
33
    {
34
        return [
×
35
            'mains',
×
36
            'mails',
×
37
            'info',
×
38
            'comments',
×
39
            'messages',
×
40
            'blogs',
×
41
            'pages',
×
42
            'others',
×
43
            'protects',
×
44
            'prices',
×
45
            'files',
×
46
            'stickers',
×
47
            'feeds',
×
48
            'seo',
×
49
        ];
×
50
    }
51

52
    /**
53
     * Возвращает настройки сайта по ключу
54
     */
55
    public static function getSettings(): array
×
56
    {
57
        try {
58
            return Cache::rememberForever('settings', static function () {
×
59
                $settings = Setting::query()
×
60
                    ->pluck('value', 'name')
×
61
                    ->all();
×
62

63
                return array_map(static function ($value) {
×
64
                    if (is_numeric($value)) {
×
65
                        return ! str_contains($value, '.') ? (int) $value : (float) $value;
×
66
                    }
67

68
                    return $value === '' ? null : $value;
×
69
                }, $settings);
×
70
            });
×
71
        } catch (Exception) {
×
72
            return [];
×
73
        }
74
    }
75
}
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