File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace App \Feeds ;
6+
7+ use App \Models \User ;
8+ use DragonCode \LaravelFeed \Feeds \Feed ;
9+ use Illuminate \Database \Eloquent \Builder ;
10+
11+ class AttributeFeed extends Feed
12+ {
13+ public function builder (): Builder
14+ {
15+ return User::query ();
16+ }
17+
18+ public function perFile (): int
19+ {
20+ return 100 ;
21+ }
22+
23+ public function maxFiles (): int
24+ {
25+ return 10 ;
26+ }
27+ }
Original file line number Diff line number Diff line change 113113
114114 <code-block lang =" xml" src =" advanced-element-attribute.xml" />
115115 </chapter >
116+
117+ <chapter title =" Split files" id =" split_files" >
118+ <secondary-label ref =" format-xml" />
119+ <secondary-label ref =" format-rss" />
120+ <secondary-label ref =" format-json" />
121+ <secondary-label ref =" format-jsonl" />
122+ <secondary-label ref =" format-csv" />
123+
124+ <p >
125+ If necessary, you can limit the number of lines output to a file, as well as the number of files themselves.
126+ To do this, use the perFile and maxFiles functions.
127+ </p >
128+
129+ <code-block lang =" php" src =" advanced-element-split.php" include-lines =" 5-" />
130+
131+ <p >
132+ The methods work independently of each other.
133+ </p >
134+
135+ <p >
136+ When splitting, a sequential number will be added to the file names. For example:
137+ </p >
138+
139+ <list >
140+ <li >attribute-1.xml</li >
141+ <li >attribute-2.xml</li >
142+ <li >attribute-3.xml</li >
143+ </list >
144+ </chapter >
116145</topic >
You can’t perform that action at this time.
0 commit comments