usamamuneerchaudhary/laravel-api-boilerplate
Composer 安装命令:
composer create-project usamamuneerchaudhary/laravel-api-boilerplate
包简介
Simple Laravel API Boilerplate to create a ready-to-use REST API using Laravel Passport
README 文档
README
Laravel API Boilerplate using Laravel Passport
Laravel API Boilerplate is a starting point for your first API.
It is built on top of:
- Laravel Framework - laravel/laravel
- Laravel Passport - laravel/passport
- Laravel-CORS barryvdh/laravel-cors
Installation
-
run
composer create-project usamamuneerchaudhary/laravel-api-boilerplate myfirstApi; -
Rename
.env.exampleto.env -
Generate Passport encryption keys & secret access tokens
php artisan passport:install -
Generate application key by
php artisan key:generate -
After DB Connection, run
php artisan migrate. For dummy data for users, runphp artisan migrate --seed. You can see more info indatabase\seeds\UserTableSeeder.php. -
For Testing Emails, you can setup MailTrap.
-
Well that's it lad, it would be up and running on your server already.
Basic Requirements for the Project
- PHP
v7.3or greater.
Main Features
Ready-To-Use Authentication Controllers
You can find Authentication Controllers under namespace App\Http\Controllers\API\Auth.
Validations
There are also the validation rules for every action (login, sign up, recovery and reset) under namespace App\Http \Request\API\Auth.
Endpoints
- Login:
POST api/v1/login - Register:
POST api/v1/register - Recover
POST api/v1/recover - Reset
POST api/v1/reset - Find Reset Token
GET api/v1/reset/{token} - Logout
GET api/v1/logout - Verify Email
api/v1/user/verify/email/{token}
Please note that, api routes are prefixed with v1, you can changed this in App\Providers\RouteServiceProvider.php
Separate File for Routes
All the API routes can be found in the routes/api.php file.
Firewall
We're using akaunting/firewall to secure our API.
Roles & Permissions
Simpler way of assigning Roles & Permissions to Users. You can more details on what we've done here on usamamuneerchaudhary/roles-permissions
CRUD Scaffolding
A Simple CRUD Scaffolding package is being setup out of the box to keep you going without any hassle.
Creating Endpoints
You can create your endpoints in routes/api.php under auth:api middleware group.
Cross Origin Resource Sharing
If you want to enable CORS for a specific route or routes group, you just have to use the cors middleware on them.
Thanks to the barryvdh/laravel-cors package, you can handle CORS easily. Just check the docs at this page for more info.
License
This project is open-sourced software licensed under the MIT license.
usamamuneerchaudhary/laravel-api-boilerplate 适用场景与选型建议
usamamuneerchaudhary/laravel-api-boilerplate 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 7, 最近一次更新时间为 2020 年 03 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「api」 「boilerplate」 「laravel」 「passport」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 usamamuneerchaudhary/laravel-api-boilerplate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 usamamuneerchaudhary/laravel-api-boilerplate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 usamamuneerchaudhary/laravel-api-boilerplate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
PHP class to extend when building a WordPress plugin allowing you to follow smart plugin setup standards.
Anax htmlform module.
A PSR-7 compatible library for making CRUD API endpoints
Laravel 5.7 Boilerplate based on Bootstrap 4 and Tabler for Backend.
WordPress Plugin Framework
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-28