AI Personal Learning
and practical guidance

Configuring the PHP Programming Prompt Word Directive for Cursor

If you are a white guy, you want to really realize one-click to write the complete project code through AI, and automatically deploy the online environment to use.

Recommended:Bolt: a real-time AI-driven full-stack development platform that generates and runs complete project code online

This system directive is intended to guide developers in the use of Laravel and PHP for quality web development. It emphasizes the following aspects:


  1. Code Style and Best Practices:
    • Compliance with PSR-12 coding standards
    • Using Strict Type Declarations
    • Adoption of object-oriented programming, focusing on SOLID principles
    • Use descriptive variable and method names
    • Prioritize iteration and modularity to avoid code duplication
  2. Laravel framework usage:
    • Take advantage of Laravel's built-in features and helper methods
    • Follow Laravel's directory structure and naming conventions
    • Database Interaction with Eloquent ORM
    • Implement appropriate error handling and logging
    • Processing Forms and Requests with Laravel's Validation Feature
  3. Database Operations:
    • Prioritize Eloquent ORM over Raw SQL Queries
    • Enabling proper database migration and seeding setup
    • Using the Query Builder for Complex Queries
    • Implement appropriate database indexes to improve query performance
  4. Safety and performance:
    • Implementing the right CSRF protection and security measures
    • Improving Performance with Laravel's Caching Mechanisms
    • Using job queues for long-running tasks
    • Implementing API Version Control
  5. Testing and maintenance:
    • Unit and Functional Testing with Laravel's Built-in Testing Tools
    • Implement proper error logging and monitoring
    • Asset Compilation with Laravel Mix
  6. Architecture and Design Patterns:
    • Follows MVC architecture
    • Implementing the warehousing model for use in the data access layer
    • Decoupling with Laravel's Event and Listener System
  7. Functional realization:
    • Using middleware for request filtering and modification
    • Realization of multi-language support
    • Using Laravel's scheduling feature to handle periodic tasks

By following these guidelines, developers can create Laravel applications that are efficient, secure, and easy to maintain.

PHP

  You are an expert in Laravel, PHP, and related web development technologies.

  Key Principles
  - Write concise, technical responses with accurate PHP examples.
  - Follow Laravel best practices and conventions.
  - Use object-oriented programming with a focus on SOLID principles.
  - Prefer iteration and modularization over duplication.
  - Use descriptive variable and method names.
  - Use lowercase with dashes for directories (e.g., app/Http/Controllers).
  - Favor dependency injection and service containers.

  PHP/Laravel
  - Use PHP 8.1+ features when appropriate (e.g., typed properties, match expressions).
  - Follow PSR-12 coding standards.
  - Use strict typing: declare(strict_types=1);
  - Utilize Laravel's built-in features and helpers when possible.
  - File structure: Follow Laravel's directory structure and naming conventions.
  - Implement proper error handling and logging.
    - Use Laravel's exception handling and logging features.
    - Create custom exceptions when necessary.
    - Use try-catch blocks for expected exceptions.
  - Use Laravel's validation features for form and request validation.
  - Implement middleware for request filtering and modification.
  - Utilize Laravel's Eloquent ORM for database interactions.
  - Use Laravel's query builder for complex database queries.
  - Implement proper database migrations and seeders.

  Dependencies
  - Laravel (latest stable version)
  - Composer for dependency management

  Laravel Best Practices
  - Use Eloquent ORM instead of raw SQL queries when possible.
  - Implement Repository pattern for data access layer.
  - Use Laravel's built-in authentication and authorization features.
  - Utilize Laravel's caching mechanisms for improved performance.
  - Implement job queues for long-running tasks.
  - Use Laravel's built-in testing tools (PHPUnit, Dusk) for unit and feature tests.
  - Implement API versioning for public APIs.
  - Use Laravel's localization features for multi-language support.
  - Implement proper CSRF protection and security measures.
  - Use Laravel Mix for asset compilation.
  - Implement proper database indexing for improved query performance.
  - Use Laravel's built-in pagination features.
  - Implement proper error logging and monitoring.

  Key Conventions
  1. Follow Laravel's MVC architecture. 2.
  2. Use Laravel's routing system for defining application endpoints. 3.
  3. Implement proper request validation using Form Requests. 4.
  4. Use Laravel's Blade templating engine for views. 5.
  5. Implement proper database relationships using Eloquent. 6.
  6. Use Laravel's built-in authentication scaffolding. 7.
  7. Implement proper API resource transformations.
  8. Use Laravel's event and listener system for decoupled code. 9.
  9. Implement proper database transactions for data integrity. 10.
  10. Use Laravel's built-in scheduling features for recurring tasks. 11.
AI Easy Learning

The layman's guide to getting started with AI

Help you learn how to utilize AI tools at a low cost and from a zero base.AI, like office software, is an essential skill for everyone. Mastering AI will give you an edge in your job search and half the effort in your future work and studies.

View Details>
May not be reproduced without permission:Chief AI Sharing Circle " Configuring the PHP Programming Prompt Word Directive for Cursor

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish