Spamworldpro Mini Shell
Spamworldpro


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/ServiceBoxes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/app/Shop/ServiceBoxes/ServiceBox.php
<?php

namespace App\Shop\ServiceBoxes;

use Illuminate\Database\Eloquent\Model;

class ServiceBox extends Model
{
    protected $fillable = [
        'title',
        'sub_title',
        'text',
        'items',
        'link_button',
        'background_img',
        'orderNo',
        'created_at',
        'updated_at',
        'meta_alt'
    ];

    public function setItemsAttribute($value) {
        if(!empty($value)){
            $this->attributes['items'] =  json_encode($value);
        } else {
            $this->attributes['items'] = null;
        }
    }

    public function getItemsAttribute() {
        if(!empty($this->attributes['items']) && !is_array($this->attributes['items'])) {
            $this->attributes['items'] =  json_decode($this->attributes['items'],true);  
        } else if(!empty($this->attributes['items']) && is_array($this->attributes['items'])) {
            $this->attributes['items'] =  $this->attributes['items'];  
        } else {
            $this->attributes['items'] = [];
        }
        return $this->attributes['items'];
    }

    /*public function setLinkButtonAttribute($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'] =  preg_replace('/^(?!https?:\/\/)/', 'http://', $this->attributes['link_button']);  
        } else {
            $this->attributes['link_button'] = null;
        }
        return $this->attributes['link_button'];
    }*/

    public function getBackgroundImgAttribute() {
        if (!empty($this->attributes['background_img'])) {
            return \Storage::url($this->attributes['background_img']);
        }
    }
}

Spamworldpro Mini