<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->group(function () {

    Route::get('auth-user', 'AuthUserController@show');

    Route::get('/memos/home', 'MemosController@home');

    Route::apiResources([
        '/users' => 'UserController',
        '/memos' => 'MemosController',
        '/meteo' => 'MeteoController',
        '/to-do-lists' => 'ToDoListController',
        '/to-do-lists/{toDoList}/to-do' => 'ToDoController',
//        '/users/{user}/posts' => 'UserPostController',
//        '/friend-request' => 'FriendRequestController',
    ]);

    Route::get('/automation/home', 'AutomationController@home');
    Route::post('/images/users/{users}', 'ImageController@users');
    Route::post('/images/memos/{memo}', 'ImageController@memos');
    Route::patch('/to-do-lists/{toDoList}/to-do/{toDo}/change', 'ToDoController@changeOrder');
    Route::patch('/to-do-lists/{toDoList}/to-do/{toDo}/check', 'ToDoController@checkedToogle');

});
