Download the PHP package jdavidbakr/ulidmodelroutes without Composer

On this page you can find all versions of the php package jdavidbakr/ulidmodelroutes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ulidmodelroutes

Ulidmodelroutes

Packagist PHP from Packagist Laravel versions GitHub Workflow Status (main) Total Downloads

Configures models to have ULID or UUID route keys while still having integer primary keys

Installation

You can install the package via Composer:

If you want to change the default ULID column name, publish the config file:

Usage

Add an identifier column to each model table that should be used for route model binding. Keep it indexed and unique.

For ULIDs:

For UUIDs:

Apply the trait to the model.

Once the trait is applied:

Example route:

Example URL generation:

Customizing the column name per model

If a model should use a different route key column, define ulidRouteKeyColumnName on that model.

Setting a package-wide default column

After publishing the config file, change the default column name:

Switching between ULID and UUID

By default, the package generates ULIDs.

You can switch to UUID generation in the config file:

Notes:

Existing data

This package does not create database columns for you. If you are adding route identifiers to an existing table, add the column in a migration and then backfill missing values before making the column unique.

You can backfill an existing model with the included Artisan command:

The command only fills missing route key values. When a row has a created_at value, the generated ULID or UUIDv7 uses that timestamp so the resulting identifiers stay as close as possible to the model's original creation order.

Recommended rollout for existing tables:

  1. Add the nullable ULID column.
  2. Run the backfill command for the model.
  3. Verify all rows have values.
  4. Add the unique index and, if desired, make the column non-nullable.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Thank you for considering contributing to UlidModelRoutes.

Security Vulnerabilities

Please open a private security advisory or contact the maintainer directly if you discover a vulnerability.

Credits

License

Ulidmodelroutes is open-sourced software licensed under the MIT license.


All versions of ulidmodelroutes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/database Version ^12.0||^13.0
illuminate/support Version ^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jdavidbakr/ulidmodelroutes contains the following files

Loading the files please wait ...