Skip to content

Instantly share code, notes, and snippets.

View abdulbasit-dev's full-sized avatar
🎯
Learning

Abdulbasit Salah abdulbasit-dev

🎯
Learning
View GitHub Profile
@abdulbasit-dev
abdulbasit-dev / LaravelWhereLikeMacro.php
Created December 4, 2023 06:21 — forked from MrPunyapal/LaravelWhereLikeMacro.php
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
class AppServiceProvider extends ServiceProvider
{
// ...
$months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
@abdulbasit-dev
abdulbasit-dev / pdocrash.php
Created December 7, 2020 21:29 — forked from bradtraversy/pdocrash.php
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance