2017 © Pedro Peláez
 

library easy-slug

Laravel Package for creating a slug

image

easy-slug/easy-slug

Laravel Package for creating a slug

  • Tuesday, May 24, 2016
  • by viraj-khatavkar
  • Repository
  • 1 Watchers
  • 18 Stars
  • 13,510 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 6 Forks
  • 3 Open issues
  • 10 Versions
  • 1 % Grown

The README.md

EasySlug (Laravel Package)

SensioLabsInsight, (*1)

Quick start

EasySlug provides a flexible way to create slugs. It is compatible with both Laravel4 as well as Laravel5, (*2)

Installation

In order to install EasySlug, just add, (*3)

"easy-slug/easy-slug": "2.0.*"

to your composer.json. Then run composer install or composer update., (*4)

Then in your config/app.php add, (*5)

'EasySlug\EasySlug\EasySlugServiceProvider',

in the providers array and, (*6)

'EasySlug' => 'EasySlug\EasySlug\EasySlugFacade'

to the aliases array., (*7)

Simple Slug with validation from database

You can make a simple slug with DB validation using following code, (*8)

<?php

use EasySlug\EasySlug\EasySlugFacade as EasySlug;

/**
 * @param1            => The string to be slugged
 * @param2            => The table name where slug is stored
 * @param3 (Optional) => The column name of slug. If not specified, by default "slug" is considered
 * @param4 (Optional) => The separator of slug. If not specified, by default "-" is taken
 */

EasySlug::generateUniqueSlug('Your String', 'table name', $column = "slug", $separator = '-')

This function looks for similar slugs in the table/column name specified in parameters. If slugs with similar pattern are found it appends numeric digits at the end of slug as follows :, (*9)

your-string
your-string-2
your-string-3
your-string-4

Simple Slug without database validation

You can also make a simple slug with string as a input, (*10)

<?php

use EasySlug\EasySlug\EasySlugFacade as EasySlug;

EasySlug::generateSlug('Your String', $separator = '-')

License

EasySlug is free software distributed under the terms of the MIT license, (*11)

The Versions

24/05 2016

dev-master

9999999-dev

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

 

The Development Requires

by Viraj Khatavkar

20/11 2015

v2.0.4

2.0.4.0

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

 

The Development Requires

by Viraj Khatavkar

20/07 2015

v2.0.3

2.0.3.0

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

 

The Development Requires

by Viraj Khatavkar

20/07 2015

v2.0.2

2.0.2.0

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

 

The Development Requires

by Viraj Khatavkar

06/07 2015

v2.0.1

2.0.1.0

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

 

The Development Requires

by Viraj Khatavkar

15/03 2015

v2.0.0

2.0.0.0

Laravel Package for creating a slug

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Viraj Khatavkar

13/03 2015

v1.2.1

1.2.1.0

Creates simple slug

  Sources   Download

The Requires

 

The Development Requires

by Viraj Khatavkar

13/03 2015

v1.2.0

1.2.0.0

Creates simple slug

  Sources   Download

The Requires

 

The Development Requires

by Viraj Khatavkar

13/03 2015

v1.1.0

1.1.0.0

Creates simple slug

  Sources   Download

The Requires

 

The Development Requires

by Viraj Khatavkar

01/01 2015

v1.0.0

1.0.0.0

Creates simple slug

  Sources   Download

The Requires

 

by Viraj Khatavkar