Skip to content

Instantly share code, notes, and snippets.

@kennedy-osaze
kennedy-osaze / BulkManager.php
Created August 13, 2025 09:06
Symfony/Doctrine Bulk insertion/upsert Manager
<?php
use Doctrine\DBAL\Connection;
class BulkManager
{
public function __construct(private readonly Connection $connection) {}
public function bulkInsert(string $tableName, array $records): int
{
@kennedy-osaze
kennedy-osaze / Product.php
Created June 7, 2020 09:50
Simple Repository in Laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
//
}
@kennedy-osaze
kennedy-osaze / phpcs.xml.dist
Created January 20, 2020 12:35
PHP Code Sniffer - An opinionated PHP codesniffer configuration for Laravel
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Coding Standard for PHP">
<description>A well crafted coding standard for PHP based on PSR 12, adapted to Laravel</description>
<!-- Import slevomat/coding-standard sniffs -->
<config name="installed_paths" value="../../slevomat/coding-standard,../../../slevomat/coding-standard,../vendor/slevomat/coding-standard"/>
<!-- The files and directory to include -->
<file>app</file>
<file>config</file>
@kennedy-osaze
kennedy-osaze / .php_cs.dist
Last active March 26, 2023 17:34
PHP CS Fixer - Laravel Coding Standard Ruleset
<?php
use PhpCsFixer\Finder;
use PhpCsFixer\Config;
$directoriesToExclude = [
'bootstrap',
'storage',
'node_modules',
];
@kennedy-osaze
kennedy-osaze / extensions.json
Last active January 31, 2020 12:03
VS code plugins for Patricia Team
[
{
"metadata": {
"id": "d3836729-9cc1-42c1-b2af-d50071f57d29",
"publisherId": "formulahendry.auto-close-tag",
"publisherDisplayName": "formulahendry"
},
"name": "auto-close-tag",
"publisher": "formulahendry",
"version": "0.5.6"
@kennedy-osaze
kennedy-osaze / nginx.conf
Created September 18, 2019 16:56 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which