setLocale() public static method

Set and return current locale
public static setLocale ( string $locale = null ) : string
$locale string Locale to set the App to (optional)
return string Returns locale (if route has any) or null (if route does not have a locale)
示例#1
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $params = $this->params;
     $localization = \Mcamara\LaravelLocalization\LaravelLocalization::class;
     if (class_exists($localization)) {
         \LaravelLocalization::setLocale($this->locale);
     }
     app()->setLocale($this->locale);
     if ($this->type == 'Normal') {
         // Text send
         Mail::raw($params['html'], function ($message) use($params) {
             if ($params['attach']) {
                 $message->attach($params['attach']);
             }
             $message->to($params['to'])->from(env('MAIL_USERNAME'), $params['fromName'])->subject($params['subject']);
         });
     } elseif ($this->type == 'Template') {
         // Template send
         Mail::send($params['templateInvokeName'], $params['xsmtpapi'], function ($message) use($params) {
             if ($params['attach']) {
                 $message->attach($params['attach']);
             }
             $message->to($params['to'])->from(env('MAIL_USERNAME'), $params['fromName'])->subject($params['subject']);
         });
     }
     $fileDir = $this->getSwiftmailLogDir();
     $this->logInfo('[' . Carbon::now($this->local)->format('Y-m-d H:i:s') . ']' . json_encode($params, JSON_UNESCAPED_UNICODE) . chr(10), $fileDir);
 }
 public function doChangeLocale()
 {
     $locale = Input::get('locale');
     LaravelLocalization::setLocale($locale);
     App::setLocale($locale);
     Cookie::queue('locale', $locale);
     return Response::json(array('status' => true, 'link' => geturl(Input::get('url'))));
 }
示例#3
0
文件: routes.php 项目: Okipa/una.app
    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
    Route::get(trans('routes.registration.index'), ['as' => 'registration.index', 'uses' => 'Registration\\RegistrationController@index']);
    // calendar
    Route::get(trans('routes.calendar.index'), ['as' => 'calendar.index', 'uses' => 'Calendar\\CalendarController@index']);
    // schedule
示例#4
0
Route::get('auth/register', 'Auth\\AuthController@getRegister');
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');
示例#5
0
                }
                Route::group($routesParams, function () use($node, $_nodeUrl, $templates) {
                    Route::get($_nodeUrl, function () use($node, $templates) {
                        if (!isset($templates[$node->template])) {
                            App::abort(404);
                        }
                        list($controller, $method) = explode('@', $templates[$node->template]['action']);
                        $app = app();
                        $controller = $app->make($controller);
                        return $controller->callAction('init', array($node, $method));
                    });
                });
                if (LaravelLocalization::setLocale() == "") {
                    $pathUrl = "/" . Request::path();
                } else {
                    $pathUrl = Request::path();
                }
                if ($pathUrl == LaravelLocalization::setLocale() . $_nodeUrl) {
                    Session::put('currentNode', $node);
                } else {
                    Session::put('currentNode', $node);
                }
            }
        }
    } catch (Exception $e) {
        // todo: implement
    }
}
// devel fallback
Route::get('/thereisnospoon', 'Yaro\\Jarboe\\DevelController@showMain');
Route::post('/thereisnospoon', 'Yaro\\Jarboe\\DevelController@handleMain');
示例#6
0
<?php

use Illuminate\Routing\Router;
/** @var Router $router */
/*
|--------------------------------------------------------------------------
| Admin routes
|--------------------------------------------------------------------------
*/
$router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter|auth.admin|permissions'], function (Router $router) {
    $router->group(['prefix' => Config::get('core::core.admin-prefix') . '/place', 'namespace' => 'Modules\\Place\\Http\\Controllers'], function (Router $router) {
        $router->resource('places', 'Admin\\PlaceController', ['except' => ['show'], 'names' => ['index' => 'admin.place.place.index', 'create' => 'admin.place.place.create', 'store' => 'admin.place.place.store', 'edit' => 'admin.place.place.edit', 'update' => 'admin.place.place.update', 'destroy' => 'admin.place.place.destroy']]);
    });
});
示例#7
0
<?php

