withAttribute
Learn how to add a context attribute to the content.
This method adds a context attribute, identified by a name, to the content.
Signature
This method has the following signature:
public function withAttribute(string $name, mixed $value): selfThis method returns a copy of the options with the change applied, leaving the original unchanged.
Example
Here is a basic example of how to use this method:
<?phpuse Croct\Plug\FetchOptions;
$options = FetchOptions::defaults()->withAttribute('plan', 'premium');Parameters
The following list describes the supported parameters: