subal-roy/preorder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

subal-roy/preorder

Composer 安装命令:

composer require subal-roy/preorder

包简介

A laravel package to manage preorder of an online shop

README 文档

README

A Laravel package for handling a pre-order form with product selection, validation, and email notifications. The package provides a reusable, decoupled pre-order form system with the following features:

  • Pre-order form with fields: Name, Email, Product, and conditional Phone number field for @xyz.com emails.
  • Support for rate-limiting pre-order submissions to prevent spam (10 submissions per minute).
  • Pre-order submission data stored in a PostgreSQL database.
  • Admin dashboard view for listing all pre-orders search, and delete functionality.
  • Email notifications to users and admins when a pre-order is submitted.
  • Soft delete functionality
  • Simple, clean user interface using Blade and Tailwind CSS.

Features

  • Pre-order Form: Fields for Name, Email, Product, and Phone (if email ends with @xyz.com).
  • Validation & Sanitization: Ensures that only valid and sanitized data is stored.
  • Rate Limiting: Prevents users from submitting more than 10 pre-orders per minute.
  • Admin Panel: Admins can view, search, and delete pre-orders.
  • Email Notifications: Confirmation email sent to the user first, then to the admin.

Installation

Follow the steps below to install the package into your Laravel project.

1. Install via Composer

Run the following command to install the package from Packagist:

composer require subalroy/preorder

2. Install Frontend Dependencies

This package relies on Vue.js, Axios, Vite and Tailwind CSS for the frontend.

3. Publish Assets

To publish the package's views, assets, and migrations, run the following commands:

php artisan vendor:publish --provider="SubalRoy\Preorder\PreorderServiceProvider" --tag="views"
php artisan vendor:publish --provider="SubalRoy\Preorder\PreorderServiceProvider" --tag="js"
php artisan vendor:publish --provider="SubalRoy\Preorder\PreorderServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="SubalRoy\Preorder\PreorderServiceProvider" --tag="models"

4. Migrate the Database

Run the migration command to create the pre-orders table:

php artisan migrate

5. Configure Email Settings

Make sure you have email configurations set up in your .env file to send emails for notifications.

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="your_email@example.com"
MAIL_FROM_NAME="${APP_NAME}"

Usage

Pre-order Form

To display the pre-order form, visit /preorder in your browser. The form allows users to select a product, enter their name and email, and submit their information.

Admin Panel

Admins can access the list of pre-orders by visiting /preorders. The list includes functionality for searching, paginating, and deleting pre-orders.

Delete Pre-orders

Admins can delete pre-orders. The deletion will be soft.

Middleware

You can add the admin middleware to restrict access to certain routes (e.g., /preorders).

Example:

Route::get('preorders', [PreorderController::class, 'index'])->middleware('admin')->name('preorders.index');

License

This package is open-source and available under the MIT License. See the LICENSE file for more information.

subal-roy/preorder 适用场景与选型建议

subal-roy/preorder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 subal-roy/preorder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 subal-roy/preorder 我们能提供哪些服务?
定制开发 / 二次开发

基于 subal-roy/preorder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 17
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-10