Download the PHP package dennis-koster/lighthouse-translatable without Composer

On this page you can find all versions of the php package dennis-koster/lighthouse-translatable. 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 lighthouse-translatable

Lighthouse Translatable

This package will make generation of GraphQL types for translatable type definitions a breeze. It ships the @translatable directive, which can be applied to any GraphQL type definition.

The directive will look for any attributes of the TranslatableString scalar type, also included in this package, and include it in the types it generates. It will respect nullable states of attributes when generating the type definitions.

The directive can generate two types of GraphQL types, based off the main type the directive gets applied to:

Installation

The package can be installed through composer.

Package compatibility

The package is completely agnostic of any translations package you might use for saving and retrieving translations to and from the database. This package focuses solely on generating schema definitions.

Its only dependency is on nuwave/lighthouse version 6 or higher.

Arguments

The directive comes with a couple of arguments, all of them optional.

Argument Description Default
generateTranslationType Whether or not to generate a type for the translation definition. Boolean: True
translationTypeName The name of the type to be generated for the translation definition. String: <BaseType>Translation
translationsFieldName The name of the field that holds the array of translations. String: translations
translationsInputName The name of the input that holds the array of translations inputs. String: translations
generateInputType Whether or not to generate a type for the translation input definition. Boolean: True
inputTypeName The name of the type to be generated for the translation input definition. String: <BaseType>TranslationInput
appendInput The inputs the translation model input should be appended to. Array: []

The default values for the arguments may be altered through the publishable config file.

Basic usage

In its most primal form, the directive uses some sensible defaults. It will always generate a translation definition and a translation input definition for the type the directive is applied to.

It will take the name of the base type, in the example below NewsItem and append Translation (so NewsItemTranslation) for the translation definition, and TranslationInput for the translation input definition (NewsItemTranslationInput).

An attribute will be added to the base type definition, holding the translation definitions. By default, the attribute will be called translations but this is customizable through the translationsAttribute argument.

Append input type to existing inputs

It's possible to provide the directive an array of existing inputs you want to append a translations argument to, through the appendInput argument.

The attribute will be called translations by default, and can be changed through the translationsAttribute argument.

Customize type names and attribute name

It's possible to customize the names of the type definitions that are generated, as well as the name of the attribute it appends to existing type definitions.

Configuration

The directive comes with a configuration file that can be published through:

Through the configuration file, all the default values for the directive may be adjusted to your liking.

View stubs

The generated types are created using blade views. These blade views can also be published and adjusted to your needs.

Blade view overview


All versions of lighthouse-translatable with dependencies

PHP Build Version
Package Version
Requires nuwave/lighthouse Version ^6
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 dennis-koster/lighthouse-translatable contains the following files

Loading the files please wait ...