![]() 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/syn.corals.io/Corals/modules/CMS/Models/ |
<?php namespace Corals\Modules\CMS\Models; use Corals\Foundation\Models\BaseModel; use Corals\Foundation\Transformers\PresentableTrait; use Spatie\Activitylog\Traits\LogsActivity; class Widget extends BaseModel { use PresentableTrait, LogsActivity; /** * Model configuration. * @var string */ public $config = 'cms.models.widget'; protected static $logAttributes = ['title']; protected $guarded = ['id']; protected $table = 'cms_widgets'; public function block() { return $this->belongsTo(Block::class); } /** * @return string * @throws FatalThrowableError * @throws \Exception */ public function getRenderedAttribute() { $__data['__env'] = app(\Illuminate\View\Factory::class); extract($__data); $obLevel = ob_get_level(); ob_start(); $content = $this->getAttributeValue('content'); $content = str_ireplace(array('<?php', '@php', '<?', '@endphp', '?>'), array('<?php', '<?PHP', '<?', '>?php', '?>'), $content); $php = \Blade::compileString($content); try { eval('?' . '>' . $php); } catch (\Exception $e) { while (ob_get_level() > $obLevel) ob_end_clean(); throw $e; } catch (\Throwable $e) { while (ob_get_level() > $obLevel) ob_end_clean(); throw new FatalThrowableError($e); } return ob_get_clean(); } }