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 namespace App\Models; use App\Events\GoodsDeleted; use Illuminate\Database\Eloque..
Decoded Output download
<?php
namespace App\Models;
use App\Events\GoodsDeleted;
use Illuminate\Database\Eloquent\SoftDeletes;
class Goods extends BaseModel
{
use SoftDeletes;
protected $table = 'goods';
protected $dispatchesEvents = [
'deleted' => GoodsDeleted::class
];
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function group()
{
return $this->belongsTo(GoodsGroup::class, 'group_id');
}
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function coupon()
{
return $this->belongsToMany(Coupon::class, 'coupons_goods', 'goods_id', 'coupons_id');
}
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function carmis()
{
return $this->hasMany(Carmis::class, 'goods_id');
}
/**
* ,
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function getInStockAttribute()
{
if (isset($this->attributes['carmis_count'])
&&
$this->attributes['type'] == self::AUTOMATIC_DELIVERY
) {
$this->attributes['in_stock'] = $this->attributes['carmis_count'];
}
return $this->attributes['in_stock'];
}
/**
*
*
* @return array
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public static function getGoodsTypeMap()
{
return [
self::AUTOMATIC_DELIVERY => admin_trans('goods.fields.automatic_delivery'),
self::MANUAL_PROCESSING => admin_trans('goods.fields.manual_processing')
];
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace App\Models;
use App\Events\GoodsDeleted;
use Illuminate\Database\Eloquent\SoftDeletes;
class Goods extends BaseModel
{
use SoftDeletes;
protected $table = 'goods';
protected $dispatchesEvents = [
'deleted' => GoodsDeleted::class
];
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function group()
{
return $this->belongsTo(GoodsGroup::class, 'group_id');
}
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function coupon()
{
return $this->belongsToMany(Coupon::class, 'coupons_goods', 'goods_id', 'coupons_id');
}
/**
*
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function carmis()
{
return $this->hasMany(Carmis::class, 'goods_id');
}
/**
* ,
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function getInStockAttribute()
{
if (isset($this->attributes['carmis_count'])
&&
$this->attributes['type'] == self::AUTOMATIC_DELIVERY
) {
$this->attributes['in_stock'] = $this->attributes['carmis_count'];
}
return $this->attributes['in_stock'];
}
/**
*
*
* @return array
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public static function getGoodsTypeMap()
{
return [
self::AUTOMATIC_DELIVERY => admin_trans('goods.fields.automatic_delivery'),
self::MANUAL_PROCESSING => admin_trans('goods.fields.manual_processing')
];
}
}
Function Calls
None |
Stats
MD5 | a3c7ce4ec9b13424c5e5801c8418bb4d |
Eval Count | 0 |
Decode Time | 105 ms |