Download the PHP package kamansoft/laravel-blame without Composer

On this page you can find all versions of the php package kamansoft/laravel-blame. 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 laravel-blame

laravel-blame

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

update_by and created_by fields in your laravel model ?

This is a laravel package that will ease the usage of the normally called created_by and update_by extra fields used to stablish responsabilites on records persistance create or update events, with similar fashion as the "timestamp fields" on Eloquent's models, it automatically fills the fields with the primary key of the currently logged user or with a preconfigured system user id.

Requirements

This packages was build taking in mind that you use laravel with an eloquent user model class as auth provider. So before installing you must make sure that your user eloquent model is set on the providers section of your auth config file like this:

Installation

You can install the package via composer:

Some times your laravel application will perform actions that persists records on the database without an authenticated or logged in user, You can call this user as System User or any other name you want, but you must specify its id or primary key.

To do so you can run the system user command or the package install comand:

The above command will publish the package config file and it will run the system user command with no arguments.

Usage

You must first add the update_by and created_by fields to the table's migration field in order to use it in your models.

Then just make use of the Modelblamer trait on your eloquent models, and its booting method will take care of the rest. Also for the seek of a good practice let your model implement the BlameableInterface on your models. Then your model should look something like this

Commands

This package ships two artisan commands as tools to ease the package usage simplifiying repetitive task like creating or updating the systemuser or adding the updated by and created by fields to your model's table.

Blame FIelds Migration command

This command is primarly intend to be used when you need to update an existing table, adding the created_by and updated_by fields, it needs an argument with the name of the table to update.

When runned the above command will create a new migration file in the database/migrations folder with the name add_blame_fields_to_some_table_name_table with a content similar to this:

System User Command

When used with no param or arguments:

This command creates a new laravel user to be used when no user can be retrived with Auth::user().

When runned with a value throug the optional "--key" param:

The command will check if a user with that id exists and if not it will try to create one with that id.

In both cases the command will set the created system user primary key or id in the project .env file as BLAME_SYSTEM_USER_ID.


All versions of laravel-blame with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/dbal Version ^3.5
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.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 kamansoft/laravel-blame contains the following files

Loading the files please wait ....