anturi/larastarted
最新稳定版本:v1.1.1
Composer 安装命令:
composer require anturi/larastarted
包简介
This package gives new route methods and it use a controller crud ready to use by herency
README 文档
README
A Laravel library designed to speed up your development with automatic generation of models, controllers, migrations, routes, standardized responses, and more. Perfect for RESTful APIs with a clean and professional structure. 🧙♂️
Requirements
Install the API base setup with the following command:
php artisan install:api
🚀 Installation
Option 1: Use it locally
Clone the repo or add it as a local package, then run:
composer require anturi/larastarted:dev-main
🔁 Make sure your branch is
mainor adjust the branch name accordingly.
🛠️ What does Larastarted do?
With just one command, it automatically generates:
- 🧠 Model (
app/Models) - 🎮 Controller (
app/Http/Controllers) - 🧱 Migration (
database/migrations) - 🚤 API Route (
routes/api.php) - 🧹 Base configuration
- 🗑️ Logs with their own table (
logs)
✨ Available Commands
🧙 anturi:generate
php artisan anturi:generate Post posts
This command will generate:
Post.phpinapp/ModelsPostController.phpinapp/Http/Controllers- A migration for
posts - A route entry in
routes/api.php
📝 Interactive Questions Example
When running the command, you'll be asked a few questions to customize your resource:
->expectsQuestion('Do you wish to create a migration?', true) ->expectsQuestion('Name of field (leave empty to finish)', 'title') ->expectsQuestion("Select the data type for 'title'", 'string') ->expectsQuestion("Length for 'title'? (leave empty to use default)", '255') ->expectsQuestion("Can the 'title' field be nullable?", false) ->expectsQuestion('Field name (leave empty to finish)', '') ->expectsQuestion('Do you want to add relationships?', false) ->expectsQuestion('Do you want to add a middleware to the route?', false)
🧹 Folder Structure
Larastarted/
├── src/
│ ├── Commands/ → Artisan commands
│ ├── config/ → Configuration files
│ ├── Controllers/ → Reusable base controllers
│ ├── Generators/ → Generation logic (Model, Controller, etc)
│ ├── Helpers/ → Reusable services (logs, CRUD, responses)
│ ├── Migrations/ → Internal package migrations
│ ├── Models/ → Models used by the package
│ ├── Providers/ → Package's Service Provider
│ ├── Publishable/ → Files that can be published to the host app
│ ├── Routes.php → Auto-injected routes
│ ├── Traits/ → Useful traits like FieldBuilder
│ └── test/ → Unit and feature tests
📄 Configuration
The AnturiServiceProvider does the magic:
- Registers artisan commands
- Injects routes automatically
- Loads internal migrations
- Publishes configurations
$this->loadMigrationsFrom(__DIR__.'/../Migrations'); $this->loadRoutesFrom(__DIR__.'/../Routes.php'); $this->publishes([...], 'larastarted-config');
📱 Vendor Publishing
It’s highly recommended to publish the vendor files before using:
php artisan vendor:publish --tag=anturi-larastarted
🧪 Testing
This package includes tests for:
- Generators
- Artisan commands
- Traits
php artisan test
🧠 Credits
Crafted with 💚 by Julian (a.k.a. Dimitri Rocket) 🚀
Inspired by real-world needs for clean, fast API development.
统计信息
- 总下载量: 56
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-25