Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ composer.phar
composer.lock
.DS_Store
.idea
.phpunit.result.cache
.phpunit.result.cache
.php-cs-fixer.cache
53 changes: 53 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'@Symfony' => true,
'@PHP71Migration' => true,
'array_push' => true,
'ordered_imports' => [
'imports_order' => [
'class', 'function', 'const',
],
'sort_algorithm' => 'length',
],
'no_leading_import_slash' => true,
'return_assignment' => true,
'phpdoc_no_empty_return' => true,
'no_blank_lines_after_phpdoc' => true,
'general_phpdoc_tag_rename' => true,
'phpdoc_inline_tag_normalizer' => true,

'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'no_useless_else' => true,
'lowercase_keywords' => true,
'modernize_types_casting' => true,
'no_short_bool_cast' => true,
'no_php4_constructor' => true,
'php_unit_construct' => [
'assertions' => ['assertSame', 'assertEquals', 'assertNotEquals', 'assertNotSame'],
],
];

$finder = Finder::create()
->in([
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/resources',
__DIR__.'/src',
__DIR__.'/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$config = new Config();

return $config->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true);
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
},
{
"name": "Jose Vicente Orts Romero",
"email": "jvortsromero@gmail.com"
}
],
"require": {
Expand Down
51 changes: 41 additions & 10 deletions config/translation-manager.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Routes group config
Expand All @@ -10,19 +9,19 @@
| The default group settings for the elFinder routes.
|
*/
'route' => [
'prefix' => 'translations',
'route' => [
'prefix' => 'translations',
'middleware' => 'auth',
],

/**
/*
* Enable deletion of translations
*
* @type boolean
*/
'delete_enabled' => true,

/**
/*
* Exclude specific groups from Laravel Translation Manager.
* This is useful if, for example, you want to avoid editing the official Laravel language files.
*
Expand All @@ -36,7 +35,7 @@
*/
'exclude_groups' => [],

/**
/*
* Exclude specific languages from Laravel Translation Manager.
*
* @type array
Expand All @@ -46,12 +45,12 @@
* 'de',
* )
*/
'exclude_langs' => [],
'exclude_langs' => [],

/**
/*
* Export translations with keys output alphabetically.
*/
'sort_keys' => false,
'sort_keys' => false,

'trans_functions' => [
'trans',
Expand All @@ -66,9 +65,41 @@
'$trans.get',
],

/**
'models' => [
// \App\Models\Post::class,
// \App\Models\Category::class,
],

'model-field-source' => 'translatable',

/*
* Database connection name to allow for different db connection for the translations table.
*/
'db_connection' => env('TRANSLATION_MANAGER_DB_CONNECTION', null),

/*
* Enable pagination of translations
*
* @type boolean
*/
'pagination_enabled' => false,

/*
* Define number of translations per page
*
* @type integer
*/
'per_page' => 40,

/* ------------------------------------------------------------------------------------------------
| Set Views options
| --------------------------å----------------------------------------------------------------------
| Here you can set The "extends" blade of index.blade.php
*/
'layout' => 'translation-manager::layout',

/*
* Choose which template to use [bootstrap3, bootstrap4, bootstrap5, tailwind3 ]
*/
'template' => 'tailwind3',
];
38 changes: 16 additions & 22 deletions database/migrations/2014_04_02_193005_create_translations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTranslationsTable extends Migration {

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ltm_translations', function(Blueprint $table)
{
$table->collation = 'utf8mb4_bin';
class CreateTranslationsTable extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('ltm_translations', static function (Blueprint $table) {
$table->collation = 'utf8mb4_bin';
$table->bigIncrements('id');
$table->integer('status')->default(0);
$table->string('locale');
Expand All @@ -23,16 +20,13 @@ public function up()
$table->text('value')->nullable();
$table->timestamps();
});
}
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::drop('ltm_translations');
}

}
}
Loading