currentRoute = Route::current()->uri(); } public function createPrivateKey() { $this->value = trim($this->value); if (!str_ends_with($this->value, "\n")) { $this->value .= "\n"; } $new_private_key = PrivateKey::create([ 'name' => $this->name, 'description' => $this->description, 'private_key' => $this->value, 'team_id' => session('currentTeam')->id ]); redirect()->route('server.new'); } }