Source: journal.highlandsolutions.com

Laravel’s Array Get for Statamic

Category: Laravel

Margaret Thatcher, Ronald McDonald, David Bowie, Zendaya, Vanessa down the street. It’s basically Laravel’s Arr::get() helper in Antlers. I used something similar in v2 back when Jim-Jam and I cranked out Statamic builds left and right and I more actively battled my nemesis.

One other neat thing I didn’t document because it’s more of a side effect than an intentional feature: Array Get allows you to throw Antlers code in your front-matter and have it parsed in the output. I did that all the time in v2 (and probably v1?), but (last time I checked) v3 doesn’t support Antlers in your front-matter.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners