-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in AuditableObserver (v5.0) #354
Comments
You sure you're on PHP 7.0.9? The only time I had issues like that was with PHP 5.5.x/5.6.x, where I had to use an alias. PHP 7.0.9 shoud be OK with using the same class name, as long as at least one is using the FQCN. Anyways, try: use OwenIt\Auditing\Contracts\Auditable as AuditableContract;
class Company extends Model implements AuditableContract
{
use SoftDeletes;
use \OwenIt\Auditing\Auditable;
...
} |
The issue was fixed in PHP 7.0.7, btw. |
No you didn't, you're not using an alias, like I have in the example above. |
Besides, downgrade from 5.0.1 to 4.1.4, works perfect without touching my model setup |
Any 4.1.x version has the alias set to prevent such issue, but like I said, this is a PHP 5.5.x/5.6.x and 7.0.0 to 7.0.7 problem. These are the PHP 5.5.21 and 5.6.5 builds failing on Travis CI, exactly because of that. Once I added aliases, the tests passed. Tests don't lie. The issue you're having should not happen in the PHP version you say you have. So you either have multiple PHP versions and you think you're using one, instead of another, or the issue wasn't properly fixed in PHP 7.0.7 and you need a higher version. Try upgrading to a more recent PHP version and see if the issue disappears. Version 7.0.x won't be actively supported for much longer, anyway. |
Upgraded PHP to 7.0.13 solve the issue without using alias. I'm sorry I bothered you so much. Thanks for all your support! |
Not a problem, I'll update the |
I just checked the changelog for 7.0.13 and it does fix the issue. |
I thought I was going crazy!! |
Actual Behaviour
Error trying to save a new instance of a audit model.
Steps to Reproduce
App\Company.php (Model)
Route
Error:
The text was updated successfully, but these errors were encountered: