Skip to content

Instantly share code, notes, and snippets.

@KushalRaj
KushalRaj / BaseCriteria.php
Last active August 7, 2019 11:40
Apply filter functions dynamically as per parameters supplied.
<?php
namespace App\Criteria;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Str;
use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;
use Illuminate\Http\Request;
@KushalRaj
KushalRaj / .env
Last active April 10, 2025 17:54
Laravel command for production database replication
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_DATABASE=guesture_stage
DB_USERNAME=dev_user
DB_PASSWORD=****
DB_HOST_2=1.1.1.1#ip of production database server
DB_PORT_2=1234 #port
DB_DATABASE_2=guesture_pro #production database name
DB_USERNAME_2=prod_user #production database username
function checkTense(word) {
return word.toLowerCase().substr(word.length - 2) === "ed" ? "Past" : "Present";
}