/*
|--------------------------------------------------------------------------
| Frontend Routes
|--------------------------------------------------------------------------
*/
$languages = LaravelLocalization::getSupportedLocales();
foreach ($languages as $language => $values) {
    $supportedLocales[] = $language;
}
$locale = Request::segment(1);
if (in_array($locale, $supportedLocales)) {
    LaravelLocalization::setLocale($locale);
    App::setLocale($locale);
}
Route::get('/', function () {
    return Redirect::to(LaravelLocalization::getCurrentLocale(), 302);
});
Route::group(array('prefix' => LaravelLocalization::getCurrentLocale(), 'before' => array('localization', 'before')), function () {
    Session::put('my.locale', LaravelLocalization::getCurrentLocale());
    // frontend dashboard
    Route::get('/', ['as' => 'dashboard', 'uses' => 'HomeController@index']);
    // article
    Route::get('/article', array('as' => 'dashboard.article', 'uses' => 'ArticleController@index'));
    Route::get('/article/{slug}', array('as' => 'dashboard.article.show', 'uses' => 'ArticleController@show'));
    // news
    Route::get('/news', array('as' => 'dashboard.news', 'uses' => 'NewsController@index'));
    Route::get('/news/{slug}', array('as' => 'dashboard.news.show', 'uses' => 'NewsController@show'));
    // tags
    Route::get('/tag/{slug}', array('as' => 'dashboard.tag', 'uses' => 'TagController@index'));
示例#8
0
<?php

Route::pattern('id', '[0-9]+');
Route::pattern('slug', '[a-z0-9-]+');
if (file_exists(app_path() . '/routes_dev.php')) {
    include app_path() . '/routes_dev.php';
}
include app_path() . '/routes_backend.php';
include 'view_composers.php';
Route::group(array('prefix' => LaravelLocalization::setLocale()), function () {
    Route::post('/app/change-locale', 'HomeController@doChangeLocale');
    Route::post('/rates/refresh', 'HomeController@doRefreshRates');
    /* Calculators */
    Route::post('/calculator/refinance', 'CalculatorController@doRefinanceCalculation');
    Route::post('/calculator/consumer', 'CalculatorController@doConsumerCalculation');
    Route::post('/calculator/cash', 'CalculatorController@doCashCalculation');
    Route::post('/calculator/deposit', 'CalculatorController@doDepositCalculation');
    Route::post('/calculator/get-deposit-interest', 'CalculatorController@getDepositInterest');
    /* end Calculators */
    Route::post('/apply-form/product', 'ApplyController@doApplyProduct');
    Route::post('/apply-form/business', 'ApplyController@doApplyBusiness');
    Route::post('/apply-form/deposit', 'ApplyController@doApplyDeposit');
    Route::post('/feedback/send', 'FeedbackController@doSendFeedback');
    Route::post('/apply-form/subscriber', 'ApplyController@doApplySubscriber');
    Route::get('/form-deposit-compare', 'PrivatePersonsController@formDepositCompare');
    Route::get('/about/press/{slug}-{id}', 'AboutController@showSinglePressItem');
    Route::post('/about/press/load', 'AboutController@doLoadPressItems');
    // map
    Route::post('/map/filter', 'MapController@doFilter');
    // async
    Route::post('/async/add-card-to-compare', 'AsyncController@addCardToCompare');
示例#9
0
function setActive($path)
{
    $prefix = LaravelLocalization::setLocale() . '/' . request()->segment(2);
    if (request()->is($prefix . $path) || request()->is($prefix . $path . '/*')) {
        return "class=active";
    }
    return '';
}
示例#10
0
<?php

use Illuminate\Routing\Router;
/** @var Router $router */
$router->group(['prefix' => 'blog'], function (Router $router) {
    $locale = LaravelLocalization::setLocale() ?: App::getLocale();
    $router->get('posts', ['as' => $locale . '.blog', 'uses' => 'PublicController@index', 'middleware' => config('asgard.blog.config.middleware')]);
    $router->get('posts/{slug}', ['as' => $locale . '.blog.slug', 'uses' => 'PublicController@show', 'middleware' => config('asgard.blog.config.middleware')]);
});
示例#11
0
 | Application Routes
 |--------------------------------------------------------------------------
 |
 | Here is where you can register all of the routes for an application.
 | It's a breeze. Simply tell Laravel the URIs it should respond to
 | and give it the Closure to execute when that URI is requested.
 |
*/
Route::get('sitemap.xml', function () {
    $content = View::make('general.sitemap');
    return Response::make($content, '200')->header('Content-Type', 'text/xml');
});
Route::get('generatesitemap', function () {
    return Artisan::call('generatesitemap');
});
Route::group(array('prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter'), function () {
    Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
    Route::get('terms', ['as' => 'terms', function () {
        return View::make('home.terms');
    }]);
    Route::get('contact', ['as' => 'contact', 'uses' => 'HomeController@getContact']);
    Route::get('search', ['as' => 'search', 'uses' => 'HomeController@search']);
    Route::post('contact', ['as' => 'contact.post', 'uses' => 'HomeController@postContact']);
    Route::get('users/login', ['as' => 'login', 'uses' => 'AuthController@getLogin']);
    Route::post('users/login', ['before' => 'csrf', 'as' => 'login.post', 'uses' => 'AuthController@postLogin']);
    Route::get('users/logout', ['as' => 'logout', 'uses' => 'AuthController@getLogout']);
    Route::get('users/register', ['as' => 'register', 'uses' => 'AuthController@getRegister']);
    Route::post('users/register', ['as' => 'register.post', 'uses' => 'AuthController@postRegister']);
    Route::get('users/resend-validation', ['as' => 'resend-validation', 'uses' => 'AuthController@getResendValidationEmail']);
    Route::post('users/resend-validation', ['as' => 'resend-validation.post', 'uses' => 'AuthController@postResendValidationEmail']);
    Route::get('users/register/verify/{confirmation_code}', ['as' => 'verify-register', 'uses' => 'AuthController@verifyRegister']);
示例#12
0
 /**
  * It's you can send template mail
  * @param  string $uri Api Url
  * @return json
  */
 private function startSendTemplate($uri)
 {
     // Def send params
     $params = ['apiUser' => $this->getApiUser(), 'apiKey' => $this->getApiKey(), 'from' => $this->getFrom(), 'fromName' => $this->getFromName(), 'to' => '', 'cc' => $this->cc, 'bcc' => $this->bcc, 'replyTo' => $this->replyTo, 'xsmtpapi' => '', 'subject' => $this->subject, 'attach' => $this->attach, 'templateInvokeName' => ''];
     // Set the gateway corresponding method
     foreach ($this->to as $gateway => $mails) {
         $params['to'] = isset($this->to[$gateway]) ? $this->to[$gateway] : null;
         $params['cc'] = isset($this->cc[$gateway]) ? $this->cc[$gateway] : null;
         $params['bcc'] = isset($this->bcc[$gateway]) ? $this->bcc[$gateway] : null;
         $params['xsmtpapi'] = $this->xsmtpapi[$gateway];
         $params['templateInvokeName'] = $this->templateInvokeName[$gateway];
         if ('swiftmail' == $gateway) {
             if ($this->getQueue()) {
                 $job = (new MailSender('Template', $params, $this->getLocale()))->onQueue($this->getQueueTarget());
                 $this->dispatch($job);
                 break;
             }
             $this->swiftMailTemplateSend($params);
         } else {
             $localization = \Mcamara\LaravelLocalization\LaravelLocalization::class;
             if (class_exists($localization)) {
                 \LaravelLocalization::setLocale($this->getLocale());
             }
             app()->setLocale($this->getLocale());
             $params['to'] = isset($params['to']) ? implode(';', $params['to']) : null;
             $params['cc'] = isset($params['cc']) ? implode(';', $params['cc']) : null;
             $params['bcc'] = isset($params['bcc']) ? implode(';', $params['bcc']) : null;
             $this->apiMailSend($uri, $gateway, $params);
         }
     }
 }
$__env->startSection('content');
?>

<!-- /#sidebar-wrapper -->

<!-- Page Content -->
<div id="page-content-wrapper">
    <div class="container-fluid">
         <?php 
echo $__env->make('template.lang', array_except(get_defined_vars(), array('__data', '__path')))->render();
?>
 
        <div class="row">
            <div class="col-lg-12">
                <form action="<?php 
echo e(URL::asset(LaravelLocalization::setLocale() . DIRECTORY_SEPARATOR . 'admin-product-edit/' . $product->id));
?>
 " method="post" enctype="multipart/form-data">
                    
                    <div class="form-group">
                        <label for="usr">Заглавие: </label>                 
                        <input name="title" value="<?php 
echo e($product->title);
?>
" type="text" class="form-control" id="usr">
                    </div>
                    
                     <input type="hidden" name="_token" value="<?php 
echo e(csrf_token());
?>
">
示例#14
0
         }
     }
     $urls = array_keys($otherTreeUrl);
     if ($urls && count($urls) && in_array($startUrl, $urls)) {
         if (isset($otherTreeUrl[$startUrl])) {
             $configName = $otherTreeUrl[$startUrl];
             $path = app_path() . '/config/packages/vis/builder/' . $configName . '.php';
             $definition = (require_once $path);
             $model = $definition['model'];
             $slug = end($arrSegments);
             if (!isset($slugTree)) {
                 $node = $model::where("slug", 'like', $slug)->first();
                 if (isset($node->id)) {
                     $_nodeUrl = $node->getUrlNoLocation();
                     $templates = $definition['templates'];
                     Route::group(array('prefix' => LaravelLocalization::setLocale()), function () use($node, $_nodeUrl, $templates) {
                         Route::get($_nodeUrl, function () use($node, $templates) {
                             if (!isset($templates[$node->template])) {
                                 App::abort(404);
                             }
                             list($controller, $method) = explode('@', $templates[$node->template]['action']);
                             $app = app();
                             $controller = $app->make($controller);
                             return $controller->callAction('init', array($node, $method));
                         });
                     });
                 }
             }
         }
     }
 }
$__env->startSection('content');
?>

<!-- /#sidebar-wrapper -->

<!-- Page Content -->
<div id="page-content-wrapper">
    <div class="container-fluid">
         <?php 
echo $__env->make('template.lang', array_except(get_defined_vars(), array('__data', '__path')))->render();
?>
 
        <div class="row">
            <div class="col-lg-12">
                <form action="<?php 
echo e(URL::asset(LaravelLocalization::setLocale() . DIRECTORY_SEPARATOR . 'admin-category-edit/' . $category->id));
?>
" method="post" enctype="multipart/form-data">
                    <div class="form-group">
                        <label for="usr">Заглавие: </label>                 
                        <input name="title" value="<?php 
echo e($category->title);
?>
" type="text" class="form-control" id="usr">
                    </div>
                     <input type="hidden" name="_token" value="<?php 
echo e(csrf_token());
?>
">

                    <div class="form-group">
<?php

/**
 * Prefixed routes
 */
Route::group(['prefix' => LaravelLocalization::setLocale()], function () {
    Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
    Route::get('/art', ['as' => 'art', 'uses' => 'AuctionController@index']);
    Route::post('/filter-style', ['as' => 'filterStyle', 'uses' => 'FilterController@filterStyle']);
    Route::post('/filter-media', ['as' => 'filterMedia', 'uses' => 'FilterController@filterMedia']);
    Route::post('/filter-era', ['as' => 'filterEra', 'uses' => 'FilterController@filterEra']);
    Route::post('/filter-endings', ['as' => 'filterEndings', 'uses' => 'FilterController@filterEndings']);
    Route::post('/filter-price', ['as' => 'filterPrice', 'uses' => 'FilterController@filterPrice']);
    Route::get('/art/{slug}', ['as' => 'show', 'uses' => 'AuctionController@show']);
    Route::get('/contact', ['as' => 'contact', 'uses' => 'ContactController@index']);
    Route::post('/contact', ['as' => 'askAQuestion', 'uses' => 'ContactController@ask']);
    Route::post('/mail', ['as' => 'sendMail', 'uses' => 'ContactController@sendMail']);
    Route::post('/search', ['as' => 'search', 'uses' => 'SearchController@show']);
    Route::get('/faq', ['as' => 'faq', 'uses' => 'FaqController@index']);
    /**
     * Authentication routes
     */
    Route::get('login', ['as' => 'getLogin', 'uses' => 'Auth\\AuthController@getLogin']);
    Route::post('login', ['as' => 'postLogin', 'uses' => 'Auth\\AuthController@postLogin']);
    /**
     * Registration routes
     */
    Route::get('register', ['as' => 'getRegister', 'uses' => 'Auth\\AuthController@getRegister']);
    Route::post('auth/register', ['as' => 'postRegister', 'uses' => 'Auth\\AuthController@postRegister']);
    Route::group(['middleware' => 'auth'], function () {
        Route::post('art/buyout', ['as' => 'buyOutAuction', 'uses' => 'AuctionController@buyOut']);
$__env->startSection('content');
?>

<!-- /#sidebar-wrapper -->

<!-- Page Content -->
<div id="page-content-wrapper">
    <div class="container-fluid">
         <?php 
echo $__env->make('template.lang', array_except(get_defined_vars(), array('__data', '__path')))->render();
?>
 
        <div class="row">
            <div class="col-lg-12">
                <form action="<?php 
echo e(URL::asset(LaravelLocalization::setLocale() . DIRECTORY_SEPARATOR . 'admin-product-add'));
?>
" method="post" enctype="multipart/form-data">
                    
                    <div class="form-group">
                        <label for="usr">Заглавие: </label>
                        <input name="title" type="text" class="form-control" id="usr">
                    </div>
                     <input type="hidden" name="_token" value="<?php 
echo e(csrf_token());
?>
">

                    <div class="form-group">
                        <label for="usr">Кратко описание: </label>
                        <textarea name='summary' class="form-control" rows="3" id="comment"></textarea>
示例#18
0
function getTypeLanguage($vi, $en)
{
    $lang = LaravelLocalization::setLocale();
    if ($lang != LANG_EN) {
        return $vi;
    }
    return $en;
}
示例#19
0
文件: routes.php 项目: Houbsi/Core
<?php

/*
|--------------------------------------------------------------------------
| Language Settings
|--------------------------------------------------------------------------
*/
$lang = null;
if (App::environment() == 'testing') {
    $lang = 'fr';
}
LaravelLocalization::setLocale($lang);
$__env->startSection('content');
?>

<!-- /#sidebar-wrapper -->

<!-- Page Content -->
<div id="page-content-wrapper">
    <div class="container-fluid">
         <?php 
echo $__env->make('template.lang', array_except(get_defined_vars(), array('__data', '__path')))->render();
?>
 
        <div class="row">
            <div class="col-lg-12">
                <form action="<?php 
echo e(URL::asset(LaravelLocalization::setLocale() . DIRECTORY_SEPARATOR . 'admin-slaider-edit/' . $slaider->id));
?>
" method="post" enctype="multipart/form-data">
                    <div class="form-group">
                        <label for="usr">Име: </label>                 
                        <input name="name" value="<?php 
echo e($slaider->name);
?>
" type="text" class="form-control" id="usr">
                    </div>
                    <input type="hidden" name="_token" value="<?php 
echo e(csrf_token());
?>
">
                    
                     <div class="form-group">
示例#21
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');
});
示例#22
0
        Route::get('/product/{slug?}', 'CategoryController@product');
        Route::get('/order/{slug?}', 'OrderController@index');
        Route::get('/order/store/{slug?}', 'OrderController@store');
        Route::get('/order/detail/{slug?}', 'OrderController@detail');
        Route::get('/order/delete/{id?}', 'OrderController@delete');
        Route::post('/order/save', 'OrderController@makeOrder');
        Route::post('/ordera/fast', 'OrderController@fastOrder');
        Route::post('/product-fast', 'OrderController@productOrder');
        Route::get('/success', 'OrderController@success');
    });
});
Route::get('/home', 'HomeController@index');
Route::group(['middleware' => 'web'], function () {
    Route::group(['prefix' => LaravelLocalization::setLocale()], function () {
        Route::auth();
        App::setLocale(LaravelLocalization::setLocale());
        Route::get('admin-category', ['middleware' => 'admin', 'uses' => 'Admin\\CategoryController@category']);
        Route::get('admin-category-edit/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\CategoryController@edit']);
        Route::get('admin-category-add/', ['middleware' => 'admin', 'uses' => 'Admin\\CategoryController@add']);
        Route::post('admin-category-add/', ['middleware' => 'admin', 'uses' => 'Admin\\CategoryController@add']);
        Route::post('admin-category-edit/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\CategoryController@update']);
        Route::get('/admin-panel', ['middleware' => 'admin', 'uses' => 'Admin\\AdminController@index']);
        Route::get('/admin-users', ['middleware' => 'admin', 'uses' => 'Admin\\UsersController@users']);
        Route::get('/admin-orders', ['middleware' => 'admin', 'uses' => 'Admin\\OrdersController@orders']);
        Route::get('/admin-order_delete/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\OrdersController@delete']);
        Route::get('/admin-order-edit/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\OrdersController@edit']);
        Route::get('admin-product', ['middleware' => 'admin', 'uses' => 'Admin\\ProductsController@products']);
        Route::get('admin-product_delete/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\ProductsController@delete']);
        Route::get('admin-product-add', ['middleware' => 'admin', 'uses' => 'Admin\\ProductsController@add']);
        Route::post('admin-product-add', ['middleware' => 'admin', 'uses' => 'Admin\\ProductsController@add']);
        Route::get('admin-product-edit/{id}', ['middleware' => 'admin', 'uses' => 'Admin\\ProductsController@edit']);
