Giter Site home page Giter Site logo

easy-slug's People

Contributors

varadmondkar avatar viraj-khatavkar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

easy-slug's Issues

generateUniqueSlug not working for slugs without -% at the end

Clients began to complain about the wrong records being retrieved when they clicked on links and I assumed that I had forgotten to enable EasySlug when creating those entries. I checked my code and found that I had indeed used EasySlug::generateUniqueSlug().

If I have an entry with a slug of football-season on my seasons table, EasySlug will generate the next slug as football-season. However, if I change the slug on the table to football-season-1, EasySlug generates the next as football-season-2.

As a test I tried using the wrong table name to see the SQL query behind the scenes and noticed this:

$title = "Football Season";
$slug = EasySlug::generateUniqueSlug($title, "season", "slug");
select count(*) as aggregate from `season` where `slug` LIKE football-season-%

So it appears to be looking only for the number of items with -% in their slug, not simply a slug without the number of entries.

Am I missing something? This worked until recently, perhaps a breaking change somewhere?

Composer Cannot Install

Adding "easy-slug/easy-slug": "2.0." to composer.json with laravel 5.0.16, concludes that it should uninstall laravel, because "easy-slug/easy-slug v2.0.0 requires illuminate/database 4. -> satisfiable by illuminate/database[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.24, v4.1.25, v4.1.26, v4.1.27, v4.1.28, v4.1.29, v4.1.3, v4.1.30, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9]", and none of those illuminate/database are concluded to work with L5.

Unique Slug is not generated if first slug is modified

I found the issue when using Easy Slug for user registrations. The generateUniqueSlug method fails in the following scenario.

if slug for user1 is abc-xyz
if slug is generated for new user then new slug will be generated as abc-xyz-2

Now if the record with fist slug abc-xyz is modified OR deleted then the generateUniqueSlug method fails to generate a unique slug i.e. abc-xyz-2 is generated as new slug

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.