sandulat / larabels
Laravel localization labels dashboard
Requires
- php: ^7.1
- czproject/git-php: ^3.17
- illuminate/support: 5.8.*
- laravel/framework: ~5.8.0|~5.9.0
- zendframework/zend-code: ^3.3
Requires (Dev)
- orchestra/testbench: 3.8.*
- phpunit/phpunit: ^7.0
- dev-master
- v0.2.1
- v0.2
- v0.1
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-and-express-6.11.0
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-and-webpack-cli-1.4.2
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/ajv-6.12.6
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/browserslist-4.16.6
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/ssri-6.0.2
- dev-dependabot/npm_and_yarn/y18n-4.0.1
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/acorn-6.4.1
This package is auto-updated.
Last update: 2024-05-04 06:44:52 UTC
README
🌍 Larabels - Laravel localization labels dashboard 🌏
About
Larabels is an editor for your Laravel localization files.
The main purpose of this package is to allow non-technical
people commit label updates directly to the repository in development environments.
It automatically parses all languages by folders from resources/lang
and all localization files from each language.
Larabels is built to work exclusively with Git. As you've might seen in the screenshot above, we've got 3 buttons fixed to the bottom of screen:
Save
- all labels from all languages will be exported to resources/lang
.
Reset
- all the changes exported to resources/lang
are reverted to original state.
Commit & Push
- all the changes are commited and pushed to origin HEAD
.
Note: you (or the server) must have passwordless push access to the repository.
Installation
composer require sandulat/larabels php artisan larabels:install
The last command will publish Larabel's service provider, config and public front-end assets.
Note: to re-publish the front-end assets when updating the package use: php artisan larabels:publish
Authorization
By default Larabels will be accessible by anyone in a local environment only. However it provides a customizable gate that
limits access in production environments. See the gate()
method inside the published LarabelsServiceProvider
:
/** * Register the Larabels gate. * * This gate determines who can access Larabels in non-local environments. * * @return void */ protected function gate() { Gate::define('viewLarabels', function ($user) { return in_array($user->email, [ // ]); }); }
Configuration
Larabels works without any additional configuration, however it provides a config (config/larabels.php
) with these options:
Option | Default Value | Description |
---|---|---|
enabled |
env('LARABELS_ENABLED', true) |
This option may be used to disable Larabels direct route access. Note: Larabels views will ignore this option so you can include them in your project. |
middleware |
[\Sandulat\Larabels\Http\Middleware\Authorize::class] |
These middlewares will be assigned to every Larabels route. Note that in any case Larabels routes implicitly belong to the "web" middleware. |
whitelist |
[] |
This value determines which localization files should be included in the dashboard. Files will be loaded from /resources/lang/{locale} . Use file names without extension: auth , pagination , validation , passwords , etc. Leave empty to load all files. |
path |
/larabels |
This value determines the base route path where the dashboard will be accessible from. |
Customization
If you would like to include the Larabels editor view directly into your personal dashboard, set the environment option LARABELS_ENABLED
to false
to disable direct access to the Larabels route. Now add @include('larabels::app')
wherever you'd like.
Larabels is splitted into partials so you can easily cutomize the look. Inside the path resources/views
create the folder vendor/larabels
.
Now you can override the default Larabels views:
components/card.blade.php
partials/action_buttons.blade.php
partials/container.blade.php
partials/label.blade.php
partials/locale_button.blade.php
Credits
Created by Stratulat Alexandru.