<?php

use Routes\RouteCollection as RouteCollection;
use ORM\Connections as Connections;
use Schema\Wrapper as Wrapper;

RouteCollection::cli('sanity/install', function() {
    
    Wrapper::set_driver(Connections::getConnection());
    App\Core\Sanity\MigratorController::getInstance()->execute_plan();
    Wrapper::commit();
    
})->middlewareIgnore('auth');


RouteCollection::add('*', '*', function() {
    App\Core\Sanity\MigratorController::getInstance()->sentinel();
}, -19)->doIgnore()->middlewareIgnore('auth');