<?php

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

//Menu itens
RouteCollection::get('*', function() {
    //Output::addMenu('/postal', 'postal', "<i class='fa fa-fa-cubes'></i>", ['class' => 'nav-link']);
    Output::addOnSubmenu('geo', '/postal', 'Codigos postais', "", ['class' => 'nav-link']);
}, -10)->doIgnore();

RouteCollection::group("/postal", function(){
    RouteCollection::get   ("/",                "\App\Geo\Postal\PostalController@index");
    RouteCollection::get   ("/form",            "\App\Geo\Postal\PostalController@create");
    RouteCollection::post  ("/",                "\App\Geo\Postal\PostalController@store");
    RouteCollection::get   ("/search/[d:code]", "\App\Geo\Postal\PostalController@search");
    RouteCollection::get   ("/[i:id]",          "\App\Geo\Postal\PostalController@show");
    RouteCollection::get   ("/[i:id]/edit",     "\App\Geo\Postal\PostalController@edit");
    RouteCollection::put   ("/[i:id]/edit",     "\App\Geo\Postal\PostalController@update");
    RouteCollection::delete("/[i:id]",          "\App\Geo\Postal\PostalController@destroy");
});