Proyek
Lihat di GitHub
bradtraversy/laravel-sanctum-api
Tentang
REST API with auth using Laravel 8 and Sanctum
Pengembangan web dan aplikasiPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliLaravel 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
Jelajahi proyek terkait
Memuat…