Download the PHP package sarkis-sh/spray-aop without Composer

On this page you can find all versions of the php package sarkis-sh/spray-aop. 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 spray-aop

Spray AOP

Latest Version Laravel PHP

A lightweight, high-performance Aspect-Oriented Programming (AOP) package for Laravel, built specifically for PHP 8.2+ Attributes.

Spray AOP enables you to apply cross-cutting concerns to your application classes using native PHP Attributes and dynamically generated proxy classes. It hooks into the Laravel Service Container to automatically resolve proxied versions of your classes whenever aspects are detected, ensuring clean separation of logic with zero manual boilerplate.

Table of Contents

Features

Requirements

Installation

Laravel will auto-discover the provider via Spray\Aop\Providers\AopServiceProvider.

Publish Configuration

This publishes the configuration file to config/spray-aop.php.

Configuration

The published config supports:

Default config values:

Usage

Create an Aspect and Attribute

You can create both using the built-in generator:

The generated files include:

Command Options

Customize your Aspect and Attribute generation with the following options:

Option Short Description
--before -b Include the before() hook in the generated Aspect
--after -a Include the after() hook in the generated Aspect
--around -x Include the handle() (around) method for full control over method execution
--exception -e Include the onException() hook for exception handling logic
--class -c Allow the Attribute to target classes
--method -m Allow the Attribute to target methods
--repeatable -r Make the Attribute repeatable (allows multiple instances on the same target)
--force - Force creation even if the Aspect or Attribute already exists

Examples

Generate with before and after hooks on methods:

Generate with exception handling on classes:

Generate a full-featured repeatable Aspect:

Example Aspect Attribute

Example Aspect Handler

The $invocation array contains the following keys:

Full Examples of Generated Aspects

Here are complete examples of aspects generated with different options using php artisan spray:make-aspect. Each example shows the Aspect class and its corresponding Attribute.

Before Hook Only (--before)

Corresponding Attribute:

After Hook Only (--after)

Exception Hook Only (--exception)

Around Hook (--around)

For full control, use the handle method (around advice):

Combined Hooks (--before --after --exception)

Apply the Attribute

How It Works

Artisan Commands

Production

For production deployments, disable runtime generation and cache proxies ahead of time:

Then run:

Notes

License

MIT — see LICENSE


All versions of spray-aop with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/pipeline Version ^10.0|^11.0|^12.0|^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 sarkis-sh/spray-aop contains the following files

Loading the files please wait ...