承接 worksofallen/laravel-api-scaffold 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

worksofallen/laravel-api-scaffold

最新稳定版本:v1.3

Composer 安装命令:

composer require worksofallen/laravel-api-scaffold

包简介

A simple way to send batch emails

README 文档

README

Status License PHP Latest Version on Packagist Downloads

A Laravel Artisan command to quickly scaffold a complete RESTful API resource, including:

  • Eloquent Model with SoftDeletes & fillable setup
  • Migration file with a name column and soft deletes support
  • API Controller with basic CRUD operations & pagination, filtering, sorting
  • Form Request classes for validation with proper JSON error responses

Installation

Require the package via Composer:

composer require worksofallen/laravel-api-scaffold:v1.0.0 --dev

Publish the command if necessary (depends on how you package it).

Usage

Run the custom Artisan command to generate a full API scaffold for a resource:

php artisan make:api {name}

Replace {name} with the singular model name, e.g., Product, Category, etc.

What gets created?

  • app/Models/{Name}.php — Model with fillable name attribute and soft deletes.
  • database/migrations/xxxx_xx_xx_xxxxxx_create_{snake_plural}_table.php — Migration with name and soft deletes columns.
  • app/Http/Requests/{Name}StoreRequest.php — Validation request for storing.
  • app/Http/Requests/{Name}UpdateRequest.php — Validation request for updating.
  • app/Http/Controllers/API/{Name}Controller.php — API controller with:
  • index method supporting search (q), sort (sortField, sortOrder), and pagination (sizePerPage).
  • store, show, update, destroy methods.

Features

  • Standardized API scaffolding reduces repetitive boilerplate code.
  • Soft deletes enabled by default.
  • Search, sort, paginate support out of the box.
  • JSON validation error responses for API-friendly error handling.
  • Clean, maintainable, and easy to customize generated code.

Example

php artisan make:api Product

Generates Product API scaffolding:

  • Model: app/Models/Product.php
  • Migration: database/migrations/xxxx_xx_xx_create_products_table.php
  • Requests: ProductStoreRequest, ProductUpdateRequest
  • Controller: app/Http/Controllers/API/ProductController.php

Authors

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

Please review our security policy on how to report security vulnerabilities.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-04