Laravel PHP optimization .cursorrules prompt file
About .cursorrules prompt file
What you can build
Laravel Project Starter Kit: A tool that generates a Laravel project starter kit with pre-configured features like authentication, authorization, RESTful API structure, and best practices baked in. It would include Eloquent models, migrations, seeders, and configured testing environments alongside recommended coding standards.
Laravel Code Quality Analyzer: A web application that analyzes Laravel projects for adherence to best practices and coding standards such as PSR-12. It would provide insights on code duplication, SOLID principles adherence, use of modern PHP features, and recommendations for improvement.
VueJS and Laravel Component Library: A library of reusable VueJS components integrated with Laravel backend logic. This could include components like data tables with server-side processing, authentication forms, and real-time notifications using Laravel Echo.
Laravel Performance Optimizer: A service that integrates with your Laravel application to provide suggestions on improving performance through caching, database indexing, query optimization, and other Laravel-specific features like job queues and service containers.
API Versioning Management Tool: An application for managing and implementing API versioning within Laravel applications. It would automate version updates and provide tools for maintaining backward compatibility and documentation generation.
Laravel Migration Builder: A web-based tool to help developers create and visualize complex database migrations in Laravel. It would provide a UI to define tables, foreign keys, and relationships, generating code that adheres to Laravel’s best practices.
Multi-language Support Platform for Laravel: A service that helps automate and manage translation files in Laravel applications. It could include machine translations, human-readable editors, and a synchronization tool for keeping translations updated.
Laravel Automated Testing Suite: A comprehensive testing suite that integrates with Laravel applications to run unit, feature, and browser tests using PHPUnit and Dusk, providing detailed reports and recommendations for test coverage improvement.
Real-time Activity Monitoring Dashboard: A real-time dashboard application that uses Laravel’s event system to display activity logs, user actions, and system alerts, leveraging good architectural practices to ensure scalability and maintainability.
Laravel Middleware Generator: A tool that helps create and manage middleware in Laravel applications. The tool would automate common middleware patterns such as authentication checks, API rate limiting, and input validation logging.
Benefits
- Focus on Laravel's object-oriented structure using SOLID principles, Eloquent ORM for database abstraction, and built-in validation/middleware tools for robust, dynamic applications.
- Emphasize modern PHP 8.3+ features and strict typing, while aligning with PSR-12 standards for clean, maintainable code.
- Prioritize Laravel-specific best practices, including its job queues, caching, and authentication, for scalable and efficient application design.
Synopsis
Developers building Laravel applications would benefit from this prompt by creating scalable, secure, and maintainable web applications that adhere to modern PHP standards and best practices.
Overview of .cursorrules prompt
The .cursorrules file provides guidelines for developing applications using Laravel, PHP, and Vue.js. It emphasizes principles like adhering to Laravel best practices, object-oriented programming with SOLID principles, dependency injection, and service containers. It specifies the use of modern PHP features, PSR-12 coding standards, and Laravel's built-in features for error handling, validation, and ORM database interactions. Dependencies include Laravel 11.x and Composer. Best practices such as using Eloquent ORM, caching, job queues, and built-in testing tools are stressed. The file outlines key conventions to follow Laravel's architecture, routing, validation, and other core features to enhance application structure and maintainability.