Download the PHP package cybercog/laravel-eloquent-flag without Composer

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

Laravel Eloquent Flag

cog-laravel-eloquent-flag

Discord Releases Build StyleCI Code Quality License

Introduction

Eloquent boolean & timestamp flagged attributes behavior. Enhance Eloquent Models with commonly used state flags like Active, Published, Approved and others in a minutes!

Contents

Features

Available flags list

Trait name Logic Database column Flag type Conflict
HasAcceptedAt Classic accepted_at Timestamp HasAcceptedFlag
HasAcceptedFlag Classic is_accepted Boolean HasAcceptedAt
HasActiveFlag Classic is_active Boolean -
HasApprovedAt Classic approved_at Timestamp HasApprovedFlag
HasApprovedFlag Classic is_approved Boolean HasApprovedAt
HasArchivedAt Inverse archived_at Timestamp HasArchivedFlag
HasArchivedFlag Inverse is_archived Boolean HasArchivedAt
HasClosedAt Inverse closed_at Timestamp HasClosedFlag
HasClosedFlag Inverse is_closed Boolean HasClosedAt
HasDraftedAt Inverse drafted_at Timestamp HasDraftedFlag
HasDraftedFlag Inverse is_drafted Boolean HasDraftedAt
HasEndedAt Inverse ended_at Timestamp HasEndedFlag
HasEndedFlag Inverse is_ended Boolean HasEndedAt
HasExpiredAt Inverse expired_at Timestamp HasExpiredFlag
HasExpiredFlag Inverse is_expired Boolean HasExpiredAt
HasInvitedAt Classic invited_at Timestamp HasInvitedFlag
HasInvitedFlag Classic is_invited Boolean HasInvitedAt
HasKeptFlag Classic is_kept Boolean -
HasPublishedAt Classic published_at Timestamp HasPublishedFlag
HasPublishedFlag Classic is_published Boolean HasPublishedAt
HasVerifiedAt Classic verified_at Timestamp HasVerifiedFlag
HasVerifiedFlag Classic is_verified Boolean HasVerifiedAt

Any entity can has more than one flag at the same time. If flags can't work for the same entity simultaneously they are listed in Conflict column.

How it works

Eloquent Flag is an easy way to add flagged attributes to eloquent models. All flags has their own trait which adds global scopes to desired entity.

There are 2 types of flags:

All flags separated on 2 logical groups:

Omitted entities could be retrieved by using special global scope methods, unique for each flag.

Example: If your Article model has PublishedAt flag then Article::get() will return you only published records. When you need to get only unpublished records you could call Article::onlyUnpublished()->get() and Article::withUnpublished()->get() will return you published and unpublished articles as well.

Helper traits will automatically cast flag attributes to a DateTime / Carbon instance or bool for you.

Installation

Pull in the package through Composer.

Usage

Usage examples described in Wiki

Changelog

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

Upgrading

Please see UPGRADING for detailed upgrade instructions.

Contributing

Please see CONTRIBUTING for details.

Testing

Run the tests with:

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev
@zagreusinoz
zagreusinoz
@jonagoldman
Jona Goldman
@irazasyed
Irfaq Syed
@gpioto
gpioto
@rayronvictor
Rayron Victor
@jnbn
Ugur Aydogdu

Eloquent Flag contributors list

Alternatives

Feel free to add more alternatives as Pull Request.

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research the best solutions in product & software development is our passion.

CyberCog


All versions of laravel-eloquent-flag with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/database Version ^9.0|^10.0|^11.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 cybercog/laravel-eloquent-flag contains the following files

Loading the files please wait ....