承接 mammut-alex/polyglot 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mammut-alex/polyglot

Composer 安装命令:

composer require mammut-alex/polyglot

包简介

Translate model column in laravel

README 文档

README

Build Status Total Downloads Latest Stable Version License Code Climate StyleCI

Installation

Require this package in your composer.json and update composer.

"mammut-alex/polyglot": "0.2.*"

or composer require mammut-alex/polyglot

Documentation

Translator works with a database, it looks for a prefix code language

Here is an example Migration

    $table->string('name_en');
    $table->string('name_uk');
    $table->string('name_ru');

To use polyglot, connect it to your model and use feature for translation.

namespace App;

use Illuminate\Database\Eloquent\Model;
use MammutAlex\Polyglot\Polyglot;

class YouModel extends Model
{
	use Polyglot;
	
	public function name()
    	{
    		return $this->translation('name');
    	}
    ...

The function will return the translation in the selected language user

An example of the use in blade:

<h1>{{$model->name()}}</h1>

See more example in tests, documentation being developed

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固