- What is xetaio/xetaravel-iptraceable used for?
- It is a Laravel package that automatically records the IP address behind Eloquent model events, such as creates, updates, and deletes. You add its trait to models so an IP field stores who made the change. It is intended for lightweight, built-in auditing rather than a full audit-log system.
- How do I install xetaio/xetaravel-iptraceable with Composer?
- Install it via Composer using composer require xetaio/xetaravel-iptraceable. Then follow the README for any Laravel package discovery, configuration, or publishing steps. Because package details can change, verify the supported Laravel version constraints in composer.json before using it in production.
- How do I add the IP traceable trait to an Eloquent model?
- Import the package trait in your model and use it inside the class body, just like other Laravel traits. Make sure the model has the IP field the package should update. Check the README for any required trait properties or configuration for that field.
- Which Eloquent events does Xetaravel IP Traceable record?
- The package description says it records the IP behind Eloquent model events for created, updated, and deleted records. That means it captures the request IP when those model operations run. Confirm exact event coverage in the README for your installed version.
- How can I query stored IP addresses after using this package?
- Because the IP is saved in a normal model column, you can query it with standard Eloquent where clauses, such as filtering by the IP field. The overview does not imply a separate audit table. Use model scopes or direct queries to report on recorded IPs.
- Does xetaio/xetaravel-iptraceable support Laravel 10 or 11?
- The package is built for Laravel applications, but the provided overview does not list version constraints. Check its composer.json requirements and README before installing on Laravel 10, 11, or newer. That is the reliable way to confirm framework compatibility.
- Can I use it to track the IP address when a user logs in?
- The package overview mentions updating an IP field when a user logs into the application, and it also hooks into Eloquent model events. In practice, the login flow must update a model field for the trait to capture the request IP. Review the documented setup to confirm the intended login-tracking pattern.
- Do I need a separate migration or audit table for IP tracking?
- The package is described as updating an IP field on your Eloquent models, so the intended storage is an existing or added IP column on the model table. It is not presented as a separate audit-log table package. Plan your schema around the model column you want to record.
- Is Xetaravel IP Traceable enough for production auditing or compliance?
- It provides lightweight, built-in IP auditing by storing request IPs on model records. That is useful for basic accountability, but it is not a full compliance audit trail with before-and-after values, retention rules, or tamper evidence. For regulated requirements, pair it with a dedicated audit-logging solution.
- How do I test that IP addresses are recorded in Laravel?
- Write a feature test that authenticates or simulates a request, performs the model create, update, or delete, and asserts the IP column contains the expected address. You can set the request IP in tests and use assertDatabaseHas on the model table. Check the package README for any test-specific configuration.