Feed, FeedInfo and
+ FeedItem classes.
+
+ Sometimes, you may want certain feed clauses to apply to a feed based on another condition.
+ For instance, you may only want to apply a where statement if a given input value is present or another attribute has a value.
+ You can accomplish this using the when method:
+
+ The when method only executes the given closure when the first argument is true.
+ If the first argument is false, the closure will not be executed.
+ So, in the example above, the closure given to the when method will only be invoked if the
+ category field is present on the model and evaluates to true.
+
+ You may pass another closure as the third argument to the when method.
+ This closure will only execute if the first argument evaluates to false.
+ To illustrate how this feature may be used, we will use it to configure the model title suffix:
+
+ Additionally, the inverse method unless is available.
+ In this case, the processing logic is the exact opposite.
+
+ Feed, FeedItem, and FeedInfo are "macroable",
+ which allows you to add additional methods to them at runtime.
+ The macro method accepts a closure that will be executed when your macro is called.
+ The macro closure may access the feed's other methods via $this,
+ just as if it were a real method of the feed classes.
+
+ For example, the following code adds a customFilename method to the Feed class:
+
+ Additionally, here are examples for FeedInfo and FeedItem:
+