areia-lab/env-craft

Simple UI + Artisan manager for .env with backup/restore

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/areia-lab/env-craft

v1.0.1 2025-09-13 12:47 UTC

This package is auto-updated.

Last update: 2025-12-13 13:17:08 UTC


README

A Laravel package to manage .env values via a modern Tailwind-based UI or Artisan commands, with full backup and restore functionality.

Installation

composer require areia-lab/env-craft

Publish Vendor Assets

Config

php artisan vendor:publish --tag="craft-env-config"

Views

php artisan vendor:publish --tag="craft-env-views"

Customize Configuration (config/env.php)

return [
    'panel' => [
        'url_prefix' => 'admin/env-manager',
        'call_back_title' => 'Home',
        'call_back_url' => '/',
        'title_prefix' => 'Env',
        'title_suffix' => 'Craft',
    ],
    'middleware' => ['web'],
    'editable_keys' => [],
    'backup' => [
        'auto_save_when_update' => false,
        'disk' => 'local',
        'dir_path' => 'backup/env-backups',
        'max_limit' => 50,
    ],
];

Usage

Web UI

Visit /admin/env-manager in your Laravel application to access the EnvCraft UI.

Dashboard (Dark Mode)

Dark Dashboard

Dashboard (Light Mode)

Light Dashboard

Artisan Commands

Backup

  • Create a backup:
php artisan env:backup
  • Create a backup with directory details:
php artisan env:backup -d|--details

List Backups

php artisan env:backup-list

Show .env Values

  • Show all key-value pairs:
php artisan env:show
  • Show a specific key:
php artisan env:show --key=APP_KEY
# or
php artisan env:show -k APP_KEY

Set .env Values

  • Interactive prompt:
php artisan env:set
  • Set key and value directly:
php artisan env:set --key="TEST_KEY" --value="Abc123"

Restore Backups

  • Restore from a backup (interactive list):
php artisan env:restore --show
  • Restore from a predefined backup file path:
php artisan env:restore C:\laragon\www\packages\laravel-env-editor\storage\app\backup\env-backups\.env_backup_20250913_104031

Delete Backups

  • Delete a specific backup:
php artisan env:backup-delete --file="/storage/app/backup/env-backups/.env_backup_20250913_141200"
  • Delete all backups:
php artisan env:backup-delete --all
  • Delete previous N backups (excluding latest):
php artisan env:backup-delete --pre=10
  • Interactive delete (choose from latest 10 backups):
php artisan env:backup-delete

This package is fully compatible with **Laravel 9–12** and ensures safe `.env` management with backup/restore mechanisms.

📜 License

MIT © AreiaLab