public static function registerPolicy($config) {
        $modeloM = ucfirst(basename($config['modelo']));
        $modelo = strtolower($modeloM);
        $policyName = $modeloM . 'Policy';
        $path = str_finish(str_replace([ "/"], [ "\\"], app_path('Providers/AuthServiceProvider.php')), '.php');
        $policyPath = app_path('Policies/' . str_finish($policyName, ".php"));
        $policyPath = str_finish(str_replace([ "/"], [ "\\"], $policyPath), '.php');
        if (file_exists($path) && file_exists($policyPath)) {
            $modeloM = basename($config['modelo']);
            $contents = file($path);
            $inicio = -1;
            $fin = -1;
            $encontrado = -1;
            foreach ($contents as $index => $line) {
                if (strpos($line, '$policies = [') !== false) {
                    $inicio = $index;
                }
                if (strpos($line, $config['modelo']) !== false && $inicio >= 0 && $fin == -1) {
                    $encontrado = $index;
                }
                if (strpos($line, "];") !== false && $inicio >= 0 && $fin == -1) {
                    $fin = $index;
                }
            }
            $newTexto = chr(9) . "'" . $config['modelo'] . "' => 'App\\Policies\\" . $policyName . "', " . chr(13) . chr(10);
            if ($encontrado >= 0) {
                $contents[$encontrado] = $newTexto;
            } elseif ($inicio >= 0 && $fin >= 0) {
                $newContent = array_slice($contents, 0, $fin);
                $newContent[] = $newTexto;
                foreach (array_slice($contents, $fin) as $linea) {
                    $newContent[] = $linea;
                }
                $contents = $newContent;
            }
            $contents = file_put_contents($path, $contents);
        } else {
            $contents = false;
        }
        return $contents;
    }