Code Monkey home page Code Monkey logo

Comments (2)

cviebrock avatar cviebrock commented on June 1, 2024 1

I think if you are using this package on a system were the database sensitivity is important, then you should take that into account when defining the method used to generate slugs.

By default, the package uses the cocur/slugify method, which should convert everything to lowercase. I see you are coming into this with a bunch of pre-existing slugs that aren't explicitly lowercase, so I think the easiest option is to redefine the slugEngineOptions in the configuration so that slugs aren't lowercased by default, e.g.:

public function sluggable(): array
{
    return [
        'slug' => [
            'source' => 'title',
            'slugEngineOptions' => [
                'lowercase' => false
            ]
        ]
    ];
}

Otherwise, I think you would need to either convert all your existing slugs to lowercase (if that's how new slugs will be generated), or create a custom method in the configuration that returns slugged strings in a mixed-case format.

Make sense?

from eloquent-sluggable.

o15a3d4l11s2 avatar o15a3d4l11s2 commented on June 1, 2024

Happy New Year, stay healthy and happy. Thank you for your input. The easiest solution for me was to lowercase all slugs (they are used for url generation, so absolutely makes sense) and I left the configuration unchanged.

from eloquent-sluggable.

Related Issues (20)

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.