1. Using Custom Fields (No Code)
- Navigate to Admin > Custom Fields.
- Click Add Custom Field and define the field type (text, number, dropdown, etc.).
- Assign the custom field to a specific asset category.
This is the easiest way to add fields without modifying the code.
2. Database Modification (Advanced)
If you need persistent changes beyond custom fields:
- Modify the
assets
table in the MySQL/MariaDB database. - Add a column using: sqlCopyEdit
ALTER TABLE assets ADD COLUMN custom_field_name VARCHAR(255) NULL;
- Modify the corresponding Eloquent model (
app/Models/Asset.php
) to include the new field infillable
: phpCopyEditprotected $fillable = ['name', 'serial', 'custom_field_name', ...];
- Update the views to display the new field in:
resources/views/assets/show.blade.php
resources/views/assets/edit.blade.php
3. Extending Snipe-IT API for Custom Fields
- If you want external integrations to recognize the new fields, modify
app/Http/Controllers/API/AssetController.php
to include them in API responses. - Extend
app/Http/Requests/AssetRequest.php
to validate input.
4. Customizing the Frontend
If the UI needs additional inputs:
- Modify Blade templates in
resources/views/assets/
. - Extend Vue.js components in
resources/js/components/
.