Inheritance diagram for App\Models\Setting:

Public Member Functions

 lar_ver ()
 
 show_custom_css ()
 

Static Public Member Functions

static getSettings ()
 
static getDefaultEula ()
 
static fileSizeConvert ($bytes)
 Converts bytes into human readable file size. More...
 

Public Attributes

 qr_text
 

Protected Attributes

 $injectUniqueIdentifier = true
 
 $rules
 
 $fillable = ['site_name']
 

Detailed Description

Definition at line 7 of file Setting.php.

Member Function Documentation

static App\Models\Setting::fileSizeConvert (   $bytes)
static

Converts bytes into human readable file size.

Parameters
string$bytes
Returns
string human readable file size (2,87 Мб)
Author
Mogilev Arseny

Definition at line 78 of file Setting.php.

79  {
80  $bytes = floatval($bytes);
81  $arBytes = array(
82  0 => array(
83  "UNIT" => "TB",
84  "VALUE" => pow(1024, 4)
85  ),
86  1 => array(
87  "UNIT" => "GB",
88  "VALUE" => pow(1024, 3)
89  ),
90  2 => array(
91  "UNIT" => "MB",
92  "VALUE" => pow(1024, 2)
93  ),
94  3 => array(
95  "UNIT" => "KB",
96  "VALUE" => 1024
97  ),
98  4 => array(
99  "UNIT" => "B",
100  "VALUE" => 1
101  ),
102  );
103 
104  foreach ($arBytes as $arItem) {
105  if ($bytes >= $arItem["VALUE"]) {
106  $result = $bytes / $arItem["VALUE"];
107  $result = round($result, 2) .$arItem["UNIT"];
108  break;
109  }
110  }
111  return $result;
112  }
static App\Models\Setting::getDefaultEula ( )
static

Definition at line 49 of file Setting.php.

50  {
51 
52  $Parsedown = new \Parsedown();
53  if (Setting::getSettings()->default_eula_text) {
54  return $Parsedown->text(e(Setting::getSettings()->default_eula_text));
55  } else {
56  return null;
57  }
58 
59  }
static getSettings()
Definition: Setting.php:33
static App\Models\Setting::getSettings ( )
static

Definition at line 33 of file Setting.php.

34  {
35  static $static_cache = null;
36 
37  if (!$static_cache) {
38  $static_cache = Setting::first();
39  }
40  return $static_cache;
41  }
App\Models\Setting::lar_ver ( )

Definition at line 43 of file Setting.php.

44  {
45  $app = \App::getFacadeApplication();
46  return $app::VERSION;
47  }
App\Models\Setting::show_custom_css ( )

Definition at line 61 of file Setting.php.

62  {
63  $custom_css = Setting::getSettings()->custom_css;
64  $custom_css = e($custom_css);
65  // Needed for modifying the bootstrap nav :(
66  $custom_css = str_ireplace('script', 'SCRIPTS-NOT-ALLOWED-HERE', $custom_css);
67  $custom_css = str_replace('>', '>', $custom_css);
68  return $custom_css;
69  }
static getSettings()
Definition: Setting.php:33

Member Data Documentation

App\Models\Setting::$fillable = ['site_name']
protected

Definition at line 31 of file Setting.php.

App\Models\Setting::$injectUniqueIdentifier = true
protected

Definition at line 9 of file Setting.php.

App\Models\Setting::$rules
protected
Initial value:
= [
"brand" => 'required|min:1|numeric'

Definition at line 12 of file Setting.php.

App\Models\Setting::qr_text
Initial value:
=> 'min:1|max:31',
"custom_css" => 'string',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'string',
"ldap_server" => 'sometimes|required_if:ldap_enabled,1|url',
"ldap_uname" => 'sometimes|required_if:ldap_enabled,1',
"ldap_pword" => 'sometimes|required_if:ldap_enabled,1',
"ldap_basedn" => 'sometimes|required_if:ldap_enabled,1',
"ldap_filter" => 'sometimes|required_if:ldap_enabled,1',
"ldap_username_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_lname_field" => 'sometimes|required_if:ldap_enabled,1',
"ldap_auth_filter_query" => 'sometimes|required_if:ldap_enabled,1',
"ldap_version" => 'sometimes|required_if:ldap_enabled,1',
]

Definition at line 14 of file Setting.php.


The documentation for this class was generated from the following file: