Download the PHP package meius/laravel-flag-forge without Composer

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

Laravel Flag Forge Package

codecov Codacy Badge PHP Version Laravel Version

Recommendation: Prior to integrating this wrapper into your application, please review the documentation for the underlying library meius/flag-forge to fully grasp its foundational concepts and operations.

Laravel Flag Forge is a refined and sophisticated extension that effortlessly bridges the gap between the powerful bitwise flag management capabilities of the core library and the expressive nature of Laravel applications. This package enhances your project with:


Table of Contents


Features


Requirements


Getting Started

To get started with the meius/laravel-flag-forge package, follow the installation instructions below and check out the usage examples.


Installation

  1. Composer Installation:
    Install the package using Composer:

  2. Register the Service Provider:
    Manually register the service provider by adding it to your bootstrap/providers.php file:

Usage

1. Creating Bitwise Enums

Generate a new bitwise enum class using Laravel's Artisan command. For instance, to create an enum for user permissions:

This command scaffolds a template class where you can define a series of bitwise flags such as SendMessages, DeleteMessages, AddUsers, etc. Customize this file to reflect the specific needs of your application.


2. Working with Eloquent (Attribute Casting)

Harness the power of Laravel's Eloquent by converting numeric bitmask fields into expressive FlagManager instances. Consider the following pivot model example:

Example of Eloquent Operations:


3. Mastering Bitwise Operations

The FlagManager object provides a robust API to manage bitwise flags with ease. Below are detailed examples of key methods:

Each of these operations is designed to be chainable, promoting a fluent and natural coding style that enhances readability and maintainability.


4. Using the Facade

The Flag facade grants immediate access to flag management operations. It supports chaining methods for building complex configurations:

This elegant facade simplifies the process of flag manipulation, allowing you to write succinct, expressive code.


5. Leveraging Database Query Methods

Laravel Flag Forge enriches your querying capabilities by providing additional methods that allow filtering based on bitwise flags.

These query methods empower you to create finely tuned database queries, ensuring that your application logic remains both robust and highly expressive.


6. Integrating with Authorization Policies

Seamlessly integrate bitwise flag management into Laravel’s authorization system. For example, consider a policy governing chat interactions. You can employ flag checks directly within policy methods to enforce nuanced permissions:

This integration ensures that your authorization logic remains expressive and perfectly aligned with the dynamic nature of bitwise permissions.


Support

For support, please open an issue on the GitHub repository.

Contributing

We welcome contributions to the meius/laravel-flag-forge library. To contribute, follow these steps:

  1. Fork the Repository: Fork the repository on GitHub and clone it to your local machine.
  2. Create a Branch: Create a new branch for your feature or bugfix.
  3. Write Tests: Write tests to cover your changes.
  4. Run Tests: Ensure all tests pass by running phpunit.
  5. Submit a Pull Request: Submit a pull request with a clear description of your changes.

For more details, refer to the CONTRIBUTING.md file.


License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-flag-forge with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
meius/flag-forge Version ^1.0
illuminate/support Version ^11.0 || ^12.0
illuminate/database Version ^11.0 || ^12.0
illuminate/console Version ^11.0 || ^12.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 meius/laravel-flag-forge contains the following files

Loading the files please wait ....