![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/app/Shop/Banners/ |
<?php namespace App\Shop\Banners; use Illuminate\Database\Eloquent\Model; class Banner extends Model { protected $fillable = [ 'title', 'sub_title', 'button_text', 'link_button', 'button_text2', 'button_link2', 'video_embed', 'background_img', 'background_img_mobile', 'section', 'content', 'created_at', 'updated_at', 'meta_alt' ]; /*public function setLinkButtonAttribute($value) { $value = ($value == 'javascript:void(0);') ? null : $value; $scheme = parse_url($value, PHP_URL_SCHEME); if (empty($scheme) && !empty($value)) { $value = 'http://'.ltrim($value, '/'); } if(!empty($value)){ $this->attributes['link_button'] = $value; } else { $this->attributes['link_button'] = null; } } public function getLinkButtonAttribute() { if(!empty($this->attributes['link_button']) && $this->attributes['link_button'] != 'javascript:void(0);') { $this->attributes['link_button'] = preg_replace('/^(?!https?:\/\/)/', 'http://', $this->attributes['link_button']); } else { $this->attributes['link_button'] = 'javascript:void(0);'; } return $this->attributes['link_button']; }*/ public function getBackgroundImgAttribute() { if (!empty($this->attributes['background_img'])) { return $this->attributes['background_img']; } } }