Laravel 5とFractalを使用したREST API Crud
REST API Crud Laravel 5を作成し、パッケージFractal(https://github.com/spatie/laravel-fractal)を使用します。
Crud API Laravel 5をインストールするには:
- ConnectデータベースのENVを変更できます。
- 最初にMigrateデータベースを使用して、データベースをインポートするために
php artisan migrate使用できます。 -
php artisan serve - 登録ユーザー:http:// localhost:8000/api/auth/register(post)
- ログインユーザー:http:// localhost:8000/api/auth/login(post)
- すべてのユーザーを表示:http:// localhost:8000/api/users(get) - >トークンIDが必要です。
- 詳細ユーザー:http:// localhost:8000/api/users/{iduser}(get) - >トークンIDが必要です。
- コンテンツの挿入:http:// localhost:8000/api/post(post) - >トークンIDが必要です。
- 編集コンテンツ:http:// localhost:8000/api/post/{idcontent}(put) - >トークンIDが必要です。
- 削除コンテンツ:http:// localhost:8000/api/post/{idcontent}(delete) - >トークンIDが必要です。
質問はありますか? [email protected]にメールを送ってください(http://pujikartono.com)