Skip to content

Instantly share code, notes, and snippets.

@er-pkumar
er-pkumar / search_multiple_column.md
Last active May 7, 2024 06:11
Laravel way to search across multiple column in table
$searchString = $request->validated('keyword');
$user = User::whereAny(
    [
        'first_name',
        'last_name',
        'email'
    ],
 'ilike',
@er-pkumar
er-pkumar / laravel-pint.md
Last active May 30, 2024 10:51
Laravel Pint is a tool built on top of PHP-CS-Fixer for PHP code that helps you style your code in a specific way, especially if you prefer a minimalist approach.

What?

Laravel Pint is a tool built on top of PHP-CS-Fixer for PHP code that helps you style your code in a specific way, especially if you prefer a minimalist approach. By default install by installing fresh laravel application, Pint does not require any configuration and will fix code style issues in your code by following the opinionated coding style of Laravel.

Why Pint?

  • Consistency: Pint enforces a consistent code style across your Laravel projects, making it easier for developers to read and understand each other's code.
@jdecode
jdecode / aws-s3-and-iam-policies.md
Last active January 17, 2024 11:45
S3 and IAM policy and configuration setup

Following is the CORS configuration that goes under Bucket > Permissions

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>