Skip to content

Instantly share code, notes, and snippets.

@IsmailShurrab
IsmailShurrab / compat_l5.php
Created December 16, 2017 09:20 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@IsmailShurrab
IsmailShurrab / firebase notification curl
Created December 10, 2017 12:35
firebase notification curl php
<?php
$url = "https://fcm.googleapis.com/fcm/send";
$token = "your device token";
$serverKey = 'your server token of FCM project';
$title = "Notification title";
$body = "Hello I am from Your php server";
$notification = array('title' =>$title , 'text' => $body, 'sound' => 'default', 'badge' => '1');
$arrayToSend = array('to' => $token, 'notification' => $notification,'priority'=>'high');
$json = json_encode($arrayToSend);
$headers = array();
@IsmailShurrab
IsmailShurrab / 1_customFunctions.php
Created August 13, 2017 19:58 — forked from MrShennawy/1_customFunctions.php
now you can query by regexp in laravel !! بالعربى إزاى تعمل بحث بالألف همزه ومن غير وهكذا ة ه وال ي وي ..... إلخ
<?php
//الملف ده اللى بيكون موجود فيه الدوال المساعده للشغل وغالبا بيكون مساره كالتالى
// app/helper/help.php
// ملحوظه (الملف ده انت اللى بتعمله عشان تحط جوا الفنكشنز اللى هتساعدك فى شغلك )0
#================ search at sql text to regx =====================================
function sql_text_to_regx($string){
$alamat = array("+","=","-","_",")","(","*","&","^","%","$","#","@","!","/","\\","|",">","<","?","؟");
$alamat_change = "";
$alef = array("ا","أ","آ","إ");
$alef_change = "@@@";