Search

Showing 7 of 1,697 result(s)

/blog/2018/04/15/laravel-5-execute-a-callback-on-a-given-value-while-chaining-the-original-value-with-tap#content-example-use

The tap helper function is used to call a given Closure (provided as an argument to the $callback parameter) with the given $value . The tap helper function will return the reference to the original $value as its return value. This allows you to...

/blog/2021/12/05/creating-stacked-content-layouts-with-statamic-and-antlers#content-using-the-limit-and-offset-modifiers-together

…tems you want to retrieve from the array. As an example, the following Antlers code would retrieve the first element of an items array: Like before, we will retrieve articles from an articles collection: Note : We are utilizing the as collection...

/blog/2016/03/23/calculating-averages-using-collections-in-laravel

The avg method is a useful method for calculating the average of all items in the collection. The avg method defines an optional $key parameter, which can be used to specify what property of the collection should be averaged. If no key is...

/blog/2016/11/30/laravel-collection-public-api-avg

avg($key = null) The avg method is a useful method for calculating the average of all items in the collection. The avg method defines an optional $key parameter, which can be used to specify what property of the collection should be averaged. If...

/blog/2021/12/12/creating-a-content-reaction-system-with-statamic-3-and-antlers#content-refactoring-our-partial-using-antlers-front-matter

Taking a look at the current state of our Antlers partial, we can see a lot of duplicate code starting to emerge. This problem will only get worse over time since we will be referencing those field names in a few places: once to create the buttons...

/blog/2014/07/28/part-two-creating-a-custom-pagination-view-in-laravel#content-one-last-consideration

…r view where we call the links() method on our collection, we can do some special things. Let's pretend we are outputting our pagination links with this line of code: {{  $users->links()  }} We can use the appends() method to append any input or...

/blog/2021/02/20/integrating-laravel-spark-and-statamic-3#content-installing-laravel-spark

We will now get our PHP environment prepped for the actual installation of Spark Stripe. Ensure that your PHP environment has the following PHP extensions installed and enabled (you may need to search for specific installation instructions based...