Download the PHP package tedon/laravel-actor without Composer

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

Laravel Actor

A brand option to have auto generated specific action fields in model. Using this package helps you universalize fields along your team.

Installation

In order to add the capability to your laravel application, you should require it via composer.

Publish configuration file

By publishing configuration file, it is possible to edit predefined custom shortcut macros.

Usage

Basic Usage

You can use actor as a macro in migrations. Verb form of action is passed as the first argument.

In the provided example, $table->actor('test'); will create fields tester_id and tester_type

Shortcut Macros

You can use some macros as shortcuts. by default, creator and editor macros is defined.

In the provided example, fields creator_id, creator_type, editor_id and editor_type is created for users table.

Define Custom Shortcut Macros

use the provided config file to add or remove custom shortcut macros.

In the provided example, the create macro is remove and the approve macro is added to the code;

Model Traits

There is a trait provided in the package: Actorable. The actorable function is defined to handle auto-set feature.

In the example above, edit-related fields is set on model update automatically. Currently, The create action is also available to be auto-set.

Retrieve Actor Data

Though you can access to fields directly by field name, there are some functions to access actor data.

Available Methods:

The following methods is added by using Actorable trait on the model. It is totally clear that the macros in migration should be used before to generate related columns.

Get Actor ID:

Retrieve actor id of given action.

Get Actor Type:

Retrieve actor type of given action.

Get Acted At:

Retrieve the time when given action is acted at.

Get Actor:

Retrieve the actor model.

Get Act:

Returns an array containing all above data.

Set Actor Data

The action field can be set with methods below.

Touch Action

This method is provided to set all action fields at the same time with the authenticated user.

Clear Action

This method is provided to clear all action fields at the same time.

Check and filter Actor Data

These accessories are used for checking and filtering action data

Check If Is Acted By

This method is used for checking if the model is acted by specific user on a specific action

returns true if the model is acted on the action by the given user.

Acted By Scope

There is a scope provided for filtering the actorable model data to get record with the given actor on the given action.

The expression above scopes actorable model query with the given action and given authenticatable user.

License

The Laravel Actor package is open-sourced software licensed under the MIT license.


All versions of laravel-actor with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
davechild/textstatistics Version ^1.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 tedon/laravel-actor contains the following files

Loading the files please wait ....