Download the PHP package honey-comb/slugs without Composer
On this page you can find all versions of the php package honey-comb/slugs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download honey-comb/slugs
More information about honey-comb/slugs
Files in honey-comb/slugs
Package slugs
Short Description HoneyComb slugs
License MIT
Homepage https://github.com/honey-comb/slugs
Informations about the package slugs
honeycomb-slugs
https://github.com/honey-comb/slugs
Description
Slugs manager for HoneyComb CMS
Attention
This is part core package HoneyComb CMS package.
If you want to use laravel version 5.5. [use slug package version 0.1.](https://github.com/honey-comb/slugs/tree/5.5 "Slugs package version 0.1.*")
Requirement
- php:
^7.1
- laravel:
^5.6
-
composer
Installation
Begin by installing this package through Composer.
or
Usage
generateHCSlug(string $path, string $string, string $separator = '-')
It is a helper function, which requires few parameters:
$path
- Under which domain the slug will be generated.
$string
- Source from which text the slug will be generated.
$separator
- You can specify a custom separator
Examples
Let's say we have 2 services House
and Flat
. Each of them will have a record with at title One
. And both of them will require a slug.
$houseSlug = generateHCSlug('house', 'One'); // output: one
$flatSlug = generateHCSlug('flat', 'One'); // output: one
Only when we will call it with the same name few times, then it will kick in.
$flatSlug = generateHCSlug('flat', 'One'); // output: one
$flatSlug = generateHCSlug('flat', 'One'); // output: one-1
$flatSlug = generateHCSlug('flat', 'One'); // output: one-2
All versions of slugs with dependencies
laravel/framework Version 5.6.*
honey-comb/starter Version 0.2.*
honey-comb/core Version 0.3.*