@@ -29,7 +29,7 @@ |
||
29 | 29 | |
30 | 30 | public function collection() |
31 | 31 | { |
32 | - return $this->query->get($this->columns)->each(function (Model $item) { |
|
32 | + return $this->query->get($this->columns)->each(function(Model $item) { |
|
33 | 33 | return $item->setAppends([]); |
34 | 34 | }); |
35 | 35 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $this->posts->query() |
54 | 54 | ->where('status', '!=', Post::PUBLISHED) |
55 | 55 | ->where('published_at', '<', $now) |
56 | - ->where(function (Builder $q) use ($now) { |
|
56 | + ->where(function(Builder $q) use ($now) { |
|
57 | 57 | $q |
58 | 58 | ->whereNull('unpublished_at') |
59 | 59 | ->orWhere('unpublished_at', '>', $now); |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | public function passes($attribute, $value) |
40 | 40 | { |
41 | 41 | // Option is off |
42 | - if (! config('access.users.password_history')) { |
|
42 | + if (!config('access.users.password_history')) { |
|
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | |
46 | - if (! $this->user instanceof User) { |
|
46 | + if (!$this->user instanceof User) { |
|
47 | 47 | if (is_numeric($this->user)) { |
48 | 48 | $this->user = resolve(BackendUserRepository::class)->getById($this->user); |
49 | 49 | } else { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - if (! $this->user || null === $this->user) { |
|
54 | + if (!$this->user || null === $this->user) { |
|
55 | 55 | return false; |
56 | 56 | } |
57 | 57 |
@@ -27,41 +27,41 @@ |
||
27 | 27 | |
28 | 28 | $donate = $request->donate*100; |
29 | 29 | $GetTokenParams = [ |
30 | - "checkout" => [ |
|
30 | + "checkout" => [ |
|
31 | 31 | "test" => $is_test, //true, |
32 | 32 | "transaction_type" => "payment", |
33 | 33 | "version" => 2.1, |
34 | 34 | "attempts" => 3, |
35 | 35 | "settings" => [ |
36 | - "success_url" => $url . "message=1", |
|
37 | - "decline_url" => $url . "message=2", |
|
38 | - "fail_url" => $url . "message=3", |
|
39 | - "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
|
40 | - "language"=> "ru" |
|
36 | + "success_url" => $url . "message=1", |
|
37 | + "decline_url" => $url . "message=2", |
|
38 | + "fail_url" => $url . "message=3", |
|
39 | + "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
|
40 | + "language"=> "ru" |
|
41 | 41 | ], |
42 | 42 | "order" =>[ |
43 | - "currency"=> "BYN", |
|
44 | - "amount"=> $donate, |
|
45 | - "description"=> "Order description" |
|
43 | + "currency"=> "BYN", |
|
44 | + "amount"=> $donate, |
|
45 | + "description"=> "Order description" |
|
46 | 46 | ], |
47 | 47 | "customer"=> [ |
48 | - "address"=> "Baker street 221b", |
|
49 | - "country"=> "GB", |
|
50 | - "city"=> "London", |
|
51 | - "email"=> "[email protected]" |
|
48 | + "address"=> "Baker street 221b", |
|
49 | + "country"=> "GB", |
|
50 | + "city"=> "London", |
|
51 | + "email"=> "[email protected]" |
|
52 | 52 | ], |
53 | - ] |
|
53 | + ] |
|
54 | 54 | ]; |
55 | 55 | |
56 | 56 | $client = new Client([ |
57 | - 'base_uri' => "https://checkout.bepaid.by" |
|
57 | + 'base_uri' => "https://checkout.bepaid.by" |
|
58 | 58 | ]); |
59 | 59 | |
60 | 60 | $response = $client->request('POST', '/ctp/api/checkouts', [ |
61 | - 'auth' => [$idMarket, $keyMarket], |
|
62 | - 'headers' => ['Accept' => 'application/json'], |
|
63 | - 'json' => $GetTokenParams, |
|
64 | - 'verify' => false |
|
61 | + 'auth' => [$idMarket, $keyMarket], |
|
62 | + 'headers' => ['Accept' => 'application/json'], |
|
63 | + 'json' => $GetTokenParams, |
|
64 | + 'verify' => false |
|
65 | 65 | ]); |
66 | 66 | return $response->getBody(); |
67 | 67 | } |
@@ -9,23 +9,23 @@ discard block |
||
9 | 9 | class Donation extends Model |
10 | 10 | { |
11 | 11 | |
12 | - static public function getPaymentPage($request,$id){ |
|
12 | + static public function getPaymentPage($request, $id) { |
|
13 | 13 | |
14 | - $idMarket = Doika_configuration::where('configuration_name','id_market') |
|
14 | + $idMarket = Doika_configuration::where('configuration_name', 'id_market') |
|
15 | 15 | ->first()->configuration_value; |
16 | - $keyMarket = Doika_configuration::where('configuration_name','key_market') |
|
16 | + $keyMarket = Doika_configuration::where('configuration_name', 'key_market') |
|
17 | 17 | ->first()->configuration_value; |
18 | - if(Doika_configuration::where('configuration_name','is_test') |
|
19 | - ->first()->configuration_value == 1){ |
|
18 | + if (Doika_configuration::where('configuration_name', 'is_test') |
|
19 | + ->first()->configuration_value == 1) { |
|
20 | 20 | $is_test = true; |
21 | - }else{ |
|
21 | + } else { |
|
22 | 22 | $is_test = false; |
23 | 23 | } |
24 | 24 | |
25 | - $url = isset($request->url) ? urldecode($request->url) : ("https://" . $_SERVER['HTTP_HOST'] . '/'); |
|
25 | + $url = isset($request->url) ? urldecode($request->url) : ("https://".$_SERVER['HTTP_HOST'].'/'); |
|
26 | 26 | $url .= (strpos($url, "?") > 0) ? "&" : "?"; |
27 | 27 | |
28 | - $donate = $request->donate*100; |
|
28 | + $donate = $request->donate * 100; |
|
29 | 29 | $GetTokenParams = [ |
30 | 30 | "checkout" => [ |
31 | 31 | "test" => $is_test, //true, |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | "version" => 2.1, |
34 | 34 | "attempts" => 3, |
35 | 35 | "settings" => [ |
36 | - "success_url" => $url . "message=1", |
|
37 | - "decline_url" => $url . "message=2", |
|
38 | - "fail_url" => $url . "message=3", |
|
36 | + "success_url" => $url."message=1", |
|
37 | + "decline_url" => $url."message=2", |
|
38 | + "fail_url" => $url."message=3", |
|
39 | 39 | "notification_url" => "https://".$_SERVER['HTTP_HOST']."/doika/payment-record-db-".$id, |
40 | 40 | "language"=> "ru" |
41 | 41 | ], |
@@ -18,7 +18,7 @@ |
||
18 | 18 | if(Doika_configuration::where('configuration_name','is_test') |
19 | 19 | ->first()->configuration_value == 1){ |
20 | 20 | $is_test = true; |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $is_test = false; |
23 | 23 | } |
24 | 24 |
@@ -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 | } |
@@ -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 | } |
@@ -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 | ); |
@@ -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); |