@@ -10,55 +10,55 @@ discard block |
||
10 | 10 | |
11 | 11 | class CampaignPageClient extends Model |
12 | 12 | { |
13 | - public static function getJSONArrCampaign($id) |
|
14 | - { |
|
13 | + public static function getJSONArrCampaign($id) |
|
14 | + { |
|
15 | 15 | $arrCampaign = self::getCampaignClientArray($id); |
16 | 16 | return json_encode($arrCampaign); |
17 | - } |
|
17 | + } |
|
18 | 18 | |
19 | - public static function getCampaignClientArray($id) |
|
20 | - { |
|
19 | + public static function getCampaignClientArray($id) |
|
20 | + { |
|
21 | 21 | $campaign = Campaign::find($id); |
22 | 22 | if(!$campaign){ |
23 | - return "Campaign not found!"; |
|
23 | + return "Campaign not found!"; |
|
24 | 24 | } |
25 | 25 | $lang = CampaignPageAdmin::getLangDefault(); |
26 | 26 | |
27 | 27 | $campaignConfigurations = $campaign->campaign_configurations()->first(); |
28 | 28 | $campaignInformations = $campaign->campaign_lang_informations() |
29 | - ->where('campaign_lang',$lang) |
|
30 | - ->first(); |
|
29 | + ->where('campaign_lang',$lang) |
|
30 | + ->first(); |
|
31 | 31 | |
32 | 32 | $arrCampaign = [ |
33 | - "height" => 200, //высота модуля |
|
34 | - "width" => 300, //ширина модуля |
|
35 | - "releaseUrl" => config('app.release_url'), |
|
36 | - "backgroundColor" => ConfigurationPageAdmin::getConfiguration('color_module_background',true), //Колер фона модуля |
|
37 | - "buttonColor" => ConfigurationPageAdmin::getConfiguration('color_module_buttons',true), //Колер кнопак з сумамі |
|
33 | + "height" => 200, //высота модуля |
|
34 | + "width" => 300, //ширина модуля |
|
35 | + "releaseUrl" => config('app.release_url'), |
|
36 | + "backgroundColor" => ConfigurationPageAdmin::getConfiguration('color_module_background',true), //Колер фона модуля |
|
37 | + "buttonColor" => ConfigurationPageAdmin::getConfiguration('color_module_buttons',true), //Колер кнопак з сумамі |
|
38 | 38 | |
39 | - "show_banner" => ConfigurationPageAdmin::getConfiguration('show_banner',true), //Паказваць банэр |
|
40 | - "color_banner_background" => ConfigurationPageAdmin::getConfiguration('color_banner_background',true), //Колер фону банэра |
|
41 | - "color_banner_help_background" => ConfigurationPageAdmin::getConfiguration('color_banner_help_background',true), //Колер кнопкі "Дапамагчы" |
|
42 | - "color_banner_help_text" => ConfigurationPageAdmin::getConfiguration('color_banner_help_text',true), //Колер тэкста "Дапамагчы" |
|
39 | + "show_banner" => ConfigurationPageAdmin::getConfiguration('show_banner',true), //Паказваць банэр |
|
40 | + "color_banner_background" => ConfigurationPageAdmin::getConfiguration('color_banner_background',true), //Колер фону банэра |
|
41 | + "color_banner_help_background" => ConfigurationPageAdmin::getConfiguration('color_banner_help_background',true), //Колер кнопкі "Дапамагчы" |
|
42 | + "color_banner_help_text" => ConfigurationPageAdmin::getConfiguration('color_banner_help_text',true), //Колер тэкста "Дапамагчы" |
|
43 | 43 | |
44 | - "titleTextColor" => "#31383e", //цвет шрифта заголовка |
|
45 | - "titleFontSize" => "22px", //размер шрифта заголовка |
|
44 | + "titleTextColor" => "#31383e", //цвет шрифта заголовка |
|
45 | + "titleFontSize" => "22px", //размер шрифта заголовка |
|
46 | 46 | |
47 | - "descriptionTextColor" => "#31383e", //цвет шрифта описания |
|
48 | - "descriptionFontSize" => "13px", //размер шрифта заголовка |
|
47 | + "descriptionTextColor" => "#31383e", //цвет шрифта описания |
|
48 | + "descriptionFontSize" => "13px", //размер шрифта заголовка |
|
49 | 49 | |
50 | - "buttonTextColor" => "#f7fafc", //цвет шрифта на кнопках |
|
51 | - "buttonFontSize" => "20px", //размер шрифта заголовка |
|
50 | + "buttonTextColor" => "#f7fafc", //цвет шрифта на кнопках |
|
51 | + "buttonFontSize" => "20px", //размер шрифта заголовка |
|
52 | 52 | |
53 | - "currency" => 'руб.', //валюта |
|
53 | + "currency" => 'руб.', //валюта |
|
54 | 54 | |
55 | - "currentFunds" => self::getCurrentFunds($id), //собрано на данный момент средств, число |
|
56 | - "expectedFunds" => $campaignConfigurations->required_amount, //необходимо собрать средств, число |
|
55 | + "currentFunds" => self::getCurrentFunds($id), //собрано на данный момент средств, число |
|
56 | + "expectedFunds" => $campaignConfigurations->required_amount, //необходимо собрать средств, число |
|
57 | 57 | |
58 | - "minDonateAmount" => 1, //минимальная сумма доната |
|
59 | - "maxDonateAmount" => 200, //максимальная сумма доната |
|
58 | + "minDonateAmount" => 1, //минимальная сумма доната |
|
59 | + "maxDonateAmount" => 200, //максимальная сумма доната |
|
60 | 60 | |
61 | - "innerText" => [ |
|
61 | + "innerText" => [ |
|
62 | 62 | "locale" => $lang, // язык текста |
63 | 63 | "titleImage" => $campaignConfigurations->photo, //путь до главного изображения, строка |
64 | 64 | "campaignTitle" => $campaignInformations->campaign_title_lang, //Заголовок компании, строка |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | "paymentDescriptionText" => $campaignInformations->payment_description_lang, |
71 | 71 | "successfulPaymentMessage" => "Текст при удачном платеже", |
72 | 72 | "errorPaymentMessage" => "Текст при неудачном платеже" |
73 | - ], |
|
74 | - "showProgressBar" => $campaignConfigurations->campaign_progress_bar |
|
73 | + ], |
|
74 | + "showProgressBar" => $campaignConfigurations->campaign_progress_bar |
|
75 | 75 | ]; |
76 | 76 | |
77 | 77 | return $arrCampaign; |
78 | - } |
|
78 | + } |
|
79 | 79 | |
80 | - private static function getCurrentFunds($id) |
|
81 | - { |
|
80 | + private static function getCurrentFunds($id) |
|
81 | + { |
|
82 | 82 | $campaign = Campaign::find($id); |
83 | 83 | if(isset($campaign->payments)){ |
84 | - $payments = $campaign->payments->sum('amount'); |
|
85 | - return $payments; |
|
84 | + $payments = $campaign->payments->sum('amount'); |
|
85 | + return $payments; |
|
86 | 86 | } |
87 | 87 | return 0; |
88 | - } |
|
88 | + } |
|
89 | 89 | } |
@@ -19,27 +19,27 @@ discard block |
||
19 | 19 | public static function getCampaignClientArray($id) |
20 | 20 | { |
21 | 21 | $campaign = Campaign::find($id); |
22 | - if(!$campaign){ |
|
22 | + if (!$campaign) { |
|
23 | 23 | return "Campaign not found!"; |
24 | 24 | } |
25 | 25 | $lang = CampaignPageAdmin::getLangDefault(); |
26 | 26 | |
27 | 27 | $campaignConfigurations = $campaign->campaign_configurations()->first(); |
28 | 28 | $campaignInformations = $campaign->campaign_lang_informations() |
29 | - ->where('campaign_lang',$lang) |
|
29 | + ->where('campaign_lang', $lang) |
|
30 | 30 | ->first(); |
31 | 31 | |
32 | 32 | $arrCampaign = [ |
33 | 33 | "height" => 200, //высота модуля |
34 | 34 | "width" => 300, //ширина модуля |
35 | 35 | "releaseUrl" => config('app.release_url'), |
36 | - "backgroundColor" => ConfigurationPageAdmin::getConfiguration('color_module_background',true), //Колер фона модуля |
|
37 | - "buttonColor" => ConfigurationPageAdmin::getConfiguration('color_module_buttons',true), //Колер кнопак з сумамі |
|
36 | + "backgroundColor" => ConfigurationPageAdmin::getConfiguration('color_module_background', true), //Колер фона модуля |
|
37 | + "buttonColor" => ConfigurationPageAdmin::getConfiguration('color_module_buttons', true), //Колер кнопак з сумамі |
|
38 | 38 | |
39 | - "show_banner" => ConfigurationPageAdmin::getConfiguration('show_banner',true), //Паказваць банэр |
|
40 | - "color_banner_background" => ConfigurationPageAdmin::getConfiguration('color_banner_background',true), //Колер фону банэра |
|
41 | - "color_banner_help_background" => ConfigurationPageAdmin::getConfiguration('color_banner_help_background',true), //Колер кнопкі "Дапамагчы" |
|
42 | - "color_banner_help_text" => ConfigurationPageAdmin::getConfiguration('color_banner_help_text',true), //Колер тэкста "Дапамагчы" |
|
39 | + "show_banner" => ConfigurationPageAdmin::getConfiguration('show_banner', true), //Паказваць банэр |
|
40 | + "color_banner_background" => ConfigurationPageAdmin::getConfiguration('color_banner_background', true), //Колер фону банэра |
|
41 | + "color_banner_help_background" => ConfigurationPageAdmin::getConfiguration('color_banner_help_background', true), //Колер кнопкі "Дапамагчы" |
|
42 | + "color_banner_help_text" => ConfigurationPageAdmin::getConfiguration('color_banner_help_text', true), //Колер тэкста "Дапамагчы" |
|
43 | 43 | |
44 | 44 | "titleTextColor" => "#31383e", //цвет шрифта заголовка |
45 | 45 | "titleFontSize" => "22px", //размер шрифта заголовка |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | private static function getCurrentFunds($id) |
81 | 81 | { |
82 | 82 | $campaign = Campaign::find($id); |
83 | - if(isset($campaign->payments)){ |
|
83 | + if (isset($campaign->payments)) { |
|
84 | 84 | $payments = $campaign->payments->sum('amount'); |
85 | 85 | return $payments; |
86 | 86 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $roles = $this->getRoleNames()->toArray(); |
68 | 68 | |
69 | 69 | if (\count($roles)) { |
70 | - return implode(', ', array_map(function ($item) { |
|
70 | + return implode(', ', array_map(function($item) { |
|
71 | 71 | return ucwords($item); |
72 | 72 | }, $roles)); |
73 | 73 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $permissions = $this->getDirectPermissions()->toArray(); |
84 | 84 | |
85 | 85 | if (\count($permissions)) { |
86 | - return implode(', ', array_map(function ($item) { |
|
86 | + return implode(', ', array_map(function($item) { |
|
87 | 87 | return ucwords($item['name']); |
88 | 88 | }, $permissions)); |
89 | 89 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | /* |
143 | 143 | * If the admin is currently NOT spoofing a user |
144 | 144 | */ |
145 | - if (! session()->has('admin_user_id') || ! session()->has('temp_user_id')) { |
|
145 | + if (!session()->has('admin_user_id') || !session()->has('temp_user_id')) { |
|
146 | 146 | //Won't break, but don't let them "Login As" themselves |
147 | 147 | if ($this->id != auth()->id()) { |
148 | 148 | return '<a href="'.route( |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | public function getConfirmedButtonAttribute() |
229 | 229 | { |
230 | - if (! $this->isConfirmed() && ! config('access.users.requires_approval')) { |
|
230 | + if (!$this->isConfirmed() && !config('access.users.requires_approval')) { |
|
231 | 231 | return '<a href="'.route('admin.auth.user.account.confirm.resend', $this).'" class="dropdown-item">'.__('buttons.backend.access.users.resend_email').'</a> '; |
232 | 232 | } |
233 | 233 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function canChangePassword() |
22 | 22 | { |
23 | - return ! app('session')->has(config('access.socialite_session_name')); |
|
23 | + return !app('session')->has(config('access.socialite_session_name')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | { |
34 | 34 | switch ($this->avatar_type) { |
35 | 35 | case 'gravatar': |
36 | - if (! $size) { |
|
36 | + if (!$size) { |
|
37 | 37 | $size = config('gravatar.default.size'); |
38 | 38 | } |
39 | 39 | |
@@ -96,6 +96,6 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function isPending() |
98 | 98 | { |
99 | - return config('access.users.requires_approval') && ! $this->confirmed; |
|
99 | + return config('access.users.requires_approval') && !$this->confirmed; |
|
100 | 100 | } |
101 | 101 | } |
@@ -121,19 +121,19 @@ discard block |
||
121 | 121 | { |
122 | 122 | parent::boot(); |
123 | 123 | |
124 | - static::saving(function (self $model) { |
|
124 | + static::saving(function(self $model) { |
|
125 | 125 | $model->slug = str_slug($model->name); |
126 | 126 | }); |
127 | 127 | } |
128 | 128 | |
129 | 129 | public function getCanEditAttribute() |
130 | 130 | { |
131 | - return ! $this->is_super_admin || 1 === auth()->id(); |
|
131 | + return !$this->is_super_admin || 1 === auth()->id(); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | public function getCanDeleteAttribute() |
135 | 135 | { |
136 | - return ! $this->is_super_admin && $this->id !== auth()->id() && ( |
|
136 | + return !$this->is_super_admin && $this->id !== auth()->id() && ( |
|
137 | 137 | Gate::check('delete users') |
138 | 138 | ); |
139 | 139 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function getCanImpersonateAttribute() |
142 | 142 | { |
143 | 143 | if (Gate::check('impersonate users')) { |
144 | - return ! $this->is_super_admin |
|
144 | + return !$this->is_super_admin |
|
145 | 145 | && session()->get('admin_user_id') !== $this->id |
146 | 146 | && $this->id !== auth()->id(); |
147 | 147 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | foreach ($this->roles as $role) { |
197 | 197 | foreach ($role->permissions as $permission) { |
198 | - if (! \in_array($permission, $permissions, true)) { |
|
198 | + if (!\in_array($permission, $permissions, true)) { |
|
199 | 199 | $permissions[] = $permission; |
200 | 200 | } |
201 | 201 | } |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getProvider($provider) |
230 | 230 | { |
231 | - return $this->providers->first(function (SocialLogin $item) use ($provider) { |
|
231 | + return $this->providers->first(function(SocialLogin $item) use ($provider) { |
|
232 | 232 | return $item->provider === $provider; |
233 | 233 | }); |
234 | 234 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | parent::boot(); |
178 | 178 | |
179 | - static::deleted(function (self $post) { |
|
179 | + static::deleted(function(self $post) { |
|
180 | 180 | $post->meta->delete(); |
181 | 181 | }); |
182 | 182 | } |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | |
242 | 242 | public function getMetaTitleAttribute() |
243 | 243 | { |
244 | - return null !== $this->meta && ! empty($this->meta->title) ? $this->meta->title : $this->title; |
|
244 | + return null !== $this->meta && !empty($this->meta->title) ? $this->meta->title : $this->title; |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | public function getMetaDescriptionAttribute() |
248 | 248 | { |
249 | - return null !== $this->meta && ! empty($this->meta->description) ? $this->meta->description : $this->summary; |
|
249 | + return null !== $this->meta && !empty($this->meta->description) ? $this->meta->description : $this->summary; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | public function owner() |
@@ -14,9 +14,9 @@ |
||
14 | 14 | |
15 | 15 | public static function bootHasTranslatableSlug() |
16 | 16 | { |
17 | - static::saving(function (Model $model) { |
|
17 | + static::saving(function(Model $model) { |
|
18 | 18 | collect($model->getTranslatedLocales($model->sluggable)) |
19 | - ->each(function (string $locale) use ($model) { |
|
19 | + ->each(function(string $locale) use ($model) { |
|
20 | 20 | $model->setTranslation('slug', $locale, |
21 | 21 | $model->generateSlug($model->getTranslation($model->sluggable, $locale), $locale) |
22 | 22 | ); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | parent::boot(); |
34 | 34 | |
35 | - static::creating(function ($model) { |
|
35 | + static::creating(function($model) { |
|
36 | 36 | $model->{$model->getUuidName()} = PackageUuid::generate(4)->string; |
37 | 37 | }); |
38 | 38 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | public static function bootHasEditor() |
12 | 12 | { |
13 | - static::saved(function (Model $model) { |
|
13 | + static::saved(function(Model $model) { |
|
14 | 14 | if ($model instanceof HasMedia && property_exists($model, 'editorFields')) { |
15 | 15 | foreach ($model->editorFields as $field) { |
16 | 16 | $model->saveImagesToMediaCollection($field); |
@@ -7,13 +7,13 @@ |
||
7 | 7 | class Campaign extends Model |
8 | 8 | { |
9 | 9 | |
10 | - public function campaign_configurations(){ |
|
10 | + public function campaign_configurations() { |
|
11 | 11 | return $this->hasMany('App\Campaign_configuration'); |
12 | 12 | } |
13 | - public function campaign_lang_informations(){ |
|
13 | + public function campaign_lang_informations() { |
|
14 | 14 | return $this->hasMany('App\Campaign_lang_information'); |
15 | 15 | } |
16 | - public function payments(){ |
|
16 | + public function payments() { |
|
17 | 17 | return $this->hasMany('App\Payment'); |
18 | 18 | } |
19 | 19 |