Skip to content

Instantly share code, notes, and snippets.

View shahmaulik's full-sized avatar

Maulik Shah shahmaulik

  • Ahmedabad,Gujarat,India
View GitHub Profile
@shahmaulik
shahmaulik / fileupload.php
Created June 23, 2020 06:15
PHP File Upload with Curl
<?php
// Helper function courtesy of https://github.com/guzzle/guzzle/blob/3a0787217e6c0246b457e637ddd33332efea1d2a/src/Guzzle/Http/Message/PostFile.php#L90
function getCurlValue($filename, $contentType, $postname)
{
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
// See: https://wiki.php.net/rfc/curl-file-upload
if (function_exists('curl_file_create')) {
return curl_file_create($filename, $contentType, $postname);
}
<?php
namespace App\Services;
use App\Mail\WelcomeNewCustomer;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
class Customer
{