Skip to content

Instantly share code, notes, and snippets.

View bhaidar's full-sized avatar

Bilal Haidar bhaidar

View GitHub Profile
@bhaidar
bhaidar / generate-inertia-docs.md
Created March 6, 2026 08:32
Claude Code slash command + Python script to generate Inertia.js docs as Word (.docx) and PDF. Usage: /generate-inertia-docs <version>
name description allowed-tools
generate-inertia-docs
Generate Inertia.js documentation as Word and PDF
Bash

Generate Inertia.js Documentation

Generate Word (.docx) and PDF documentation for the specified Inertia.js version.

@bhaidar
bhaidar / new-laravel-project.md
Created March 5, 2026 12:24
Scaffold a new Laravel 12 project with Vue 3, Inertia.js, TypeScript, Sail, and common packages
description arguments
Scaffold a new Laravel 12 project with Vue 3, Inertia.js, TypeScript, Sail, and common packages
name description
project_name
Name of the new Laravel project (e.g. MyApp)
name description
parent_dir
Parent directory where the project folder will be created (e.g. ~/projects)

Create a new Laravel 12 project named $ARGUMENTS.project_name inside $ARGUMENTS.parent_dir.

@bhaidar
bhaidar / CLAUDE.md
Last active September 23, 2025 20:56
Laravel Boost: CLAUDE.md updated with Laravel Sail commands
=== foundation rules ===

Laravel Boost Guidelines

The Laravel Boost guidelines are specifically curated by Laravel maintainers for this application. These guidelines should be followed closely to enhance the user's satisfaction building Laravel applications.

Foundational Context

This application is a Laravel application and its main Laravel ecosystems package & versions are below. You are an expert with them all. Ensure you abide by these specific packages & versions.

@bhaidar
bhaidar / php-pools.md
Created September 25, 2024 05:44 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
Here is a quick way to add authentication logging to Laravel.
1. Modify app/Providers/EventServiceProvider.php and add lines 16 through 32 of the example file in this GIST.
2. Create a new file app/Listeners/LogActivity.php and copy the contents of the file below into that file.
3. Enjoy logging.
@bhaidar
bhaidar / google-recaptcha.md
Created December 15, 2023 20:30 — forked from babacarcissedia/google-recaptcha.md
Add google recaptcha to website

Opinionated code Laravel code for adding recaptcha on website. Bot protection especially on open form with user authentication.

  1. Create blade component for ease of reuse
resources/views/components/input/captcha.blade.php

@props([
    'id',
    'name',
@bhaidar
bhaidar / .eslintrc.js
Created December 5, 2023 15:35 — forked from onlime/.eslintrc.js
ESLint/Prettier config for Vue 3 in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
@bhaidar
bhaidar / print.css
Created October 26, 2023 19:04 — forked from anonymous/print.css
/**
* Print Stylesheet fuer Deinewebsite.de
* @version 1.0
* @lastmodified 16.06.2016
*/
@media print {
/* Inhaltsbreite setzen, Floats und Margins aufheben */
/* Achtung: Die Klassen und IDs variieren von Theme zu Theme. Hier also eigene Klassen setzen */
@bhaidar
bhaidar / AppServiceProvider.php
Created October 3, 2023 07:23
Laravel macro to split a name into a first_name and last_name
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
@bhaidar
bhaidar / Setup_Laravel_App
Last active July 2, 2023 15:37
Setting up a new Laravel application
## Setting up a Laravel application
I started by creating a new Laravel app. There are several methods for creating a new Laravel app. I chose the Docker-based one using the Laravel Sail package. You can read more about Laravel installation by following this URL (https://laravel.com/docs/10.x/installation).
Choose the method that best suits you. Before you start, make sure you have Docker running on your computer.
I'm using a MacBook Pro. I start by running this command:
curl -s "https://laravel.build/laravel-app" | bash