<?php

use App\Core\Template\Output as Output;
use Routes\RouteCollection as RouteCollection;

//Menu itens
RouteCollection::get('*', function() {
    Output::addOnSubmenu('config', '/email', "Emails", "", ['class' => 'nav-link']);
}, -10)->doIgnore();

RouteCollection::group("/email", function(){
    RouteCollection::get   ("/",            "\App\Common\Email\EmailController@index");
    RouteCollection::get   ("/form",        "\App\Common\Email\EmailController@create");
    RouteCollection::post  ("/",            "\App\Common\Email\EmailController@store");
    RouteCollection::post  ("/search",      "\App\Common\Email\EmailController@search");
    RouteCollection::get   ("/[i:id]",      "\App\Common\Email\EmailController@show");
    RouteCollection::get   ("/[i:id]/edit", "\App\Common\Email\EmailController@edit");
    RouteCollection::put   ("/[i:id]/edit", "\App\Common\Email\EmailController@update");
    RouteCollection::delete("/[i:id]",      "\App\Common\Email\EmailController@destroy");

    //RouteCollection::get   ("/template", "\App\Common\Email\EmailTemplateController@index");
    RouteCollection::get   ("/template/form", "\App\Common\Email\EmailTemplateController@create");
    RouteCollection::post  ("/template", "\App\Common\Email\EmailTemplateController@store");
    RouteCollection::get   ("/template/[i:id]", "\App\Common\Email\EmailTemplateController@show");
    RouteCollection::get   ("/template/[i:id]/edit", "\App\Common\Email\EmailTemplateController@edit");
    RouteCollection::put   ("/template/[i:id]/edit", "\App\Common\Email\EmailTemplateController@update");

});