mkaram/laravel-snap

Granular pattern and feature snapshotting system for Laravel.

Maintainers

Package info

github.com/mohamedkaram123/laravel-snap

pkg:composer/mkaram/laravel-snap

Transparency log

Statistics

Installs: 19

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.3.0 2026-08-19 02:07 UTC

This package is auto-updated.

Last update: 2026-08-19 02:07:49 UTC


README

Latest Version on Packagist Total Downloads PHP Versions Laravel Versions License

Granular pattern capture, architectural blueprint scaffolding, dependency-aware transplantation, and native AI MCP engine for Laravel.

Laravel Snap Demo

💡 Why Laravel Snap?

Moving features between Laravel applications (like Wallet, OTP, Subscription, or Invoicing) is traditionally messy:

  • You manually hunt down dozens of scattered files across app/, database/, and config/.
  • You waste time fixing namespaces, imports, and broken timestamps on migrations.
  • You run into Class not found errors when third-party packages are missing.

Laravel Snap turns any feature into a portable, dependency-aware architectural blueprint that you can snapshot and install into any target Laravel project in seconds.

✨ Key Features

  • 🔍 Deep Multi-Layer Discovery: Recursively scans Models, Services, Actions, Contracts, DTOs, Events, Controllers, Requests, Resources, Notifications, Jobs, Policies, Rules, Migrations, and Config.
  • AST-Powered Skeleton Mode (--skeleton): Uses PHP Abstract Syntax Tree parsing (nikic/php-parser) to strip method bodies while keeping strict return types, docblocks, and properties intact — generating pristine domain interfaces ready for logic implementation.
  • 📦 Smart Dependency Resolver: Scans imported use statements against installed.json, identifies required 3rd-party Composer packages (e.g. stripe/stripe-php), and offers interactive auto-installation during setup.
  • 🔄 Dynamic PSR-4 Namespace Translation: Tokenizes root namespaces on snapshot and rebinds them dynamically to match the target project's application namespace.
  • 🕒 Safe Database Migrations: Automatically recalculates migration timestamps upon installation to ensure correct schema execution order without conflicts.
  • 🤖 Native Model Context Protocol (MCP) Server: Seamless stdio integration with Cursor, Windsurf, and Claude Code to scaffold patterns right from your AI prompt.
  • 🐳 Docker & Team-Ready: Zero-config storage path resolution supporting Host OS, Docker containers, and project-level Git repository sharing.

🚀 Installation

Install the package via Composer into your Laravel application:

composer require mkaram/laravel-snap --dev

🛠️ Quick Usage

1. Capture a feature (Source Project):

php artisan snap:pattern wallet --all

📚 Documentation

Full guides live in docs/:

Guide Description
Introduction What Laravel Snap is and the problems it solves
AST Skeleton Mode --skeleton blueprints powered by nikic/php-parser
Dependency Resolution How Composer packages travel with a snapshot
CLI Reference snap:pattern, snap:install, and snap:list
Cursor & MCP Integration Native stdio MCP server for Cursor and Windsurf

laravel-snap