laravel-auditing
laravel-auditing copied to clipboard
auditable_type does not reflect the correct path of the model
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Framework | Laravel |
| Framework version | 7.30.3 |
| Package version | v10.0.0 |
| PHP version | 7.4.3 |
Actual Behaviour
on OwenIt\Auditing\Models\Audit the auditable_type is returning "App\Model\Foo" and I can't change
Expected Behaviour
Describe the behaviour you're expecting.
You should be returning App\Models\Foo as all models are in the "Models" folder within the app
Steps to Reproduce
I looked in the code, something about configuring the default models folder, but I didn't find anything like that.

up
Can't say for sure if this will resolve your particular issues, but I'd recommend using Laravel's MorphMap instead of letting the _type field default to the namespaced class name. It'll save you a lot of trouble if you ever reorganize/rename any of your models.
auditable_type shows the model namespace, not the path of folders