Skip to content

Instantly share code, notes, and snippets.

View Shaz3e's full-sized avatar
💭
Working on @Invoika

Shahrukh Akhtar Shaz3e

💭
Working on @Invoika
View GitHub Profile
@Shaz3e
Shaz3e / DevResource.php
Created July 16, 2025 13:08
Create CRUD API with one command
<?php
// Run: php artisan make:command DevResource
namespace App\Console\Commands\Dev;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class DevResource extends Command
@Shaz3e
Shaz3e / functions.php
Created July 2, 2025 17:35
Disable Email Fields at Checkout in WooCommerce
<?php
// Add this code inside themes' functions.php
add_filter('woocommerce_checkout_fields', 'hide_email_address_field');
function hide_email_address_field($fields)
{
unset($fields['billing']['billing_email']);
return $fields;
}
@Shaz3e
Shaz3e / Readme.md
Created January 22, 2025 20:10
Rebase Development Branch from Main/Master Branch

Ensure you're on the development branch:

git checkout development

Fetch the latest changes from the remote (including the main branch):

git fetch origin
@Shaz3e
Shaz3e / README.md
Created December 29, 2024 12:28
Create Shortcut Command in Mac

Open terminal Type: echo $SHELL If the output is /bin/zsh, you're using Zsh (default on macOS Catalina and later). Otherwise, you might be using Bash.

For Zsh:

nano ~/.zshrc

For Bash:

@Shaz3e
Shaz3e / READMME.MD
Last active November 27, 2024 22:47
Connect Private Repo

Pull github respository into cpanel and auto deploy recent chagnes

First check at cPanel SSH Access there should not be any key if there is any delete this than generate new key from terminal ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa

After generating key Go to .ssh directory and open .pub file and copy SSH Key Add this SSH Key into GITHUB REPO - Setting - Deploy Keys

Backup all files from public_html to _backup directory e.g. /home/_backup

@Shaz3e
Shaz3e / ServerMonitor.php
Last active November 24, 2024 23:53
Get Server Usage in Laravel - Unix-based systems (Linux, macOS)
<?php
// Create file inside Services folder
// php artisan make:class Services/ServerMonitor
namespace App\Services;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
class ServerMonitor
{
@Shaz3e
Shaz3e / .env
Created September 10, 2024 19:32
Send Slack Notification in Laravel 11
SLACK_BOT_USER_OAUTH_TOKEN=
SLACK_BOT_USER_DEFAULT_CHANNEL=
@Shaz3e
Shaz3e / extensions.json
Last active September 23, 2024 20:42
My VS Code Extension List to code faster and easier
// .vscode/extensions.json
{
"recommendations": [
"rangav.vscode-thunder-client",
"bmewburn.vscode-intelephense-client",
"donjayamanne.githistory",
"DavidAnson.vscode-markdownlint",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github",
"PKief.material-icon-theme",
@Shaz3e
Shaz3e / api.php
Last active July 25, 2024 22:19
Laravel API Versioning
<?php
// routes/api.php
use Illuminate\Support\Facades\Route;
Route::prefix('v1')->group(base_path('routes/api/v1.php'));
Route::prefix('v2')->group(base_path('routes/api/v2.php'));
@Shaz3e
Shaz3e / UserList.php
Created July 21, 2024 15:29
Pagination with Livewire without loosing serial number
// In your livewire blade
@php
// Get the current page number, default to 1 if not set
$currentPage = $dataSet->currentPage();
// Get the number of items per page
$perPage = $dataSet->perPage();
// Calculate the starting index
$i = ($currentPage - 1) * $perPage + 1;
@endphp