PHPackages                             siddharthgor/update-file-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. siddharthgor/update-file-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

siddharthgor/update-file-generator
==================================

Laravel package for generating fresh install and date-based update packages

1.0.1(7mo ago)24MITPHPPHP ^8.1

Since Sep 15Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/siddharthgorinfinitie/update-file-generator)[ Packagist](https://packagist.org/packages/siddharthgor/update-file-generator)[ Docs](https://github.com/siddharthgorinfinitie/update-file-generator)[ RSS](/packages/siddharthgor-update-file-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Update File Generator
=====================

[](#update-file-generator)

A Laravel package for generating **fresh install** and **update packages** for a Laravel application.

The package provides two Artisan commands:

- `app:make-fresh` – Generates a fresh install SQL file (`install.sql`) and renames a view file to `install.blade.php`.
- `app:make-update` – Creates an update zip package with files, migrations, and archives based on a date range or configuration.

---

✨ Features
----------

[](#-features)

### Fresh Install

[](#fresh-install)

- Truncates specified tables (e.g., `projects`, `tasks`) while handling foreign key constraints.
- Exports the database schema to `install.sql` in the project root.
- Renames `resources/views/setup.blade.php` → `resources/views/install.blade.php`.

### Update Package

[](#update-package)

- Generates a zip file (e.g., `update_from_v2.0.1_to_2.0.2.zip`) with:
    - Metadata files (`package.json`, `updater.json`, `files.json`, `archives.json`, `folders.json`, `query.sql`, `rollback.sql`).
    - Files and archives under `update-files/` (e.g., `Controllers.zip`, `config/scribe.php`).
- Includes:
    - Configured `archiveable_dirs` and `single_files`.
    - Git-changed files (e.g., migrations).
- Supports:
    - Exclusions
    - File extensions
    - Advanced options (`--include-uncommitted`, `--dry-run`, `--rollback`).

---

⚙️ Requirements
---------------

[](#️-requirements)

- **PHP**: ^8.0
- **Laravel**: ^9.0 | ^10.0 | ^11.0
- **Dependencies**: `illuminate/support`, `symfony/process`
- **MySQL &amp; mysqldump** (for `app:make-fresh`)
- **Git** (for `app:make-update`)

---

📦 Installation
--------------

[](#-installation)

### 1. Install the Package

[](#1-install-the-package)

```
composer require siddharthgor/update-file-generator
```

### 2. Publish the Configuration

[](#2-publish-the-configuration)

```
php artisan vendor:publish --tag=config
```

This creates `config/update-file-generator.php`.

### 3. Configure Logging

[](#3-configure-logging)

Add to `config/logging.php`:

```
'channels' => [
    'update-file-generator' => [
        'driver' => 'single',
        'path' => storage_path('logs/update-file-generator.log'),
        'level' => 'info',
    ],
],
```

### 4. Ensure Dependencies

[](#4-ensure-dependencies)

#### MySQL and mysqldump

[](#mysql-and-mysqldump)

- Verify installation:

    ```
    mysqldump --version
    ```
- Add `mysqldump.exe` to PATH (Windows example: `C:\xampp\mysql\bin\mysqldump.exe`).

#### Git

[](#git)

- Verify installation:

    ```
    git --version
    ```

### 5. Verify Database Connection

[](#5-verify-database-connection)

Update `.env`:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

### 6. Set Permissions (Windows)

[](#6-set-permissions-windows)

```
icacls "path\to\project" /grant Everyone:F /T
icacls "path\to\project\storage" /grant Everyone:F /T
icacls "path\to\project\resources\views" /grant Everyone:F /T
```

---

🔧 Configuration
---------------

[](#-configuration)

Edit `config/update-file-generator.php`:

```
return [
    'archiveable_dirs' => [
        'app/Http/Controllers' => 'Controllers.zip',
        'app/Http/Middleware' => 'Middleware.zip',
        'app/Models' => 'Models.zip',
        'app/Console' => 'Console.zip',
        'app/Imports' => 'Imports.zip',
        'resources/views' => 'views.zip',
        'public/assets' => 'assets.zip',
    ],
    'single_files' => [
        'app/Http/Kernel.php',
        'app/Providers/AppServiceProvider.php',
        'app/app_helpers.php',
        'app/Exceptions/Handler.php',
        'routes/api.php',
        'routes/web.php',
        'public/storage/Work_3.jpg',
        'config/scribe.php',
    ],
    'file_extensions' => ['.php', '.jpg', '.png', '.css', '.js'],
    'exclusions' => ['.env', 'storage/', 'vendor/', 'node_modules/', '.git/', 'bootstrap/cache/', '*.log'],
    'truncate_tables' => ['projects', 'tasks'],
    'database_driver' => 'mysql',
    'versioning' => [
        'new_version' => '2.0.2',
        'prev_version' => '2.0.1',
    ],
    'logging' => [
        'channel' => 'update-file-generator',
        'file' => 'update-file-generator.log',
    ],
];
```

---

🚀 Usage
-------

[](#-usage)

### 1. `app:make-fresh`

[](#1-appmake-fresh)

Generates `install.sql` and renames `setup.blade.php` → `install.blade.php`.

```
php artisan app:make-fresh --output=install.sql
```

**Actions:**

- Copies `setup.blade.php` → `install.blade.php`
- Truncates `projects`, `tasks`
- Exports schema via `mysqldump`
- Resets `.env` to generic settings

**Example Output:**

```
Copied and renamed resources/views/setup.blade.php to resources/views/install.blade.php
Truncated table: projects
Truncated table: tasks
Fresh install SQL generated at install.sql

```

Custom output:

```
php artisan app:make-fresh --output=storage/app/install.sql
```

---

### 2. `app:make-update`

[](#2-appmake-update)

Generates an update zip (e.g., `update_from_v2.0.1_to_2.0.2.zip`).

```
php artisan app:make-update \
  --from-date=2025-07-01 \
  --to-date=2025-08-01 \
  --output=update_from_v2.0.1_to_2.0.2.zip \
  --new-version=2.0.2 \
  --prev-version=2.0.1 \
  --debug-output
```

**Options:**

- `--from-date`, `--to-date` → Git change range
- `--output` → Custom zip name
- `--include-uncommitted` → Add uncommitted changes
- `--dry-run` → Simulate only
- `--rollback` → Generate rollback package

**Zip Structure:**

```
update_from_v2.0.1_to_2.0.2.zip
├── package.json
├── updater.json
├── files.json
├── archives.json
├── folders.json
├── query.sql
├── rollback.sql
└── update-files/
    ├── app/Http/Controllers/Controllers.zip
    ├── app/Http/Middleware/Middleware.zip
    ├── app/Models/Models.zip
    ├── app/Console/Console.zip
    ├── app/Imports/Imports.zip
    ├── resources/views/views.zip
    ├── public/assets/assets.zip
    ├── database/migrations/
    ├── config/scribe.php
    └── app/Http/Kernel.php

```

Verify:

```
unzip -l update_from_v2.0.1_to_2.0.2.zip
```

---

🛠 Troubleshooting
-----------------

[](#-troubleshooting)

### `app:make-fresh`

[](#appmake-fresh)

- **mysqldump Not Found**Add MySQL bin folder to PATH. Verify:

    ```
    mysqldump --version
    ```
- **Foreign Key Constraint Error**Add dependent tables to `truncate_tables`.
- **Missing `setup.blade.php`**Ensure file exists or update `MakeFreshCommand.php`.
- **Empty install.sql**Check `storage/logs/update-file-generator.log`.

---

### `app:make-update`

[](#appmake-update)

- **No Files Included**Verify Git history:

    ```
    git log --since=2025-07-01 --until=2025-08-01 --name-only
    ```
- **Incorrect Zip Structure**Ensure metadata files are at root, others under `update-files/`.
- **UpdaterController Issues**Verify expected paths and check `storage/logs/update.log`.

---

📑 Logs
------

[](#-logs)

- **Location**: `storage/logs/update-file-generator.log`
- **Example**:

    ```
    [2025-09-15 13:11:xx] INFO: Copied and renamed resources/views/setup.blade.php to resources/views/install.blade.php
    [2025-09-15 13:11:xx] INFO: Truncated table: projects
    [2025-09-15 13:11:xx] INFO: Fresh install SQL generated at install.sql

    ```

---

🤝 Contributing
--------------

[](#-contributing)

- Submit issues or PRs to the GitHub repository.
- Contact: **Siddharth Gor** ()

---

📜 License
---------

[](#-license)

MIT License

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance62

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

238d ago

PHP version history (2 changes)1.0.0PHP ^8.0

1.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1a5996ebb55c841c910828eca9323c57dc84e815e059a0614ec7da49bb0a0f9?d=identicon)[siddharthgorinfinitie](/maintainers/siddharthgorinfinitie)

---

Top Contributors

[![siddharthgorinfinitie](https://avatars.githubusercontent.com/u/110272568?v=4)](https://github.com/siddharthgorinfinitie "siddharthgorinfinitie (11 commits)")

---

Tags

installerupdateupdate-fileslaravelpackagegeneratorupdate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/siddharthgor-update-file-generator/health.svg)

```
[![Health](https://phpackages.com/badges/siddharthgor-update-file-generator/health.svg)](https://phpackages.com/packages/siddharthgor-update-file-generator)
```

###  Alternatives

[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[okipa/laravel-table

Generate tables from Eloquent models.

56752.8k](/packages/okipa-laravel-table)[melihovv/laravel-package-generator

A laravel package generator

14434.7k1](/packages/melihovv-laravel-package-generator)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[dcblogdev/laravel-module-generator

Generate Laravel Modules from a template.

7710.1k1](/packages/dcblogdev-laravel-module-generator)[linkxtr/laravel-qrcode

A clean, modern, and easy-to-use QR code generator for Laravel

295.1k](/packages/linkxtr-laravel-qrcode)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
