| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function shorten(string $url, array $opt = []) |
||
| 23 | { |
||
| 24 | $link_length = $opt['length'] ?? config('shortener.link_length') ?? 8; |
||
| 25 | |||
| 26 | return ShortLink::create([ |
||
| 27 | 'id' => Str::random($link_length), |
||
| 28 | 'url' => $url, |
||
| 29 | 'expire_at' => $opt['expire_at'] ?? null, |
||
| 30 | 'not_before' => $opt['not_before'] ?? null, |
||
| 31 | ]); |
||
| 32 | } |
||
| 33 | |||
| 35 |