Download the PHP package muratsplat/multilang without Composer

On this page you can find all versions of the php package muratsplat/multilang. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package multilang

MultiLang Package For Laravel 4.2

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

A Laravel extension is make be easy to CRUD ORM proccess for multi languages contents.

!! The development of this project is discontinued !!

Requiretments

Installing

Add muratsplat/multilang as a requirement to composer.json

Update your packages with composer update or install with composer install.

You can also add the package using composer require muratsplat/multilang on your terminal.

This package only supports Composer to instaling.

Configuration

Firstly you should add the package's service provider to your laravel app

Also you can add the package's alias

Finally install to the package's configuration via artisan like this

in your project's main folder:

Now you can change the package's configuration by editing ..app/config/packages/muratsplat/multilang/config.php

How to use in Example

Let's imagine simple Laravel App. We want to have multi language pages. In this case common way is creating two models firstly. For them let's create tables via Laravel Migration.

take a look at:

Pages will be our main model's table. Only common attributes should be in the table. It likes this migrate:

Second step is creating other table for just multi language contents..

Let's edit created migrate again..

It can be useful to have Language model. For every web app I create an struct to manage languages. In basic you can create Languge model like this:

If you decide to create Language model don't forget make reference as like

You can create default data for language models by using seeder class

Tables are ready. It is the turn of creating models.

Main model will be Page model in example. Main model must be implement 'Muratsplat\Multilang\Interfaces\MainInterface' and it must be used 'Muratsplat\Multilang\Traits\MainTrait'.

Page Model

For pageLangs table we are creating PageLang Model. PageLang must be implement 'Muratsplat\Multilang\Interfaces\LangInterface' and must be used 'Muratsplat\Multilang\Traits\LangTrait' trait in it. That's like this:

Multilang gets with new rule. 'RequiredForDefaultLang' rule validates elements for default language id. If default language is Turkish, and if Turkish element is empty, validation is failed.

RequiredForDefaultLang accepts tree parameters. First of these prefix for picking elements up and second parameter is default language id and also last parameter is replacer in error message.

You can add a message for the rule by editing '..app/lang/en/validation.php'.

example:

Validation rules can be in models. But it is not required. You can add rules in your controller. It is recommended that rules is in models. This make keep clean on your controller.

Dynamic Form Example

You can create form as down on view layer.

This form sends post data to a controller...

You can use MultiLang on your controller..

let's create a wrapper to access two models at one point

You can force to show wanted language model like this

Events

Event Name Event Parameter Statement
multilang.wrapper.creating Muratsplat\Multilag\MultiLang Object When new Wrapper is creating, this event is fired.
multilang.crud.creating Muratsplat\Multilag\MultiLang Object When new models is creating, this event is fired.
multilang.crud.updating Muratsplat\Multilag\MultiLang Object When models is updating, this event is fired.
multilang.crud.deleting Muratsplat\Multilag\MultiLang Object When models is deleting, this event is fired.

You can set wanted language by using MultiLang Event

Todos

License

Copyright (C) 2014 Murat ÖDÜNÇ GPLv3


All versions of multilang with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.2.*
illuminate/database Version 4.2.*
illuminate/config Version 4.2.*
illuminate/validation Version 4.2.*
illuminate/events Version 4.2.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package muratsplat/multilang contains the following files

Loading the files please wait ....