Skip to content

Instantly share code, notes, and snippets.

View cygeorgel's full-sized avatar

Cyrille Georgel cygeorgel

View GitHub Profile
public function nextWorkingDay(Carbon $date)
{
$holidays = [];
$holidays[] = Carbon::create($date->format('Y'), 1, 1);
$holidays[] = Carbon::create($date->format('Y'), 5, 1);
$holidays[] = Carbon::create($date->format('Y'), 5, 8);
$holidays[] = Carbon::create($date->format('Y'), 7, 14);
$holidays[] = Carbon::create($date->format('Y'), 8, 15);
$holidays[] = Carbon::create($date->format('Y'), 11, 1);
$holidays[] = Carbon::create($date->format('Y'), 11, 11);
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class NewsletterListController extends Controller
{
public function __construct()
{
public function createContactFromString($string)
{
$data = [
'contactId' => null,
'name' => null,
'email' => null,
'phone' => null,
'mobilePhone' => null,
public function handle()
{
$filename = 'import/contacts.csv';
if (Storage::disk('ftp')->exists($filename)) {
$content = Storage::disk('ftp')->get($filename);
$lines = explode("\n", $content);
<?php
namespace App\BlueRock\Telco3cx;
use App\TelcoCdrPbx3cxCall;
class Cdr
{
public function getPbx3cxCall($file, $line, $host) {
@cygeorgel
cygeorgel / getContacts
Created February 20, 2020 22:07
Get list of phone numbers
function getContacts($data)
{
$contacts = [];
$data = str_replace(' ', '', $data);
$strings = explode(',', $data);
foreach ($strings as $string) {
function getContacts($data)
{
$contacts = [];
$data = str_replace(' ', '', $data);
$strings = explode(',', $data);
foreach ($strings as $string) {
<?php
namespace App\Console\Commands;
use App\CustomerContact;
use App\Validation;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class Fix10Command extends Command
<?php
namespace App\Console\Commands;
use App\Family;
use App\Invoice;
use App\InvoicePreprod;
use App\Mail\BlueRockToolsExportAccountMessage;
use App\Term;
use Illuminate\Console\Command;
<?php
namespace App\BlueRock\Services;
class FileableIndexService extends FileableService
{
public function breakIndexes()
{
$fileable = $this->getFileable();