Laravel Nova icon Nova Packages
D

Dynamic Language

This package is possibly abandoned. Please proceed with care.

Installation Instructions

You can install the package into a Laravel app that uses Nova via composer:

composer install ysfkaya/nova-dynamic-lang

And you need to publish the migration and config files

php artisan vendor:publish --provider="Ysfkaya\NovaDynamicLang\NovaDynamicLangProvider"

You must register the tool with Nova

// in app/Providers/NovaServiceProvider.php

// ...

public function tools()
{
   return [
        // ...
        new Ysfkaya\NovaDynamicLang\DynamicLang(),
    );
}

Configuration

  • file_name : frontend

    We will create a file in your language files to save your fields.

  • default_languages_path : null only json file

    If you want to use your languages then set path here. By default available languages will be used.

    Example Json Data:

    [
         {
           "label": "A language label",
           "code": "A language code"
         }
    ]

Usage

Select a store to default fields to save in config file

Array store

Array store is provides you to quickly and simply set up your fields. Only usage the simply rules you can set the fields.

// in config/nova-dynamic-lang.php

// ...

'array' => [
    'driver' => 'array',
    'fields' => [
        // ...
        ["Title","Title","title"],
        ["Description","Description","description"]
        // ...
    ],
],

Json store

Json store is also like an array store, but only a json file must be defined.

Note : "fields" key is required

// in config/nova-dynamic-lang.php

// ...

'json' => [
    'driver' => 'json',
    'path' =>   null // set a json file path,
],

In file :

{
    "fields":[
        ["Title","Title","title"],
        ["Description","Description","description"]
    ]
}

Database store

Database store is management your fields by dynamical. It allows you use a nova resource. But you shouldn't modify table columns in migration file

// in config/nova-dynamic-lang.php

// ...

'json' => [
    'driver' => 'database',
    'model' => \Ysfkaya\NovaDynamicLang\Models\LanguageSection::class // or you may use model instance of this model,
],

Readme

Laravel Nova Dynamic Language

This tool is provide management the your language files by dynamical for your Nova application

Dashboard index page

Installation

You can install the package into a Laravel app that uses Nova via composer:

composer install ysfkaya/nova-dynamic-lang

And you need to publish the migration and config files

php artisan vendor:publish --provider="Ysfkaya\NovaDynamicLang\NovaDynamicLangProvider"

You must register the tool with Nova

// in app/Providers/NovaServiceProvider.php

// ...

public function tools()
{
   return [
        // ...
        new \Ysfkaya\NovaDynamicLang\NovaDynamicLang,
    );
}

Configuration

  • file_name : frontend

    We will create a file in your language files to save your fields.

  • default_languages_path : null only json file

    If you want to use your languages then set path here. By default available languages will be used.

    Example Json Data:

    [
         {
           "label": "A language label",
           "code": "A language code"
         }
    ]

Select a store to default fields to save

Rules (For Store : array,json)
First Index Second Index Third Index
Form Input Label Form Input Value Short Code for invoke

Array store

Array store is provides you to quickly and simply set up your fields. Only usage the simply rules you can set the fields.

// in config/nova-dynamic-lang.php

// ...

'array' => [
    'driver' => 'array',
    'fields' => [
        // ...
        ["Title","Title","title"],
        ["Description","Description","description"]
        // ...
    ],
],

Json store

Json store is also like an array store, but only a json file must be defined.

Note : "fields" key is required

// in config/nova-dynamic-lang.php

// ...

'json' => [
    'driver' => 'json',
    'path' =>   null // set a json file path,
],

In file :

{
    "fields":[
        ["Title","Title","title"],
        ["Description","Description","description"]
    ]
}

Database store

Database store is management your fields by dynamical. It allows you use a nova resource. But you shouldn't modify table columns in migration file

// in config/nova-dynamic-lang.php

// ...

'json' => [
    'driver' => 'database',
    'model' => \Ysfkaya\NovaDynamicLang\Models\LanguageSection::class // or you may use model instance of this model,
],

Usage

You can use @lang blade directive to display text by your app language

@lang('frontend.hello')

Screenshots

Back to Top
Added 6 years ago
Last updated 7 Years Ago
Version v1.0.2
Composer
ysfkaya/nova-dynamic-lang
GitHub stars 2
Packagist downloads 212

Favorites

4 users favorited

Rating

0.00
(out of 5)
★★★★★
★★★★
★★★
★★
0 ratings

Tags

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas