Download the PHP package veeqtoh/secure-code without Composer

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

secure-code

Latest Version on Packagist PHP from Packagist GitHub license

Table of Contents

Overview

A Laravel package that provides secure codes management system, allowing you to generate n-digit secure codes and manage it's allocation within you existing web app.

Installation

Requirements

The package has been developed and tested to work with the following minimum requirements:

Secure-code requires either the BC Math or GMP PHP extensions in order to work.

Install the Package

You can install the package via Composer:

Publish the Config and Migrations

You can then publish the package's config file and database migrations by using the following command:

Migrate the Database

This package contains a migration file that add a new table to the database: . To run this migration, simply run the following command:

Usage

Generating Secure Codes

Quick Start

The quickest way to get started with generating a secure code is by using the snippet below.

Validation

By default, the secure code is not validated against any condition. The library however, comes with three (3) inbuilt validation classes that checks for;

  1. Palindrome.
  2. Repeated characters.
  3. Sequence length.

These validation classes can be initialized and passed down to the code generator class in an array on it's constructor as shown below;

You may wish to define a custom validation yourself for more control. You can

Custom Validation

To achieve this, you must write a class that implements the library's base validation interface as follows;

Defining your custom validation class

To use your custom rule, simply initialize and include it in the validators array as shown above.

Customizing Configs

Tailor the package to to your needs with customizable configuration options:

Note: The code length cannot be more than 19.

Facade

If you prefer to use facades in Laravel, you can choose to use the provided facade instead of instantiating the class manually.

Using the Secure Code Manager

The code manager provides functionality to manage generated access codes, including allocation, resetting, and destruction.

Allocating a Code

To allocate a code to an owner, you can use the allocateCode method:

Resetting a Code

To reset a code and make it available for reallocation, you can use the resetCode method:

Destroying a Code

To permanently destroy a code, you can use the destroyCode method:

Config Validation

By default, the values defined in the config file are validated as the library contains a validator that is used to ensure that your values are safe to use. To disable the config validation, you can set the following option in the config:

Custom Database Connection

By default, Secure code will use your application's default database connection. But there may be times that you'd like to use a different connection. For example, you might be building a multi-tenant application that uses a separate connection for each tenant, and you may want to store the Secure codes in a central database.

To do this, you can set the connection name using the connection config value in the config/secure-code.php file like so:

Helper Methods

Find by code

To find the SecureCode model that corresponds to a given code, you can use the method.

For example, to find the SecureCode model of a code that has the code , you could use the following:

Find by Owner

To find the SecureCode models that belongs to a given owner ID, you can use the method.

For example, to find all of the SecureCode models of owners that belongs to , you could use the following:

Model Factories

The package comes with model factories included for testing purposes.

Testing

To run the package's unit tests, run the following command:

Security

If you find any security related issues, please contact me directly at [email protected] to report it.

Contribution

If you wish to make any changes or improvements to the package, feel free to make a pull request.

Note: A contribution guide will be added soon.

Changelog

Check the CHANGELOG to get more information about the latest changes.

Upgrading

Check the UPGRADE guide to get more information on how to update this library to newer versions.

License

The MIT License (MIT). Please see License File for more information.

Support Me

If you've found this package useful, please consider sponsoring this project. It will encourage me to keep maintaining it.


All versions of secure-code with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nesbot/carbon Version ^2.0|^3.0
illuminate/container Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
ramsey/uuid Version ^4.0
ashallendesign/laravel-config-validator Version ^2.6.1
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 veeqtoh/secure-code contains the following files

Loading the files please wait ....