This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Services; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Exception\GuzzleException; | |
class TelegramServices | |
{ | |
protected Client $client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the user's IP address from various possible sources. | |
* It filters out private and reserved IP ranges. | |
* If no valid public IP is found, returns 'local'. | |
* | |
* @return string User's IP address or 'local' if not found. | |
*/ | |
function getUserIpAddress() { | |
// Define the list of possible IP address sources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showAlert(icon, title, text, url) { | |
Swal.fire({ | |
icon: icon, | |
title: title, | |
text: text, | |
showDenyButton: false, | |
showCancelButton: true, | |
confirmButtonColor: "green", | |
confirmButtonText: "Onaylıyorum", | |
cancelButtonText: "Vazgeç", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Refactored keyup event handler for the target link input | |
$(".target_link").on("keyup", function () { | |
const query = $(this).val(); | |
if (query === "") { | |
$("#livesearch").html("No result found"); | |
return; | |
} | |
$.ajax({ | |
url: "../../action/project_article/live_search", | |
type: "GET", |