Download the PHP package maize-tech/laravel-badges without Composer

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

# Laravel Badges [![Latest Version on Packagist](https://img.shields.io/packagist/v/maize-tech/laravel-badges.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-badges) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-badges/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/maize-tech/laravel-badges/actions?query=workflow%3Arun-tests+branch%3Amain) [![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/maize-tech/laravel-badges/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/maize-tech/laravel-badges/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/maize-tech/laravel-badges.svg?style=flat-square)](https://packagist.org/packages/maize-tech/laravel-badges) This package lets you easily add badge mechanics to your application. ## Installation You can install the package via composer: You can publish the config and migration files and run the migrations with: This is the contents of the published config file: ## Usage ### Basic To use the package, firstly you should implement the `Maize\Badges\HasBadges` interface and apply the `Maize\Badges\InteractsWithBadges` trait to all models who can have badges: Once done, all you have to do is define a class for each badge, extend the `Maize\Badges\Badge` class and implement the `isAwarded` abstract method: Once done, don't forget to list the newly created badge within the `badges` list under `config/badges.php`: ### Progressable badges If your badge can have progress, you should extend the `Maize\Badges\ProgressableBadge` class and implement both the `getTotal` and `getCurrent` abstract methods: Under the hoods, the `isAwarded` method checks if `getCurrent` is equals or greater than `getTotal`. ### Badge metadata What is a badge without a name or description? To accomplish this, you can override the `metadata` method within all badge classes. Here is an example implementation using Laravel built-in translation method and the badge slug: Once done, you can retrieve the metadata using both the badge class and the `BadgeModel` entities: ### Custom badge slug All badges have a default slug used when storing a badge awarded event into the database. The default slug is the badge's fully qualified class name. For example, `FirstLogin` badge's slug would be `App\Badges\FirstLogin`. You can however customize the default behaviour overriding the `slug` method. Here is an example using the badge's class basename in kebab case: Beware that all badge classes should have a unique slug to prevent inconsistencies. ### Giving a badge You can give a badge to any entity implementing the `HasBadges` interface using one of the following methods: When giving a badge, the `isAwarded` method will be evaluated to make sure the entity meets the conditions. Every time a badge is given, a `BadgeAwarded` event will also be fired. ### Check if a badge is awarded To check if an entity has a badge, you can use the `hasBadge` method: ### Retrieve awarded badges To retrieve all badges awarded by an entity, you can use the `badges` relationship which returns a list of `BadgeModel` entities. ### Sync badges To sync all badges for a given entity, you can use the `syncBadges` method, which retrieves all badges within the `badges` list under `config/badges.php` and checks whether it can be awarded or not. ### Scheduling badges cleanup The package also comes with the `badges:clear` command, which automatically deletes all stored badges which are not anymore listed within the `badges` list under `config/badges.php`: You may schedule the command using the `schedule` method of the console kernel (usually located under the `App\Console` directory): ## Testing ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## Contributing Please see [CONTRIBUTING](https://github.com/maize-tech/.github/blob/main/CONTRIBUTING.md) for details. ## Security Vulnerabilities Please review [our security policy](https://github.com/maize-tech/.github/security/policy) on how to report security vulnerabilities. ## Credits - [Riccardo Dalla Via](https://github.com/riccardodallavia) - [All Contributors](../../contributors) ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

All versions of laravel-badges with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.14.1
illuminate/console Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^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 maize-tech/laravel-badges contains the following files

Loading the files please wait ....