Code Snippets
Save and reuse frequently used Tinker commands.
Overview
Snippets let you:
- Save commonly used code
- Organize by category
- Insert with one click
- Share across projects
Accessing Snippets
Open the Snippets panel:
- Click Snippets icon in the sidebar
- Or use keyboard shortcut
Cmd + Shift + S
Snippets Panel
┌─────────────────────────────────────────────────┐
│ Snippets + New │
├─────────────────────────────────────────────────┤
│ 📁 Eloquent │
│ ├── Get all users │
│ ├── Find by email │
│ └── With relationships │
│ 📁 Debug │
│ ├── Dump request │
│ └── Log query │
│ 📁 Testing │
│ └── Create test user │
└─────────────────────────────────────────────────┘Creating Snippets
From the Panel
- Click + New button
- Enter snippet details:
- Name
- Category (optional)
- Code
Related Features
- Code Execution — Run your snippets
- Autocompletion — While writing snippets