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
/** | |
* @param $input mixed | |
*/ | |
function telegramLogger($input){ | |
$bot_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //get from @botfather | |
$id = 'xxxxxxxxxx'; //reciever telegram id (not username) | |
ob_start(); | |
var_dump($input); |
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\Casts; | |
use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | |
class PartialUpdateJson implements CastsAttributes | |
{ | |
/** | |
* Cast the given value. | |
* |
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
in your editor (i used phpstorm ctrl+shift+f for find and replace in all files of a specific folder): | |
find : (?<=class=["'][^"']*)([0-9a-zA-Z_-]+\s*)(?=[^"']*["']) | |
replace : tw-$1 |
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 | |
function number2latin($str) | |
{ | |
$en_digits = ['0','0','1','1','2','2','3','3','4','4','5','5','6','6','7','7','8','8','9','9']; | |
$fa_ar_digits = ['٠','۰','۱','١','٢','۲','٣','۳','٤','۴','٥','۵','٦','۶','٧','۷','٨','۸','٩','۹']; | |
$str = str_replace($fa_ar_digits, $en_digits, $str); | |
return $str; | |
} |
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
//add this to config/logging.php | |
'fluent' => [ | |
'driver' => 'monolog', | |
'level' => env('LOG_LEVEL', 'debug'), | |
'handler' => \Monolog\Handler\SyslogUdpHandler::class, | |
'handler_with' => [ | |
'host' => env('FLUENTD_SYSLOG_HOST', '127.0.0.1'), | |
'port' => env('FLUENTD_SYSLOG_PORT', ''), | |
'rfc' => \Monolog\Handler\SyslogUdpHandler::RFC3164, | |
'ident' => env('FLUENTD_SYSLOG_IDENT', 'laravel'), |