Overview
AssetHub v2.0.0 adds batch/lot asset tracking, operational reports, a disposals module, and a public QR handover page. None of these changes require a fresh install or data migration script.
php artisan migrate — no data loss when done correctly.
| Item | Action |
|---|---|
Application code (app/, routes/, public/build/, etc.) |
Replace with v2 files |
.env |
Keep your existing file |
storage/ (uploads, logs, installed.lock) |
Keep your existing folder |
| MySQL database | Keep — run incremental migrations only |
Before you start
Always back up before upgrading any production system.
1. Back up your database
Export your MySQL database via phpMyAdmin, Adminer, or the command line:
mysqldump -u USERNAME -p DATABASE_NAME > assethub-backup.sql
2. Back up your files
.env— database credentials, mail settings, APP_KEYstorage/— asset photos, avatars, company logo, logsstorage/app/public/— all uploaded media
3. Put the site in maintenance mode (optional but recommended)
php artisan down
# ... perform upgrade ...
php artisan up
4. Download v2.0.0 from CodeCanyon
Go to your CodeCanyon Downloads page and download the latest AssetHub v2.0.0 ZIP. Extract the source/ folder on your computer.
Upgrade steps
Follow these steps in order. Do not re-run the web installer at /install.
-
Upload v2 application files
Replace the application files on your server with the contents of the v2
source/folder. On shared hosting (Hostinger, cPanel, Plesk), zip thesource/contents, upload to your web root (e.g.public_html/), and extract.Do not overwrite your existing
.envorstorage/folder. If the upload overwrote them, restore from your backup.Files to keep from your v1 installation
.envstorage/(entire folder, includinginstalled.lock)public/filessymlink or folder (if present)
-
Run database migrations
Connect via SSH or your hosting terminal, navigate to your application root, and run:
cd /path/to/your/public_html php artisan migrate --forceLaravel will apply only the 5 new migrations that v2 adds on top of v1. Existing tables and data are not dropped or recreated.
Important: Usephp artisan migrateonly. Never usemigrate:fresh,migrate:refresh, ormigrate --seedon a production database with live data. -
Clear and rebuild caches
php artisan optimize:clear php artisan optimizeThis refreshes config, route, and view caches so v2 code runs correctly.
-
Update permissions (if needed)
v2 introduces two new permissions for the Disposals module. See the New permissions section below.
-
Verify the upgrade
- Log in as admin and confirm existing assets, users, and transactions are intact
- Check the sidebar for new menu items (Batch assets, Disposals, new reports)
- Test a QR code — v2 links to the public handover page at
/a/{tag} - Confirm your cron job still runs
php artisan schedule:runevery minute
Upgrading on Hostinger Single
This section is for customers who already run AssetHub v1.0.0 on Hostinger Single Web Hosting (~$2.99/month). You do not need SSH, Composer, or a fresh install — your existing database, .env, and uploaded files stay in place.
/install after upgrading. The web installer runs migrate:fresh and will wipe your database. Use the Terminal commands below instead.
Step 1 — Back up via hPanel
- Login to Hostinger hPanel → Hosting → Manage for your domain.
- Database backup: go to Databases → phpMyAdmin → select your AssetHub database → tab Export → choose Quick → click Go. Save the
.sqlfile to your computer. - File backup: open Files → File Manager → navigate to
public_html/. - Enable Settings → Show hidden files so you can see
.env. - Download these to your computer:
.env- The entire
storage/folder (right-click → Compress → download the ZIP)
Step 2 — Check PHP version
- In hPanel, go to Advanced → PHP Configuration.
- Set PHP to 8.2 or 8.3.
- Confirm these extensions are enabled: OpenSSL, PDO, PDO_MySQL, Mbstring, GD, Tokenizer, XML, Ctype, JSON, Fileinfo.
Step 3 — Upload v2 files (keep your data)
- On your computer, extract the v2 CodeCanyon ZIP and zip the contents of the
source/folder (not the folder itself). - In File Manager, open
public_html/— this is where your v1 AssetHub already lives. - Upload
assethub-v2.zipintopublic_html/. - Right-click the ZIP → Extract. Allow files to overwrite when prompted (
app/,public/,vendor/, etc.). - Critical — restore protected files: if extraction overwrote them, re-upload your saved copies:
.env— keeps your DB credentials, mail settings, and APP_KEYstorage/— keeps uploads, logs, andinstalled.lock
- Delete the uploaded ZIP file after extraction to save disk space.
- Verify
public_html/still containsartisan,.htaccess, and yourstorage/installed.lockfile.
.env or storage/ were overwritten, always re-upload your backups from Step 1. Never use the default .env from the v2 package on a live site.
Step 4 — Run migrations (no Terminal needed)
Hostinger Single does not provide SSH or a web Terminal. The recommended way to run php artisan migrate is through a temporary Cron Job — the same tool you already use for scheduled email alerts.
Method A — Temporary Cron Job (recommended for Single)
- In hPanel, open Advanced → Cron Jobs.
- Click Create Cron Job.
- Type: Custom (not "PHP").
- Command — replace
uXXXXXXwith your Hostinger username (find the full path: File Manager → right-clickartisan→ Properties):/usr/bin/php /home/uXXXXXX/public_html/artisan migrate --force - Schedule: Every minute (
* * * * *) — only for a short time. - Click Save.
- Wait 1–2 minutes, then open
storage/logs/laravel.login File Manager or try logging in to AssetHub. If the site loads and v2 menus appear, migrations succeeded. - Delete this temporary cron job immediately — you only need it to run once. Keep your existing
schedule:runcron job untouched.
Optionally, create two more one-time cron jobs (same steps, delete after they run once):
/usr/bin/php /home/uXXXXXX/public_html/artisan optimize:clear
/usr/bin/php /home/uXXXXXX/public_html/artisan optimize
migrate --force runs, Laravel applies 5 new migrations (batch tracking, allocations, disposals). Running migrate again is safe — it will report "Nothing to migrate".
Method B — One-time PHP script (alternative)
If Cron Jobs are unavailable or you prefer a browser-based trigger:
- In File Manager, create a new file
public_html/upgrade-migrate.php. - Paste the script below. Change
YOUR-SECRET-KEY-HEREto a long random string before saving. - Visit
https://yourdomain.com/upgrade-migrate.php?key=YOUR-SECRET-KEY-HEREonce in your browser. - You should see migration output ending with "Done".
- Delete
upgrade-migrate.phpimmediately — leaving it on the server is a security risk.
<?php
// DELETE THIS FILE IMMEDIATELY AFTER USE
$secret = 'YOUR-SECRET-KEY-HERE';
if (($_GET['key'] ?? '') !== $secret) { http_response_code(403); exit('Forbidden'); }
define('LARAVEL_START', microtime(true));
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
Illuminate\Support\Facades\Artisan::call('migrate', ['--force' => true]);
echo Illuminate\Support\Facades\Artisan::output() . "\n";
Illuminate\Support\Facades\Artisan::call('optimize:clear');
echo Illuminate\Support\Facades\Artisan::output() . "\n";
Illuminate\Support\Facades\Artisan::call('optimize');
echo Illuminate\Support\Facades\Artisan::output() . "\n";
echo "Done. DELETE upgrade-migrate.php now.\n";
Method C — SSH / Terminal (Premium, Business, or VPS only)
If your plan includes SSH Access or a web Terminal (not available on Single), you can run commands directly:
cd ~/public_html
php artisan migrate --force
php artisan optimize:clear
php artisan optimize
Step 5 — Add new Disposals permissions
On Hostinger, the easiest safe option is to assign permissions through the admin UI (no Terminal needed):
- Login to AssetHub as Admin.
- Go to Users & Roles → edit the roles that need access to Disposals.
- Grant
manage disposalsand/orapprove disposals.
Alternatively, if you have not customized role permissions and have SSH/Terminal access (Premium+), run:
php artisan db:seed --class=RolePermissionSeeder --force
See New permissions for details on the seeder caution.
Step 6 — Verify cron job (usually unchanged)
If you already set up a cron job during v1 installation, it should keep working after the upgrade. Confirm in hPanel:
- Go to Advanced → Cron Jobs.
- Find your existing entry — it should look like:
/usr/bin/php /home/uXXXXXX/public_html/artisan schedule:run - Check the Last run column after a few minutes. If empty, edit the job and verify the
artisanpath via File Manager → Properties. - Schedule must be every minute (
* * * * *).
public_html/public/? Your Laravel code still lives at public_html/ root — the cron path remains /home/uXXXXXX/public_html/artisan (do not add /public/).
Step 7 — Test the upgrade
- Open
https://yourdomain.comand login — confirm existing assets, users, and transactions are intact. - Check the sidebar for new v2 items (Batch assets, Disposals, new reports).
- Scan a QR code — v2 links to the public page at
/a/{tag}. - Confirm uploaded images still display (avatars, asset photos).
Hostinger-specific notes
Uploaded images (/files/ not /storage/)
AssetHub serves uploads via public/files/ (symlink to storage/app/public/) because Hostinger Single may block /storage/* URLs via mod_security. If symlink creation fails, the app falls back to a PHP route — both work. Do not delete your storage/app/public/ folder during upgrade — that is where your images live.
"500 Internal Server Error" after upload
- Confirm
.htaccessexists atpublic_html/root (enable Show hidden files). - Confirm PHP is 8.2 or 8.3 in hPanel (Advanced → PHP Configuration).
- Run
optimize:clearvia a temporary Cron Job or the PHP script in Step 4. - Check
storage/logs/laravel.login File Manager for the exact error. - Set folder permissions: right-click
storage/andbootstrap/cache/→ Permissions →755recursively.
Where is Terminal / SSH?
Hostinger Single does not include them — your hPanel Advanced menu typically shows only: PHP Configuration, DNS Zone Editor, Cron Jobs, PHP Info, Cache, GIT, etc. This is expected. Use Method A (Cron Job) or Method B (PHP script) in Step 4. To get SSH, upgrade to Premium or Business, or contact Hostinger support.
QR scanner requires HTTPS
Enable free SSL in hPanel → SSL → Manage (Let's Encrypt). Camera access will not work over plain HTTP.
Hostinger Single upgrade checklist
- Export database via phpMyAdmin
- Download
.envandstorage/from File Manager - Set PHP to 8.2 or 8.3
- Upload and extract v2 ZIP into
public_html/ - Re-upload
.envandstorage/if overwritten - Run migrate via temporary Cron Job (Step 4, Method A)
- Run optimize via temporary Cron Job or PHP script
- Assign Disposals permissions in admin UI
- Verify cron job Last run timestamp
- Login and confirm data + new v2 features
- Do not visit
/install
Database migrations
When you run php artisan migrate, Laravel applies these 5 new migrations (v1 installations that are already up to date will only run these):
| Migration | What it does |
|---|---|
add_bulk_tracking_to_assets_table |
Adds tracking_type (default single), quantity (default 1), and unit columns. All existing v1 assets remain single-item records. |
create_asset_allocations_table |
New table for batch/lot allocation tracking (assign, return, reconcile quantities). |
add_quantity_to_transactions_table |
Adds a quantity column to transaction logs for batch moves. |
create_disposal_batches_table |
New table for formal write-off batches (Q1–Q4, yearly, ad-hoc). |
create_disposal_items_table |
New table for individual items within a disposal batch. |
New permissions
v2.0.0 adds two permissions that are not created automatically by migrate alone:
manage disposals— create and edit disposal batchesapprove disposals— approve or reject disposal batches (separation of duty)
Option A — Run the permission seeder (simplest)
If you have not customized role permissions, run:
php artisan db:seed --class=RolePermissionSeeder --force
This creates the new permissions and assigns them to the default roles (Admin gets all; IT Manager and Accountant get disposal management permissions).
syncPermissions, which resets each role to the default permission set. If you have customized role permissions, use Option B instead.
Option B — Assign manually (recommended if roles are customized)
Log in as Admin → Users & Roles → edit each role that should access Disposals → grant manage disposals and/or approve disposals as needed.
What's new in v2.0.0
After upgrading, these features become available without affecting your existing v1 data:
- Batch / lot assets — track identical items by quantity (e.g. 10 chairs as one record); allocate, return, and reconcile in real time
- 4 operational reports — Employee Assignments, Department/Location, Inventory Reconciliation, Damaged Assets (Excel + PDF)
- Disposals module — formal write-off batches with separation-of-duty approval and printable minutes PDF
- Public QR asset page at
/a/{tag}— printable handover page with photo and quantity breakdown; visibility: public / login / disabled - Updated legacy reports — now show asset count + total units
- QR codes — link to the public handover page; transaction log records quantity on batch moves
For full feature documentation, open documentation/index.html included in your v2 download package.
Do NOT do this
The following actions will erase or corrupt your production data. Avoid them during an upgrade:
| Action | Why it's dangerous |
|---|---|
Visit /install again |
The web installer runs migrate:fresh, which drops all tables and recreates them empty. |
Delete storage/installed.lock and reinstall |
Same result — triggers a fresh install that wipes the database. |
php artisan migrate:fresh |
Drops every table and re-runs all migrations from scratch. |
php artisan migrate --seed |
May insert demo/sample data into your production database. |
Replace .env with the default v2 copy |
You'll lose DB credentials, mail config, and your APP_KEY (invalidating sessions). |
migrate:fresh, restore from your database backup immediately. There is no undo without a backup.
Quick checklist
Print or copy this list when performing the upgrade:
- Back up MySQL database
- Back up
.envandstorage/ - Download AssetHub v2.0.0 from CodeCanyon
- Upload v2
source/files to server - Keep existing
.envandstorage/ - Run
php artisan migrate --force - Run
php artisan optimize - Seed or assign new Disposals permissions
- Log in and verify existing data + new features
- Do not visit
/install
Troubleshooting
Migration fails with "Nothing to migrate"
Your database may already be up to date, or migration files were not uploaded correctly. Verify that the v2 database/migrations/ folder contains the 5 new migration files listed above.
500 error after upload
php artisan optimize:clear
chmod -R 775 storage bootstrap/cache
Check storage/logs/laravel.log for the exact error message.
Disposals menu missing or "Unauthorized"
Run the permission seeder or manually assign manage disposals / approve disposals to the relevant roles. See New permissions.
Images or uploads not showing
Ensure your storage/ folder was not replaced. The app serves uploads from storage/app/public/ via the public/files symlink or fallback route.
Hostinger Single issues
See the Upgrading on Hostinger Single section for hPanel-specific fixes (500 errors, Terminal, cron path, /files/ uploads, SSL).
Need more help?
Open documentation/index.html in your v2 package for the full user guide (including the Hostinger fresh-install guide), or contact the author through the CodeCanyon item support tab.