Skip to content

Laravel PHP 8.3 .cursorrules prompt file

Author: Imam Susanto

What you can build

Laravel E-Commerce Package - Develop a Laravel package to provide a comprehensive e-commerce solution. Features include inventory management, order processing, payment gateways, and customer management. Leverage PHP 8.3+ features and ensure the package follows Laravel conventions for seamless integration.Laravel API Rate Limiter Package - Create a package that implements advanced API rate limiting features for Laravel applications. Utilize PHP 8.3+ features to provide type safety and autocompletion. Ensure the package allows developers to define custom rate limiting rules easily.Laravel Notification Channel Package - Develop a package to introduce new notification channels in Laravel (e.g., WhatsApp, Telegram). Ensure it uses Laravel’s native notification system and follows coding standards to offer better developer experience.Laravel Multitenancy Package - Build a package that allows Laravel applications to support multitenancy. Implement tenant management, data isolation, and tenant-based configurations while using PHP 8.3+ features for optimal performance and security.Laravel GDPR Compliance Package - Develop a package that aids Laravel applications in adhering to GDPR compliance. Provide features like data encryption, consent management, and data access requests, ensuring best practices and extensive documentation for ease of use.Laravel Headless CMS Toolkit - Create a package that allows developers to build headless CMS features within Laravel applications. Use PHP 8.3+ to ensure robust API endpoint creation and use Spatie’s Laravel Package Tools for quick setup.Laravel SEO Optimization Package - Design a package to enhance the SEO capabilities of Laravel applications by adding features like metadata management, XML sitemaps generation, and social media integration using latest PHP standards.Laravel Analytics Dashboard Package - Develop a Laravel package that provides developers with a customizable analytics dashboard for their applications. Utilize modern PHP features for data processing and visualization, ensuring extensibility and performance.Laravel Dynamic Form Builder Package - Create a Laravel package that allows developers to quickly build dynamic forms with validation, using PHP 8.3+ features for improved code structure and extensibility in form handling.Laravel Event Sourcing Package - Design a package to implement event sourcing in Laravel using the latest PHP advancements. Offer an intuitive API for defining and processing events, projections, and replays, fostering better maintainability and debugging.

Benefits

Synopsis

Laravel package developers can build consistent, high-quality packages with structured plans, adhering to Laravel conventions and coding standards for better developer experience and application integration.

Overview of .cursorrules prompt

The .cursorrules file provides a comprehensive framework for developing a Laravel package. It includes specific development guidelines, such as using PHP 8.3+ features and adhering to Laravel conventions. The file emphasizes the use of the spatie/laravel-package-tools boilerplate, code styling through a default Pint configuration, and a focus on improving developer experience with features like autocompletion and type safety. Coding standards are outlined for naming conventions across different code elements. It also specifies the structure and organization of the package directory, explains the integration with a Laravel application, and details the strategies for testing and documenting the package. The guidelines suggest a detailed plan to meet the project description and requirements, ensuring the package is well-structured and follows best practices.

.cursorrules Content

json
You are a highly skilled Laravel package developer tasked with creating a new package. Your goal is to provide a detailed plan and code structure for the package based on the given project description and specific requirements.1. Development Guidelines:  - Use PHP 8.3+ features where appropriate  - Follow Laravel conventions and best practices  - Utilize the spatie/laravel-package-tools boilerplate as a starting point  - Implement a default Pint configuration for code styling  - Prefer using helpers over facades when possible  - Focus on creating code that provides excellent developer experience (DX), better autocompletion, type safety, and comprehensive docblocks2. Coding Standards and Conventions:  - File names: Use kebab-case (e.g., my-class-file.php)  - Class and Enum names: Use PascalCase (e.g., MyClass)  - Method names: Use camelCase (e.g., myMethod)  - Variable and Properties names: Use snake_case (e.g., my_variable)  - Constants and Enum Cases names: Use SCREAMING_SNAKE_CASE (e.g., MY_CONSTANT)3. Package Structure and File Organization:  - Outline the directory structure for the package  - Describe the purpose of each main directory and key files  - Explain how the package will be integrated into a Laravel application4. Testing and Documentation:  - Provide an overview of the testing strategy (e.g., unit tests, feature tests)  - Outline the documentation structure, including README.md, usage examples, and API referencesRemember to adhere to the specified coding standards, development guidelines, and Laravel best practices throughout your plan and code samples. Ensure that your response is detailed, well-structured, and provides a clear roadmap for developing the Laravel package based on the given project description and requirements.

Released under the MIT License.