Download the PHP package lyhty/macronite without Composer

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

Latest Version on Packagist PHP Laravel Total Downloads StyleCI License

This package provides a very convenient macro maker to your Laravel project.

Installation

Install the package with Composer:

composer require lyhty/macronite

The package registers itself automatically.

Extending the MacroServiceProvider

You can make your own pretty MacroServiceProviders by extending the MacroServiceProvider class provided by this package!

Here's an example:

The first macro class referenced in the example above would look something like:

The Macro service provider handles the mapping of the macros quite responsively. You can either explicitly name the macro by setting the key of the array row defining the macro as the name you wish to use. Alternatively you can define a constant MACRO_NAME inside the macro file, which will be used if the key is not defined in the service provider.

Finally, if the key is not defined in the service provider and the macro class does not contain the constant, the class name will be used. For example ExampleMacro::class macro will be named as example.

Commands

make:macro

You can use make:macro <name> to generate a macro file to help you with the structure. The command supports --mixin option (example: --mixin=/Illuminate/Support/Collection). This will add a PHP docblock above the macro class declaration with @mixin tag.

macro:generate

The package also comes with macro:generate command. If you have a provider class setup that extends Lyhty\Macronite\MacroServiceProvider class, the command will go through the macros defined in the provider and generate the ones that are missing. This way you can define multiple macros you know you will have and then generate them in bulk. It is very similar to Laravel's event:generate in its behavior.

For example:

Assuming ExampleMacro doesn't exist yet, the command would then generate the macro class, automatically also filling in the @mixin tag.

macro:cache & macro:clear

Since the macro mapping is very dynamic, you can cache the macros to be set in stone with macro:cache. The cache can be cleared with the macro:clear function.

macro:list

If you want to list all the macros that are created using the MacroServiceProvider, you can use the macro:list command.

Example output:

Example verbose output:

License

Lyhty Macros is open-sourced software licensed under the MIT license.


All versions of macronite with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 | ^8.2
illuminate/collections Version ^10.0 | ^11.0
illuminate/console Version ^10.0 | ^11.0
illuminate/filesystem Version ^10.0 | ^11.0
illuminate/support Version ^10.0 | ^11.0
laravel/prompts Version ^0.1.12
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 lyhty/macronite contains the following files

Loading the files please wait ....