Search

All tools
Laravel & PHP

Laravel App Key Generator

Generate a Laravel APP_KEY (AES-256-CBC) and a starter .env block. A new key will not decrypt existing data.

The key is created on the server and is not stored in the URL or in logs from this form.

Examples

  • New local app. Generate a key, paste the .env block, then run migrations.
  • Rotating a key. Set APP_PREVIOUS_KEYS to the old key before swapping, or decrypt data first.
  • Do not share. Treat APP_KEY like a password. Do not commit it or paste it into tickets.

How it works

Laravel encrypts cookies, sessions, and Encrypted casts with APP_KEY. This page calls Encrypter::generateKey() the same way artisan key:generate does. Use a fresh key only on a new app or after you accept that previously encrypted values cannot be read. The key is created on POST and is never placed in the URL.

Related tools

Related reading

Your experience on this site will be improved by allowing cookies Cookie Policy