|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | return [ |
4 | | - |
5 | | - /** |
| 4 | + /* |
6 | 5 | * What attributes do we use to build the slug? |
7 | 6 | * This can be a single field, like "name" which will build a slug from: |
8 | 7 | * |
|
20 | 19 |
|
21 | 20 | 'source' => null, |
22 | 21 |
|
23 | | - /** |
| 22 | + /* |
24 | 23 | * The maximum length of a generated slug. Defaults to "null", which means |
25 | 24 | * no length restrictions are enforced. Set it to a positive integer if you |
26 | 25 | * want to make sure your slugs aren't too long. |
27 | 26 | */ |
28 | 27 |
|
29 | 28 | 'maxLength' => null, |
30 | 29 |
|
31 | | - /** |
| 30 | + /* |
32 | 31 | * If you are setting a maximum length on your slugs, you may not want the |
33 | 32 | * truncated string to split a word in half. The default setting of "true" |
34 | 33 | * will ensure this, e.g. with a maxLength of 12: |
|
43 | 42 |
|
44 | 43 | 'maxLengthKeepWords' => true, |
45 | 44 |
|
46 | | - /** |
| 45 | + /* |
47 | 46 | * If left to "null", then use the cocur/slugify package to generate the slug |
48 | 47 | * (with the separator defined below). |
49 | 48 | * |
|
61 | 60 |
|
62 | 61 | 'method' => null, |
63 | 62 |
|
64 | | - /** |
65 | | - * Separator to use when generating slugs. Defaults to a hyphen. |
66 | | - */ |
| 63 | + // Separator to use when generating slugs. Defaults to a hyphen. |
67 | 64 |
|
68 | 65 | 'separator' => '-', |
69 | 66 |
|
70 | | - /** |
| 67 | + /* |
71 | 68 | * Enforce uniqueness of slugs? Defaults to true. |
72 | 69 | * If a generated slug already exists, an incremental numeric |
73 | 70 | * value will be appended to the end until a unique slug is found. e.g.: |
|
79 | 76 |
|
80 | 77 | 'unique' => true, |
81 | 78 |
|
82 | | - /** |
| 79 | + /* |
83 | 80 | * If you are enforcing unique slugs, the default is to add an |
84 | 81 | * incremental value to the end of the base slug. Alternatively, you |
85 | 82 | * can change this value to a closure that accepts three parameters: |
86 | 83 | * the base slug, the separator, and a Collection of the other |
87 | 84 | * "similar" slugs. The closure should return the new unique |
88 | 85 | * suffix to append to the slug. |
89 | 86 | */ |
90 | | - |
| 87 | + |
91 | 88 | 'uniqueSuffix' => null, |
92 | 89 |
|
93 | | - /** |
| 90 | + /* |
94 | 91 | * What is the first suffix to add to a slug to make it unique? |
95 | 92 | * For the default method of adding incremental integers, we start |
96 | 93 | * counting at 2, so the list of slugs would be, e.g.: |
|
101 | 98 | */ |
102 | 99 | 'firstUniqueSuffix' => 2, |
103 | 100 |
|
104 | | - /** |
| 101 | + /* |
105 | 102 | * Should we include the trashed items when generating a unique slug? |
106 | 103 | * This only applies if the softDelete property is set for the Eloquent model. |
107 | 104 | * If set to "false", then a new slug could duplicate one that exists on a trashed model. |
|
110 | 107 |
|
111 | 108 | 'includeTrashed' => false, |
112 | 109 |
|
113 | | - /** |
| 110 | + /* |
114 | 111 | * An array of slug names that can never be used for this model, |
115 | 112 | * e.g. to prevent collisions with existing routes or controller methods, etc.. |
116 | 113 | * Defaults to null (i.e. no reserved names). |
|
136 | 133 |
|
137 | 134 | 'reserved' => null, |
138 | 135 |
|
139 | | - /** |
| 136 | + /* |
140 | 137 | * Whether to update the slug value when a model is being |
141 | 138 | * re-saved (i.e. already exists). Defaults to false, which |
142 | 139 | * means slugs are not updated. |
|
146 | 143 | * is probably not a good idea from an SEO point of view. |
147 | 144 | * Only set this to true if you understand the possible consequences. |
148 | 145 | */ |
149 | | - |
| 146 | + |
150 | 147 | 'onUpdate' => false, |
151 | 148 |
|
152 | | - /** |
| 149 | + /* |
153 | 150 | * If the default slug engine of cocur/slugify is used, this array of |
154 | 151 | * configuration options will be used when instantiating the engine. |
155 | 152 | */ |
156 | 153 | 'slugEngineOptions' => [], |
157 | | - |
158 | 154 | ]; |
0 commit comments