shlogg · Early preview
A.s Nasseri @nassiry

Laravel Encoder: Simple URL-Safe Encoding For IDs & Strings

Created a lightweight PHP package for efficient string & ID encoding/decoding with customizable schemes like Base62 & URL-safe options. Perfect for creating URL-safe tokens & encoding database IDs.

In one of my Laravel projects, I ran into a challenge:

I needed to encode and decode strings efficiently. Initially, I turned to Laravel's built-in encrypt and decrypt functions. While they worked, the encoded strings were too long and unsuitable for my use case made the URLs messy and impractical for sharing..
Then I experimented with Base64 encoding. It was closer to what I needed, but making it URL-safe added unnecessary complexity. Frustrated by the lack of an all-in-one solution, I realized there wasn’t a straightforward package for encoding IDs and strings with a customizable and URL-sa...