Пример #1
0
 public function save(array $data = [], array $localizedData = [])
 {
     foreach ($data['exchange_rates'] as $currencyCode => $rate) {
         $data['exchange_rates'][$currencyCode] = fromFormattedNumber($rate);
     }
     return parent::save($data, $localizedData);
     // TODO: Change the autogenerated stub
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->ogType = 'website';
     $this->ogUrl = currentUrl();
     $this->ogTitle = appName();
     $this->ogDescription = appDescription();
     $this->ogImage = appLogo();
     $this->ogSiteName = appName();
     $this->ogLocale = currentFullLocaleCode();
     $this->ogLocaleAlternate = allSupportedFullLocaleCodes();
 }
Пример #3
0
 public function validationRules()
 {
     return array_merge(parent::validationRules(), ['facebook_enable' => 'sometimes|in:1', 'facebook_app_id' => 'required_if:facebook_enable,1', 'facebook_comment_enable' => 'sometimes|in:1', 'facebook_comment_color_scheme' => 'required_if:facebook_comment_enable,1|in:' . implode(',', $this->facebookCommentColorSchemeValues), 'facebook_comment_num_posts' => 'required_if:facebook_comment_enable,1|min:1', 'facebook_comment_order_by' => 'required_if:facebook_comment_enable,1|in:' . implode(',', $this->facebookCommentOrderByValues), 'facebook_like_enable' => 'sometimes|in:1', 'facebook_like_layout' => 'required_if:facebook_like_enable,1|in:' . implode(',', $this->facebookLikeLayoutValues), 'facebook_share_enable' => 'sometimes|in:1', 'facebook_share_layout' => 'required_if:facebook_share_enable,1|in:' . implode(',', $this->facebookShareLayoutValues), 'facebook_recommend_enable' => 'sometimes|in:1', 'facebook_recommend_layout' => 'required_if:facebook_recommend_enable,1|in:' . implode(',', $this->facebookRecommendLayoutValues), 'facebook_send_enable' => 'sometimes|in:1', 'facebook_save_enable' => 'sometimes|in:1', 'twitter_enable' => 'sometimes|in:1', 'twitter_share_enable' => 'sometimes|in:1', 'linkedin_enable' => 'sometimes|in:1', 'linkedin_share_enable' => 'sometimes|in:1', 'linkedin_share_count_mode' => 'required_if:linkedin_share_enable,1|in:' . implode(',', $this->linkedInShareCountModeValues), 'google_enable' => 'sometimes|in:1', 'google_share_enable' => 'sometimes|in:1', 'google_share_button_size' => 'required_if:google_share_enable,1|in:' . implode(',', $this->googleShareButtonSizeValues), 'google_share_button_annotation' => 'required_if:google_share_enable,1|in:' . implode(',', $this->googleShareButtonAnnotationValues), 'google_share_button_width' => 'required_if:google_share_button_annotation,inline|integer|min:1']);
 }
Пример #4
0
 public function save(array $data = [], array $localizedData = [])
 {
     $result = parent::save($data, $localizedData);
     // TODO: Change the autogenerated stub
     if ($result === true) {
         $extension = new Extension();
         $extension->cacheScripts();
     }
     return $result;
 }