Comments (17)
Sorry, I was dealing with a lot of things at the same time. I must not have seen her.
Thank you so much!
from laravel-auditing.
Describe the behaviour you're experiencing. Do not just copy and paste a random error message and expect help.
List all the steps needed to reproduce the issue you're having.
Make sure to include code (affected models, configuration, ...).
Pastebins, screenshots and/or other resources that may help us understand what's going on, will also be appreciated.
In a nutshell, help us, help you.
You give too much information to investigate.
from laravel-auditing.
Versions:
PHP: 8.1
owen-it/laravel-auditing: "^13.5"
Vendor Folder:
The package is installed correctly
Config
In config/app.php
My error:
VisualStudio tells me an error in a Model
Tests I did
I have a seeder to create a "Solicitud".
When I run the seeder it only records in the "Solicitud" table but not in Audit
from laravel-auditing.
Config
In config/app.php
It is not necessary to add that line in the config file, the package uses autodiscover
Try composer du
on console
When I run the seeder it only records in the "Solicitud"
maybe it is not designed to work from seeder
seeder uses insert()
, and insert has no event, only create()
is audited
from laravel-auditing.
1) Delete the line in providers
3) I run composer dump-autoload ok
4) Does not save in the audits table
5) The warning still appears in the model
6) Could it be that Audit is not compatible with PHP 8.1?
from laravel-auditing.
In my Seeder try "Insert" but it doesn't work either
from laravel-auditing.
Could it be that Audit is not compatible with PHP 8.1?
I'm using it on 8.1, 8.2, and everything works, but i never try to audit seeders
VisualStudio tells me an error in a Model
That looks like another problem.
from laravel-auditing.
do you have audit.console => true
?
laravel-auditing/src/Auditable.php
Lines 525 to 527 in 7d929c0
from laravel-auditing.
I was doing tests.
Apparently it doesn't work with seeders but using postman it works fine!
from laravel-auditing.
thank you so much
from laravel-auditing.
Hi.
I leave an image of how I managed to make it work.
In the seeder I tried "insert" and "create" but it didn't work.
Creating a new instance of the model and using the "save()" function worked correctly
Bye
from laravel-auditing.
@evolucionaurea did you try $cliente->fill($request->all());
, if you have 100 properties and if you do it one at a time, it will take you a lot
from laravel-auditing.
Yeah.
I see that from the controller it always works fine.
Using insert() or create() works correctly.
The Seeder is where it doesn't work.
In controller this is ok:
$cliente = Cliente::findOrFail($id);
$cliente->update($data);
from laravel-auditing.
do you have
audit.console => true
?
That didn't work either?
from laravel-auditing.
Hi.
There I set console to true and now they work correctly with the seeders.
Thank you!
from laravel-auditing.
They had given you that answer a long time ago, it seems that you deliberately ignored it. 😄
laravel-auditing/config/audit.php
Line 164 in 7d929c0
from laravel-auditing.
Hello.
Sorry for the inconvenience.
I have a problem with sql server saving dates. I solved it this way.
The problem is that the models that have Laravel Auditing give an error when saving.
How do I configure it to accept the date format (Y-d-m H:i:s) in SQL SERVER?
SQLSTATE[22007]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]La conversión del tipo de datos nvarchar en datetime produjo un valor fuera de intervalo. (Connection: sqlsrv, SQL: insert into [audits] ([old_values], [new_values], [event], [auditable_id], [auditable_type], [user_id], [user_type], [tags], [ip_address], [user_agent], [url], [updated_at], [created_at]) values ([], {"nombre":"Naldo Lombardi","codigo":"2jk5eg8","razon_social":"Naldo Lombardi SA","id_pais":1,"id":1}, created, 1, App\Models\Cliente, ?, ?, ?, 127.0.0.1, Symfony, console, 2023-10-19 09:51:32.161, 2023-10-19 09:51:32.161))
from laravel-auditing.
Related Issues (20)
- Audit is not created when manually triggering the updated event on model HOT 4
- Serialization of 'PDO' is not allowed - Queued Audits HOT 9
- The [sync] queue connection has not been configured. HOT 5
- Excessive Queue job logged when use with batch import of large amount of data (#846) HOT 3
- Enabling queue causes Unable to JSON encode payload. Error (5) HOT 7
- Audit excludes fields records are creating in table HOT 3
- Class "Request" not found HOT 1
- The events (DispatchAudit) are missing the SerializesModels trait HOT 9
- Serialization of 'Closure' is not allowed HOT 7
- ErrorException: Undefined array key "table" in /vendor/laravel/framework/src/Illuminate/Queue/Connectors/DatabaseConnector.php:38 HOT 1
- Binary attribute casting no longer works in new versions (works flawlessly with v13.5.1) HOT 5
- Duplicate entries for every action HOT 8
- Values are not being audited when using DB::beginTransaction HOT 2
- Implement support for Laravel 11.x. HOT 1
- Column with type `point` throws error HOT 1
- SoftDelete behaviour config option true/false HOT 5
- Laravel 11 HOT 1
- Error when implementing transformAudit HOT 1
- UUID user_type and user_id store error HOT 3
- Empty array values when auditing relations HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-auditing.