I am currently developing an application with Laravel 5
, my main tables are users
, suppliers
, manufacturers
etc.
Each of these tables has a separate users_log
,suppliers_log
log table. The purpose of these log tables is to review operations performed for a single entity (for example: logs belonging to a particular manufacturer and the changes made in the past for that manufacturer etc.,)
I am planning to use Eloquent
and I have generated an Eloquent
model
for each of the major tables.
My Question : Should I generate separate Eloquent
models for each of the log tables or just write a method like user_log()
in the model of the major table to write my log.
P.S : Number of users going to use my application are few, therefore writing logs to a database is preferred over file logs.
eloquent model
foruser_log
table or just use theuser
model and write a function to do the logging operation.saveLog()
and use someDB::
to write my log because that would be easy for me to perform rather than creating a new eloquent model