Getting Started
Start by confirming the package’s Filament and Laravel version constraints in composer.json, then install it into the same app that hosts your Filament panel:
composer require zpm-packages/server-access-filament
Look first at:
- The package README for the plugin registration class name.
- Published config and migrations, if available.
- The Filament resource/page classes under
src/.
- Any policies, gates, or model contracts the package expects.
Typical first setup:
php artisan vendor:publish --tag="server-access-filament-config"
php artisan vendor:publish --tag="server-access-filament-migrations"
php artisan migrate
Register the plugin in your Filament panel provider:
use Zpm\ServerAccessFilament\ServerAccessFilamentPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(ServerAccessFilamentPlugin::make());
}
Your first day-to-day use case should be: open the Filament admin panel, create a server/access record, attach it to a user or team, assign the relevant role/access level, and verify that the record is visible only to authorized admins.
Implementation Patterns
Treat this package as the Filament UI layer for server access records, not as a replacement for your application’s authorization model.
Common workflows:
- Server inventory first: create records for each server/host before granting access. Use consistent naming, environment labels, and ownership fields.
- Access assignment through Filament actions: use the package’s resource/table actions to grant or revoke access, then mirror those changes into your own audit log via model events.
- Policy-backed visibility: pair the package resources with Laravel policies so non-admin users only see servers they own or manage.
- Seeding for repeatable environments: seed baseline servers and access roles in local/staging so developers can exercise the Filament UI without manual setup.
- Custom resources when needed: if the package exposes base resource classes, extend them in your app rather than editing vendor files. Override form schemas, table columns, and actions in your own classes.
- Tenant integration: if your Filament panel uses tenancy, scope server access records by tenant and verify that the package resources respect the panel’s tenant relationship.
- Audit integration: listen to create/update/delete events on the package models and write to your audit trail, especially for grant/revoke operations.
A useful pattern is to keep the package’s Filament resource for admin operations, while exposing a small internal service for programmatic access checks:
$user->canAccessServer($server);
Keep that check policy-based so the Filament UI and your application code use the same source of truth.
Gotchas and Tips
- v1.0.0 is an initial release. Pin the version in
composer.json and review the changelog before upgrading. Expect API and UI adjustments in early releases.
- Verify Filament compatibility early. Check the package’s
composer.json constraints against your Filament major version before installing.
- Publish and review migrations before production. Do not run package migrations blindly; confirm table names, indexes, and foreign-key behavior match your schema conventions.
- The UI is not the security boundary. Enforce access rules in policies, gates, or middleware. Filament resource visibility alone is not sufficient authorization.
- Avoid storing secrets in plaintext. If the package manages credentials or SSH keys, use Laravel’s encryption casts or an external secret manager.
- Check route and panel registration. If the resource does not appear, verify the plugin is registered on the correct panel and that the user has the required policy permissions.
- Clear Filament caches when debugging UI issues:
php artisan filament:optimize-clear
php artisan route:list
- Use extension points instead of vendor edits. Prefer published config, custom resource subclasses, custom actions, and model event listeners so upgrades remain manageable.
- Add tests around grant/revoke flows. A small feature test that creates a server, assigns access, and asserts policy visibility will catch most integration regressions.