项目
在 GitHub 查看
bradtraversy/laravel-sanctum-api
关于
REST API with auth using Laravel 8 and Sanctum
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Laravel REST API with Sanctum
This is an example of a REST API using auth tokens with Laravel Sanctum
Usage
Change the .env.example to .env and add your database info
For SQLite, add
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
Create a database.sqlite file in the database directory
# Run the webserver on port 8000
php artisan serve
Routes
# Public
GET /api/products
GET /api/products/:id
POST /api/login
@body: email, password
POST /api/register
@body: name, email, password, password_confirmation
# Protected
POST /api/products
@body: name, slug, description, price
PUT /api/products/:id
@body: ?name, ?slug, ?description, ?price
DELETE /api/products/:id
POST /api/logout
探索相关项目
加载中…