@@ -74,6 +74,8 @@ Each feed can be created in a certain folder of a certain storage.
7474To indicate the storage, reduce the property of ` $storage ` in the feed class:
7575
7676``` php
77+ use DragonCode\LaravelFeed\Feeds\Feed;
78+
7779class UserFeed extends Feed
7880{
7981 protected string $storage = 'public';
@@ -85,6 +87,8 @@ By default, `public`.
8587The path to the file inside the storage is indicated in the ` filiname ` method:
8688
8789``` php
90+ use DragonCode\LaravelFeed\Feeds\Feed;
91+
8892class UserFeed extends Feed
8993{
9094 public function filename(): string
@@ -176,25 +180,26 @@ According to this example, the XML file with the following contents will be gene
176180#### Setting the root element
177181
178182``` php
183+ use DragonCode\LaravelFeed\Data\ElementData;
184+ use DragonCode\LaravelFeed\Feeds\Feed;
185+
179186class UserFeed extends Feed
180187{
181- public function rootItem(): ?string
182- {
183- return 'users';
184- }
185-
186- public function rootAttributes(): array
188+ public function root(): ElementData
187189 {
188- return [
189- 'foo' => 'some value',
190- ];
190+ return new ElementData(
191+ name: 'users',
192+ attributes: ['foo' => 'some value']
193+ );
191194 }
192195}
193196```
194197
195198#### Adding attributes for the main section
196199
197200``` php
201+ use DragonCode\LaravelFeed\Feeds\Items\FeedItem;
202+
198203class UserFeedItem extends FeedItem
199204{
200205 public function attributes(): array
@@ -223,6 +228,8 @@ class UserFeedItem extends FeedItem
223228> - ` @mixed `
224229
225230``` php
231+ use DragonCode\LaravelFeed\Feeds\Items\FeedItem;
232+
226233class UserFeedItem extends FeedItem
227234{
228235 public function toArray(): array
@@ -264,6 +271,8 @@ class UserFeedItem extends FeedItem
264271If it is necessary to change the file cap, override the ` header ` method in the feed class:
265272
266273``` php
274+ use DragonCode\LaravelFeed\Feeds\Feed;
275+
267276class UserFeed extends Feed
268277{
269278 public function header(): string
0 commit comments