@@ -115,18 +115,6 @@ public function show(Post $post){
115115
116116## Customisation
117117
118- ### Padding
119-
120- Change the minimum length of a slug (default: 5)
121-
122- ``` php
123- class Post extends Model {
124- use HasHashSlug;
125-
126- protected static $minSlugLength = 10;
127- }
128- ```
129-
130118### Salts
131119
132120The uniqueness of hashslug series per model and app installation depends on having unique salts.
@@ -141,7 +129,7 @@ To change the 'application salt', create file `config/hashslug.php` then add the
141129<?php
142130
143131return [
144- 'appsalt' => 'your-application-salt'
132+ 'appsalt' => 'your-application-salt'
145133];
146134```
147135
@@ -153,29 +141,52 @@ To use a custom model salt instead of the classname:
153141
154142``` php
155143class Post extends Model {
156- use HasHashSlug;
144+ use HasHashSlug;
157145
158- protected static $modelSalt = "posts";
146+ protected static $modelSalt = "posts";
159147}
160148```
161149
162150This might be a good idea to do, if you have several extended classes of the same model and you need hashslugs to be consistent.
163151
152+ ### Padding
153+
154+ Change the minimum length of a slug (default: 5)
155+
156+ ``` php
157+ class Post extends Model {
158+ use HasHashSlug;
159+
160+ protected static $minSlugLength = 10;
161+ }
162+ ```
164163
165- #### Alphabet
164+ You can set the minimum length of a slug globally too, by adding the following line to ` config/hashslug.php ` :
165+
166+ ``` php
167+ 'minSlugLength' => 10
168+ ```
169+
170+ ### Alphabet
166171
167172The default alphabet is ` abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 `
168173
169174This can be changed:
170175
171176``` php
172177class Post extends Model {
173- use HasHashSlug;
178+ use HasHashSlug;
174179
175- protected static $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
180+ protected static $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
176181}
177182```
178183
184+ You can set the alphabet globally too, by adding the following line to ` config/hashslug.php ` :
185+
186+ ``` php
187+ 'alphabet' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
188+ ```
189+
179190## Similar packages and how is this one different
180191
181192#### [ Laravel Hashids] ( https://github.com/vinkla/laravel-hashids )
0 commit comments