transRoute() public static method

Translate routes and save them to the translated routes array (used in the localize route filter)
public static transRoute ( string $routeName ) : string
$routeName string Key of the translated string
return string Translated string
Esempio n. 1
0
// we define the middlewares to apply according to the config
$group = config('settings.multilingual') ? ['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['guest', 'localize', 'localeSessionRedirect', 'localizationRedirect']] : ['middleware' => ['guest']];
Route::group($group, function () {
    // account
    Route::get(LaravelLocalization::transRoute('routes.account.create'), ['as' => 'account.create', 'uses' => 'Auth\\AccountController@createAccount']);
    Route::post(LaravelLocalization::transRoute('routes.account.store'), ['as' => 'account.store', 'uses' => 'Auth\\AccountController@store']);
    Route::get(LaravelLocalization::transRoute('routes.account.email'), ['as' => 'account.activation_email', 'uses' => 'Auth\\AccountController@sendActivationEmail']);
    Route::get(LaravelLocalization::transRoute('routes.account.activation'), ['as' => 'account.activate', 'uses' => 'Auth\\AccountController@activateAccount']);
    // login
    Route::get(LaravelLocalization::transRoute('routes.login.index'), ['as' => 'login.index', 'uses' => 'Auth\\AuthController@index']);
    Route::post(LaravelLocalization::transRoute('routes.login.login'), ['as' => 'login.login', 'uses' => 'Auth\\AuthController@login']);
    // password recovery
    Route::get(LaravelLocalization::transRoute('routes.password.index'), ['as' => 'password.index', 'uses' => 'Auth\\PasswordController@index']);
    Route::post(LaravelLocalization::transRoute('routes.password.email'), ['as' => 'password.email', 'uses' => 'Auth\\PasswordController@sendResetEmail']);
    Route::get(LaravelLocalization::transRoute('routes.password.reset'), ['as' => 'password.reset', 'uses' => 'Auth\\PasswordController@show']);
    Route::put(LaravelLocalization::transRoute('routes.password.update'), ['as' => 'password.update', 'uses' => 'Auth\\PasswordController@update']);
});
//public routes
// we define the middlewares to apply according to the config
$group = config('settings.multilingual') ? ['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']] : [];
Route::group($group, function () {
    // home
    Route::get('/', ['as' => 'home', 'uses' => 'Home\\HomeController@show']);
    // news
    Route::get(trans('routes.news.index'), ['as' => 'news.index', 'uses' => 'News\\NewsController@index']);
    Route::get(trans('routes.news.show'), ['as' => 'news.show', 'uses' => 'News\\NewsController@show']);
    // leading team
    Route::get(trans('routes.leading_team.index'), ['as' => 'front.leading_team', 'uses' => 'LeadingTeam\\LeadingTeamController@index']);
    // palmares
    Route::get(trans('routes.palmares.index'), ['as' => 'palmares.index', 'uses' => 'Palmares\\PalmaresController@index']);
    // registration
Esempio n. 2
0
<?php

/**
 * Ajax Routes
 */
Route::group(['prefix' => LaravelLocalization::setLocale() . "/" . LaravelLocalization::transRoute('routes.admin'), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
    Route::get(LaravelLocalization::transRoute('routes.blog') . '/data_blog', 'ChildrenFriendly\\Blog\\Controllers\\PostController@data_blog');
    Route::get(LaravelLocalization::transRoute('routes.blog') . '/data_blog_trash', 'ChildrenFriendly\\Blog\\Controllers\\PostController@data_blog_trashed');
});
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
    //HOTELS
    Route::get(LaravelLocalization::transRoute('routes.admin/blog'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@index');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/trash'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@index(true)');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/new'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@create');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/store'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@store');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/edit'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@edit');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/update'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@update');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/remove'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@destroy');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/remove_force'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@forceDestroy');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/restore'), 'ChildrenFriendly\\Blog\\Controllers\\PostController@restore');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/store'), 'ChildrenFriendly\\Blog\\Controllers\\CategoriesController@store');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/categories/edit'), 'ChildrenFriendly\\Blog\\Controllers\\CategoriesController@edit');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/update'), 'ChildrenFriendly\\Blog\\Controllers\\CategoriesController@update');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/remove'), 'ChildrenFriendly\\Blog\\Controllers\\CategoriesController@destroy');
});
Esempio n. 3
0
    Route::get(LaravelLocalization::transRoute('menu.colabora'), function () {
        return View::make('colabora');
    });
    Route::get(LaravelLocalization::transRoute('menu.nuestros-vinculos'), function () {
        return View::make('nuestros-vinculos');
    });
    Route::get(LaravelLocalization::transRoute('menu.contacto'), ['as' => 'contacto', 'uses' => 'ContactoController@index']);
    Route::post(LaravelLocalization::transRoute('menu.contacto'), 'ContactoController@store');
    Route::get(LaravelLocalization::transRoute('menu.galerias'), function () {
        return View::make('galeria');
    });
    Route::get('/gracias', function () {
        return View::make('gracias');
    });
    Route::get('/aviso-de-privacidad', function () {
        return View::make('aviso-de-privacidad');
    });
    Route::get(LaravelLocalization::transRoute('menu.ayudalos'), function () {
        return View::make('programas.ayudalos-a-seguir');
    });
    Route::get(LaravelLocalization::transRoute('menu.frio'), function () {
        return View::make('programas.vive-mejor-sin-frio');
    });
    Route::get(LaravelLocalization::transRoute('menu.sonrian'), function () {
        return View::make('programas.haz-que-sonrian');
    });
    Route::get('minicv/{minicv}', ['as' => 'minicv', function ($minicv) {
        return view('minicv.' . $minicv);
        //return "".$minicv;
    }]);
});
Esempio n. 4
0
Route::post('auth/register', 'Auth\\AuthController@postRegister');
Route::get('auth/register/confirm/{email_token}', 'Auth\\AuthController@confirmEmail');
// Password reset link request routes...
//Route::get('password/email', 'Auth\PasswordController@getEmail');
//Route::post('password/email', 'Auth\PasswordController@postEmail');
// Password reset routes...
//Route::get('auth/password/reset/{token}', 'Auth\PasswordController@getReset');
//Route::post('auth/password', 'Auth\PasswordController@postReset');
/** Home ruta za testiranje **/
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['auth', 'localize']], function () {
    Route::get('/', ['as' => LaravelLocalization::transRoute('routes.home'), function () {
        return View::make('index');
    }]);
});
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize']], function () {
    /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
    Route::get(LaravelLocalization::transRoute('routes.about'), function () {
        return view('frontend.institution.index');
    });
});
/** OTHER PAGES THAT SHOULD NOT BE LOCALIZED **/
Route::get('admin/dashboard', ['middleware' => 'auth', function () {
    return view('layouts.admin.master');
}]);
Route::get('users', 'UsersController@index');
Route::resource(LaravelLocalization::transRoute('routes.institution'), 'InstitutionsController');
Route::resource(LaravelLocalization::transRoute('routes.faculty-bodies'), 'BodiesController');
Route::resource(LaravelLocalization::transRoute('routes.body-types'), 'BodyTypesController');
Route::resource(LaravelLocalization::transRoute('routes.functions'), 'BodyTypeFunctionsController');
Route::resource(LaravelLocalization::transRoute('routes.services'), 'ServicesController');
Esempio n. 5
0
    Route::get('/cart', function () {
        return View::make('cart');
    });
    Route::get('/shipping', function () {
        return View::make('shipping');
    });
    Route::get('/payment', function () {
        return View::make('payment');
    });
    Route::get('/overview', function () {
        return View::make('overview');
    });
    Route::get('/confirmation', function () {
        return View::make('confirmation');
    });
    Route::get(LaravelLocalization::transRoute('routes.about'), function () {
        return View::make('about');
    });
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    //
Esempio n. 6
0
        Route::post(LaravelLocalization::transRoute('routes.contactMessage'), 'UserController@sendContactMessage');
    });
    /*
    |   All other routes which need translation put here
    |
    */
    Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
        Route::get('/', function () {
            return view('pages.home');
        });
        Route::get(LaravelLocalization::transRoute('routes.home'), 'PagesController@home');
        Route::get(LaravelLocalization::transRoute('routes.portfolio'), 'PagesController@portfolio');
        Route::get(LaravelLocalization::transRoute('routes.about'), 'PagesController@about');
        Route::get(LaravelLocalization::transRoute('routes.services'), 'PagesController@services');
        Route::get(LaravelLocalization::transRoute('routes.options'), 'PagesController@options');
        Route::get(LaravelLocalization::transRoute('routes.contact'), 'PagesController@contact');
        //Route::post(LaravelLocalization::transRoute('routes.contactMessage'), 'UserController@sendContactMessage');
    });
});
Route::get('/vue', function () {
    return view('pages.vue');
});
Route::get('/.well-known/acme-challenge/K5Wv4J5EE6OwWtXbYIKZcYlEgNpRQxdez7vKr-9RQ8g', function () {
    return 'K5Wv4J5EE6OwWtXbYIKZcYlEgNpRQxdez7vKr-9RQ8g.k5KBZdnQAMA4pXk38l1P8ikRiZ0N4nPwNzjKVrMOt0A';
});
Route::get('google6cfafa75f1d1a345.html', function () {
    return 'google-site-verification: google6cfafa75f1d1a345.html';
});
Route::get('baidu_verify_QDufbSGLfm.html', function () {
    return 'QDufbSGLfm';
});
Esempio n. 7
0
    Route::resource('/bottomtext', 'BottomTextController');
    Route::resource('/newstype', 'NewsTypeController');
    Route::get('/news/search', array('uses' => 'NewsController@search', 'as' => 'admin.news.search'));
    Route::resource('/news', 'NewsController');
    Route::post('/image_slider/delete/{id}', 'AdminSlideController@deleteSlide');
    Route::get('/slider/search', array('uses' => 'AdminSlideController@search', 'as' => 'admin.slide.search'));
    Route::resource('/slider', 'AdminSlideController');
    Route::resource('/des_content', 'DesContentController');
    Route::resource('/introduce', 'AdminIntroduceController');
    Route::resource('/about_us_company', 'AdminAboutUsController');
    Route::resource('/type_about_us', 'AdminTypeAboutController');
});
Route::group(array('prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRoutes'), function () {
    Route::post('/sendLang', 'SiteIndexController@sendLang');
    Route::post('/sendContact', array('uses' => 'ContactController@contact', 'as' => 'contact'));
    // Route::get('/tin-tuc/{slug}', array('uses' => 'SiteNewsController@show', 'as' =>'showNews'));
    // Route::get('/tin-tuc', array('uses' => 'SiteNewsController@index', 'as' => 'listNews'));
    /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/
    Route::resource('/', 'SiteIndexController');
    // Route::resource(LaravelLocalization::transRoute('routes.slug'), 'SiteTypeController');
    // Route::get(LaravelLocalization::transRoute('routes.about'),function(){
    // 	return View::make('about');
    // });
    Route::get(LaravelLocalization::transRoute('routes.about'), 'AboutController@index');
    Route::get(LaravelLocalization::transRoute('routes.contact'), 'ContactController@index');
    Route::get(LaravelLocalization::transRoute('routes.slug'), 'SiteTypeController@showSlug');
    Route::get(LaravelLocalization::transRoute('routes.slugDetail'), 'SiteTypeController@showChildSlug');
    // Route::get(LaravelLocalization::transRoute('routes.view'),function($id){
    // 	return View::make('view',array('id'=>$id));
    // });
});
Esempio n. 8
0
<?php

