Download the PHP package turahe/otp without Composer

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

Laravel OTP โ–ฒ

Tests Code Quality codecov Latest Stable Version Total Downloads License PHP Version Laravel Version PHPStan

Introduction ๐Ÿ––

A robust Laravel package for generating and validating OTPs (One Time Passwords) with comprehensive test coverage and modern CI/CD pipeline. Perfect for authentication systems, email verification, and secure access control.

Features โœจ

Requirements ๐Ÿ“‹

Installation ๐Ÿ’ฝ

1. Install via Composer

2. Add Service Provider

Add to config/app.php providers array:

3. Add Facade Alias (Optional)

Add to config/app.php aliases array:

4. Publish Configuration (Optional)

5. Run Migrations

Configuration โš™๏ธ

The package configuration file (config/otp.php) allows you to customize:

Usage ๐Ÿงจ

Basic OTP Generation

OTP Validation

Email Integration

Custom Email Templates

The package includes a default email template at resources/views/emails/otp.blade.php. You can customize it by publishing the views:

Cleanup Expired Tokens

Testing ๐Ÿงช

The package includes comprehensive test coverage organized into Unit and Feature tests:

Test Structure

Unit Tests (tests/Unit/) - Isolated class testing

Feature Tests (tests/Feature/) - Integration testing

Test Coverage Summary

CI/CD Pipeline ๐Ÿš€

Continuous Integration

The GitHub Actions workflow runs on every push and pull request:

Release Management

Automated releases are created when semantic version tags are pushed:

Local Development

Run the same checks locally:

API Reference ๐Ÿ“š

Otp Facade

Method Parameters Returns Description
generate() string $identity, int $expiresAt = 15 OtpToken Generate new OTP
validate() string $identity, string $token bool Validate OTP

Token Service

Method Parameters Returns Description
identity() - mixed Get token identity
token() - string Get token value
plainText() - string Get plain text token value
expired() - bool Check if token expired
timeLeft() - int Get seconds until expiry

Helper Functions

Function Parameters Returns Description
validation_number() string $number, string $country = 'ID' bool Validate phone number
format_number() string $number, string $country = 'ID' string Format phone number
get_email_provider() string $email string Extract email provider
validate_email() string $email bool Check if email is disposable

Examples ๐Ÿ“

Authentication Flow

Phone Number Validation

Email Provider Detection

Contributing ๐Ÿค

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (composer test)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Setup

Security ๐Ÿ”’

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

License ๐Ÿ“„

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

Support ๐Ÿ’ฌ

Changelog ๐Ÿ“‹

See CHANGELOG.md for a detailed history of changes.


Made with โค๏ธ by Turahe


All versions of otp with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
giggsey/libphonenumber-for-php Version ^8.0|^9.0
illuminate/container Version ^10.0|^11.0|^12.0
illuminate/notifications Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^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 turahe/otp contains the following files

Loading the files please wait ...