Zero-dependency Laravel installer with hybrid type safety (PHP β TypeScript). Run Laravel projects anywhere without installing PHP or Composer system-wide.
npm create s6-app@latest my-appnpm create s6-app@latest my-app --no-typesafeAccess your app at:
- Laravel API: http://127.0.0.1:8000
- Vite Dev Server: http://localhost:5173
β¨ Zero System Dependencies: No need for system PHP or Composer
π Hybrid Type Safety: PHP DTOs automatically converted to TypeScript + Zod schemas
π Auto-generated API Client: Type-safe fetch wrappers from Laravel routes
β‘ Watch Mode: Auto-regenerate types on DTO changes
π― Runtime Validation: Zod-powered validation for all API responses
π¦ Batteries Included: TypeScript, Vite, and all tooling pre-configured
π οΈ Unified Commands: Use npm run for everything - no need to remember PHP/Composer paths
- create-s6-app
Type safety is enabled by default in all new projects. This gives you a fully configured hybrid type safety system inspired by create-t3-app.
Note: Use
--no-typesafeto skip type safety setup (not recommended for production projects).
- Define DTOs in PHP:
#[TypeScript]
class UserDto {
public function __construct(
public int $id,
public string $name,
public string $email,
) {}
}- Use DTOs in Controllers:
public function index(): JsonResponse {
$users = User::all()->map(fn($u) => new UserDto(...));
return response()->json($users);
}- Generate Types:
npm run gen:types- Use Type-Safe API Client:
import { api } from '@/api/client';
const users = await api.getUsers();
// β
Fully typed as UserDto[]
// β
Runtime validated with Zod
// β
Autocomplete and type checking# Start watch mode (auto-regenerates on DTO changes)
npm run watch:types
# In another terminal, start dev server
npm run dev
# Now edit any DTO in app/DTO/
# Types regenerate automatically
# TypeScript errors appear instantly in VSCodeAvailable Commands:
npm run dev- Start Laravel + Vite dev serversnpm run serve- Start Laravel server onlynpm run migrate- Run database migrationsnpm run gen:types- Generate TypeScript types from PHPnpm run type-check- TypeScript type checkingnpm run watch:types- Watch mode for auto-regeneration
For advanced usage, you can still use:
npx artisan <command>- Run any Laravel Artisan commandnpx composer <command>- Run any Composer command
Generated Files:
resources/js/types/UserDto.ts- Zod schema + TypeScript interfaceresources/js/api/client.ts- Type-safe API clientresources/js/types/generated.d.ts- Additional type definitions
See the TYPE_SAFETY.md guide (generated in your project) for complete documentation.
Inspired by the T3 Stack, we're reimagining Laravel development with modern tooling to make PHP development more robust and enjoyable. Our goals include:
- Run Anywhere/Everywhere: Pure npm-based installation (no curl commands needed)
- Single Command Setup: Install everything with one command
- Type Safety: Full TypeScript integration for better developer experience
- Linting: Built-in code quality tools
- Modern Database Layer: Prisma-like database management with type safety
- SPA Integration: Seamless single-page application support
- Validation: Zod-powered schema validation
- Type-Safe APIs: tRPC-style communication between PHP backend and frontend (detect changes in controllers and get errors in Blade/frontend)
These enhancements aim to bring PHP development into the modern era, combining Laravel's power with cutting-edge tools.
We focus on adding features that address genuine pain points in Laravel development. Everything included should provide clear value without unnecessary complexity.
We embrace modern tools and practices while maintaining Laravel's reliability. We prioritize stability for core functionality while experimenting with innovative features.
Full-stack type safety is our north star. Any feature that compromises type safety should be implemented elsewhere.
This creates a fully functional Laravel project with bundled PHP and Composer binaries.
We welcome contributions! This project is in active development, and we need help implementing the vision above.
- Fork and Clone: Fork the repo and clone it locally
- Install Dependencies:
npm install - Test Locally:
npm test - Make Changes: Implement features or fix issues
- Submit PR: Create a pull request with a clear description
- TypeScript Integration: Add TS support to the CLI and generated projects
- Database Tools: Integrate Prisma or similar for Laravel
- Frontend Integration: Add SPA frameworks and tRPC-like type safety
- Validation: Implement Zod schemas for Laravel validation
- Linting: Add ESLint/Prettier configurations
- Documentation: Improve docs and add examples
- Testing: Add comprehensive test coverage
git clone https://github.com/souravdutt/create-laravel-app.git
cd create-laravel-app
npm install
npm testCheck out our issues for specific tasks or propose new ideas!
For help, discussion about best practices, or any other conversation:
Join our GitHub Discussions
We π contributors! Feel free to contribute to this project.
Made with contrib.rocks
MIT