mindtwo/slugify

Create WordPress like slugs in laravel or any other php application.

1.1.1 2018-07-12 10:39 UTC

This package is auto-updated.

Last update: 2024-10-24 12:07:07 UTC


README

Total Downloads Latest Stable Version Latest Unstable Version License

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');