IDE-Tools · Foto: Homedust, CC BY 2.0
Laravel PHP 83
Zuletzt aktualisiert:
Typ
Regel
Lizenz
CC0 1.0
Anwendungsfeld
Cursor Rules
Voraussetzungen
Keine besonderen — direkt loslegen.
Cursor-Regel für Laravel auf PHP 8.3 – moderne Sprachfeatures statt veralteter PHP-7-Muster.
Original-Beschreibung der Autoren: Cursor rules for Laravel development with PHP 8.3 integration.
Die Regel
---
description: "Cursor rules for Laravel development with PHP 8.3 integration."
globs: **/*
alwaysApply: false
---
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 docblocks
2. 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 application
4. 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 references
Remember 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.
So nutzt du sie
Die Regel kopieren (Button oben) oder als Datei herunterladen und im Projekt unter .cursor/rules/ ablegen — Cursor lädt sie beim nächsten Start automatisch. Ältere Cursor-Versionen lesen alternativ eine einzelne .cursorrules-Datei im Projektstamm; dort einfach den Regel-Text ohne den Kopfblock zwischen den ----Zeilen einfügen.
Der Regel-Text ist englisch — Cursor versteht ihn unabhängig von der Sprache, in der Sie mit dem Editor chatten.
Im Detail
Diese Regel bringt der KI bei, in Laravel-Projekten aktiv PHP-8.3-Features zu nutzen statt veraltete PHP-7-Muster fortzuschreiben: readonly Properties, native Enums für Status-Felder, typisierte Properties und First-Class-Callable-Syntax, kombiniert mit gängigen Laravel-Konventionen wie Form Requests, Eloquent-Beziehungen und Service-Klassen statt fetter Controller. Relevant für Teams, die bereits auf PHP 8.3 aktualisiert haben und wollen, dass generierter Code diese Möglichkeiten auch tatsächlich einsetzt statt defensiv auf ältere Syntax zurückzufallen. Kein Ersatz für Static-Analysis-Tools wie PHPStan, sondern eine Stilvorgabe für den Editor.
Praxis-Tipp
Bei „Erstelle ein Model mit Statusfeld und Validierung“ prüfen, ob ein PHP-8.3-Enum statt eines String-Konstanten-Sets vorgeschlagen wird.
Siehe auch
Lizenz & Quelle
- Lizenz: CC0 1.0
- Quelle: PatrickJS/awesome-cursorrules (GitHub)
Inhalt ansehen (laravel-php-83.mdc)
Lade …
Erfahrungen & Kommentare.
Funktioniert der Regel bei Ihnen? Tipps, Stolperfallen, Varianten — teilen Sie es mit der Community.
Lade Kommentare …
Passt dazu.
AI Agent Specialist
Cursor-Regel für diszipliniertes, klar abgegrenztes Agenten-Verhalten statt unstrukturierter KI-Antworten.
Alpha Skills Quant Factor Research
Cursor-Regel für methodisch saubere quantitative Faktor-Recherche im Trading-Umfeld.
Android Jetpack Compose
Cursor-Regel für idiomatischen, deklarativen Android-UI-Code mit Jetpack Compose.
