Skip to content

Instantly share code, notes, and snippets.

@abdullahessam
abdullahessam / cpanel deploy laravel project
Last active June 25, 2023 13:52
this bash script used for deploy laravel project on cpanel
#!/bin/sh
echo "what is your project name ?"
read project_name
echo "what is your repo ?"
read repo
echo "what is your branch ?"
read branch
echo "what php version you want to use ?"
echo "1) 7.4"
echo "2) 8.0"
@abdullahessam
abdullahessam / digital signature for BAB integration
Created June 13, 2023 14:27
digital signature for BAB integration
first create sign function and pass the private key and the passphrase if needed
public function sign(string $data): string
{
$privateKey = openssl_pkey_get_private($the_private_key_file,$passphrase_if_needed);
if (!$privateKey) {
throw new Exception("Failed to load private key : " . openssl_error_string());
}
// sign data using the private key with SHA256 algorithm
$encryptedData = "";
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Spatie\Image\Image;
use Spatie\Image\Manipulations;
use Symfony\Component\HttpFoundation\File\UploadedFile;