|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
| 5 | +use DragonCode\LaravelFeed\Transformers\BooleanTransformer; |
| 6 | +use DragonCode\LaravelFeed\Transformers\DateTimeTransformer; |
| 7 | + |
| 8 | +/** |
| 9 | + * Laravel Feeds configuration |
| 10 | + * |
| 11 | + * This file defines how feeds are generated and presented, including |
| 12 | + * formatting, persistence, scheduling, console UX and value transformers. |
| 13 | + * Adjust the options below or override them via environment variables. |
| 14 | + */ |
5 | 15 | return [ |
6 | 16 | /** |
7 | 17 | * Pretty-print the generated feed output. |
8 | 18 | * |
9 | 19 | * When enabled, the resulting XML/JSON will include indentation and |
10 | 20 | * human‑friendly formatting. Disable for slightly smaller payload size. |
11 | 21 | * |
12 | | - * By default, false |
| 22 | + * Default: false |
13 | 23 | */ |
14 | 24 | 'pretty' => (bool) env('FEED_PRETTY', false), |
15 | 25 |
|
| 26 | + /** |
| 27 | + * Output format options. |
| 28 | + */ |
| 29 | + 'formats' => [ |
| 30 | + /** |
| 31 | + * Date/time format used when serializing timestamps to feeds. |
| 32 | + * You may use any PHP date format constant, e.g. DATE_ATOM, DATE_RFC3339 |
| 33 | + * or a custom PHP date() format string. |
| 34 | + * |
| 35 | + * Default: DATE_ATOM |
| 36 | + */ |
| 37 | + 'date' => DATE_ATOM, |
| 38 | + ], |
| 39 | + |
16 | 40 | /** |
17 | 41 | * Database table settings used by the package (e.g., for generation logs or state). |
18 | 42 | */ |
|
22 | 46 | * |
23 | 47 | * Should match a connection defined in config/database.php under |
24 | 48 | * the "connections" array. |
| 49 | + * |
| 50 | + * Default: sqlite |
25 | 51 | */ |
26 | 52 | 'connection' => env('DB_CONNECTION', 'sqlite'), |
27 | 53 |
|
28 | 54 | /** |
29 | 55 | * The database table name used by the package. |
| 56 | + * |
| 57 | + * Default: feeds |
30 | 58 | */ |
31 | 59 | 'table' => env('FEED_TABLE', 'feeds'), |
32 | 60 | ], |
|
40 | 68 | * |
41 | 69 | * Controls how frequently a scheduled job may be executed to avoid |
42 | 70 | * overlapping or excessively frequent runs. |
| 71 | + * |
| 72 | + * Default: 1440 (24 hours) |
43 | 73 | */ |
44 | 74 | 'ttl' => (int) env('FEED_SCHEDULE_TTL', 1440), |
45 | 75 |
|
|
48 | 78 | * |
49 | 79 | * When true, tasks will be dispatched to run asynchronously so they do |
50 | 80 | * not block the current process. Set to false to run in the foreground. |
| 81 | + * |
| 82 | + * Default: true |
51 | 83 | */ |
52 | 84 | 'background' => (bool) env('FEED_SCHEDULE_RUN_BACKGROUND', true), |
53 | 85 | ], |
|
62 | 94 | * When set to true, the feed:generate command will display a |
63 | 95 | * progress bar showing the execution progress. |
64 | 96 | * |
65 | | - * Default is false. |
| 97 | + * Default: false |
66 | 98 | */ |
67 | 99 | 'progress_bar' => (bool) env('FEED_CONSOLE_PROGRESS_BAR_ENABLED', false), |
68 | 100 | ], |
| 101 | + |
| 102 | + /** |
| 103 | + * Transformers convert rich/complex values to simple scalar representations |
| 104 | + * suitable for feeds (XML/JSON). Order matters: the first transformer that |
| 105 | + * supports the value will handle it. |
| 106 | + * |
| 107 | + * You may add your own transformers by implementing |
| 108 | + * DragonCode\LaravelFeed\Contracts\Transformer and registering the class |
| 109 | + * here, or publish a stub via the package's make command if available. |
| 110 | + */ |
| 111 | + 'transformers' => [ |
| 112 | + DateTimeTransformer::class, |
| 113 | + BooleanTransformer::class, |
| 114 | + ], |
69 | 115 | ]; |
0 commit comments