Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php if (!function_exists('is_field_translatable')) { /** * Check if a Field is..
Decoded Output download
<?php
if (!function_exists('is_field_translatable')) {
/**
* Check if a Field is translatable.
*
* @param Illuminate\Database\Eloquent\Model $model
* @param Illuminate\Database\Eloquent\Collection $row
*/
function is_field_translatable($model, $row)
{
if (!is_bread_translatable($model)) {
return;
}
return $model->translatable()
&& method_exists($model, 'getTranslatableAttributes')
&& in_array($row->field, $model->getTranslatableAttributes());
}
}
if (!function_exists('get_field_translations')) {
/**
* Return all field translations.
*
* @param Illuminate\Database\Eloquent\Model $model
* @param string $field
* @param string $rowType
* @param bool $stripHtmlTags
*/
function get_field_translations($model, $field, $rowType = '', $stripHtmlTags = false)
{
$_out = $model->getTranslationsOf($field);
if ($stripHtmlTags && $rowType == 'rich_text_box') {
foreach ($_out as $language => $value) {
$_out[$language] = strip_tags($_out[$language]);
}
}
return json_encode($_out);
}
}
if (!function_exists('is_bread_translatable')) {
/**
* Check if BREAD is translatable.
*
* @param Illuminate\Database\Eloquent\Model $model
*/
function is_bread_translatable($model)
{
return config('voyager.multilingual.enabled')
&& isset($model)
&& method_exists($model, 'translatable')
&& $model->translatable();
}
}
?>
Did this file decode correctly?
Original Code
<?php
if (!function_exists('is_field_translatable')) {
/**
* Check if a Field is translatable.
*
* @param Illuminate\Database\Eloquent\Model $model
* @param Illuminate\Database\Eloquent\Collection $row
*/
function is_field_translatable($model, $row)
{
if (!is_bread_translatable($model)) {
return;
}
return $model->translatable()
&& method_exists($model, 'getTranslatableAttributes')
&& in_array($row->field, $model->getTranslatableAttributes());
}
}
if (!function_exists('get_field_translations')) {
/**
* Return all field translations.
*
* @param Illuminate\Database\Eloquent\Model $model
* @param string $field
* @param string $rowType
* @param bool $stripHtmlTags
*/
function get_field_translations($model, $field, $rowType = '', $stripHtmlTags = false)
{
$_out = $model->getTranslationsOf($field);
if ($stripHtmlTags && $rowType == 'rich_text_box') {
foreach ($_out as $language => $value) {
$_out[$language] = strip_tags($_out[$language]);
}
}
return json_encode($_out);
}
}
if (!function_exists('is_bread_translatable')) {
/**
* Check if BREAD is translatable.
*
* @param Illuminate\Database\Eloquent\Model $model
*/
function is_bread_translatable($model)
{
return config('voyager.multilingual.enabled')
&& isset($model)
&& method_exists($model, 'translatable')
&& $model->translatable();
}
}
Function Calls
function_exists | 3 |
Stats
MD5 | 69c1c9d80d0c25a25c648d68f1d9fcf5 |
Eval Count | 0 |
Decode Time | 97 ms |