From de061e7a8bc596267d26f49e657d20c2e4b00904 Mon Sep 17 00:00:00 2001 From: Cristian Tabacitu Date: Sat, 1 Jul 2023 10:04:36 +0300 Subject: [PATCH 1/2] provide support for Backpack v6 --- README.md | 21 +++++++------- composer.json | 9 ++---- src/resources/views/translations.blade.php | 32 ++++++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 67f02b8..9a61735 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Style CI](https://styleci.io/repos/53691643/shield)](https://styleci.io/repos/53691643) [![Total Downloads][ico-downloads]][link-downloads] -A quick interface to edit language files, for Laravel Backpack. +A quick interface to edit language files, for Laravel Backpack. _**Note:** this interface allows the admin to directly edit the language files stored in ```resources/lang```. Which might not be a great idea in production, if you have those files commited to git and/or use auto-deployment._ @@ -16,7 +16,7 @@ _**Note:** this interface allows the admin to directly edit the language files s > Please **[subscribe to the Backpack Newsletter](http://backpackforlaravel.com/newsletter)** so you can find out about any security updates, breaking changes or major features. We send an email every 1-2 months. -## Install in Backpack 5.x or 4.1 (Laravel 6, 7, 8 or 9) +## Install in Backpack v6.x ### Step 1. Install via Composer @@ -36,18 +36,19 @@ php artisan vendor:publish --provider="Backpack\LangFileManager\LangFileManagerS ### Step 3. Add menu items for it -Add a menu item for it in resources/views/vendor/backpack/base/inc/sidebar.blade.php: +Add a menu item for it in resources/views/vendor/backpack/ui/inc/menu_items.blade.php: ```html - + + + + ``` +## Upgrading from 4.x to 5.x + +You should have no problems upgrading, there have been no breaking changes. Just require the new version. + ## Upgrading from 3.x to 4.x - Flags are no longer supported on the Language CRUD, until version 3 admins could browse an image for the language flag, we now recommend developers to setup those images in advance, having them in a public folder like `public\flags\en.svg` `public\flags\ro.svg`. diff --git a/composer.json b/composer.json index 7836e1c..fde22a7 100644 --- a/composer.json +++ b/composer.json @@ -7,15 +7,10 @@ "lang files", "lang file manager", "language", - "dick", "tabacitu", - "updivision", - "dick admin", - "dickadmin", "laravel", "admin panel", - "translationmanager", - "dick translationmanager" + "translationmanager" ], "homepage": "https://github.com/laravel-backpack/langfilemanager", "license": "MIT", @@ -33,7 +28,7 @@ } ], "require": { - "backpack/crud": "^5.0" + "backpack/crud": "^6.0" }, "require-dev": { "phpunit/phpunit" : "^9.0", diff --git a/src/resources/views/translations.blade.php b/src/resources/views/translations.blade.php index e496ada..0e46712 100644 --- a/src/resources/views/translations.blade.php +++ b/src/resources/views/translations.blade.php @@ -1,4 +1,4 @@ -@extends(backpack_view('layouts.top_left')) +@extends(backpack_view('blank')) @php $defaultBreadcrumbs = [ @@ -12,15 +12,19 @@ @endphp @section('header') -
-

- {{ trans('backpack::langfilemanager.translate') }} - {{ trans('backpack::langfilemanager.site_texts') }}. - - @if ($crud->hasAccess('list')) - {{ trans('backpack::crud.back_to_all') }} {{ $crud->entity_name_plural }} - @endif -

+
+

+ {{ trans('backpack::langfilemanager.translate') }} +

+

+ {{ trans('backpack::langfilemanager.site_texts') }}. +

+ @if ($crud->hasAccess('list')) +

+ {{ + trans('backpack::crud.back_to_all') }} {{ $crud->entity_name_plural }} +

+ @endif
@endsection @@ -28,7 +32,7 @@
-

+
  {{ trans('backpack::langfilemanager.switch_to') }}:   -

+
-
+
@if (!empty($fileArray))
Date: Sat, 1 Jul 2023 07:04:47 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- src/app/Http/Requests/LanguageRequest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/Http/Requests/LanguageRequest.php b/src/app/Http/Requests/LanguageRequest.php index f1ce4af..c416719 100644 --- a/src/app/Http/Requests/LanguageRequest.php +++ b/src/app/Http/Requests/LanguageRequest.php @@ -2,7 +2,6 @@ namespace Backpack\LangFileManager\app\Http\Requests; -use App\Http\Requests\Request; use Illuminate\Foundation\Http\FormRequest; class LanguageRequest extends FormRequest