Download the PHP package yieldstudio/eloquent-public-id without Composer

On this page you can find all versions of the php package yieldstudio/eloquent-public-id. 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 eloquent-public-id

Eloquent Public Id

Latest Version GitHub Workflow Status Total Downloads

What It Does

The interest of public IDs is to keep a whole and incremental ID, while having a UUID to expose to the front end, which can be convenient for security reasons.

This package offers two features:

Installation

You can install the package via composer:

HasPublicId Trait

This Trait will enable your Model to have benefit of all the actions needed to process the public id.

Once package installed, Add a public id field into your table

Next step, use the HasPublicId trait into your Model

It's ready to work :)

⚠️ By default the trait will mark the ID field as a hidden field and guard the public ID.

The Trait adds some methods to your Model, here they are:

Name Description
wherePublicId(string $publicId) A new scope to find with a public ID
findByPublicId(string $publicId, array $columns = ['*']) A new static method to get a model by their public ID
getPublicIdName() Returns the public ID column name
getPublicId() Returns the public ID of the model

Change the name of the public ID column

If in your migration you have chosen another field name instead of public_id, you have to specify this field using the getPublicIdName function.

Change the generation of the public ID

The public id is automatically generated once your Model is created in the database. If you want to modify the value of the generation of this field, you must add the generatePublicId function to your Model

ConvertPublicId Trait

Allowing to convert public IDs to IDs in a FormRequest (before validation).

Unit tests

To run the tests, just run composer install and composer test.

Contact us

Our team at Yield Studio is ready to welcome you and make every interaction an exceptional experience. You can contact us.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of eloquent-public-id with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
illuminate/support Version ^9|^10.0|^11.0
illuminate/database Version ^9|^10.0|^11.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 yieldstudio/eloquent-public-id contains the following files

Loading the files please wait ....