⚠️ 本站内容为服务 Laravel 中文社区所建立,相关文档均由 ChatGPT 翻译整理,仅供参考。由于自动翻译存在一定局限,内容可能存在误差或遗漏,敬请谅解。如有建议或勘误,欢迎提交反馈。

Directory Structure

建议编辑

The default structure is intended to provide universal applications. But you are free to organize your application however you like. Laravel and Orchid imposes almost no restrictions on where any given class is located – as long as Composer can autoload the class.

Default Directories

Upon installing the Orchid package, you will find the following directories within your application’s app directory:

app
└── Orchid
    ├── Filters
    ├── Layouts
    ├── Presenters
    ├── Screens
    └── PlatformProvider.php

In this structure, the Orchid directory serves as the core of package, containing several subdirectories:

  • Filters: Store your custom filters in this directory. Filters allow you to modify and refine your data before presentation or storage. They act as gatekeepers, ensuring data integrity and enhancing the quality of your application’s output.

  • Layouts: Craft layout files in this directory to define the structure, appearance, and organization of your application’s pages. Layouts promote consistency and maintainability in presenting the visual elements of your web application.

  • Presenters: Here, you can create presenter classes that transform raw data into a suitable format for display. Presenters promote code reusability and encapsulate data processing logic, resulting in cleaner and more expressive code.

  • Screens: This directory contains files that define the user interface and functionality of individual pages, serving as the building blocks of your application. Using screens enables a modular and component-based development approach.

  • PlatformProvider.php: This essential file acts as a service provider, seamlessly integrating the Orchid package with your Laravel application. It serves as a bridge that allows configuration and extension of the Orchid package’s functionalities within your Laravel application.

Custom Directories

The Orchid package encourages developers to embrace their creativity and add custom directories as needed. For example, you can enrich your application by including a directory like Fields within the app/Orchid directory. This flexibility allows you to tailor the structure to align with the specific requirements of your application. Feel free to unleash your creativity and create directories that resonate with your application’s unique needs.

我们的朋友