17. ID vs UUID vs ULID. Laravel slug with edit option. Booting a trait. Sqids vs Hashids

Video version
(Leave your feedback on YouTube)

Never, NEVER expose numerical IDs on the front end.

IDOR vulnerability is not resolved by hiding IDs. However, it does reduce the immediate damage from the vulnerability.

Numerical IDs reveal the real statistics of your project, so it's important to hide them from regular users.

Squid converts an array of integers into a unique string. The string can be decrypted even without knowing the alphabet. Therefore, do not use it for transmitting sensitive data.

With ULID and newer UUID specifications, you can retrieve the creation date of the record.

Problems with numerical ID replication exist but are not critical.

Eloquent allows using boot in traits. Just name the function {TraitName}Boot.

Think about the links to your site when developing a slug.

If the slug can be edited, it is important for SEO to have a single link to the page. Therefore, redirect old URLs to the new one with a 302 status.

install GMP
RUN apk add gmp-dev && docker-php-ext-install gmp