-
Notifications
You must be signed in to change notification settings - Fork 0
/
Setting.php
73 lines (64 loc) · 1.72 KB
/
Setting.php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace Modules\Core;
use Illuminate\Database\Eloquent\Model;
use Vinkla\Hashids\Facades\Hashids;
use Codesleeve\Stapler\ORM\StaplerableInterface;
use Codesleeve\Stapler\ORM\EloquentTrait;
class Setting extends Model implements StaplerableInterface
{
use EloquentTrait;
protected $guarded = [];
protected $table = 'cwa_settings';
protected $fillable = [
'mailchimp_api_key',
'getresponse_api_key',
'jvzoo_secret',
'warriorplus_api_key',
'warriorplus_security_key',
'aweber_code',
'mail_driver',
'mail_host',
'mail_port',
'mail_encryption',
'mail_username',
'mail_password',
'mail_from_name',
'mail_from_email',
'application_title',
'support_link',
'footer_links',
'custom_text',
'allow_public_signup',
'maintenance_mode',
'application_logo',
'master_password',
'allow_reset_password',
'allow_change_password',
'allow_change_email'
];
public function __construct(array $attributes = array())
{
$this->hasAttachedFile('application_logo', [
'styles' => [
'medium' => '300x300',
'thumb' => '100x100'
]
]);
parent::__construct($attributes);
}
public function uniqueid()
{
$uniqueId = Hashids::encode($this->id);
return $uniqueId;
}
public static function originalid($value)
{
$originalId = Hashids::decode($value)[0];
return $originalId;
}
public static function mail()
{
$mailConfiguration = Setting::find(1);
return $mailConfiguration;
}
}