Download the PHP package laragrad/eloquent-model-userstamps without Composer

On this page you can find all versions of the php package laragrad/eloquent-model-userstamps. 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-model-userstamps

laragrad/eloquent-model-userstamps

This package provides a trait for Model to fill userstamp fields.

Installing

Run command in console

composer require laragrad/eloquent-model-userstamps

Using

Preparing table

Add into your model's table migration userstamp fields. It's type must be same as type of user id. You can use default created_by, updated_by, deleted_by field names or any other.

You can use Laragrad\Support\Userstamps methods addUserstampColumns() to add or dropUserstampColumns() drop columns in your migration file.

For example, to add userstamps columns:

If you use soft deleting in your table then put true into 2nd argument. To change type of your userstamps columns you can put 'uuid' or 'integer' or 'bigInteger' into 3rd argument. By default created columns has default names. If your userstamp columns have not default names then put column name array into 4th argument.

For example:

UserstampsSupport::addUserstampsColumns($table, true, 'uuid', ['create_user_id','update_user_id','deleted_user_id']);

To drop columns you can use UserstampsSupport::dropUserstampsColumns(). For example

UserstampsSupport::dropUserstampsColumns($table, true, ['create_user_id','update_user_id','deleted_user_id']);

Preparing model

Add next changes into your table model class:

The created_by and updated_by fields in your model will now be populated in the same way as the timestamp fields when you create or update the model. If your model uses SoftDeletes trait, will also be processed field, deleted_by.

Using custom userstamp field names

If your table userstamp field names are not defaults then declare next constants in your model:

class YourModel extends Model
{
    ...

    const CREATED_BY = 'your_created_by_field_name'; 
    const UPDATED_BY = 'your_updated_by_field_name'; 
    const DELETED_BY = 'your_deleted_by_field_name'; 

    ...
}

All versions of eloquent-model-userstamps with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.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 laragrad/eloquent-model-userstamps contains the following files

Loading the files please wait ....