/**
 * Ajax Routes
 */
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
    Route::get(LaravelLocalization::transRoute('routes.admin/blog') . '/data_blog', 'starter\\Blog\\Controllers\\PostController@data_blog');
});
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
    //HOTELS
    Route::get(LaravelLocalization::transRoute('routes.admin/blog'), 'starter\\Blog\\Controllers\\PostController@index');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/trash'), 'starter\\Blog\\Controllers\\PostController@index(true)');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/new'), 'starter\\Blog\\Controllers\\PostController@create');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/store'), 'starter\\Blog\\Controllers\\PostController@store');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/edit'), 'starter\\Blog\\Controllers\\PostController@edit');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/update'), 'starter\\Blog\\Controllers\\PostController@update');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/remove'), 'starter\\Blog\\Controllers\\PostController@destroy');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/remove_force'), 'starter\\Blog\\Controllers\\PostController@forceDestroy');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/restore'), 'starter\\Blog\\Controllers\\PostController@restore');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/store'), 'starter\\Blog\\Controllers\\CategoriesController@store');
    Route::get(LaravelLocalization::transRoute('routes.admin/blog/categories/edit'), 'starter\\Blog\\Controllers\\CategoriesController@edit');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/update'), 'starter\\Blog\\Controllers\\CategoriesController@update');
    Route::post(LaravelLocalization::transRoute('routes.admin/blog/categories/remove'), 'starter\\Blog\\Controllers\\CategoriesController@destroy');
    //IMAGE TEXT EDITOR
    Route::post('admin/blog/upload_editor_image', 'starter\\Blog\\Controllers\\PostController@upload_image_editor');
    Route::post('admin/blog/remove_editor_image', 'starter\\Blog\\Controllers\\PostController@remove_editor_images');
    Route::get(LaravelLocalization::transRoute('routes.menu.public_blog'), 'starter\\Blog\\Controllers\\PostController@index_front');
    Route::get(LaravelLocalization::transRoute('routes.menu.public_blog_item'), 'starter\\Blog\\Controllers\\PostController@show')->where('slug', '[a-z0-9-]+');
    Route::get(LaravelLocalization::transRoute('routes.menu.public_blog_category'), 'starter\\Blog\\Controllers\\PostController@showCategory')->where('slug', '[a-z0-9-]+');
    Route::get(LaravelLocalization::transRoute('routes.menu.public_blog_tag'), 'starter\\Blog\\Controllers\\PostController@showTag')->where('slug', '[a-z0-9-]+');
});
Esempio n. 9
0
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
    Route::get('/', function () {
        return view('welcome');
    });
    Route::auth();
    Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localize', 'localeSessionRedirect', 'localizationRedirect']], function () {
        Route::get(LaravelLocalization::transRoute('routes.tasks'), 'TaskController@index');
        Route::get(LaravelLocalization::transRoute('routes.home'), function () {
            return view('welcome');
        });
        Route::get(LaravelLocalization::transRoute('routes.login'), 'Auth\\AuthController@showLoginForm');
        Route::get(LaravelLocalization::transRoute('routes.register'), 'Auth\\AuthController@showRegistrationForm');
    });
    //Route::get('/tasks', 'TaskController@index');
    Route::post('/task', 'TaskController@store');
    Route::delete('/task/{task}', 'TaskController@destroy');
});