<?php

namespace Sargilla\Flatlab4;

class Flatlab4 {

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

    public function loadMigrationRoute(){
        return FLATLAB4_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'),
        ];
    }

}
