'How to save HTTP request data and user data into a database in Laravel 7+
As the title says I want to know how to save HTTP request data and user data into my database. I am using Postgres.
I google around a bit and found an answer such as How to Save Laravel rest Api logs into db but it is around 3 years old so I am not sure how much things have changed with Laravel. I am still pretty much a noob at Laravel, so I was hoping I could get some help on this.
My current idea is to try to get my request data and save it directly to my database, but I am unsure of how to implement this. I looked into Monolog as well but couldn't find anything that would be of help.
This is a snippet from my migration file.
$table->id();
$table->string('last_name')->nullable();
$table->string('first_name')->nullable();
$table->string('email')->nullable();
$table->string('method');
$table->string('url');
$table->string('body')->nullable();
$table->string('received_at');
$table->string('ip');
$table->string('agent')->nullable();
$table->integer('user_id')->nullable();
$table->timestamps();
$table->softDeletes();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