示例#23
0
 public function setLocale($language)
 {
     LaravelLocalization::setLocale($language);
     return Redirect::route('dashboard');
 }
示例#24
0
            Route::get('/{type}/index', ['as' => 'portal.property.index.agent', 'uses' => 'PropertyController@indexAgent']);
        });
        //Referrals
        Route::group(['prefix' => '/referrals', 'is' => 'agent'], function () {
            Route::get('index', ['as' => 'portal.referrals.index', 'uses' => 'ReferralController@index']);
            Route::get('create', ['as' => 'portal.referrals.create', 'uses' => 'ReferralController@create']);
            Route::post('store', ['as' => 'portal.referrals.store', 'uses' => 'ReferralController@store']);
            Route::group(['middleware' => ['can' => 'admin.can_edit_or_owner']], function () {
                Route::get('edit/{id}', ['as' => 'portal.referrals.edit', 'uses' => 'ReferralController@edit']);
                Route::post('update/{id}', ['as' => 'portal.referrals.update', 'uses' => 'ReferralController@update']);
                Route::post('delete/{id}', ['as' => 'portal.referrals.delete', 'uses' => 'ReferralController@delete']);
            });
        });
    });
});
Route::group(['namespace' => 'Frontend', 'prefix' => LaravelLocalization::setLocale(), 'middleware' => ['localizationRedirect']], function () {
    //Account
    Route::group(['prefix' => '/account'], function () {
        Route::get('/register', ['as' => 'frontend.account.register', 'uses' => 'Auth\\AuthController@getRegister']);
        Route::post('/register', ['as' => 'frontend.account.register.process', 'uses' => 'Auth\\AuthController@postRegister']);
        Route::get('/login', ['as' => 'frontend.account.login', 'uses' => 'Auth\\AuthController@getLogin']);
        Route::post('/login', ['as' => 'frontend.account.login.process', 'uses' => 'Auth\\AuthController@postLogin']);
        Route::get('/email', ['as' => 'frontend.account.email', 'uses' => 'Auth\\PasswordController@getEmail']);
        Route::post('/email', ['as' => 'frontend.account.email.process', 'uses' => 'Auth\\PasswordController@postEmail']);
        Route::get('/reset', ['as' => 'frontend.account.reset', 'uses' => 'Auth\\PasswordController@getReset']);
        Route::post('/reset', ['as' => 'frontend.account.reset.process', 'uses' => 'Auth\\PasswordController@postReset']);
        Route::get('/logout', ['as' => 'frontend.account.logout', 'uses' => 'Auth\\AuthController@getLogout']);
        Route::get('/auth/facebook', ['as' => 'frontend.account.auth.facebook', 'uses' => 'Auth\\AuthController@authFacebook']);
        Route::get('/auth/facebook/handle', ['as' => 'frontend.account.auth.facebook.handle', 'uses' => 'Auth\\AuthController@authFacebookHandle']);
        Route::group(['middleware' => ['auth']], function () {
            Route::get('/dashboard', ['as' => 'frontend.account.dashboard', 'uses' => 'AccountController@dashboard']);