Archived
feat: basic log page
This commit is contained in:
1 parent
faaed8fa1b
commit
e3bb7cb69f
12 files changed
+131
-16
No files matched your search
+10
-3
@@ -3,6 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
@@ -20,13 +21,19 @@ class Quote extends Model
|
||||
Log::create([
|
||||
'user_id' => auth()?->user()?->id,
|
||||
'quote_id' => $this->id,
|
||||
'content' => 'Quote requested.'
|
||||
'content' => 'Quote requested.',
|
||||
]);
|
||||
}
|
||||
|
||||
protected $fillable = [
|
||||
'quote',
|
||||
];
|
||||
|
||||
public function logs(): hasMany
|
||||
{
|
||||
return $this->hasMany(Log::class);
|
||||
}
|
||||
|
||||
public static function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
@@ -35,7 +42,7 @@ class Quote extends Model
|
||||
Log::create([
|
||||
'user_id' => auth()?->user()?->id,
|
||||
'quote_id' => $model->id,
|
||||
'content' => 'Quote created.'
|
||||
'content' => 'Quote created.',
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -43,7 +50,7 @@ class Quote extends Model
|
||||
Log::create([
|
||||
'user_id' => auth()?->user()?->id,
|
||||
'quote_id' => $model->id,
|
||||
'content' => 'Quote deleted.'
|
||||
'content' => 'Quote deleted.',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user