public function disable($code)
    {
        $promocode = Promocode::byCode($code)->first();

        if ($promocode === null) {
            throw new InvalidPromocodeException;
        }

        $promocode->expires_at = Carbon::now();

        return $promocode->save();
    }
public function disable($code)
    {
        $promocode = Promocode::byCode($code)->first();

        if ($promocode === null) {
            throw new InvalidPromocodeException;
        }

        $promocode->expires_at = Carbon::now();

        return $promocode->save();
    }
public function disable ( $ code ) { $ promocode = Promocode :: byCode ( $ code ) -> first ( ) ; if ( $ promocode === null ) { throw new InvalidPromocodeException ; } $ promocode -> expires_at = Carbon :: now ( ) ; return $ promocode -> save ( ) ; }
Expire code as it won't usable anymore.

@param string $code
@return bool
@throws InvalidPromocodeException
Expire code as it won t usable anymore .