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 /** * The file was created by Assimon. * * @author assimon<[email protected]> * ..

Decoded Output download

<?php
/**
 * The file was created by Assimon.
 *
 * @author    assimon<[email protected]>
 * @copyright assimon<[email protected]>
 * @link      http://utf8.hk/
 */

namespace App\Service;


use App\Models\Carmis;

class CarmisService
{

    /**
     * 
     *
     * @param int $goodsID id
     * @param int $byAmount 
     * @return array|null
     *
     * @author    assimon<[email protected]>
     * @copyright assimon<[email protected]>
     * @link      http://utf8.hk/
     */
    public function withGoodsByAmountAndStatusUnsold(int $goodsID, int $byAmount)
    {
        $carmis = Carmis::query()
            ->where('goods_id', $goodsID)
            ->where('status', Carmis::STATUS_UNSOLD)
            ->take($byAmount)
            ->get();
        return $carmis ? $carmis->toArray() : null;
    }

    /**
     * id
     *
     * @param array $ids id
     * @return bool
     *
     * @author    assimon<[email protected]>
     * @copyright assimon<[email protected]>
     * @link      http://utf8.hk/
     */
    public function soldByIDS(array $ids): bool
    {
        return Carmis::query()->whereIn('id', $ids)->where('is_loop', 0)->update(['status' => Carmis::STATUS_SOLD]);
    }

}
 ?>

Did this file decode correctly?

Original Code

<?php
/**
 * The file was created by Assimon.
 *
 * @author    assimon<[email protected]>
 * @copyright assimon<[email protected]>
 * @link      http://utf8.hk/
 */

namespace App\Service;


use App\Models\Carmis;

class CarmisService
{

    /**
     * 
     *
     * @param int $goodsID id
     * @param int $byAmount 
     * @return array|null
     *
     * @author    assimon<[email protected]>
     * @copyright assimon<[email protected]>
     * @link      http://utf8.hk/
     */
    public function withGoodsByAmountAndStatusUnsold(int $goodsID, int $byAmount)
    {
        $carmis = Carmis::query()
            ->where('goods_id', $goodsID)
            ->where('status', Carmis::STATUS_UNSOLD)
            ->take($byAmount)
            ->get();
        return $carmis ? $carmis->toArray() : null;
    }

    /**
     * id
     *
     * @param array $ids id
     * @return bool
     *
     * @author    assimon<[email protected]>
     * @copyright assimon<[email protected]>
     * @link      http://utf8.hk/
     */
    public function soldByIDS(array $ids): bool
    {
        return Carmis::query()->whereIn('id', $ids)->where('is_loop', 0)->update(['status' => Carmis::STATUS_SOLD]);
    }

}

Function Calls

None

Variables

None

Stats

MD5 9bd3adc76a4eb59ca65975107a2606f4
Eval Count 0
Decode Time 105 ms