<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Route::group([
    'prefix'     => 'notifications',
    'namespace'  => 'Api',
    'middleware' => config('api.route.middleware_guess'),
], function (Router $router) {
    // 用户未读消息数量，不登陆返回0
    $router->get('counts', 'IndexController@counts');
});

Route::group([
    'prefix'    => 'notifications',
    'namespace' => 'Api',
    'middleware' => config('api.route.middleware_auth'),
], function (Router $router) {
    $router->get('', 'IndexController@index');
    $router->get('{type}/list', 'IndexController@type');
    $router->put('{type?}', 'IndexController@markAsRead');
    $router->delete('{type?}', 'IndexController@clean');
    $router->get('{id}', 'IndexController@show');
});

