grafik.forEach(elem => {
elem.attr = attr;
});
grafik.forEach(elem => {
elem.attr = attr.map(el => ({ ...el }));
});
grafik.forEach(elem => {
elem.attr = attr.map(el => Object.assign({}, el));
});
$array = json_decode(..., true);
$sorted = collect($array)->sortBy(function ($hero, $key) {
return collect($hero)->sum('win_rate');
})->all();
video::-internal-media-controls-download-button {
display: none;
}
<?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)
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/project/public
<Directory /var/www/html/project/public>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
проблема в том что не видит он Auth::user() Trying to get property of non-objectВсё он прекрасно видит. Просто пользователь не авторизован, поэтому невозможно получить его id. Используйте Auth::check() сначала для проверки.