fjffk简单的咖啡店科开发2方法2
环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也
???????????????????????????????
??????????????/?????????????????
............/...................
.........................../...
???????????????????????????????
>>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>
ÿØÿà JFIF ÿÛ „ ( %!1!%)+//.383,7(-.+
-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ ¥2" ÿÄ ÿÄ J ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ ÿÄ * !1AQa‘"2q3±ð#b¡ÿÚ ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁTÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßwpŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
?>
.........................................
.............................................................................
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
dsdflaravel-json-mysql-locations-manager/LICENSE 0000644 00000002065 15266537166 0014736 0 ustar 00 MIT License
Copyright (c) 2023 Mahmud Elseyyidömer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
laravel-json-mysql-locations-manager/README.md 0000644 00000004712 15266537166 0015211 0 ustar 00 # Laravel Json Localization Manager
This is a package to manage json strings for Laravel 5.4 and higher Localization Translation Strings As Keys With MySQL.
[Using Translation Strings As Keys][6ea2d96e]
[6ea2d96e]: https://laravel.com/docs/5.4/localization#using-translation-strings-as-keys "Using Translation Strings As Keys"
## Composer require
``` bash
$ composer require elseyyid/laravel-json-mysql-locations-manager
```
## Add Provider into config/app.php
``` php
Elseyyid\LaravelJsonLocationsManager\Providers\LaravelJsonLocationsManagerServiceProvider::class,
```
### For Only local environment
Add the following to the AppServiceProvider in the register function:
#### app/Providers/AppServiceProvider.php
``` php
if ($this->app->environment() == 'local' || $this->app->environment() == 'testing') {
/*
* Load third party local providers
*/
$this->app->register(\Elseyyid\LaravelJsonLocationsManager\Providers\LaravelJsonLocationsManagerServiceProvider::class);
}
```
## Package install
Run in console this command
``` bash
$ php artisan elseyyid:location:install
```
This command install database and will ask if you want to import the existing locations in the application.
There are 2 questions, the first to import the strings in arrays and the second to import the existing strings into json files.
This will pupulate the database with all strings. You don't need to run artisan migrate, this package uses an independent database (sqlite).
### Other Console Command
You can publish all languages Json files in console running
``` bash
$ php artisan elseyyid:location:publish
```
Of course you also can do that in browser views.
## Manage Locations
Now you can access to /translations/home in your browser and manage all langs strings.
- Search Language Strings
- Add new Language
- Add new Strings
- Edit Strings
- Publish / Update json Files
## Publish the views and config file
``` bash
$ php artisan vendor:publish --provider='Elseyyid\LaravelJsonLocationsManager\Providers\LaravelJsonLocationsManagerServiceProvider'
```
### In the config file you can call your custom layout, the content section and the scripts section (this is important for the edit views) and routes prefix and middlewares.
## Routes middlewares
in config file you can add your middlewares, by default is only 'web' middleware
### Feel free to send improvements
Created by [elseyyid][760a7857]
[760a7857]: https://github.com/OmarElseyyid "https://github.com/OmarElseyyid"
laravel-json-mysql-locations-manager/src/Controllers/HomeController.php 0000644 00000011045 15266537166 0022471 0 ustar 00 files = $filesystem;
}
public function index()
{
if (Schema::hasTable('strings')) {
$fields = \DB::getSchemaBuilder()->getColumnListing('strings');
} else {
Artisan::call('elseyyid:location:install');
$fields = \DB::getSchemaBuilder()->getColumnListing('strings');
}
$exceptions = ['en','code','created_at','updated_at'];
$filtered = collect($fields)->filter(function ($value, $key) use($exceptions){
if (!in_array($value,$exceptions) ) {
return $value;
}
});
return view('langs::home')->with('langs', $filtered);
}
public function lang($lang)
{
$list = Strings::select(['code','en',$lang])->get();
return view('langs::list')->with('lang', $lang)->with('list', $list);
}
public function update(Request $request,$code)
{
$column_name = $request->get('name');
$column_value = $request->get('value');
if($request->has('name') && $request->has('value')) {
$test = Strings::select()
->where('code', '=', $code)
->update([$column_name => $column_value]);
return response()->json([ 'code'=>200], 200);
}
return response()->json([ 'error'=> 400, 'message'=> 'Not enought params' ], 400);
}
public function generateJson($lang)
{
$list = Strings::pluck($lang,'en');
$json = json_encode_prettify($list);
$this->files->put(base_path('lang/'.$lang.'.json'),$json);
return redirect()->back()->with(config('elseyyid-location.message_success_variable'), 'Publicado');
}
public function newLang(NewLangFormRequest $request)
{
$fields = \DB::getSchemaBuilder()->getColumnListing('strings');
if (! in_array( $request->newLang, $fields )) {
Schema::table('strings', function (Blueprint $table) use($request){
$table->text($request->newLang)->nullable();
});
}
return redirect()->route('elseyyid.translations.lang',$request->newLang)->with(config('elseyyid-location.message_success_variable'), 'Language '.$request->newLang. ' Created!');
}
public function newString(NewStringFormRequest $request)
{
$string = Strings::where('en',$request->newString)->first();
if (!isset($string->code)) {
Strings::create(['en' => $request->newString]);
}
return redirect()->back()->with(config('elseyyid-location.message_success_variable'), 'String '.$request->newString. ' Created!');
}
public function search(SearchFormRequest $request)
{
$search_value = $request->search;
$fields = collect(\DB::getSchemaBuilder()->getColumnListing('strings'));
$columns = $fields->flip()->except(['code','created_at','updated_at'])->keys();
$query = Strings::select('*');
$query->where('en', 'LIKE', '%' . $search_value . '%');
foreach($columns as $column)
{
$query->orWhere($column, 'LIKE', '%' . $search_value . '%');
}
$result = $query->get();
return view('langs::search_result')->with('result', $result)->with('search_value', $search_value);
}
public function string($code)
{
$string = Strings::find($code);
return view('langs::lang')->with('string', $string);
}
public function publishAll()
{
$fields = collect(\DB::getSchemaBuilder()->getColumnListing('strings'));
$columns = $fields->flip()->except(['code','en','created_at','updated_at'])->keys();
foreach ($columns as $lang) {
$list = Strings::pluck($lang,'en');
$json = json_encode_prettify($list);
$this->files->put(base_path('lang/'.$lang.'.json'),$json);
}
return redirect()->back()->with(config('elseyyid-location.message_success_variable'), __('All Json Files Published!'));
}
}
laravel-json-mysql-locations-manager/src/Services/Helper.php 0000644 00000000440 15266537166 0020226 0 ustar 00 'required',
];
}
}
laravel-json-mysql-locations-manager/src/Requests/NewLangFormRequest.php 0000644 00000001036 15266537166 0022571 0 ustar 00 'required',
];
}
}
laravel-json-mysql-locations-manager/src/Requests/SearchFormRequest.php 0000644 00000001034 15266537166 0022441 0 ustar 00 'required',
];
}
}
laravel-json-mysql-locations-manager/src/Models/Strings.php 0000644 00000000420 15266537166 0020076 0 ustar 00 {{__('Languages installed')}}
@foreach ($langs as $lang)