Skip to content

Instantly share code, notes, and snippets.

View od3n's full-sized avatar
🎯
Focusing

Salahuddin Hairai od3n

🎯
Focusing
View GitHub Profile
@viezel
viezel / log query
Created April 22, 2020 08:05
Laravel Vapor - Cloudwatch insights logs
fields @timestamp, @message
# Lambda
| filter @message not like "START RequestId"
| filter @message not like "END RequestId"
| filter @message not like "REPORT RequestId"
# FPM
| filter @message not like "NOTICE: ready to handle connections"
| filter @message not like "NOTICE: fpm is running"
@altynbek07
altynbek07 / README.md
Last active March 25, 2022 22:42
Switch PHP Version in Laravel Valet

Switch PHP Version in Laravel Valet

For me, the valet use php@7.3 command does not work. And so I created this bash function.

Install

I already have PHP versions 7.2, 7.3 and 7.4 installed via Homebrew. Add this function in your .bash_profile or .zshrc file:

# Switch PHP version
switch-php() {
@meigwilym
meigwilym / index.md
Created November 28, 2019 08:52
Notes on stitcher.io's Laravel beyond CRUD

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

@od3n
od3n / .php_cs.laravel.php
Created November 11, 2019 10:38 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',

Learning Plan for Test Driven Development (TDD)

These learning resources primarily focus on Test Driven Development (TDD).

  • There is an emphasis on learning using PHP, Laravel and PHPUnit.
  • All these resources are free (at the time of writing)
@Spittal
Spittal / docker-compose.yaml
Created September 15, 2018 02:43
Docker compose file from SBVR
version: '3'
services:
fpm:
image: sbvr/laravel-fpm:2.1.2
volumes:
- app:/var/www
networks:
- appnet
worker:
@BenSampo
BenSampo / deploy.sh
Last active June 18, 2024 01:44
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@nginx-gists
nginx-gists / api_gateway.conf
Last active November 10, 2022 23:53
Deploying NGINX Plus as an API Gateway, Part 2: Protecting Backend Services
include api_backends.conf;
include api_keys.conf;
limit_req_zone $binary_remote_addr zone=client_ip_10rs:1m rate=1r/s;
limit_req_zone $http_apikey zone=apikey_200rs:1m rate=200r/s;
server {
access_log /var/log/nginx/api_access.log main; # Each API may also log to a
# separate file
@meSingh
meSingh / JsonMiddleware.php
Last active July 11, 2022 09:19
If you are using laravel as api only, you might want to return JSON on every request, even on errors/exceptions. The easiest way to do so is using this middleware globally.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class JsonMiddleware
{
public function handle(Request $request, Closure $next)