elasticmind / lalaz-framework
The Lalaz framework.
Installs: 188
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 2
Type:project
pkg:composer/elasticmind/lalaz-framework
Requires
- php: ^8.2
Requires (Dev)
- mockery/mockery: ^1.6
- pestphp/pest: ^3.3
README
Welcome to Lalaz Framework v1.0 โ A modern, fast, and elegant PHP framework designed for developers who value clean code, excellent performance, and great developer experience.
๐ Why Lalaz?
Lalaz Framework combines the best practices from modern PHP development with a focus on:
- โก Performance - Router cache (50x faster), Config cache (300x faster)
- ๐ Security - Built-in CSRF protection, security headers, bcrypt hashing
- ๐จ Clean Architecture - PSR-compliant, dependency injection, middleware pipeline
- ๐ Great DX - Intuitive CLI, detailed error messages, extensive documentation
- ๐งช Well Tested - 308 tests, 847 assertions, 100% passing
- ๐ง Flexible - Template-engine agnostic, multiple database adapters
๐ Documentation Structure
Getting Started
- Installation Guide - Requirements, setup, and your first app
- Routing - Define routes, parameters, groups, and middleware
- Controllers - Handle requests and return responses
- Middleware - Filter and modify HTTP requests
Core Concepts
- Database - Query builder, migrations, and seeders
- Models - ActiveRecord pattern and relationships
- Views - Templates, view helpers, and rendering
- Validation - Form validation and error handling
Advanced Topics
- Security - CSRF, security headers, and authentication
- Logging - PSR-3 logging with multiple writers
- Events & Jobs - Event system and background processing
- CLI Commands - All available CLI commands
Production
- Performance - Optimization tips and caching strategies
- Deployment - Production setup and best practices
โก Quick Start
Installation
composer require lalaz/framework
Create Your First Route
<?php // routes/web.php use Lalaz\Lalaz; $router = Lalaz::router(); $router->get('/', function() { return 'Welcome to Lalaz Framework!'; }); $router->get('/hello/{name}', function($name) { return "Hello, {$name}!"; });
Run Development Server
php lalaz serve
Visit http://localhost:8080 and you're ready! ๐
๐ฏ Key Features
Routing
- Clean, expressive syntax
- Route parameters and constraints
- Route groups with shared middleware
- 50x faster with route caching
Database
- Fluent query builder
- ActiveRecord models with relationships
- Migration system for version control
- Support for MySQL, PostgreSQL, SQLite
Views
- Template-engine agnostic design
- Built-in Twig provider
- View helpers for common tasks
- Layout and component support
Security
- CSRF protection out of the box
- Security headers middleware (4 presets)
- Bcrypt password hashing
- SQL injection prevention
Performance
- Router cache: 50x faster (1ms โ 0.02ms)
- Config cache: 300x faster (2-3ms โ 0.01ms)
- OPcache optimization
- ~90ms saved per request in production
CLI Tools
- 9 code generators (controller, model, migration, etc.)
- Database migrations and seeders
- Cache management commands
- Queue/job workers
- Built-in development server
๐ฆ What's Included
Core Components
- Router with middleware support
- HTTP Request/Response objects
- Dependency injection container
- Session management
- File upload handling
Data Layer
- Query builder with fluent interface
- ActiveRecord pattern
- Relationships (hasMany, belongsTo, belongsToMany)
- Database migrations
- Database seeders
View Layer
- Template engine support
- View helpers (asset, route, CSRF, etc.)
- Flash messages
- Layout inheritance
Validation
- 15+ built-in validation rules
- Custom validation callbacks
- Localized error messages
- Array and JSON serialization
Logging
- PSR-3 compliant logger
- Multiple formatters (Text, JSON)
- Multiple writers (File, Console)
- Automatic log rotation
- Level filtering
Queue System
- Background job processing
- Event system
- Job scheduling
- Daemon mode for continuous processing
๐ค Requirements
- PHP 8.1 or higher
- Composer
- PDO extension (for database)
- One of: MySQL 5.7+, PostgreSQL 9.6+, or SQLite 3
๐ Learning Path
Beginners
Intermediate
Advanced
๐ Philosophy
Lalaz Framework is built on these core principles:
- Simplicity - Keep things simple and intuitive
- Performance - Fast by default, optimized for production
- Security - Secure defaults, easy to maintain
- Flexibility - Don't force patterns, provide tools
- Testing - Everything should be testable
- Documentation - If it's not documented, it doesn't exist
๐ Useful Links
- GitHub Repository: elasticmind-io/lalaz-framework
- CLI Reference: CLI Commands Guide
- API Documentation: Coming soon
- Community Forum: Coming soon
๐ก Need Help?
- ๐ Check the detailed documentation
- ๐ฌ Ask questions in GitHub Discussions
- ๐ Report bugs in GitHub Issues
- ๐ง Email: ola@elasticmind.io
๐ License
Lalaz Framework is open-source software licensed under the MIT license.
Ready to build something amazing? Start with the Installation Guide! ๐