53 lines
1.4 KiB
PHP
53 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Settings;
|
|
|
|
use App\Abstracts\Http\Controller;
|
|
use App\Models\Setting\Setting;
|
|
use App\Traits\DateTime;
|
|
|
|
class Localisation extends Controller
|
|
{
|
|
use DateTime;
|
|
|
|
public function edit()
|
|
{
|
|
$setting = Setting::all('localisation')->map(function ($s) {
|
|
$s->key = str_replace('localisation.', '', $s->key);
|
|
|
|
return $s;
|
|
})->pluck('value', 'key');
|
|
|
|
$timezones = $this->getTimezones();
|
|
|
|
$date_formats = [
|
|
'd M Y' => '31 Dec 2017',
|
|
'd F Y' => '31 December 2017',
|
|
'd m Y' => '31 12 2017',
|
|
'm d Y' => '12 31 2017',
|
|
'Y m d' => '2017 12 31',
|
|
];
|
|
|
|
$date_separators = [
|
|
'dash' => trans('settings.localisation.date.dash'),
|
|
'slash' => trans('settings.localisation.date.slash'),
|
|
'dot' => trans('settings.localisation.date.dot'),
|
|
'comma' => trans('settings.localisation.date.comma'),
|
|
'space' => trans('settings.localisation.date.space'),
|
|
];
|
|
|
|
$percent_positions = [
|
|
'before' => trans('settings.localisation.percent.before'),
|
|
'after' => trans('settings.localisation.percent.after'),
|
|
];
|
|
|
|
return view('settings.localisation.edit', compact(
|
|
'setting',
|
|
'timezones',
|
|
'date_formats',
|
|
'date_separators',
|
|
'percent_positions'
|
|
));
|
|
}
|
|
}
|