Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add practical examples showing facade alternatives to Antlers tags

オープン
#1,770 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

この issue はまだ評価されていません。

説明

The current Blade documentation shows two approaches for using Statamic features in Blade:

  1. Antlers Blade Components (<s:glide>) - verbose for simple use cases
  2. Fluent tags (Statamic::tag('glide')) - awkward syntax, not discoverable

However, there's a cleaner approach using facades that isn't documented at all.

For example: Image Manipulation (Glide), the docs currently show:

{{-- Using fluent tags --}}
<img src="{{
 Statamic::tag('glide')->src('test.png')->width(1280)->height(800)->fetch() }}"
/>

{{-- Using Antlers Blade Components --}}
<s:glide src="test.png" width="1280" height="800">
 <img src="{{ $url }}" />
</s:glide>

The second approach is clunky if you're just wanting the URL, so you're forced to use Statamic::tag() everywhere if you just want the data, but there's a much cleaner facade approach that isn't documented:

<img src="{{ Image::manipulate('test.png', ['w' => 1280, 'h' => 800]) }}" />

I prefer using Facades because it's more Laravel-like and familiar to developers, and also better IDE autocomplete support. It's also a cleaner syntax for simple use cases.

Suggestion

The Blade documentation should include a section showing facade equivalents for common Antlers tags. For example:

Collections:

// Instead of: Statamic::tag('collection:wheels')->limit(3)
Collection::findByHandle('wheels')->queryEntries()->limit(3)->get()

Taxonomies:

// Instead of: <s:taxonomy:categories>
Taxonomy::findByHandle('categories')

Navigation:

// Instead of: <s:nav:main>
Nav::find('main')->tree()

This would help developers transitioning from Antlers or building custom Blade components discover the most appropriate API for their needs.

主要言語
PHP
スター
133
フォーク
405
平均マージ
21時間 45分
マージ済み PR(30日)
12

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

statamic/docs のほかの issue

statamic/docs の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。