File size: 734 Bytes
8baf129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SiteSetting extends Model
{
    protected $table = 'site_settings';

    protected $fillable = [
        'storage_mode',
        'local_path',
        'ftp_hostname',
        'ftp_port',
        'ftp_user',
        'ftp_pass',
        'ftp_path',
        'r2_bucket',
        'r2_key',
        'r2_secret',
        'r2_endpoint',
        'gdrive_client_id',
        'gdrive_client_secret',
        'gdrive_redirect_uri',
        'gdrive_shared_drive_id',
        'gdrive_mode'
    ];

    protected $casts = [
        'ftp_port' => 'integer',
    ];

    public static function getSettings()
    {
        return static::firstOrCreate(['id' => 1]);
    }
}