{% set obCategoryList = CategoryList.make().tree() %}
{% if obCategoryList.isNotEmpty() %}
<ul class="product__about-usage">
{% for obCategory in obCategoryList %}
{% if obCategory.children.isNotEmpty() %}
{% for obChildCategory in obCategory.children %}
<li class="product__about-usage-item">
<div class="product__about-usage-descr">
<img class="product__about-usage-ico" src="{{ obChildCategory.preview_image.path }}" aria-hidden="true">
<span class="product__about-usage-title">{{ obChildCategory.name }}</span>
</div>
</li>
{% endfor %}
{% endif %}
{% endfor %}
</ul>
{% endif %}
id | text
id | content | …
tag_id | content_id
class Content extends Model {
public function tags(): BelongsToMany {
return $this->belongsToMany(Tag::class);
}
}
class Tag extends Model {
public function contents(): BelongsToMany {
return $this->belongsToMany(Content::class);
}
}
dd($content->tags);
WITH countries_links AS (
SELECT JSON_OBJECT('name', `name`, 'iso2', `iso2`, 'links', COUNT(`link_id`)) d
FROM `links`
JOIN `countries` ON `countries`.`iso2` = `links`.`country`
GROUP BY `name`, `iso2`
HAVING COUNT(`link_id`) > 0
) SELECT JSON_ARRAYAGG(d) FROM countries_links
$result = ['data' => [
'main' => $keywords['data'],
'secondary' => $keywords['data'],
]];
https://ideone.com/fi0l5o(new Decimal\Decimal('153.17'))->mul(100)->toInt(); // 15317
(int)bcmul('153.17', '100'); // 15317
\translit($text)
Str::slug()