mindtwo / slugify
Create WordPress like slugs in laravel or any other php application.
1.1.1
2018-07-12 10:39 UTC
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: dev-master
This package is auto-updated.
Last update: 2024-11-24 12:28:10 UTC
README
Create WordPress like slugs in Laravel or any other php application without wordpress as a dependency.
The code to generate the slug is taken from WordPress 4.9.5 and battle tested on million websites.
Install
composer require mindtwo/slugify
How to use with Laravel:
<?php
echo slugify('Hello everyone');
or:
<?php
echo app('slugify')->generate('Hello everyone');
How to use without Laravel:
<?php
require 'vendor/autoload.php';
echo slugify('Hello everyone');
or:
<?php
require 'vendor/autoload.php';
$slugger = new \mindtwo\Slugify\WordPressSlugger();
echo $slugger->generate('Hello everyone');