morphOne(Log::class, 'loggable'); } public function approve(): void { Log::create([ 'user_id' => auth()?->user()?->id, 'loggable_type' => self::class, 'loggable_id' => $this->id, 'action' => LogAction::APPROVE, 'content' => $this->quote, 'ip' => request()->ip(), ]); Quote::create([ 'quote' => $this->quote, ]); $this->delete(); } public function reject(): void { Log::create([ 'user_id' => auth()?->user()?->id, 'loggable_type' => self::class, 'loggable_id' => $this->id, 'action' => LogAction::REJECT, 'content' => $this->quote, 'ip' => request()->ip(), ]); $this->delete(); } }