資料夾結構 / Folder Structure

Toppay 採用 Laravel 標準資料夾結構,並以模組化設計強化擴展性、支付流程與 UI 元件。
Toppay follows Laravel's standard folder structure, enhanced with clean modular separation for scalability, payments, and UI components.


核心資料夾 / Core Folders

app/ — 包含所有核心邏輯、服務、隊列、事件與商業功能。
app/ — All core logic, services, jobs, events, and business features.

Http/Controllers — 控制器邏輯(對應路由)。
Http/Controllers — Route-facing controller logic.

Http/Middleware — 自訂中介層。
Http/Middleware — Custom middlewares.

Http/Requests — 表單驗證邏輯。
Http/Requests — Form request validations.

Models — Eloquent 模型類。
Models — Eloquent model classes.

Enums — 狀態、類型等 Enum 常數。
Enums — Enum-based constants for status, types, etc.

Observers — 模型事件處理器。
Observers— Model event handlers.

Payment/ — 依支付閘道分類,如 Stripe, PayPal, Mollie, etc.
Payment/ — Structured by gateway: Stripe, PayPal, Mollie, etc.

Services — 可重複使用的服務類,如貨幣轉換、會員等級等。
Services — Reusable service classes like currency converters, user rank, etc.

Notifications — 系統通知(郵件、SMS、推播)。
Notifications — System notifications (mail, SMS, push).

Mail — 自訂郵件類別。
Mail — Custom mailable classes.

routes/ — Web 與 API 路由檔案。
routes/ — Web and API route files.

resources/views — Blade 視圖:後台、前台、元件、郵件。
resources/views — Blade views structured by backend, frontend, components, and emails.

resources/lang — 多語系字串。
resources/lang — Localization strings.

resources/structure/page_component — 動態頁面元件定義。
resources/structure/page_component — Dynamic page component definitions.

config/ — 應用層設定檔案。
config/ — All app-level configuration files.

public/ — 公開資源與入口檔(index.php)。
public// — Public assets and entry point (index.php).

database/Migrations, factories, seeders.
database/Migrations, factories, seeders.

storage/ — 日誌、快取視圖、檔案上傳。
storage/ — Logs, cached views, file uploads.

vendor/ — Composer 依賴。
vendor/ — Composer dependencies.


常用檔案 / Helpful Files

.env — 應用環境設定。
.env — App-specific environment config.

composer.json — PHP 套件依賴。
composer.json — PHP dependencies.

artisan — Laravel CLI 入口。
artisan — Laravel CLI entry point.

README.md —(可選)安裝或更新紀錄說明。
README.md — (Optional) installation or changelog info.