Ich möchte die Laravel Modell Klasse anpassen einige andere Dinge einzuloggen (zum Beispiel, die erstellt/aktualisiert/gelöscht, dass die Zeile in der DBLaravel: Anpassen der Modellklasse
Ich fand dies in der Model-Klasse des 582-. 587
// First we need to create a fresh query instance and touch the creation and
// update timestamp on the model which are maintained by us for developer
// convenience. Then we will just continue saving the model instances.
if ($this->usesTimestamps()) {
$this->updateTimestamps();
}
das nutzt diese (Betrifft/HasTimestamps.php 32-48):
/**
* Update the creation and update timestamps.
*
* @return void
*/
protected function updateTimestamps()
{
$time = $this->freshTimestamp();
if (! $this->isDirty(static::UPDATED_AT)) {
$this->setUpdatedAt($time);
}
if (! $this->exists && ! $this->isDirty(static::CREATED_AT)) {
$this->setCreatedAt($time);
}
}
Meine Frage: wie dies auch außer Kraft setzen zu protokollieren das "wer" ohne im Kreditoren Ordner bastelt? (Wer kommt fr om Auth::user()->id
)
Vielen Dank, es funktioniert wie ein Charme :) – Feralheart