Skip to main content
rule

laravel-php-83-cursorrules-prompt-file — Cursor rule for Laravel

A Cursor rule that walks the agent through building Laravel packages: plan, directory layout, naming standards, tests and docs.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/laravel-php-83-cursorrules-prompt-file.mdc
Open on GitHub

What laravel-php-83-cursorrules-prompt-file does

The file puts the agent in the role of a Laravel package developer. It asks for a plan and a directory structure first, then code written against that plan. PHP 8.3 features are expected, Laravel conventions apply, and spatie/laravel-package-tools is the suggested starting point.

A separate section covers naming: kebab-case for files, PascalCase for classes and enums, camelCase for methods, snake_case for variables and properties, SCREAMING_SNAKE_CASE for constants and enum cases. The rule prefers helpers over facades and calls for a Pint config. The agent also has to outline a testing strategy and a docs structure with README and usage examples.

The rule lives at .cursor/rules/laravel-php-83-cursorrules-prompt-file.mdc and matches **/*, but alwaysApply: false is set. So it will not load on its own — attach it manually, or the agent never sees these requirements.

What it helps with

  • plan a new Laravel package layout before writing code
  • keep file, class and method naming consistent
  • wire up Pint so formatting stops being a debate
  • sketch tests and docs alongside the code
  • start from a package skeleton instead of an empty folder

Example prompts for the agent

  • plan a Laravel package for handling webhooks and outline the directory structure
  • write the package code following that plan, use PHP 8.3 features
  • propose a testing strategy and a README structure for the package

How to install laravel-php-83-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/laravel-php-83-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about laravel-php-83-cursorrules-prompt-file

How do I install laravel-php-83-cursorrules-prompt-file in Cursor?

Create .cursor/rules/laravel-php-83-cursorrules-prompt-file.mdc in your project root and paste the rule contents into it.

What does laravel-php-83-cursorrules-prompt-file do?

It sets the order of work for a Laravel package: plan, directory structure, naming standards, tests and documentation. It also asks for PHP 8.3 features and a start from spatie/laravel-package-tools.

Does the rule apply automatically?

No. The file sets alwaysApply: false, so you have to attach the rule yourself — otherwise Cursor will not put it in context.

Source text

laravel-php-83-cursorrules-prompt-file.mdc · CC0-1.0
---
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.

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Backend and APIs →

From the same set68

nextjs-app-router-cursorrules-prompt-file A Cursor rule that hands the agent a set of Next.js App Router habits: server components by default, file-based routing, separate files for loading and errors. ★ 41,011repo stars netlify-official-cursorrules-prompt-file A Cursor rule that hands the agent Netlify's official conventions: function types, environment access, and no stray CORS headers. ★ 41,011repo stars nativescript-cursorrules-prompt-file A Cursor rule that tells the agent how to structure a NativeScript project and which libraries to reach for. ★ 41,011repo stars manifest-yaml-cursorrules-prompt-file A Cursor rule that tells the agent how to scaffold a small Manifest backend: project setup, the manifest/backend.yml file and limits on entities. ★ 41,011repo stars kubernetes-mkdocs-documentation-cursorrules-prompt A Cursor rule that turns the agent into a technical writer for Kubernetes and cloud native docs built with Markdown and MkDocs. ★ 41,011repo stars knative-istio-typesense-gpu-cursorrules-prompt-fil A Cursor rule that turns the assistant into a helper for serverless projects built on Knative with Istio, Typesense and HTMX. Useful when your search app runs on that stack. ★ 41,011repo stars javascript-chrome-apis-cursorrules-prompt-file A Cursor rule that points the AI agent at Chrome extension work: manifest, architecture, Chrome API usage. ★ 41,011repo stars htmx-go-fiber-cursorrules-prompt-file A Cursor rule for Go projects built on Fiber with HTMX: it pins down folder layout, routing and template rendering so the agent stops improvising. ★ 41,011repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor