定制 czim/laravel-localization-route-cache 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

czim/laravel-localization-route-cache

最新稳定版本:0.9.9

Composer 安装命令:

composer require czim/laravel-localization-route-cache

包简介

Translated route caching solution for laravel localization

README 文档

README

Software License

Important: This solution has been merged into mcamara/laravel-localization since version 1.3.11. This package is no longer required!

A cobbled together fix to allow caching routes per locale for mcamara's laravel localization.

See the github issue related to this fix in the original package.

This has been tested with laravel 5.1 through 5.6.

Version Compatibility

Laravel Package
5.1.x 0.8.x
5.2.x and up 0.9.x

Change log

View the change log.

Install

Via Composer

$ composer require czim/laravel-localization-route-cache

If you don't use auto-discovery, add the service provider after mcamara's in your config/app.php:

    Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
    Czim\LaravelLocalizationRouteCache\LaravelLocalizationServiceProvider::class,

In your App's RouteServiceProvider, use the LoadsTranslatedCachedRoutes trait:

class RouteServiceProvider extends ServiceProvider
{
    use \Czim\LaravelLocalizationRouteCache\Traits\LoadsTranslatedCachedRoutes;

Usage

To cache your routes, use

    php artisan route:trans:cache

instead of the normal route:cache command.

To list the routes for a given locale, use

    php artisan route:trans:list {locale}
    
    # for instance:
    php artisan route:trans:list en

To clear cached routes for all locales, use

    php artisan route:trans:clear

Note that using route:clear will also effectively unset the cache (at the minor cost of leaving some clutter in your bootstrap/cache directory).

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 173.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 48
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 47
  • Watchers: 3
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-25