Skip to content

Instantly share code, notes, and snippets.

View andrefelipe18's full-sized avatar
👻

André Domingues andrefelipe18

👻
View GitHub Profile
@andrefelipe18
andrefelipe18 / Phosphor.php
Last active August 6, 2025 18:10
Phosphor Icon Enum (Filament v4)
<?php
namespace App\Enums;
use Filament\Support\Contracts\ScalableIcon;
use Filament\Support\Enums\IconSize;
enum Phosphor: string implements ScalableIcon
{
public function getIconForSize(IconSize $size): string
@andrefelipe18
andrefelipe18 / .md
Created May 13, 2025 23:56
Guideline Laravel, Livewire, Fialment

{{ Add context to your system, explaining what it is and does }}

The application uses the latest versions of Laravel (v12), Livewire (v3), and Filament (v3), and the language for code comments and implementations is always English.

We prioritize extremely clean, organized, and decoupled code, always using the most modern features of PHP and JavaScript, such as named arguments, attributes, match expressions, constructor property promotion, and in ES6+ features like destructuring, spread operator, optional chaining, and nullish coalescing. Always use proper typing (PHP 8 types, JSDoc, or TypeScript) to improve safety and autocomplete.

Optimize by eliminating duplicated code, refactoring for reusability, reducing nesting and cyclomatic complexity, and replacing multiple if/else statements with more concise structures like match expressions, associative arrays, or mapping objects. Use modern PHP collections and functional programming in JavaScript. Ensure security and maintainability by sanitizing inputs and o

@andrefelipe18
andrefelipe18 / auth.ts
Created February 4, 2024 18:02 — forked from IgorHalfeld/auth.ts
nuxt server methods auth middleware
// server/middleware/auth.ts
import { DecodedIdToken } from 'firebase-admin/lib/auth/token-verifier'
import { createAuth } from '@/libs/firebase/firebaseAdmin'
export interface AuthContext {
isAuthenticated: boolean
user: DecodedIdToken | null
}