<?php

namespace Sigma\Flatlab;

class Flatlab {

    public function config()
    {
        return [
            FLATLAB_PATH.'/config/flatlab.php' => config_path('flatlab.php')
        ];
    }
    public function routes()
    {
        return [
            FLATLAB_PATH.'/routes/api.php' =>  base_path('routes/api.php'),
            FLATLAB_PATH.'/routes/menu.php' =>  base_path('routes/menu.php'),
            FLATLAB_PATH.'/routes/permisos.php' =>  base_path('routes/permisos.php'),
            FLATLAB_PATH.'/routes/web.php' =>  base_path('routes/web.php')
        ];
    }
    public function views()
    {
        return [
            FLATLAB_PATH.'/resources/views/flatlab'  =>  resource_path('views/vendor/flatlab'),
            FLATLAB_PATH.'/resources/views/notifications' =>  resource_path('views/vendor/notifications')
        ];
    }
    public function languages()
    {
        return [
            FLATLAB_PATH.'/lang' => resource_path('lang/vendor/flatlab')
        ];
    }

    public function loadMigrationRoute(){
        return FLATLAB_PATH .'/database/migrations';
    }

    public function compile($template, $data)
    {
        foreach ($data as $key => $value) {
            $template = preg_replace("/\\$$key\\$/i", $value, $template);
        }
        return $template;
    }

    public function gravatar()
    {
        return [
            base_path().'/vendor/creativeorange/gravatar/config/gravatar.php' => config_path('gravatar.php'),
        ];
    }

}
