goszowski / laravel-db-trans by goszowski

14
0
2
Package Data
Maintainer Username: goszowski
Maintainer Contact: goszowski@gmail.com (Jaroslaw Goszowski)
Package Create Date: 2017-04-09
Package Last Update: 2017-04-09
Language: HTML
License: MIT
Last Refreshed: 2024-11-15 15:22:56
Package Statistics
Total Downloads: 14
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Total Downloads Latest Stable Version Latest Unstable Version License

LaravelDbTrans

LaravelDbTrans is a package for automatic creating and edition translates in database.

Template:
{{ __('Some words') }}
or using prefix:
{{ __('myprefix.Some words') }}
In both cases, records will be created in the database, and returned to the tempate only "Some words"

Installation

  1. Require this package in your composer.json and run composer update :

     "goszowski/laravel-db-trans": "1.*"
    
  2. After composer update, add service providers to the config/app.php

    Goszowski\LaravelDbTrans\LaravelDbTransServiceProvider::class,
    
  3. Run

    php artisan vendor:publish
    
  4. Migrate

    php artisan migrate
    

Configuration

Visit url /laravel-db-trans in your app. Here will be all translations that will be created.

If You want to protect this url or change name, You must disable option use_package_routes in config/laraveldbtrans.php

After this, You must create routes for you app by this template:

Route::group(['prefix'=>'laravel-db-trans', 'as'=>'laravel-db-trans.'], function(){
  Route::get('/', ['as'=>'index', 'uses'=>'\Goszowski\LaravelDbTrans\LaravelDbTransController@index']);
  Route::get('/{key}', ['as'=>'edit', 'uses'=>'\Goszowski\LaravelDbTrans\LaravelDbTransController@edit']);
  Route::patch('/{key}', ['as'=>'update', 'uses'=>'\Goszowski\LaravelDbTrans\LaravelDbTransController@update']);
  Route::delete('/{key}', ['as'=>'destroy', 'uses'=>'\Goszowski\LaravelDbTrans\LaravelDbTransController@destroy']);
});

Also, You can customize blade templates in views/vendor/laravel-db-trans