PHPackages                             crow/laravel-activation-code - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. crow/laravel-activation-code

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

crow/laravel-activation-code
============================

laravel activation codes

1.0.0(1y ago)01MITPHPPHP &gt;=8.2

Since Sep 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/gavoronok30/laravel-activation-code)[ Packagist](https://packagist.org/packages/crow/laravel-activation-code)[ RSS](/packages/crow-laravel-activation-code/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Install for laravel
-------------------

[](#install-for-laravel)

**1.** Open file **bootstrap/providers.php** and connect the provider from the package (optional, using laravel discovered package system by default)

```
\Crow\LaravelActivationCode\Providers\ActivationCodeServiceProvider::class,

```

**2.** Run commands

For creating config file

```
php artisan vendor:publish --provider="Crow\LaravelActivationCode\Providers\ActivationCodeServiceProvider" --tag=config

```

For creating migration file

```
php artisan activation:code:publish --tag=migration

```

For generate table

```
php artisan migrate

```

ENV variables
-------------

[](#env-variables)

File .env

Total of attempt for enter code

```
ACTIVATION_CODE_DEFAULT_MAX_ATTEMPT=5

```

Total of attempt for enter code (for sms mode)

```
ACTIVATION_CODE_SMS_MAX_ATTEMPT=5

```

Generate code mode

```
ACTIVATION_CODE_DEFAULT_GENERATE_MODE=5

```

Generate code mode (for sms mode)

```
ACTIVATION_CODE_SMS_GENERATE_MODE=4

```

Code length

```
ACTIVATION_CODE_DEFAULT_CODE_LENGTH=20

```

Code length (for sms mode)

```
ACTIVATION_CODE_SMS_CODE_LENGTH=5

```

Code TTL

```
ACTIVATION_CODE_DEFAULT_CODE_TTL=1h

```

Code TTL (for sms mode)

```
ACTIVATION_CODE_SMS_CODE_TTL=5m

```

Custom model
------------

[](#custom-model)

###### Step 1

[](#step-1)

Create custom model for activation code

Example:

File: **app/CustomFile.php**

Content:

```
