Download the PHP package magdicom/laravel-hooks without Composer

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

A lightweight action hooks package for Laravel

Latest Version on Packagist

This is a laravel 9 magdicom/hooks wrapper that lets easily use action hooks in your laravel project.

Installation

You can install the package via composer:

Usage

To call any of the available method you can use the facade:

or use the helper function as below:

Quick Start

The above example will output

Output

When you call any of toArray methods.

Callbacks

Closure

Function Name

Object Method

or

Static Method

in case this is not a static method, an object will be created and the provided method will be called.

Parameters

With each of hook callback functions execution an array of parameters could be passed to it to help it perform the required action.

Parameters split into two types:

Priority

When you need to ensure that certain hook functions should be executed in sequence order, here it comes $priority which is the 3rd and last argument of register method.

Methods

register

Register all your hook functions via this method:

all

Will execute all callback functions of the specified hook name, by default it will return the output as string, check output section for more options.

Please Note: parameters provided via this method will be available only in the scope of the specified hook name, to specify global parameters use setParameters methods instead.

first

Similar to all method in every aspect with the exception that only the first callback (after sorting) will be executed.

last

Similar to all method in every aspect with the exception that only the last callback (after sorting) will be executed.

toArray

Will return output of the last executed hook name functions as an array.

toString

Will return output of the last executed hook name functions as one string.

setParameter

Use this method to define a parameter that will be accessible from any hook function.

P.S: if the parameter already defined then its old value will be replaced by the value provided here.

setParameters

Same as setParameter but here it accepts a name, value pair array as its only argument.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-hooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^v9.48.0
magdicom/hooks 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 magdicom/laravel-hooks contains the following files

Loading the files please wait ....