Download the PHP package gecche/laravel-bannable without Composer

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

License Laravel Laravel Laravel Laravel Laravel Laravel Laravel

laravel-bannable

Laravel package to handle bannable users

Description

In many apps, your users could be banned from the platform due to various causes, i.e.: for not respecting platform's rules or for not respecting other users or simply for not paying the monthly fees :)

This package adds a banned attribute to the standard users in order to prevent the authentication of such banned users. Fully tested.

Documentation

Version Compatibility

Laravel Bannable
5.5.x 1.1.x
5.6.x 1.2.x
5.7.x 1.3.x
5.8.x 1.4.x
6.x 2.x
7.x 3.x
8.x 4.x
9.x 5.x
10.x 10.x
11.x 11.x

Installation

Add gecche/laravel-bannable as a requirement to composer.json:

This package makes use of the discovery feature.

Basic usage

To use the package's features, first you have to publish and to run the provided migration which simply adds a banned boolean field to the users' table.

Then, if you use Eloquent users you have to add the bannable features to the User model class:

Then, if you use Eloquent users you have to add the bannable features to the User model class:

Finally, you have to change the auth.php configuration, changing the user provider's driver to eloquent-bannable

That's it! From now on, if an user has the banned attribute set to true, it will not be able to authenticate to the platform.

The package provides a database-bannable user provider's driver too.

Change the name of the "banned" attribute

To change the name of the "banned" attribute, simply override in you Eloquent User class the getBannedName method, replacing the banned name with whatever name you want:

Remember to change the name of the database field too!

Ban and Unban users

The Gecche\Bannable\Bannable trait also provides two simple methods, namely ban and unban which obviously ban and unban the user. Both methods also fire a correspondent event, namely Gecche\Bannable\Events\Banned and Gecche\Bannable\Events\Unbanned events.


All versions of laravel-bannable with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^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 gecche/laravel-bannable contains the following files

Loading the files please wait ....