const data = new URLSearchParams(formDataObject);
/**
* Get the cookie lifetime in seconds.
*
* @return \DateTimeInterface
*/
protected function getCookieExpirationDate()
{
$config = $this->manager->getSessionConfig();
return $config['expire_on_close'] ? 0 : Carbon::now()->addMinutes($config['lifetime']);
}
<?php
$data = <<<XML
<document>
<bank name="Kazkommertsbank JSC">
<customer name="TERRA" mail="test@mail.ru" phone="">
<merchant cert_id="00c15670b" name="ZARA’S GROUP">
<order order_id="374565664" amount="8000" currency="398">
<department merchant_id="92451103" amount="8000"/>
</order>
</merchant>
<merchant_sign type="RSA"/>
</customer>
<customer_sign type="RSA"/>
<results timestamp="2017-01-26 15:21:21">
<payment merchant_id="9256е1103" card="548318-XX-XXXX-0293" amount="8000" reference="17012562121" approval_code="152121" response_code="00" Secure="No" card_bin="" c_hash="D643983890D0003EA973E88A346CDDBE"/>
</results>
</bank>
<bank_sign cert_id="00c154690" type="SHA/RSA">
k72PKDHhQ2QMyi8eGH7SRf4+4q4h3TTjTS4x+XIIpubT/kR67yTbKSYYRFg6iUv6NROx6SCm+hVJoaztBk/2QVU47FlIFe60iMVliONSIZ5RvLvYZwy/2q2b7vLiav8ZKOFahLb7NfhoBrNJeNKUFEXYn3EKKx2ojiMj7jWr/Q8=
</bank_sign>
</document>
XML;
$xml = new SimpleXMLElement($data);
var_dump((int) $xml->xpath('//order')[0]->attributes()['order_id']);
int(374565664)
Раньше при создании экзепляра класса свойство updated_at автоматически устанавливалось в null.
\Validator::extend('your_rule_name', function ($attr, $value, $params, \Illuminate\Validation\Validator $validator) {
// request data
$data = $validator->getData();
if (array_get($data, 'resource_id') === 154) {
return $value >= 0 && $value <= 60;
}
if (array_get($data, 'first_payment') !== 100) {
return $value >= 0 && $value <= 12;
}
return false;
});