Skip to content

Instantly share code, notes, and snippets.

View prasanth-j's full-sized avatar
🎯
Focusing

Prasanth Jayakumar prasanth-j

🎯
Focusing
View GitHub Profile
@prasanth-j
prasanth-j / PascalCaseToSnakeCaseConverter.php
Last active March 20, 2024 13:15
Helper to convert PascalCase strings or arrays of strings into snake_case format
<?php
/**
* Convert PascalCase string or array values to snake_case.
*
* @param array|string $input
* @return array|string
*/
function pascalToSnakeCase(array|string $input): array|string
{
@prasanth-j
prasanth-j / PhpStormKeyboardShortcuts.md
Last active April 4, 2024 05:39
PhpStorm keyboard shortcuts

PhpStorm Keyboard Shortcuts

Editing

  • Toggle between upper case and lower case: Ctrl + Shift + U / Cmd + Shift + U
  • Surround code fragments: Ctrl + Alt + T / Сmd + Opt + T

Note: Shortcuts may vary depending on your keymap.

@prasanth-j
prasanth-j / AppServiceProvider.php
Created June 20, 2023 12:55
Redirects emails to configured mail during testing to prevent accidental deliveries
<?php
use Illuminate\Support\Facades\Mail;
public function boot()
{
if (!$this->app->environment('production')) {
Mail::alwaysTo('admin@example.com');
}
}