From b1dc4d4a41303817754dc02036ba247a6bd930db Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Mar 2022 13:54:32 +0000 Subject: [PATCH 1/5] Apply Laravel coding style Shift automatically applies the Laravel coding style - which uses the PSR-2 coding style as a base with some minor additions. You may customize the adopted coding style by adding a [PHP CS Fixer][1] or [PHP CodeSniffer][2] config to your project root. Feel free to use [Shift's Laravel ruleset][3] to help you get started. For more information on customizing the code style applied by Shift, [watch this short video][4]. [1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [2]: https://github.com/squizlabs/PHP_CodeSniffer [3]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200 [4]: https://laravelshift.com/videos/shift-code-style --- app/Application.php | 52 +++-- app/Console/Commands/RegisterApp.php | 24 +- app/EnhancedApps.php | 13 +- app/Helper.php | 40 ++-- app/Http/Controllers/Auth/LoginController.php | 5 +- .../Controllers/Auth/RegisterController.php | 4 +- app/Http/Controllers/Controller.php | 11 +- app/Http/Controllers/ItemController.php | 142 ++++++------ app/Http/Controllers/SearchController.php | 6 +- app/Http/Controllers/SettingsController.php | 37 +-- app/Http/Controllers/TagController.php | 48 ++-- app/Http/Controllers/UserController.php | 52 +++-- app/Http/Middleware/CheckAllowed.php | 21 +- app/Http/Middleware/TrustProxies.php | 4 +- app/Http/Middleware/VerifyCsrfToken.php | 1 - app/Item.php | 94 ++++---- app/ItemTag.php | 3 +- app/Jobs/ProcessApps.php | 17 +- app/Providers/AppServiceProvider.php | 86 +++---- app/Providers/AuthServiceProvider.php | 2 +- app/Providers/BroadcastServiceProvider.php | 2 +- app/Providers/EventServiceProvider.php | 2 +- app/Providers/RouteServiceProvider.php | 2 +- app/Search.php | 69 +++--- app/SearchInterface.php | 9 +- app/Setting.php | 133 ++++++----- app/SupportedApps.php | 73 +++--- app/User.php | 12 +- config/app.php | 3 +- config/logging.php | 2 +- .../2018_01_27_155922_create_items_table.php | 4 +- ...018_02_04_185524_create_settings_table.php | 4 +- ..._04_185802_create_setting_groups_table.php | 4 +- ...175830_add_columns_to_items_for_groups.php | 4 +- .../migrations/2018_02_16_193703_item_tag.php | 4 +- .../2018_10_12_122907_create_users_table.php | 4 +- ...12_123036_create_password_resets_table.php | 4 +- ...0_12_131222_add_user_id_to_items_table.php | 4 +- ...140451_create_setting_user_pivot_table.php | 4 +- ...10_18_110905_create_applications_table.php | 5 +- ..._10_23_132008_add_class_to_items_table.php | 4 +- .../2018_10_31_191604_create_jobs_table.php | 4 +- ..._11_06_112434_create_failed_jobs_table.php | 4 +- database/seeds/SettingsSeeder.php | 44 ++-- database/seeds/UsersSeeder.php | 4 +- resources/lang/br/app.php | 1 - resources/lang/cn/app.php | 4 +- resources/lang/da/app.php | 2 - resources/lang/da/passwords.php | 2 +- resources/lang/de/app.php | 116 +++++----- resources/lang/el/app.php | 2 - resources/lang/el/passwords.php | 2 +- resources/lang/en/app.php | 5 +- resources/lang/es/app.php | 116 +++++----- resources/lang/fi/app.php | 191 ++++++++------- resources/lang/fr/app.php | 218 +++++++++--------- resources/lang/fr/passwords.php | 2 +- resources/lang/hu/app.php | 5 +- resources/lang/hu/passwords.php | 2 +- resources/lang/it/app.php | 67 +++--- resources/lang/it/auth.php | 1 + resources/lang/it/pagination.php | 1 + resources/lang/ko/app.php | 2 - resources/lang/ko/passwords.php | 2 +- resources/lang/nl/app.php | 4 +- resources/lang/nl/passwords.php | 2 +- resources/lang/no/app.php | 16 +- resources/lang/no/passwords.php | 2 +- resources/lang/pl/app.php | 16 +- resources/lang/pt/app.php | 2 - resources/lang/pt/passwords.php | 2 +- resources/lang/ru/app.php | 2 - resources/lang/ru/passwords.php | 2 +- resources/lang/sl/app.php | 2 - resources/lang/sl/passwords.php | 2 +- resources/lang/sv/app.php | 188 +++++++-------- resources/lang/tr/app.php | 40 ++-- resources/lang/tr/auth.php | 4 +- resources/lang/tr/pagination.php | 6 +- resources/lang/tr/passwords.php | 8 +- resources/lang/tr/validation.php | 12 +- routes/api.php | 1 - routes/web.php | 16 +- tests/CreatesApplication.php | 2 +- tests/Feature/ExampleTest.php | 2 +- tests/Unit/ExampleTest.php | 2 +- 86 files changed, 1051 insertions(+), 1093 deletions(-) diff --git a/app/Application.php b/app/Application.php index e5fcda37..65288106 100644 --- a/app/Application.php +++ b/app/Application.php @@ -13,14 +13,13 @@ class Application extends Model // public function icon() { - if(!file_exists(storage_path('app/public/'.$this->icon))) { + if (! file_exists(storage_path('app/public/'.$this->icon))) { $img_src = app_path('SupportedApps/'.$this->name.'/'.str_replace('icons/', '', $this->icon)); $img_dest = storage_path('app/public/'.$this->icon); //die("i: ".$img_src); @copy($img_src, $img_dest); } - return $this->icon; } @@ -32,33 +31,38 @@ class Application extends Model public function defaultColour() { // check if light or dark - if($this->tile_background == 'light') return '#fafbfc'; + if ($this->tile_background == 'light') { + return '#fafbfc'; + } + return '#161b1f'; } public function class() { $name = $this->name; - $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); + $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); $class = '\App\SupportedApps\\'.$name.'\\'.$name; + return $class; } public static function classFromName($name) { - $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); + $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); $class = '\App\SupportedApps\\'.$name.'\\'.$name; + return $class; } - public static function apps() { $json = json_decode(file_get_contents(storage_path('app/supportedapps.json'))) ?? []; $apps = collect($json->apps); - $sorted = $apps->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE); + $sorted = $apps->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE); + return $sorted; } @@ -66,49 +70,52 @@ class Application extends Model { $apps = self::apps(); $list = []; - foreach($apps as $app) { - $list[] = (object)[ + foreach ($apps as $app) { + $list[] = (object) [ 'label' => $app->name, - 'value' => $app->appid + 'value' => $app->appid, ]; } + return $list; } public static function getApp($appid) { - $localapp = Application::where('appid', $appid)->first(); + $localapp = self::where('appid', $appid)->first(); $app = self::single($appid); - $application = ($localapp) ? $localapp : new Application; + $application = ($localapp) ? $localapp : new self; - if(!file_exists(app_path('SupportedApps/'.className($app->name)))) { + if (! file_exists(app_path('SupportedApps/'.className($app->name)))) { SupportedApps::getFiles($app); SupportedApps::saveApp($app, $application); } else { // check if there has been an update for this app - if($localapp) { - if($localapp->sha !== $app->sha) { + if ($localapp) { + if ($localapp->sha !== $app->sha) { SupportedApps::getFiles($app); $app = SupportedApps::saveApp($app, $application); } - } else { + } else { SupportedApps::getFiles($app); $app = SupportedApps::saveApp($app, $application); - } } - return $app; + return $app; } public static function single($appid) { $apps = self::apps(); $app = $apps->where('appid', $appid)->first(); - if ($app === null) return null; - $classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name); + if ($app === null) { + return null; + } + $classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name); $app->class = '\App\SupportedApps\\'.$classname.'\\'.$classname; + return $app; } @@ -117,11 +124,10 @@ class Application extends Model $list = []; $list['null'] = 'None'; $apps = self::apps(); - foreach($apps as $app) { + foreach ($apps as $app) { $list[$app->appid] = $app->name; } + return $list; } - - } diff --git a/app/Console/Commands/RegisterApp.php b/app/Console/Commands/RegisterApp.php index 5f8364d5..aea317c0 100644 --- a/app/Console/Commands/RegisterApp.php +++ b/app/Console/Commands/RegisterApp.php @@ -2,9 +2,9 @@ namespace App\Console\Commands; -use Illuminate\Console\Command; use App\Application; use App\SupportedApps; +use Illuminate\Console\Command; class RegisterApp extends Command { @@ -40,40 +40,38 @@ class RegisterApp extends Command public function handle() { $folder = $this->argument('folder'); - if($folder == 'all') { + if ($folder == 'all') { $apps = scandir(app_path('SupportedApps')); - foreach($apps as $folder) { - if($folder == '.' || $folder == '..') continue; + foreach ($apps as $folder) { + if ($folder == '.' || $folder == '..') { + continue; + } $this->addApp($folder); } - } else { $this->addApp($folder); } - } public function addApp($folder) { $json = app_path('SupportedApps/'.$folder.'/app.json'); - if(file_exists($json)) { + if (file_exists($json)) { $app = json_decode(file_get_contents($json)); - if(isset($app->appid)) { + if (isset($app->appid)) { $exists = Application::find($app->appid); - if($exists) { - $this->error('Application already registered - '.$exists->name." - ".$exists->appid); + if ($exists) { + $this->error('Application already registered - '.$exists->name.' - '.$exists->appid); } else { // Doesn't exist so add it SupportedApps::saveApp($app, new Application); - $this->info("Application Added - ".$app->name." - ".$app->appid); + $this->info('Application Added - '.$app->name.' - '.$app->appid); } } else { $this->error('No App ID for - '.$folder); } - } else { $this->error('Could not find '.$json); } - } } diff --git a/app/EnhancedApps.php b/app/EnhancedApps.php index fb137715..46064f41 100644 --- a/app/EnhancedApps.php +++ b/app/EnhancedApps.php @@ -1,12 +1,15 @@ -= $btype && $x < (count($labels) - 1); $bytes /= $btype, $x++); // use 1000 rather than 1024 to simulate HD size not real size - if($labels[$x] == "TB") return(round($bytes, 3).$beforeunit.$labels[$x].$afterunit); - elseif($labels[$x] == "GB") return(round($bytes, 2).$beforeunit.$labels[$x].$afterunit); - elseif($labels[$x] == "MB") return(round($bytes, 2).$beforeunit.$labels[$x].$afterunit); - else return(round($bytes, 0).$beforeunit.$labels[$x].$afterunit); + $btype = ($is_drive_size === true) ? 1000 : 1024; + $labels = ['B', 'KB', 'MB', 'GB', 'TB']; + for ($x = 0; $bytes >= $btype && $x < (count($labels) - 1); $bytes /= $btype, $x++); // use 1000 rather than 1024 to simulate HD size not real size + if ($labels[$x] == 'TB') { + return round($bytes, 3).$beforeunit.$labels[$x].$afterunit; + } elseif ($labels[$x] == 'GB') { + return round($bytes, 2).$beforeunit.$labels[$x].$afterunit; + } elseif ($labels[$x] == 'MB') { + return round($bytes, 2).$beforeunit.$labels[$x].$afterunit; + } else { + return round($bytes, 0).$beforeunit.$labels[$x].$afterunit; + } } function str_slug($title, $separator = '-', $language = 'en') @@ -34,24 +39,25 @@ if (! function_exists('str_is')) { } } -function get_brightness($hex) { +function get_brightness($hex) +{ // returns brightness value from 0 to 255 // strip off any leading # $hex = str_replace('#', '', $hex); - if(strlen($hex) == 3) { + if (strlen($hex) == 3) { $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; } - + $c_r = hexdec(substr($hex, 0, 2)); $c_g = hexdec(substr($hex, 2, 2)); $c_b = hexdec(substr($hex, 4, 2)); - + return (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000; } function title_color($hex) { - if(get_brightness($hex) > 130) { + if (get_brightness($hex) > 130) { return ' black'; } else { return ' white'; @@ -62,18 +68,16 @@ function getLinkTargetAttribute() { $target = \App\Setting::fetch('window_target'); - if($target === 'current') { + if ($target === 'current') { return ''; } else { - return ' target="' . $target . '"'; + return ' target="'.$target.'"'; } } - - function className($name) { - $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); + $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); + return $name; } - diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 3b42163e..af79a2ae 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; -use Illuminate\Foundation\Auth\AuthenticatesUsers; use App\User; +use Illuminate\Foundation\Auth\AuthenticatesUsers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; @@ -92,6 +92,7 @@ class LoginController extends Controller { Auth::logout(); session(['current_user' => $user]); + return redirect()->route('dash'); } @@ -100,6 +101,7 @@ class LoginController extends Controller $user = User::where('autologin', $uuid)->first(); Auth::login($user, true); session(['current_user' => $user]); + return redirect()->route('dash'); } @@ -122,5 +124,4 @@ class LoginController extends Controller { return Session::get('url.intended') ? Session::get('url.intended') : $this->redirectTo; } - } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index d5bfca5a..b9ac71f7 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers\Auth; -use App\User; use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\Validator; +use App\User; use Illuminate\Foundation\Auth\RegistersUsers; +use Illuminate\Support\Facades\Validator; class RegisterController extends Controller { diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 04c8100d..2fcd31b4 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,12 +2,12 @@ namespace App\Http\Controllers; -use Illuminate\Foundation\Bus\DispatchesJobs; -use Illuminate\Routing\Controller as BaseController; -use Illuminate\Foundation\Validation\ValidatesRequests; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; -use Illuminate\Support\Facades\Auth; use App\User; +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; +use Illuminate\Foundation\Bus\DispatchesJobs; +use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Routing\Controller as BaseController; +use Illuminate\Support\Facades\Auth; class Controller extends BaseController { @@ -22,7 +22,6 @@ class Controller extends BaseController //print_r($this->user); return $next($request); }); - } public function user() diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php index 8a3258be..775c279c 100644 --- a/app/Http/Controllers/ItemController.php +++ b/app/Http/Controllers/ItemController.php @@ -2,23 +2,21 @@ namespace App\Http\Controllers; -use Artisan; use App\Application; use App\Item; -use App\Setting; -use App\User; -use GrahamCampbell\GitHub\Facades\GitHub; -use Illuminate\Http\Request; -use Illuminate\Support\Facades\Storage; -use App\SupportedApps; use App\Jobs\ProcessApps; use App\Search; -use Illuminate\Support\Facades\Route; - -use GuzzleHttp\Exception\GuzzleException; +use App\Setting; +use App\SupportedApps; +use App\User; +use Artisan; +use GrahamCampbell\GitHub\Facades\GitHub; use GuzzleHttp\Client; +use GuzzleHttp\Exception\GuzzleException; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; - +use Illuminate\Support\Facades\Route; +use Illuminate\Support\Facades\Storage; class ItemController extends Controller { @@ -26,7 +24,8 @@ class ItemController extends Controller { $this->middleware('allowed'); } - /** + + /** * Display a listing of the resource on the dashboard. * * @return \Illuminate\Http\Response @@ -46,7 +45,7 @@ class ItemController extends Controller return view('welcome', $data); } - /** + /** * Set order on the dashboard. * * @return \Illuminate\Http\Response @@ -54,7 +53,7 @@ class ItemController extends Controller public function setOrder(Request $request) { $order = array_filter($request->input('order')); - foreach($order as $o => $id) { + foreach ($order as $o => $id) { $item = Item::find($id); $item->order = $o; $item->save(); @@ -72,10 +71,11 @@ class ItemController extends Controller $item->pinned = true; $item->save(); $route = route('dash', []); + return redirect($route); } - /** + /** * Unpin item on the dashboard. * * @return \Illuminate\Http\Response @@ -86,36 +86,38 @@ class ItemController extends Controller $item->pinned = false; $item->save(); $route = route('dash', []); + return redirect($route); } - /** + /** * Unpin item on the dashboard. * * @return \Illuminate\Http\Response */ - public function pinToggle($id, $ajax=false, $tag=false) + public function pinToggle($id, $ajax = false, $tag = false) { $item = Item::findOrFail($id); - $new = ((bool)$item->pinned === true) ? false : true; + $new = ((bool) $item->pinned === true) ? false : true; $item->pinned = $new; $item->save(); - if($ajax) { - if(is_numeric($tag) && $tag > 0) { + if ($ajax) { + if (is_numeric($tag) && $tag > 0) { $item = Item::whereId($tag)->first(); $data['apps'] = $item->children()->pinned()->orderBy('order', 'asc')->get(); } else { $data['apps'] = Item::pinned()->orderBy('order', 'asc')->get(); } $data['ajax'] = true; + return view('sortable', $data); } else { $route = route('dash', []); + return redirect($route); } } - /** * Display a listing of the resource. * @@ -123,18 +125,17 @@ class ItemController extends Controller */ public function index(Request $request) { - $trash = (bool)$request->input('trash'); + $trash = (bool) $request->input('trash'); $data['apps'] = Item::ofType('item')->orderBy('title', 'asc')->get(); $data['trash'] = Item::ofType('item')->onlyTrashed()->get(); - if($trash) { + if ($trash) { return view('items.trash', $data); } else { return view('items.list', $data); } } - /** * Show the form for creating a new resource. * @@ -146,8 +147,8 @@ class ItemController extends Controller $data['tags'] = Item::ofType('tag')->orderBy('title', 'asc')->pluck('title', 'id'); $data['tags']->prepend(__('app.dashboard'), 0); $data['current_tags'] = '0'; - return view('items.create', $data); + return view('items.create', $data); } /** @@ -160,9 +161,9 @@ class ItemController extends Controller { // Get the item $item = Item::find($id); - if($item->appid === null && $item->class !== null) { // old apps wont have an app id so set it + if ($item->appid === null && $item->class !== null) { // old apps wont have an app id so set it $app = Application::where('class', $item->class)->first(); - if($app) { + if ($app) { $item->appid = $app->appid; } } @@ -173,10 +174,9 @@ class ItemController extends Controller //$data['current_tags'] = $data['item']->parent; //die(print_r($data['current_tags'])); // show the edit form and pass the nerd - return view('items.edit', $data); + return view('items.edit', $data); } - public function storelogic($request, $id = null) { $application = Application::single($request->input('appid')); @@ -185,12 +185,12 @@ class ItemController extends Controller 'url' => 'required', ]); - if($request->hasFile('file')) { + if ($request->hasFile('file')) { $path = $request->file('file')->store('icons'); $request->merge([ - 'icon' => $path + 'icon' => $path, ]); - } elseif(strpos($request->input('icon'), 'http') === 0) { + } elseif (strpos($request->input('icon'), 'http') === 0) { $contents = file_get_contents($request->input('icon')); if ($application) { @@ -204,7 +204,7 @@ class ItemController extends Controller $path = 'icons/'.$icon; Storage::disk('public')->put($path, $contents); $request->merge([ - 'icon' => $path + 'icon' => $path, ]); } @@ -212,10 +212,10 @@ class ItemController extends Controller $current_user = User::currentUser(); $request->merge([ 'description' => $config, - 'user_id' => $current_user->id + 'user_id' => $current_user->id, ]); - if($request->input('appid') === 'null') { + if ($request->input('appid') === 'null') { $request->merge([ 'class' => null, ]); @@ -223,20 +223,16 @@ class ItemController extends Controller $request->merge([ 'class' => Application::classFromName($application->name), ]); - } - - if($id === null) { + if ($id === null) { $item = Item::create($request->all()); } else { $item = Item::find($id); $item->update($request->all()); } - $item->parents()->sync($request->tags); - } /** @@ -250,6 +246,7 @@ class ItemController extends Controller $this->storelogic($request); $route = route('dash', []); + return redirect($route) ->with('success', __('app.alert.success.item_created')); } @@ -265,7 +262,6 @@ class ItemController extends Controller // } - /** * Update the specified resource in storage. * @@ -277,8 +273,9 @@ class ItemController extends Controller { $this->storelogic($request, $id); $route = route('dash', []); + return redirect($route) - ->with('success',__('app.alert.success.item_updated')); + ->with('success', __('app.alert.success.item_updated')); } /** @@ -290,8 +287,8 @@ class ItemController extends Controller public function destroy(Request $request, $id) { // - $force = (bool)$request->input('force'); - if($force) { + $force = (bool) $request->input('force'); + if ($force) { Item::withTrashed() ->where('id', $id) ->forceDelete(); @@ -300,8 +297,9 @@ class ItemController extends Controller } $route = route('items.index', []); - return redirect($route) - ->with('success',__('app.alert.success.item_deleted')); + + return redirect($route) + ->with('success', __('app.alert.success.item_deleted')); } /** @@ -315,11 +313,12 @@ class ItemController extends Controller // Item::withTrashed() ->where('id', $id) - ->restore(); - + ->restore(); + $route = route('items.index', []); + return redirect($route) - ->with('success',__('app.alert.success.item_restored')); + ->with('success', __('app.alert.success.item_restored')); } /** @@ -332,7 +331,9 @@ class ItemController extends Controller $output = []; $appid = $request->input('app'); - if($appid === "null") return null; + if ($appid === 'null') { + return null; + } /*$appname = $request->input('app'); //die($appname); @@ -358,22 +359,19 @@ class ItemController extends Controller $output['custom'] = null; $app = Application::single($appid); - $output = (array)$app; + $output = (array) $app; $appdetails = Application::getApp($appid); - if((boolean)$app->enhanced === true) { + if ((bool) $app->enhanced === true) { // if(!isset($app->config)) { // class based config - $output['custom'] = className($appdetails->name).'.config'; + $output['custom'] = className($appdetails->name).'.config'; // } } - + $output['colour'] = ($app->tile_background == 'light') ? '#fafbfc' : '#161b1f'; - $output['iconview'] = config('app.appsource').'icons/' . $app->icon; + $output['iconview'] = config('app.appsource').'icons/'.$app->icon; -; - - return json_encode($output); } @@ -385,20 +383,20 @@ class ItemController extends Controller $app = $single->class; $app_details = new $app(); - $app_details->config = (object)$data; + $app_details->config = (object) $data; $app_details->test(); } - public function execute($url, $attrs = [], $overridevars=false) + public function execute($url, $attrs = [], $overridevars = false) { $res = null; $vars = ($overridevars !== false) ? $overridevars : [ - 'http_errors' => false, - 'timeout' => 15, + 'http_errors' => false, + 'timeout' => 15, 'connect_timeout' => 15, - 'verify' => false + 'verify' => false, ]; $client = new Client($vars); @@ -406,21 +404,22 @@ class ItemController extends Controller $method = 'GET'; try { - return $client->request($method, $url, $attrs); + return $client->request($method, $url, $attrs); } catch (\GuzzleHttp\Exception\ConnectException $e) { - Log::error("Connection refused"); + Log::error('Connection refused'); Log::debug($e->getMessage()); } catch (\GuzzleHttp\Exception\ServerException $e) { Log::debug($e->getMessage()); } + return $res; } - public function websitelookup($url) { $url = \base64_decode($url); $data = $this->execute($url); + return $data->getBody(); } @@ -429,26 +428,19 @@ class ItemController extends Controller $item = Item::find($id); $config = $item->getconfig(); - if(isset($item->class)) { + if (isset($item->class)) { $application = new $item->class; $application->config = $config; echo $application->livestats(); } - } - public function checkAppList() { ProcessApps::dispatch(); $route = route('items.index'); + return redirect($route) ->with('success', __('app.alert.success.updating')); - } - - - - - } diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index fee98ffa..0269d4db 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Search; +use Illuminate\Http\Request; class SearchController extends Controller { @@ -15,9 +15,9 @@ class SearchController extends Controller $provider = Search::providerDetails($requestprovider); - if($provider->type == 'standard') { + if ($provider->type == 'standard') { return redirect($provider->url.'?'.$provider->query.'='.urlencode($query)); - } elseif($provider->type == 'external') { + } elseif ($provider->type == 'external') { $class = new $provider->class; //print_r($provider); return $class->getResults($query, $provider); diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index afcec249..a342cc89 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -2,12 +2,12 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; +use App\Http\Controllers\Controller; use App\Setting; use App\SettingGroup; use App\User; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -use App\Http\Controllers\Controller; class SettingsController extends Controller { @@ -40,15 +40,18 @@ class SettingsController extends Controller $setting = Setting::find($id); //die("s: ".$setting->label); - if((bool)$setting->system === true) return abort(404); + if ((bool) $setting->system === true) { + return abort(404); + } - if (!is_null($setting)) { + if (! is_null($setting)) { return view('settings.edit')->with([ 'setting' => $setting, ]); } else { $route = route('settings.list', []); - return redirect($route) + + return redirect($route) ->with([ 'error' => __('app.alert.error.not_exist'), ]); @@ -65,39 +68,39 @@ class SettingsController extends Controller $setting = Setting::find($id); $user = $this->user(); - if (!is_null($setting)) { + if (! is_null($setting)) { $data = Setting::getInput($request); $setting_value = null; if ($setting->type == 'image') { - - - if($request->hasFile('value')) { + if ($request->hasFile('value')) { $path = $request->file('value')->store('backgrounds'); $setting_value = $path; } - } else { $setting_value = $data->value; } $user->settings()->detach($setting->id); $user->settings()->save($setting, ['uservalue' => $setting_value]); - + $route = route('settings.index', []); - return redirect($route) + + return redirect($route) ->with([ 'success' => __('app.alert.success.setting_updated'), ]); } else { $route = route('settings.index', []); - return redirect($route) + + return redirect($route) ->with([ 'error' => __('app.alert.error.not_exist'), ]); } } + /** * @param int $id * @@ -107,21 +110,19 @@ class SettingsController extends Controller { $user = $this->user(); $setting = Setting::find($id); - if((bool)$setting->system !== true) { + if ((bool) $setting->system !== true) { $user->settings()->detach($setting->id); $user->settings()->save($setting, ['uservalue' => '']); } $route = route('settings.index', []); - return redirect($route) + + return redirect($route) ->with([ 'success' => __('app.alert.success.setting_updated'), ]); - } public function search(Request $request) { - } - } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 77723911..44aa48ad 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Item; use App\User; use DB; +use Illuminate\Http\Request; class TagController extends Controller { @@ -13,6 +13,7 @@ class TagController extends Controller { $this->middleware('allowed'); } + /** * Display a listing of the resource. * @@ -20,11 +21,11 @@ class TagController extends Controller */ public function index(Request $request) { - $trash = (bool)$request->input('trash'); + $trash = (bool) $request->input('trash'); $data['apps'] = Item::ofType('tag')->where('id', '>', 0)->orderBy('title', 'asc')->get(); $data['trash'] = Item::ofType('tag')->where('id', '>', 0)->onlyTrashed()->get(); - if($trash) { + if ($trash) { return view('tags.trash', $data); } else { return view('tags.list', $data); @@ -39,6 +40,7 @@ class TagController extends Controller public function create() { $data = []; + return view('tags.create', $data); } @@ -54,10 +56,10 @@ class TagController extends Controller 'title' => 'required|max:255', ]); - if($request->hasFile('file')) { + if ($request->hasFile('file')) { $path = $request->file('file')->store('icons'); $request->merge([ - 'icon' => $path + 'icon' => $path, ]); } @@ -69,12 +71,13 @@ class TagController extends Controller $request->merge([ 'type' => '1', 'url' => $slug, - 'user_id' => $current_user->id + 'user_id' => $current_user->id, ]); //die(print_r($request->all())); Item::create($request->all()); $route = route('dash', []); + return redirect($route) ->with('success', __('app.alert.success.tag_created')); } @@ -92,6 +95,7 @@ class TagController extends Controller $data['apps'] = $item->children()->pinned()->orderBy('order', 'asc')->get(); $data['tag'] = $item->id; $data['all_apps'] = $item->children; + return view('welcome', $data); } @@ -108,7 +112,7 @@ class TagController extends Controller // show the edit form and pass the nerd return view('tags.edit') - ->with('item', $item); + ->with('item', $item); } /** @@ -124,24 +128,25 @@ class TagController extends Controller 'title' => 'required|max:255', ]); - if($request->hasFile('file')) { + if ($request->hasFile('file')) { $path = $request->file('file')->store('icons'); $request->merge([ - 'icon' => $path + 'icon' => $path, ]); } $slug = str_slug($request->title, '-'); // set item type to tag $request->merge([ - 'url' => $slug + 'url' => $slug, ]); Item::find($id)->update($request->all()); $route = route('dash', []); + return redirect($route) - ->with('success',__('app.alert.success.tag_updated')); + ->with('success', __('app.alert.success.tag_updated')); } /** @@ -153,18 +158,19 @@ class TagController extends Controller public function destroy(Request $request, $id) { // - $force = (bool)$request->input('force'); - if($force) { + $force = (bool) $request->input('force'); + if ($force) { Item::withTrashed() ->where('id', $id) ->forceDelete(); } else { Item::find($id)->delete(); } - + $route = route('tags.index', []); + return redirect($route) - ->with('success',__('app.alert.success.item_deleted')); + ->with('success', __('app.alert.success.item_deleted')); } /** @@ -178,10 +184,11 @@ class TagController extends Controller // Item::withTrashed() ->where('id', $id) - ->restore(); + ->restore(); $route = route('tags.index', []); + return redirect($route) - ->with('success',__('app.alert.success.item_restored')); + ->with('success', __('app.alert.success.item_restored')); } public function add($tag, $item) @@ -189,14 +196,15 @@ class TagController extends Controller $output = 0; $tag = Item::find($tag); $item = Item::find($item); - if($tag && $item) { + if ($tag && $item) { // only add items, not cats - if((int)$item->type === 0) { + if ((int) $item->type === 0) { $tag->children()->attach($item); + return 1; } } + return $output; } - } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 7448cd22..b76b0145 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\User; -use Illuminate\Support\Str; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Str; class UserController extends Controller { @@ -14,6 +14,7 @@ class UserController extends Controller { $this->middleware('allowed')->except(['selectUser']); } + /** * Display a listing of the resource. * @@ -22,6 +23,7 @@ class UserController extends Controller public function index() { $data['users'] = User::all(); + return view('users.index', $data); } @@ -33,6 +35,7 @@ class UserController extends Controller public function create() { $data = []; + return view('users.create', $data); } @@ -40,8 +43,8 @@ class UserController extends Controller { Auth::logout(); $data['users'] = User::all(); - return view('userselect', $data); + return view('userselect', $data); } /** @@ -56,7 +59,7 @@ class UserController extends Controller 'username' => 'required|max:255|unique:users', 'email' => 'required|email', 'password' => 'nullable|confirmed', - 'password_confirmation' => 'nullable' + 'password_confirmation' => 'nullable', ]); $user = new User; @@ -65,24 +68,25 @@ class UserController extends Controller $user->public_front = $request->input('public_front'); $password = $request->input('password'); - if(!empty($password)) { + if (! empty($password)) { $user->password = bcrypt($password); } - if($request->hasFile('file')) { + if ($request->hasFile('file')) { $path = $request->file('file')->store('avatars'); $user->avatar = $path; } - if ((bool)$request->input('autologin_allow') === true) { - $user->autologin = (string)Str::uuid(); + if ((bool) $request->input('autologin_allow') === true) { + $user->autologin = (string) Str::uuid(); } $user->save(); - + $route = route('dash', []); + return redirect($route) - ->with('success',__('app.alert.success.user_updated')); + ->with('success', __('app.alert.success.user_updated')); } /** @@ -105,8 +109,8 @@ class UserController extends Controller public function edit(User $user) { $data['user'] = $user; - return view('users.edit', $data); + return view('users.edit', $data); } /** @@ -122,28 +126,28 @@ class UserController extends Controller 'username' => 'required|max:255|unique:users,username,'.$user->id, 'email' => 'required|email', 'password' => 'nullable|confirmed', - 'password_confirmation' => 'nullable' + 'password_confirmation' => 'nullable', ]); - //die(print_r($request->all())); + //die(print_r($request->all())); $user->username = $request->input('username'); $user->email = $request->input('email'); $user->public_front = $request->input('public_front'); $password = $request->input('password'); - if(!empty($password)) { + if (! empty($password)) { $user->password = bcrypt($password); - } elseif($password == 'null') { + } elseif ($password == 'null') { $user->password = null; } - - if($request->hasFile('file')) { + + if ($request->hasFile('file')) { $path = $request->file('file')->store('avatars'); $user->avatar = $path; } - if ((bool)$request->input('autologin_allow') === true) { - $user->autologin = (is_null($user->autologin)) ? (string)Str::uuid() : $user->autologin; + if ((bool) $request->input('autologin_allow') === true) { + $user->autologin = (is_null($user->autologin)) ? (string) Str::uuid() : $user->autologin; } else { $user->autologin = null; } @@ -151,9 +155,9 @@ class UserController extends Controller $user->save(); $route = route('dash', []); - return redirect($route) - ->with('success',__('app.alert.success.user_updated')); + return redirect($route) + ->with('success', __('app.alert.success.user_updated')); } /** @@ -164,12 +168,12 @@ class UserController extends Controller */ public function destroy(User $user) { - if($user->id !== 1) { + if ($user->id !== 1) { $user->delete(); $route = route('dash', []); - return redirect($route) - ->with('success',__('app.alert.success.user_deleted')); + return redirect($route) + ->with('success', __('app.alert.success.user_deleted')); } } } diff --git a/app/Http/Middleware/CheckAllowed.php b/app/Http/Middleware/CheckAllowed.php index 59f8e68d..f67da62c 100644 --- a/app/Http/Middleware/CheckAllowed.php +++ b/app/Http/Middleware/CheckAllowed.php @@ -2,9 +2,9 @@ namespace App\Http\Middleware; +use App\User; use Closure; use Illuminate\Support\Facades\Auth; -use App\User; use Illuminate\Support\Facades\Route; use Session; @@ -22,27 +22,32 @@ class CheckAllowed $route = Route::currentRouteName(); $current_user = User::currentUser(); - if(str_is('users*', $route)) { - if($current_user->id !== 1) { + if (str_is('users*', $route)) { + if ($current_user->id !== 1) { return redirect()->route('dash'); } } - if($route == 'dash') { + if ($route == 'dash') { //print_r(User::all()); //die("here".var_dump($current_user->password)); - if((bool)$current_user->public_front === true) return $next($request); + if ((bool) $current_user->public_front === true) { + return $next($request); + } } - if(empty($current_user->password)) return $next($request); + if (empty($current_user->password)) { + return $next($request); + } // Check if user is logged in as $current_user if (Auth::check()) { $loggedin_user = Auth::user(); - if($loggedin_user->id === $current_user->id) return $next($request); + if ($loggedin_user->id === $current_user->id) { + return $next($request); + } } return Auth::authenticate(); - } } diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 7945af40..d0acfbec 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware; -use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; +use Illuminate\Http\Request; class TrustProxies extends Middleware { @@ -12,7 +12,7 @@ class TrustProxies extends Middleware * * @var array */ - protected $proxies = ['192.168.0.0/16', '172.16.0.0/12','10.0.0.0/8', '127.0.0.1']; + protected $proxies = ['192.168.0.0/16', '172.16.0.0/12', '10.0.0.0/8', '127.0.0.1']; /** * The current proxy header mappings. diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index ce71f1ea..a53ca423 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -54,5 +54,4 @@ class VerifyCsrfToken extends Middleware { return EncryptCookies::serialized('HEIMDALL-XSRF-TOKEN'); } - } diff --git a/app/Item.php b/app/Item.php index 3ad37ae5..0e3f75ae 100644 --- a/app/Item.php +++ b/app/Item.php @@ -2,13 +2,13 @@ namespace App; -use Illuminate\Database\Eloquent\Model; -use Symfony\Component\ClassLoader\ClassMapGenerator; -use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Database\Eloquent\Builder; -use App\User; -use App\ItemTag; use App\Application; +use App\ItemTag; +use App\User; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; +use Symfony\Component\ClassLoader\ClassMapGenerator; class Item extends Model { @@ -20,7 +20,7 @@ class Item extends Model static::addGlobalScope('user_id', function (Builder $builder) { $current_user = User::currentUser(); - if($current_user) { + if ($current_user) { $builder->where('user_id', $current_user->id)->orWhere('user_id', 0); } else { $builder->where('user_id', 0); @@ -30,7 +30,7 @@ class Item extends Model // protected $fillable = [ - 'title', 'url', 'colour', 'icon', 'appdescription', 'description', 'pinned', 'order', 'type', 'class', 'user_id', 'appid' + 'title', 'url', 'colour', 'icon', 'appdescription', 'description', 'pinned', 'order', 'type', 'class', 'user_id', 'appid', ]; /** @@ -54,31 +54,31 @@ class Item extends Model public static function checkConfig($config) { // die(print_r($config)); - if(empty($config)) { + if (empty($config)) { $config = null; } else { $config = json_encode($config); } + return $config; - } - public function tags() { $id = $this->id; $tags = ItemTag::select('tag_id')->where('item_id', $id)->pluck('tag_id')->toArray(); - $tagdetails = Item::select('id', 'title', 'url', 'pinned')->whereIn('id', $tags)->get(); + $tagdetails = self::select('id', 'title', 'url', 'pinned')->whereIn('id', $tags)->get(); //print_r($tags); - if(in_array(0, $tags)) { - $details = new Item([ - "id" => 0, - "title" => __('app.dashboard'), - "url" => '', - "pinned" => 0 + if (in_array(0, $tags)) { + $details = new self([ + 'id' => 0, + 'title' => __('app.dashboard'), + 'url' => '', + 'pinned' => 0, ]); $tagdetails->prepend($details); } + return $tagdetails; } @@ -86,6 +86,7 @@ class Item extends Model { return $this->belongsToMany('App\Item', 'item_tag', 'item_id', 'tag_id'); } + public function children() { return $this->belongsToMany('App\Item', 'item_tag', 'tag_id', 'item_id'); @@ -93,7 +94,7 @@ class Item extends Model public function getLinkAttribute() { - if((int)$this->type === 1) { + if ((int) $this->type === 1) { return url('tag/'.$this->url); } else { return $this->url; @@ -102,7 +103,7 @@ class Item extends Model public function getDroppableAttribute() { - if((int)$this->type === 1) { + if ((int) $this->type === 1) { return ' droppable'; } else { return ''; @@ -113,24 +114,25 @@ class Item extends Model { $target = Setting::fetch('window_target'); - if((int)$this->type === 1 || $target === 'current') { + if ((int) $this->type === 1 || $target === 'current') { return ''; } else { - return ' target="' . $target . '"'; + return ' target="'.$target.'"'; } } public function getLinkIconAttribute() { - if((int)$this->type === 1) { + if ((int) $this->type === 1) { return 'fa-tag'; } else { return 'fa-arrow-alt-to-right'; } } + public function getLinkTypeAttribute() { - if((int)$this->type === 1) { + if ((int) $this->type === 1) { return 'tags'; } else { return 'items'; @@ -141,13 +143,13 @@ class Item extends Model { $explode = explode('\\', $class); $name = end($explode); - + return $name; } public function scopeOfType($query, $type) { - switch($type) { + switch ($type) { case 'item': $typeid = 0; break; @@ -172,77 +174,81 @@ class Item extends Model public static function isEnhanced($class) { - if($class === null || $class === 'null') return false; + if ($class === null || $class === 'null') { + return false; + } $app = new $class; - return (bool)($app instanceof \App\EnhancedApps); + + return (bool) ($app instanceof \App\EnhancedApps); } public static function isSearchProvider($class) { $app = new $class; - return ((bool)($app instanceof \App\SearchInterface)) ? $app : false; + + return ((bool) ($app instanceof \App\SearchInterface)) ? $app : false; } public function enabled() { - if($this->enhanced()) { + if ($this->enhanced()) { $config = $this->getconfig(); - if($config) { + if ($config) { return (bool) $config->enabled; } } + return false; } public function getconfig() { // $explode = explode('\\', $this->class); - - if(!isset($this->description) || empty($this->description)) { + if (! isset($this->description) || empty($this->description)) { $config = new \stdClass; // $config->name = end($explode); $config->enabled = false; $config->override_url = null; $config->apikey = null; + return $config; } - - $config = json_decode($this->description); // $config->name = end($explode); - $config->url = $this->url; - if(isset($config->override_url) && !empty($config->override_url)) { + if (isset($config->override_url) && ! empty($config->override_url)) { $config->url = $config->override_url; } else { $config->override_url = null; } - + return $config; } public static function applicationDetails($class) { - if(!empty($class)) { + if (! empty($class)) { $name = self::nameFromClass($class); $application = Application::where('name', $name)->first(); - if($application) return $application; + if ($application) { + return $application; + } } return false; - } public static function getApplicationDescription($class) { $details = self::applicationDetails($class); - if($details !== false) { + if ($details !== false) { return $details->description.' - '.$details->license; } + return ''; } @@ -252,7 +258,5 @@ class Item extends Model public function user() { return $this->belongsTo('App\User'); - } - - + } } diff --git a/app/ItemTag.php b/app/ItemTag.php index 13357f4d..a2b168b2 100644 --- a/app/ItemTag.php +++ b/app/ItemTag.php @@ -6,5 +6,4 @@ use Illuminate\Database\Eloquent\Relations\Pivot; class ItemTag extends Pivot { - -} \ No newline at end of file +} diff --git a/app/Jobs/ProcessApps.php b/app/Jobs/ProcessApps.php index 67549afc..3c37a105 100644 --- a/app/Jobs/ProcessApps.php +++ b/app/Jobs/ProcessApps.php @@ -2,15 +2,15 @@ namespace App\Jobs; +use App\Application; +use App\Item; +use App\SupportedApps; use Illuminate\Bus\Queueable; -use Illuminate\Queue\SerializesModels; -use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; +use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Storage; -use App\Application; -use App\SupportedApps; -use App\Item; class ProcessApps implements ShouldQueue { @@ -38,18 +38,17 @@ class ProcessApps implements ShouldQueue Storage::disk('local')->put('supportedapps.json', $json); - foreach($localapps as $app) { + foreach ($localapps as $app) { $app->class = $app->class(); $app->save(); } $items = Item::whereNotNull('class')->get(); - foreach($items as $item) { - if(!file_exists(app_path('SupportedApps/'.Item::nameFromClass($item->class)))) { + foreach ($items as $item) { + if (! file_exists(app_path('SupportedApps/'.Item::nameFromClass($item->class)))) { $app = Application::where('class', $item->class)->first(); Application::getApp($app->appid); } } - } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index cfc8c4d5..2099b82a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,13 +2,13 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; -use Artisan; -use Schema; -use App\Setting; -use App\User; use App\Application; use App\Jobs\ProcessApps; +use App\Setting; +use App\User; +use Artisan; +use Illuminate\Support\ServiceProvider; +use Schema; class AppServiceProvider extends ServiceProvider { @@ -19,36 +19,33 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - - if(!is_file(base_path('.env'))) { + if (! is_file(base_path('.env'))) { copy(base_path('.env.example'), base_path('.env')); } $this->genKey(); - if(!is_file(database_path('app.sqlite'))) { + if (! is_file(database_path('app.sqlite'))) { // first time setup touch(database_path('app.sqlite')); - Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); + Artisan::call('migrate', ['--path' => 'database/migrations', '--force' => true, '--seed' => true]); //Cache //Artisan::call('config:cache'); //Artisan::call('route:cache'); } - if(is_file(database_path('app.sqlite'))) { - if(Schema::hasTable('settings')) { + if (is_file(database_path('app.sqlite'))) { + if (Schema::hasTable('settings')) { // check version to see if an upgrade is needed $db_version = Setting::_fetch('version'); $app_version = config('app.version'); - if(version_compare($app_version, $db_version) == 1) { // app is higher than db, so need to run migrations etc - Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); + if (version_compare($app_version, $db_version) == 1) { // app is higher than db, so need to run migrations etc + Artisan::call('migrate', ['--path' => 'database/migrations', '--force' => true, '--seed' => true]); } - } else { - Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); + Artisan::call('migrate', ['--path' => 'database/migrations', '--force' => true, '--seed' => true]); } - } - if(!is_file(public_path('storage/.gitignore'))) { + if (! is_file(public_path('storage/.gitignore'))) { Artisan::call('storage:link'); \Session::put('current_user', null); } @@ -56,38 +53,33 @@ class AppServiceProvider extends ServiceProvider $lang = Setting::fetch('language'); \App::setLocale($lang); - $applications = Application::all(); - if($applications->count() <= 0) { + if ($applications->count() <= 0) { if (class_exists('ZipArchive')) { ProcessApps::dispatch(); } else { - die("You are missing php-zip"); + die('You are missing php-zip'); } - } // User specific settings need to go here as session isn't available at this point in the app - view()->composer('*', function ($view) - { - - if(isset($_SERVER['HTTP_AUTHORIZATION']) && !empty($_SERVER['HTTP_AUTHORIZATION'])) { - list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = + view()->composer('*', function ($view) { + if (isset($_SERVER['HTTP_AUTHORIZATION']) && ! empty($_SERVER['HTTP_AUTHORIZATION'])) { + list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); } - if(!\Auth::check()) { - if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) - && !empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { + if (! \Auth::check()) { + if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) + && ! empty($_SERVER['PHP_AUTH_USER']) && ! empty($_SERVER['PHP_AUTH_PW'])) { $credentials = ['username' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']]; - + if (\Auth::attempt($credentials, true)) { // Authentication passed... $user = \Auth::user(); //\Session::put('current_user', $user); - session(['current_user' => $user]); + session(['current_user' => $user]); } - } - elseif(isset($_SERVER['REMOTE_USER']) && !empty($_SERVER['REMOTE_USER'])) { + } elseif (isset($_SERVER['REMOTE_USER']) && ! empty($_SERVER['REMOTE_USER'])) { $user = User::where('username', $_SERVER['REMOTE_USER'])->first(); if ($user) { \Auth::login($user, true); @@ -96,52 +88,44 @@ class AppServiceProvider extends ServiceProvider } } - $alt_bg = ''; - if($bg_image = Setting::fetch('background_image')) { + if ($bg_image = Setting::fetch('background_image')) { $alt_bg = ' style="background-image: url(storage/'.$bg_image.')"'; } $allusers = User::all(); $current_user = User::currentUser(); - $view->with('alt_bg', $alt_bg ); - $view->with('allusers', $allusers ); - $view->with('current_user', $current_user ); - - - - - }); + $view->with('alt_bg', $alt_bg); + $view->with('allusers', $allusers); + $view->with('current_user', $current_user); + }); $this->app['view']->addNamespace('SupportedApps', app_path('SupportedApps')); - if (env('FORCE_HTTPS') === true) { \URL::forceScheme('https'); } - if(env('APP_URL') != 'http://localhost') { + if (env('APP_URL') != 'http://localhost') { \URL::forceRootUrl(env('APP_URL')); } - } - /** + /** * Generate app key if missing and .env exists * * @return void */ public function genKey() { - if(is_file(base_path('.env'))) { - if(empty(env('APP_KEY'))) { - Artisan::call('key:generate', array('--force' => true, '--no-interaction' => true)); + if (is_file(base_path('.env'))) { + if (empty(env('APP_KEY'))) { + Artisan::call('key:generate', ['--force' => true, '--no-interaction' => true]); } } } - /** * Register any application services. * diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 9784b1a3..e12ff88f 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Gate; class AuthServiceProvider extends ServiceProvider { diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 352cce44..395c518b 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Broadcast; +use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index fca6152c..f106ba4d 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 5ea48d39..548e4be7 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { diff --git a/app/Search.php b/app/Search.php index 096a99f6..4c50d841 100644 --- a/app/Search.php +++ b/app/Search.php @@ -1,44 +1,49 @@ - $provider) { + foreach ($providers as $key => $provider) { $all[$key] = $provider; $all[$key]['type'] = 'standard'; } @@ -57,16 +62,18 @@ abstract class Search /** * Loops through users apps to see if app is a search provider, might be worth * looking into caching this at some point - * - * @return Array + * + * @return array */ public static function appProviders() { $providers = []; $userapps = Item::all(); - foreach($userapps as $app) { - if(empty($app->class)) continue; - if(($provider = Item::isSearchProvider($app->class)) !== false) { + foreach ($userapps as $app) { + if (empty($app->class)) { + continue; + } + if (($provider = Item::isSearchProvider($app->class)) !== false) { $name = Item::nameFromClass($app->class); $providers[$app->id] = [ 'id' => $app->id, @@ -76,17 +83,17 @@ abstract class Search 'name' => $app->title, 'colour' => $app->colour, 'icon' => $app->icon, - 'description' => $app->description + 'description' => $app->description, ]; - } } + return $providers; } /** * Outputs the search form - * + * * @return html */ public static function form() @@ -96,15 +103,16 @@ abstract class Search $search_provider = Setting::where('key', '=', 'search_provider')->first(); $user_search_provider = Setting::fetch('search_provider'); //die(print_r($search_provider)); - + //die(var_dump($user_search_provider)); // return early if search isn't applicable - if((bool)$homepage_search !== true) return $output; + if ((bool) $homepage_search !== true) { + return $output; + } $user_search_provider = $user_search_provider ?? 'none'; - if((bool)$homepage_search && (bool)$search_provider) { - - if((bool)$user_search_provider) { + if ((bool) $homepage_search && (bool) $search_provider) { + if ((bool) $user_search_provider) { $name = 'app.options.'.$user_search_provider; $provider = self::providerDetails($user_search_provider); @@ -112,8 +120,8 @@ abstract class Search $output .= '
'; $output .= '
'; $output .= ''; @@ -124,8 +132,7 @@ abstract class Search $output .= '
'; } } + return $output; } - - } diff --git a/app/SearchInterface.php b/app/SearchInterface.php index 62c5e4dc..98c83690 100644 --- a/app/SearchInterface.php +++ b/app/SearchInterface.php @@ -1,10 +1,11 @@ -system === true) { + if ((bool) $this->system === true) { $value = self::_fetch($this->key); } else { $value = self::fetch($this->key); } $this->value = $value; - switch($this->type) { + switch ($this->type) { case 'image': - if(!empty($this->value)) { + if (! empty($this->value)) { $value = ''.__('app.settings.view').''; } else { $value = __('app.options.none'); - } + } break; case 'boolean': - if((bool)$this->value === true) { + if ((bool) $this->value === true) { $value = __('app.options.yes'); } else { $value = __('app.options.no'); - } + } break; case 'select': - if(!empty($this->value) && $this->value !== 'none') { - $options = (array)json_decode($this->options); - if($this->key === 'search_provider') { + if (! empty($this->value) && $this->value !== 'none') { + $options = (array) json_decode($this->options); + if ($this->key === 'search_provider') { $options = Search::providers()->pluck('name', 'id')->toArray(); - } + } $value = __($options[$this->value]); } else { $value = __('app.options.none'); - } + } break; default: $value = __($this->value); @@ -88,32 +88,33 @@ class Setting extends Model } return $value; - } public function getEditValueAttribute() { - if((bool)$this->system === true) { + if ((bool) $this->system === true) { $value = self::_fetch($this->key); } else { $value = self::fetch($this->key); } $this->value = $value; - switch($this->type) { + switch ($this->type) { case 'image': $value = ''; - if(isset($this->value) && !empty($this->value)) { + if (isset($this->value) && ! empty($this->value)) { $value .= ''; } $value .= Form::file('value', ['class' => 'form-control']); - if(isset($this->value) && !empty($this->value)) { + if (isset($this->value) && ! empty($this->value)) { $value .= ''.__('app.settings.reset').''; } - + break; case 'boolean': $checked = false; - if(isset($this->value) && (bool)$this->value === true) $checked = true; + if (isset($this->value) && (bool) $this->value === true) { + $checked = true; + } $set_checked = ($checked) ? ' checked="checked"' : ''; $value = ' @@ -125,10 +126,10 @@ class Setting extends Model break; case 'select': $options = json_decode($this->options); - if($this->key === 'search_provider') { + if ($this->key === 'search_provider') { $options = Search::providers()->pluck('name', 'id'); } - foreach($options as $key => $opt) { + foreach ($options as $key => $opt) { $options->$key = __($opt); } $value = Form::select('value', $options, null, ['class' => 'form-control']); @@ -142,7 +143,6 @@ class Setting extends Model } return $value; - } public function group() @@ -150,7 +150,6 @@ class Setting extends Model return $this->belongsTo('App\SettingGroup', 'group_id'); } - /** * @param string $key * @@ -159,53 +158,54 @@ class Setting extends Model public static function fetch($key) { $user = self::user(); + return self::_fetch($key, $user); } + /** * @param string $key * * @return mixed */ - public static function _fetch($key, $user=null) + public static function _fetch($key, $user = null) { - #$cachekey = ($user === null) ? $key : $key.'-'.$user->id; - #if (Setting::cached($cachekey)) { - # return Setting::$cache[$cachekey]; - #} else { - $find = self::where('key', '=', $key)->first(); + //$cachekey = ($user === null) ? $key : $key.'-'.$user->id; + //if (Setting::cached($cachekey)) { + // return Setting::$cache[$cachekey]; + //} else { + $find = self::where('key', '=', $key)->first(); - if (!is_null($find)) { - if((bool)$find->system === true) { // if system variable use global value + if (! is_null($find)) { + if ((bool) $find->system === true) { // if system variable use global value + $value = $find->value; + } else { // not system variable so use user specific value + // check if user specified value has been set + //print_r($user); + $usersetting = $user->settings()->where('id', $find->id)->first(); + //print_r($user->settings); + //die(var_dump($usersetting)); + //->pivot->value; + //echo "user: ".$user->id." --- ".$usersettings; + if (isset($usersetting) && ! empty($usersetting)) { + $value = $usersetting->pivot->uservalue; + } else { // if not get default from base setting + //$user->settings()->save($find, ['value' => $find->value]); + //$has_setting = $user->settings()->where('id', $find->id)->exists(); + //if($has_setting) { + // $user->settings()->updateExistingPivot($find->id, ['uservalue' => (string)$find->value]); + //} else { + // $user->settings()->save($find, ['uservalue' => (string)$find->value]); + //} $value = $find->value; - } else { // not system variable so use user specific value - // check if user specified value has been set - //print_r($user); - $usersetting = $user->settings()->where('id', $find->id)->first(); - //print_r($user->settings); - //die(var_dump($usersetting)); - //->pivot->value; - //echo "user: ".$user->id." --- ".$usersettings; - if(isset($usersetting) && !empty($usersetting)) { - $value = $usersetting->pivot->uservalue; - } else { // if not get default from base setting - //$user->settings()->save($find, ['value' => $find->value]); - #$has_setting = $user->settings()->where('id', $find->id)->exists(); - #if($has_setting) { - # $user->settings()->updateExistingPivot($find->id, ['uservalue' => (string)$find->value]); - #} else { - # $user->settings()->save($find, ['uservalue' => (string)$find->value]); - #} - $value = $find->value; - } - } - #Setting::add($cachekey, $value); - - return $value; - } else { - return false; } - #} + //Setting::add($cachekey, $value); + + return $value; + } else { + return false; + } + //} } /** @@ -214,7 +214,7 @@ class Setting extends Model */ public static function add($key, $value) { - Setting::$cache[$key] = $value; + self::$cache[$key] = $value; } /** @@ -224,10 +224,9 @@ class Setting extends Model */ public static function cached($key) { - return array_key_exists($key, Setting::$cache); + return array_key_exists($key, self::$cache); } - /** * The users that belong to the setting. */ @@ -240,6 +239,4 @@ class Setting extends Model { return User::currentUser(); } - - } diff --git a/app/SupportedApps.php b/app/SupportedApps.php index 071d0049..7b3f1301 100644 --- a/app/SupportedApps.php +++ b/app/SupportedApps.php @@ -1,34 +1,37 @@ -config->url)) { - return (object)[ + if (empty($this->config->url)) { + return (object) [ 'code' => 404, 'status' => 'No URL has been specified', 'response' => 'No URL has been specified', - ]; + ]; } $res = $this->execute($url, $attrs); - if($res == null) { - return (object)[ + if ($res == null) { + return (object) [ 'code' => null, 'status' => $this->error, 'response' => 'Connection failed', ]; } - switch($res->getStatusCode()) { + switch ($res->getStatusCode()) { case 200: $status = 'Successfully communicated with the API'; break; @@ -42,21 +45,22 @@ abstract class SupportedApps $status = 'Something went wrong... Code: '.$res->getStatusCode(); break; } - return (object)[ + + return (object) [ 'code' => $res->getStatusCode(), 'status' => $status, 'response' => $res->getBody(), ]; } - public function execute($url, $attrs = [], $overridevars=false, $overridemethod=false) + public function execute($url, $attrs = [], $overridevars = false, $overridemethod = false) { $res = null; $vars = ($overridevars !== false) ? $overridevars : [ - 'http_errors' => false, - 'timeout' => 15, + 'http_errors' => false, + 'timeout' => 15, 'connect_timeout' => 15, ]; @@ -65,35 +69,34 @@ abstract class SupportedApps $method = ($overridemethod !== false) ? $overridemethod : $this->method; try { - return $client->request($method, $url, $attrs); + return $client->request($method, $url, $attrs); } catch (\GuzzleHttp\Exception\ConnectException $e) { - Log::error("Connection refused"); + Log::error('Connection refused'); Log::debug($e->getMessage()); - $this->error = "Connection refused - ".(string) $e->getMessage(); + $this->error = 'Connection refused - '.(string) $e->getMessage(); } catch (\GuzzleHttp\Exception\ServerException $e) { Log::debug($e->getMessage()); $this->error = (string) $e->getResponse()->getBody(); } $this->error = 'General error connecting with API'; + return $res; } public function login() { - } - public function normaliseurl($url, $addslash=true) + public function normaliseurl($url, $addslash = true) { - $url = rtrim($url, '/'); - if($addslash) $url .= '/'; + if ($addslash) { + $url .= '/'; + } return $url; - } - public function getLiveStats($status, $data) { $className = get_class($this); @@ -101,8 +104,9 @@ abstract class SupportedApps $name = end($explode); $html = view('SupportedApps::'.$name.'.livestats', $data)->with('data', $data)->render(); + return json_encode(['status' => $status, 'html' => $html]); - //return + //return } public static function getList() @@ -110,14 +114,17 @@ abstract class SupportedApps // $list_url = 'https://apps.heimdall.site/list'; $list_url = config('app.appsource').'list.json'; $client = new Client(['http_errors' => false, 'timeout' => 15, 'connect_timeout' => 15]); + return $client->request('GET', $list_url); } - public static function configValue($item=null, $key=null) + public static function configValue($item = null, $key = null) { - if(isset($item) && !empty($item)) { + if (isset($item) && ! empty($item)) { return $item->getconfig()->$key; - } else return null; + } else { + return null; + } } public static function getFiles($app) @@ -127,7 +134,7 @@ abstract class SupportedApps $client = new Client(['http_errors' => false, 'timeout' => 60, 'connect_timeout' => 15]); $res = $client->request('GET', $zipurl); - if(!file_exists(app_path('SupportedApps'))) { + if (! file_exists(app_path('SupportedApps'))) { mkdir(app_path('SupportedApps'), 0777, true); } @@ -146,7 +153,7 @@ abstract class SupportedApps } public static function saveApp($details, $app) - { + { $app->appid = $details->appid; $app->name = $details->name; $app->sha = $details->sha ?? null; @@ -156,12 +163,12 @@ abstract class SupportedApps $appclass = $app->class(); $application = new $appclass; - $enhanced = (bool)($application instanceof \App\EnhancedApps); + $enhanced = (bool) ($application instanceof \App\EnhancedApps); $app->class = $appclass; $app->enhanced = $enhanced; $app->tile_background = $details->tile_background; $app->save(); - return $app; - } -} \ No newline at end of file + return $app; + } +} diff --git a/app/User.php b/app/User.php index e4a68e9c..8a8a76f1 100644 --- a/app/User.php +++ b/app/User.php @@ -2,8 +2,8 @@ namespace App; -use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Notifications\Notifiable; class User extends Authenticatable { @@ -49,15 +49,13 @@ class User extends Authenticatable if ($current_user) { // if logged in, set this user return $current_user; } else { // not logged in, get first user - $user = User::where('public_front',true)->first(); - if(!$user) { - $user = User::first(); + $user = self::where('public_front', true)->first(); + if (! $user) { + $user = self::first(); } session(['current_user' => $user]); + return $user; } - } - - } diff --git a/config/app.php b/config/app.php index b6024368..7a0e17b4 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | */ - 'name' => env('APP_NAME', 'Heimdall'), + 'name' => env('APP_NAME', 'Heimdall'), 'version' => '2.4.5', /* @@ -56,7 +56,6 @@ return [ 'url' => env('APP_URL', 'http://localhost'), 'appsource' => env('APP_SOURCE', 'https://appslist.heimdall.site/'), - /* |-------------------------------------------------------------------------- | Application Timezone diff --git a/config/logging.php b/config/logging.php index 822194ca..088c204e 100644 --- a/config/logging.php +++ b/config/logging.php @@ -101,4 +101,4 @@ return [ ], ], -]; \ No newline at end of file +]; diff --git a/database/migrations/2018_01_27_155922_create_items_table.php b/database/migrations/2018_01_27_155922_create_items_table.php index 66bf466e..fafb90f2 100644 --- a/database/migrations/2018_01_27_155922_create_items_table.php +++ b/database/migrations/2018_01_27_155922_create_items_table.php @@ -1,8 +1,8 @@ string('appid')->unique(); $table->string('name')->unique(); $table->string('sha')->unique()->nullable(); diff --git a/database/migrations/2018_10_23_132008_add_class_to_items_table.php b/database/migrations/2018_10_23_132008_add_class_to_items_table.php index a016db61..297ae501 100644 --- a/database/migrations/2018_10_23_132008_add_class_to_items_table.php +++ b/database/migrations/2018_10_23_132008_add_class_to_items_table.php @@ -1,8 +1,8 @@ id = 1; $setting_group->title = 'app.settings.system'; @@ -24,7 +24,7 @@ class SettingsSeeder extends Seeder $setting_group->title = 'app.settings.system'; $setting_group->save(); } - if(!$setting_group = SettingGroup::find(2)) { + if (! $setting_group = SettingGroup::find(2)) { $setting_group = new SettingGroup; $setting_group->id = 2; $setting_group->title = 'app.settings.appearance'; @@ -34,7 +34,7 @@ class SettingsSeeder extends Seeder $setting_group->title = 'app.settings.appearance'; $setting_group->save(); } - if(!$setting_group = SettingGroup::find(3)) { + if (! $setting_group = SettingGroup::find(3)) { $setting_group = new SettingGroup; $setting_group->id = 3; $setting_group->title = 'app.settings.miscellaneous'; @@ -44,7 +44,7 @@ class SettingsSeeder extends Seeder $setting_group->title = 'app.settings.miscellaneous'; $setting_group->save(); } - if(!$setting_group = SettingGroup::find(4)) { + if (! $setting_group = SettingGroup::find(4)) { $setting_group = new SettingGroup; $setting_group->id = 4; $setting_group->title = 'app.settings.advanced'; @@ -55,7 +55,7 @@ class SettingsSeeder extends Seeder $setting_group->save(); } - if($version = Setting::find(1)) { + if ($version = Setting::find(1)) { $version->label = 'app.settings.version'; $version->value = config('app.version'); $version->save(); @@ -71,7 +71,7 @@ class SettingsSeeder extends Seeder $setting->save(); } - if(!$setting = Setting::find(2)) { + if (! $setting = Setting::find(2)) { $setting = new Setting; $setting->id = 2; $setting->group_id = 2; @@ -83,7 +83,7 @@ class SettingsSeeder extends Seeder $setting->label = 'app.settings.background_image'; $setting->save(); } - if(!$setting = Setting::find(3)) { + if (! $setting = Setting::find(3)) { $setting = new Setting; $setting->id = 3; $setting->group_id = 3; @@ -105,8 +105,7 @@ class SettingsSeeder extends Seeder 'startpage' => 'app.options.startpage', ]); - if(!$setting = Setting::find(4)) { - + if (! $setting = Setting::find(4)) { $setting = new Setting; $setting->id = 4; $setting->group_id = 3; @@ -121,7 +120,6 @@ class SettingsSeeder extends Seeder $setting->save(); } - $language_options = json_encode([ 'de' => 'Deutsch (German)', 'en' => 'English', @@ -135,7 +133,7 @@ class SettingsSeeder extends Seeder 'es' => 'Español (Spanish)', 'tr' => 'Türkçe (Turkish)', ]); - if($languages = Setting::find(5)) { + if ($languages = Setting::find(5)) { $languages->options = $language_options; $languages->save(); } else { @@ -156,8 +154,7 @@ class SettingsSeeder extends Seeder '_blank' => 'app.settings.window_target.new', ]); - if(!$setting = Setting::find(7)) { - + if (! $setting = Setting::find(7)) { $setting = new Setting; $setting->id = 7; $setting->group_id = 3; @@ -173,7 +170,7 @@ class SettingsSeeder extends Seeder $setting->save(); } - if($support = Setting::find(8)) { + if ($support = Setting::find(8)) { $support->label = 'app.settings.support'; $support->value = 'Discord | Github | Blog'; $support->save(); @@ -189,7 +186,7 @@ class SettingsSeeder extends Seeder $setting->save(); } - if($donate = Setting::find(9)) { + if ($donate = Setting::find(9)) { $donate->label = 'app.settings.donate'; $donate->value = 'Paypal'; $donate->save(); @@ -204,8 +201,8 @@ class SettingsSeeder extends Seeder $setting->system = true; $setting->save(); } - - if(!$setting = Setting::find(10)) { + + if (! $setting = Setting::find(10)) { $setting = new Setting; $setting->id = 10; $setting->group_id = 4; @@ -221,7 +218,7 @@ class SettingsSeeder extends Seeder $setting->save(); } - if(!$setting = Setting::find(11)) { + if (! $setting = Setting::find(11)) { $setting = new Setting; $setting->id = 11; $setting->group_id = 4; @@ -237,7 +234,7 @@ class SettingsSeeder extends Seeder $setting->save(); } - if(!$home_tag = \App\Item::find(0)) { + if (! $home_tag = \App\Item::find(0)) { $home_tag = new \App\Item; $home_tag->id = 0; $home_tag->title = 'app.dashboard'; @@ -248,11 +245,12 @@ class SettingsSeeder extends Seeder $home_tag->save(); $homeapps = \App\Item::withoutGlobalScope('user_id')->doesntHave('parents')->get(); - foreach($homeapps as $app) { - if($app->id === 0) continue; + foreach ($homeapps as $app) { + if ($app->id === 0) { + continue; + } $app->parents()->attach(0); } } - } } diff --git a/database/seeds/UsersSeeder.php b/database/seeds/UsersSeeder.php index e7454ec3..869dbf99 100644 --- a/database/seeds/UsersSeeder.php +++ b/database/seeds/UsersSeeder.php @@ -1,7 +1,7 @@ id = 1; $user->username = 'admin'; diff --git a/resources/lang/br/app.php b/resources/lang/br/app.php index 7821b1d0..c8b5e758 100644 --- a/resources/lang/br/app.php +++ b/resources/lang/br/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'busca', 'settings.no_items' => 'Nenhum item encontrado', - 'settings.label' => 'Rótulo', 'settings.value' => 'Valor', 'settings.edit' => 'Editar', diff --git a/resources/lang/cn/app.php b/resources/lang/cn/app.php index 2fd7ea98..2e15e7d0 100644 --- a/resources/lang/cn/app.php +++ b/resources/lang/cn/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => '搜索', 'settings.no_items' => '没有可用项目', - 'settings.label' => '设置项', 'settings.value' => '内容', 'settings.edit' => '编辑', @@ -95,7 +94,7 @@ return [ 'title' => '标题', 'delete' => '删除', 'optional' => '可选', - 'restore' => '复位', + 'restore' => '复位', 'alert.success.item_created' => '应用添加成功', 'alert.success.item_updated' => '应用更新成功', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => '用户删除成功', 'alert.success.user_restored' => '用户复位成功', - ]; diff --git a/resources/lang/da/app.php b/resources/lang/da/app.php index 8e31072f..ef1a8d3f 100644 --- a/resources/lang/da/app.php +++ b/resources/lang/da/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'søg', 'settings.no_items' => 'Intet fundet', - 'settings.label' => 'Etiket', 'settings.value' => 'Værdi', 'settings.edit' => 'Rediger', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => 'Bruger slettet med succes', 'alert.success.user_restored' => 'Bruger genskabt med succes', - ]; diff --git a/resources/lang/da/passwords.php b/resources/lang/da/passwords.php index 9303a558..7af6129b 100644 --- a/resources/lang/da/passwords.php +++ b/resources/lang/da/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Din adgangskode er nulstillet!', 'sent' => 'Vi har sendt dig en e-mail med et link til nulstilling af adgangskode!', 'token' => 'Dit token er ikke gyldigt!', - 'user' => "Vi kan ikke finde en bruger med den e-mail-adresse.", + 'user' => 'Vi kan ikke finde en bruger med den e-mail-adresse.', ]; diff --git a/resources/lang/de/app.php b/resources/lang/de/app.php index 474231a5..4bb93c24 100644 --- a/resources/lang/de/app.php +++ b/resources/lang/de/app.php @@ -1,60 +1,60 @@ 'System', - 'settings.appearance' => 'Aussehen', - 'settings.miscellaneous' => 'Sonstiges', - 'settings.version' => 'Version', - 'settings.background_image' => 'Hintergrundbild', - 'settings.homepage_search' => 'Startseite Sucheingabe', - 'settings.search_provider' => 'Suchanbieter', - 'settings.language' => 'Sprache', - 'settings.reset' => 'Zurücksetzen auf Standard', - 'settings.remove' => 'Entfernen', - 'settings.search' => 'suche', - 'settings.no_items' => 'Keine Elemente gefunden', - 'settings.label' => 'Bezeichnung', - 'settings.value' => 'Wert', - 'settings.edit' => 'Bearbeiten', - 'settings.view' => 'Ansicht', - 'options.none' => '- nicht festgelegt -', - 'options.google' => 'Google', - 'options.ddg' => 'DuckDuckGo', - 'options.bing' => 'Bing', - 'options.qwant' => 'Qwant', - 'options.yes' => 'Ja', - 'options.no' => 'Nein', - 'buttons.save' => 'Speichern', - 'buttons.cancel' => 'Abbrechen', - 'buttons.add' => 'Hinzufügen', - 'buttons.upload' => 'Hochladen einer Datei', - 'dash.pin_item' => 'Element auf dem Dashboard anheften', - 'dash.no_apps' => 'Derzeit gibt es keine angeheftete Anwendungen. :link1 oder :link2', - 'dash.link1' => 'Anwendung neu hinzufügen', - 'dash.link2' => 'anheften', - 'dash.pinned_items' => 'Angeheftete Elemente', - 'apps.app_list' => 'Anwendungsliste', - 'apps.view_trash' => 'Ansicht Papierkorb', - 'apps.add_application' => 'Anwendung hinzufügen', - 'apps.application_name' => 'Anwendungsname', - 'apps.colour' => 'Farbe', - 'apps.icon' => 'Symbol', - 'apps.pinned' => 'Angeheftet', - 'apps.title' => 'Titel', - 'apps.hex' => 'Hex-Farbe', - 'apps.username' => 'Benutzername', - 'apps.password' => 'Passwort', - 'apps.config' => 'Konfiguration', - 'apps.only_admin_account' => 'Nur mit Admin-Konto!', - 'url' => 'URL', - 'title' => 'Titel', - 'delete' => 'Löschen', - 'optional' => 'Optional', - 'restore' => 'Wiederherstellen', - 'alert.success.item_created' => 'Element erfolgreich erstellt', - 'alert.success.item_updated' => 'Element erfolgreich aktualisiert', - 'alert.success.item_deleted' => 'Element erfolgreich gelöscht', - 'alert.success.item_restored' => 'Element erfolgreich wiederhergestellt', - 'alert.success.setting_updated' => 'Die Einstellungen wurden übernommen', - 'alert.error.not_exist' => 'Diese Einstellung existiert nicht.', -); \ No newline at end of file +return [ + 'settings.system' => 'System', + 'settings.appearance' => 'Aussehen', + 'settings.miscellaneous' => 'Sonstiges', + 'settings.version' => 'Version', + 'settings.background_image' => 'Hintergrundbild', + 'settings.homepage_search' => 'Startseite Sucheingabe', + 'settings.search_provider' => 'Suchanbieter', + 'settings.language' => 'Sprache', + 'settings.reset' => 'Zurücksetzen auf Standard', + 'settings.remove' => 'Entfernen', + 'settings.search' => 'suche', + 'settings.no_items' => 'Keine Elemente gefunden', + 'settings.label' => 'Bezeichnung', + 'settings.value' => 'Wert', + 'settings.edit' => 'Bearbeiten', + 'settings.view' => 'Ansicht', + 'options.none' => '- nicht festgelegt -', + 'options.google' => 'Google', + 'options.ddg' => 'DuckDuckGo', + 'options.bing' => 'Bing', + 'options.qwant' => 'Qwant', + 'options.yes' => 'Ja', + 'options.no' => 'Nein', + 'buttons.save' => 'Speichern', + 'buttons.cancel' => 'Abbrechen', + 'buttons.add' => 'Hinzufügen', + 'buttons.upload' => 'Hochladen einer Datei', + 'dash.pin_item' => 'Element auf dem Dashboard anheften', + 'dash.no_apps' => 'Derzeit gibt es keine angeheftete Anwendungen. :link1 oder :link2', + 'dash.link1' => 'Anwendung neu hinzufügen', + 'dash.link2' => 'anheften', + 'dash.pinned_items' => 'Angeheftete Elemente', + 'apps.app_list' => 'Anwendungsliste', + 'apps.view_trash' => 'Ansicht Papierkorb', + 'apps.add_application' => 'Anwendung hinzufügen', + 'apps.application_name' => 'Anwendungsname', + 'apps.colour' => 'Farbe', + 'apps.icon' => 'Symbol', + 'apps.pinned' => 'Angeheftet', + 'apps.title' => 'Titel', + 'apps.hex' => 'Hex-Farbe', + 'apps.username' => 'Benutzername', + 'apps.password' => 'Passwort', + 'apps.config' => 'Konfiguration', + 'apps.only_admin_account' => 'Nur mit Admin-Konto!', + 'url' => 'URL', + 'title' => 'Titel', + 'delete' => 'Löschen', + 'optional' => 'Optional', + 'restore' => 'Wiederherstellen', + 'alert.success.item_created' => 'Element erfolgreich erstellt', + 'alert.success.item_updated' => 'Element erfolgreich aktualisiert', + 'alert.success.item_deleted' => 'Element erfolgreich gelöscht', + 'alert.success.item_restored' => 'Element erfolgreich wiederhergestellt', + 'alert.success.setting_updated' => 'Die Einstellungen wurden übernommen', + 'alert.error.not_exist' => 'Diese Einstellung existiert nicht.', +]; diff --git a/resources/lang/el/app.php b/resources/lang/el/app.php index bb16f41a..c260533e 100644 --- a/resources/lang/el/app.php +++ b/resources/lang/el/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'αναζήτηση', 'settings.no_items' => 'Δε βρεθηκαν αποτελέσματα', - 'settings.label' => 'Ετικέτα', 'settings.value' => 'Τιμή', 'settings.edit' => 'Επεξεργασία', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => 'Ο χρήστης διαγράφηκε επιτυχώς', 'alert.success.user_restored' => 'Ο χρήστης επαναφέρθηκε επιτυχώς', - ]; diff --git a/resources/lang/el/passwords.php b/resources/lang/el/passwords.php index 4ecdc14a..70d32746 100644 --- a/resources/lang/el/passwords.php +++ b/resources/lang/el/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Έχει γίνει επαναφορά του κωδικού σας!', 'sent' => 'Σας στείλαμε ένα Ε-mail με τον σύνδεσμο για την επαναφορά του κωδικού πρόσβασής σας!', 'token' => 'Αυτό το token για την επαναφορά του κωδικού πρόσβασής σας είναι άκυρο.', - 'user' => "Δεν μπορούμε να βρόυμε κάποιον χρήστη με αυτή τη διεύθυνση E-mail.", + 'user' => 'Δεν μπορούμε να βρόυμε κάποιον χρήστη με αυτή τη διεύθυνση E-mail.', ]; diff --git a/resources/lang/en/app.php b/resources/lang/en/app.php index 5943b36f..4bcf007a 100644 --- a/resources/lang/en/app.php +++ b/resources/lang/en/app.php @@ -13,7 +13,7 @@ return [ 'settings.appearance' => 'Appearance', 'settings.miscellaneous' => 'Miscellaneous', 'settings.advanced' => 'Advanced', - + 'settings.support' => 'Support', 'settings.donate' => 'Donate', @@ -35,7 +35,7 @@ return [ 'settings.value' => 'Value', 'settings.edit' => 'Edit', 'settings.view' => 'View', - + 'settings.custom_css' => 'Custom CSS', 'settings.custom_js' => 'Custom JavaScript', @@ -125,5 +125,4 @@ return [ 'alert.success.user_deleted' => 'User deleted successfully', 'alert.success.user_restored' => 'User restored successfully', - ]; diff --git a/resources/lang/es/app.php b/resources/lang/es/app.php index e585d7b0..def144e2 100644 --- a/resources/lang/es/app.php +++ b/resources/lang/es/app.php @@ -1,60 +1,60 @@ 'Sistema', - 'settings.appearance' => 'Apariencia', - 'settings.miscellaneous' => 'Miscelánea', - 'settings.version' => 'Versión', - 'settings.background_image' => 'Imagen De Fondo', - 'settings.homepage_search' => 'Página De Inicio De Búsqueda', - 'settings.search_provider' => 'Proveedor de búsqueda', - 'settings.language' => 'Idioma', - 'settings.reset' => 'Restablecer a predeterminado', - 'settings.remove' => 'Quitar', - 'settings.search' => 'búsqueda', - 'settings.no_items' => 'No se encontraron elementos', - 'settings.label' => 'Etiqueta', - 'settings.value' => 'Valor', - 'settings.edit' => 'Editar', - 'settings.view' => 'Ver', - 'options.none' => '- no establecido -', - 'options.google' => 'Google', - 'options.ddg' => 'DuckDuckGo', - 'options.bing' => 'Bing', - 'options.qwant' => 'Qwant', - 'options.jackett' => 'Jackett', - 'options.yes' => 'Sí', - 'options.no' => 'No', - 'buttons.save' => 'Guardar', - 'buttons.cancel' => 'Cancelar', - 'buttons.add' => 'Añadir', - 'buttons.upload' => 'Cargar un archivo', - 'dash.pin_item' => 'Pin elemento al tablero', - 'dash.no_apps' => 'Actualmente no hay aplicaciones ancladas, :link1 o :link2', - 'dash.link1' => 'Agregue una aplicación aquí', - 'dash.link2' => 'Pin de un elemento en el tablero', - 'dash.pinned_items' => 'Elementos Anclados', - 'apps.app_list' => 'Lista de aplicaciones', - 'apps.view_trash' => 'Vista de la papelera de reciclaje', - 'apps.add_application' => 'Agregar aplicación', - 'apps.application_name' => 'Nombre de la aplicación', - 'apps.colour' => 'Color', - 'apps.icon' => 'Icono', - 'apps.pinned' => 'Fijado', - 'apps.title' => 'Título', - 'apps.hex' => 'Código de color hexadecimal', - 'apps.username' => 'Nombre de usuario', - 'apps.password' => 'Contraseña', - 'apps.config' => 'Config', - 'url' => 'Url', - 'title' => 'Título', - 'delete' => 'Borrar', - 'optional' => 'Opcional', - 'restore' => 'Restaurar', - 'alert.success.item_created' => 'Elemento creado con éxito', - 'alert.success.item_updated' => 'Artículo actualizado con éxito', - 'alert.success.item_deleted' => 'Elemento eliminado correctamente', - 'alert.success.item_restored' => 'Elemento restaurado con éxito', - 'alert.success.setting_updated' => 'Ha editado con éxito esta configuración', - 'alert.error.not_exist' => 'Esta configuración no existe.', -); +return [ + 'settings.system' => 'Sistema', + 'settings.appearance' => 'Apariencia', + 'settings.miscellaneous' => 'Miscelánea', + 'settings.version' => 'Versión', + 'settings.background_image' => 'Imagen De Fondo', + 'settings.homepage_search' => 'Página De Inicio De Búsqueda', + 'settings.search_provider' => 'Proveedor de búsqueda', + 'settings.language' => 'Idioma', + 'settings.reset' => 'Restablecer a predeterminado', + 'settings.remove' => 'Quitar', + 'settings.search' => 'búsqueda', + 'settings.no_items' => 'No se encontraron elementos', + 'settings.label' => 'Etiqueta', + 'settings.value' => 'Valor', + 'settings.edit' => 'Editar', + 'settings.view' => 'Ver', + 'options.none' => '- no establecido -', + 'options.google' => 'Google', + 'options.ddg' => 'DuckDuckGo', + 'options.bing' => 'Bing', + 'options.qwant' => 'Qwant', + 'options.jackett' => 'Jackett', + 'options.yes' => 'Sí', + 'options.no' => 'No', + 'buttons.save' => 'Guardar', + 'buttons.cancel' => 'Cancelar', + 'buttons.add' => 'Añadir', + 'buttons.upload' => 'Cargar un archivo', + 'dash.pin_item' => 'Pin elemento al tablero', + 'dash.no_apps' => 'Actualmente no hay aplicaciones ancladas, :link1 o :link2', + 'dash.link1' => 'Agregue una aplicación aquí', + 'dash.link2' => 'Pin de un elemento en el tablero', + 'dash.pinned_items' => 'Elementos Anclados', + 'apps.app_list' => 'Lista de aplicaciones', + 'apps.view_trash' => 'Vista de la papelera de reciclaje', + 'apps.add_application' => 'Agregar aplicación', + 'apps.application_name' => 'Nombre de la aplicación', + 'apps.colour' => 'Color', + 'apps.icon' => 'Icono', + 'apps.pinned' => 'Fijado', + 'apps.title' => 'Título', + 'apps.hex' => 'Código de color hexadecimal', + 'apps.username' => 'Nombre de usuario', + 'apps.password' => 'Contraseña', + 'apps.config' => 'Config', + 'url' => 'Url', + 'title' => 'Título', + 'delete' => 'Borrar', + 'optional' => 'Opcional', + 'restore' => 'Restaurar', + 'alert.success.item_created' => 'Elemento creado con éxito', + 'alert.success.item_updated' => 'Artículo actualizado con éxito', + 'alert.success.item_deleted' => 'Elemento eliminado correctamente', + 'alert.success.item_restored' => 'Elemento restaurado con éxito', + 'alert.success.setting_updated' => 'Ha editado con éxito esta configuración', + 'alert.error.not_exist' => 'Esta configuración no existe.', +]; diff --git a/resources/lang/fi/app.php b/resources/lang/fi/app.php index d77fdb0e..c95e6624 100644 --- a/resources/lang/fi/app.php +++ b/resources/lang/fi/app.php @@ -1,115 +1,104 @@ 'Järjestelmä', - 'settings.appearance' => 'Ulkonäkö', - 'settings.miscellaneous' => 'Sekalainen', - 'settings.support' => 'Tue', - 'settings.donate' => 'Lahjoita', +return [ + 'settings.system' => 'Järjestelmä', + 'settings.appearance' => 'Ulkonäkö', + 'settings.miscellaneous' => 'Sekalainen', + 'settings.support' => 'Tue', + 'settings.donate' => 'Lahjoita', - 'settings.version' => 'Versio', - 'settings.background_image' => 'Taustakuva', - 'settings.window_target' => 'Linkit aukeaa', - 'settings.window_target.current' => 'Avaa tässä välilehdessä', - 'settings.window_target.one' => 'Avaa samassa välilehdessä', - 'settings.window_target.new' => 'Avaa uudessa välilehdessä', - 'settings.homepage_search' => 'Kotisivu Haku', - 'settings.search_provider' => 'Hakupalvelu', - 'settings.language' => 'Kieli', - 'settings.reset' => 'Palauta oletusasetukset', - 'settings.remove' => 'Poista', - 'settings.search' => 'haku', - 'settings.no_items' => 'Kohteita ei löytynyt', + 'settings.version' => 'Versio', + 'settings.background_image' => 'Taustakuva', + 'settings.window_target' => 'Linkit aukeaa', + 'settings.window_target.current' => 'Avaa tässä välilehdessä', + 'settings.window_target.one' => 'Avaa samassa välilehdessä', + 'settings.window_target.new' => 'Avaa uudessa välilehdessä', + 'settings.homepage_search' => 'Kotisivu Haku', + 'settings.search_provider' => 'Hakupalvelu', + 'settings.language' => 'Kieli', + 'settings.reset' => 'Palauta oletusasetukset', + 'settings.remove' => 'Poista', + 'settings.search' => 'haku', + 'settings.no_items' => 'Kohteita ei löytynyt', + 'settings.label' => 'Etiketti', + 'settings.value' => 'Arvo', + 'settings.edit' => 'Muokkaa', + 'settings.view' => 'Näkymä', - 'settings.label' => 'Etiketti', - 'settings.value' => 'Arvo', - 'settings.edit' => 'Muokkaa', - 'settings.view' => 'Näkymä', + 'options.none' => '- ei asetettu -', + 'options.google' => 'Google', + 'options.ddg' => 'DuckDuckGo', + 'options.bing' => 'Bing', + 'options.qwant' => 'Qwant', + 'options.startpage' => 'Etusivu', + 'options.yes' => 'Kyllä', + 'options.no' => 'Ei', + 'buttons.save' => 'Tallenna', + 'buttons.cancel' => 'Peruuta', + 'buttons.add' => 'Lisää', + 'buttons.upload' => 'Lataa tiedosto', + 'buttons.downloadapps' => 'Päivitä sovelluslistaa', - 'options.none' => '- ei asetettu -', - 'options.google' => 'Google', - 'options.ddg' => 'DuckDuckGo', - 'options.bing' => 'Bing', - 'options.qwant' => 'Qwant', - 'options.startpage' => 'Etusivu', - 'options.yes' => 'Kyllä', - 'options.no' => 'Ei', + 'dash.pin_item' => 'Kiinnitä kohde hallintapaneliin', + 'dash.no_apps' => 'Tällä hetkellä ei ole kiinnitettyjä sovelluksia :link1 tai :link2', + 'dash.link1' => 'Lisää sovellus tähän', + 'dash.link2' => 'Kiinnitä kohde hallintapaneliin', + 'dash.pinned_items' => 'Kiinnitetyt Kohteet', + 'apps.app_list' => 'Sovellusluettelo', + 'apps.view_trash' => 'Näytä roskakori', + 'apps.add_application' => 'Lisää sovellus', + 'apps.application_name' => 'Sovelluksen nimi', + 'apps.colour' => 'Väri', + 'apps.icon' => 'Kuvake', + 'apps.pinned' => 'Kiinnitetty', + 'apps.title' => 'Otsikko', + 'apps.hex' => 'Hex väri', + 'apps.username' => 'Käyttäjätunnus', + 'apps.password' => 'Salasana', + 'apps.config' => 'Konfiguraatio', + 'apps.apikey' => 'API Avain', + 'apps.enable' => 'Aktivoi', + 'apps.tag_list' => 'Tagi lista', + 'apps.add_tag' => 'Lisää tagi', + 'apps.tag_name' => 'Tagin nimi', + 'apps.tags' => 'Tagit', + 'apps.override' => 'Jos eri kuin pää-osoite', + 'apps.preview' => 'Esikatsele', - 'buttons.save' => 'Tallenna', - 'buttons.cancel' => 'Peruuta', - 'buttons.add' => 'Lisää', - 'buttons.upload' => 'Lataa tiedosto', - 'buttons.downloadapps' => 'Päivitä sovelluslistaa', + 'user.user_list' => 'Käyttäjät', + 'user.add_user' => 'Lisää käyttäjä', + 'user.username' => 'Käyttäjänimi', + 'user.avatar' => 'Avatar', + 'user.email' => 'Sähköposti', + 'user.password_confirm' => 'Vahvista salasana', + 'user.secure_front' => 'Salli yleinen pääsy etusivulle - Pakotetaan ainoastaan jos salasana on asetettu.', + 'user.autologin' => 'Salli sisäänkirjautuminen tietystä URLista. Linkilläk uka tahansa pystyy kirjautua.', + 'url' => 'Url', + 'title' => 'Otsikko', + 'delete' => 'Poistaa', + 'optional' => 'Valinnainen', + 'restore' => 'Palauta', - 'dash.pin_item' => 'Kiinnitä kohde hallintapaneliin', - 'dash.no_apps' => 'Tällä hetkellä ei ole kiinnitettyjä sovelluksia :link1 tai :link2', - 'dash.link1' => 'Lisää sovellus tähän', - 'dash.link2' => 'Kiinnitä kohde hallintapaneliin', - 'dash.pinned_items' => 'Kiinnitetyt Kohteet', + 'alert.success.item_created' => 'Kohde luotu onnistuneesti', + 'alert.success.item_updated' => 'Kohde päivitetty onnistuneesti', + 'alert.success.item_deleted' => 'Kohde poistettu onnistuneesti', + 'alert.success.item_restored' => 'Kohde palautettu onnistuneesti', + 'alert.success.tag_created' => 'Tagi luotu onnistuneesti', + 'alert.success.tag_updated' => 'Tagi päivitetty onnistuneesti', + 'alert.success.tag_deleted' => 'Tagi poistettu onnistuneesti', + 'alert.success.tag_restored' => 'Tagi palautettu onnistuneesti', + 'alert.success.updating' => 'Päivitetään sovelluslistaa', - 'apps.app_list' => 'Sovellusluettelo', - 'apps.view_trash' => 'Näytä roskakori', - 'apps.add_application' => 'Lisää sovellus', - 'apps.application_name' => 'Sovelluksen nimi', - 'apps.colour' => 'Väri', - 'apps.icon' => 'Kuvake', - 'apps.pinned' => 'Kiinnitetty', - 'apps.title' => 'Otsikko', - 'apps.hex' => 'Hex väri', - 'apps.username' => 'Käyttäjätunnus', - 'apps.password' => 'Salasana', - 'apps.config' => 'Konfiguraatio', - 'apps.apikey' => 'API Avain', - 'apps.enable' => 'Aktivoi', - 'apps.tag_list' => 'Tagi lista', - 'apps.add_tag' => 'Lisää tagi', - 'apps.tag_name' => 'Tagin nimi', - 'apps.tags' => 'Tagit', - 'apps.override' => 'Jos eri kuin pää-osoite', - 'apps.preview' => 'Esikatsele', + 'alert.success.setting_updated' => 'Asetus muokattu onnistuneesti', + 'alert.error.not_exist' => 'Tätä asetusta ei ole olemassa.', - - 'user.user_list' => 'Käyttäjät', - 'user.add_user' => 'Lisää käyttäjä', - 'user.username' => 'Käyttäjänimi', - 'user.avatar' => 'Avatar', - 'user.email' => 'Sähköposti', - 'user.password_confirm' => 'Vahvista salasana', - 'user.secure_front' => 'Salli yleinen pääsy etusivulle - Pakotetaan ainoastaan jos salasana on asetettu.', - 'user.autologin' => 'Salli sisäänkirjautuminen tietystä URLista. Linkilläk uka tahansa pystyy kirjautua.', - - - 'url' => 'Url', - 'title' => 'Otsikko', - 'delete' => 'Poistaa', - 'optional' => 'Valinnainen', - 'restore' => 'Palauta', - - - 'alert.success.item_created' => 'Kohde luotu onnistuneesti', - 'alert.success.item_updated' => 'Kohde päivitetty onnistuneesti', - 'alert.success.item_deleted' => 'Kohde poistettu onnistuneesti', - 'alert.success.item_restored' => 'Kohde palautettu onnistuneesti', - - - 'alert.success.tag_created' => 'Tagi luotu onnistuneesti', - 'alert.success.tag_updated' => 'Tagi päivitetty onnistuneesti', - 'alert.success.tag_deleted' => 'Tagi poistettu onnistuneesti', - 'alert.success.tag_restored' => 'Tagi palautettu onnistuneesti', - 'alert.success.updating' => 'Päivitetään sovelluslistaa', - - - 'alert.success.setting_updated' => 'Asetus muokattu onnistuneesti', - 'alert.error.not_exist' => 'Tätä asetusta ei ole olemassa.', - - - 'alert.success.user_created' => 'Käyttäjä luotu onnistuneesti', - 'alert.success.user_updated' => 'Käyttäjä päivitetty onnistuneesti', - 'alert.success.user_deleted' => 'Käyttäjä poistettu onnistuneesti', - 'alert.success.user_restored' => 'Käyttäjä palautettu onnistuneesti', -); + 'alert.success.user_created' => 'Käyttäjä luotu onnistuneesti', + 'alert.success.user_updated' => 'Käyttäjä päivitetty onnistuneesti', + 'alert.success.user_deleted' => 'Käyttäjä poistettu onnistuneesti', + 'alert.success.user_restored' => 'Käyttäjä palautettu onnistuneesti', +]; diff --git a/resources/lang/fr/app.php b/resources/lang/fr/app.php index 620d1e01..3eb8d9c3 100644 --- a/resources/lang/fr/app.php +++ b/resources/lang/fr/app.php @@ -1,114 +1,114 @@ 'Système', - 'settings.appearance' => 'Apparence', - 'settings.miscellaneous' => 'Divers', - 'settings.support' => 'Support', - 'settings.donate' => 'Contribuer', - 'settings.advanced' => 'Options avancées', - - 'settings.version' => 'Version', - 'settings.background_image' => 'Image d\'arrière-plan', - 'settings.window_target' => 'Ouverture des liens', - 'settings.window_target.current' => 'Dans l\'onglet courant', - 'settings.window_target.one' => 'Dans le même nouvel onglet', - 'settings.window_target.new' => 'Dans un nouvel onglet', - 'settings.homepage_search' => 'Barre de recherche', - 'settings.search_provider' => 'Moteur de recherche', - 'settings.language' => 'Langue', - 'settings.reset' => 'Réinitialiser les valeurs par défaut', - 'settings.remove' => 'Supprimer', - 'settings.search' => 'Chercher', - 'settings.no_items' => 'Aucun élement trouvé', - - 'settings.label' => 'Étiquette', - 'settings.value' => 'Valeur', - 'settings.edit' => 'Modifier', - 'settings.view' => 'Vue', - - 'options.none' => '- non défini -', - 'options.google' => 'Google', - 'options.ddg' => 'DuckDuckGo', - 'options.bing' => 'Bing', - 'options.qwant' => 'Qwant', - 'options.startpage' => 'Page d\'accueil', - 'options.yes' => 'Oui', - 'options.no' => 'Non', - 'options.nzbhydra' => 'NZBHydra', - 'options.jackett' => 'Jackett', - - 'buttons.save' => 'Enregistrer', - 'buttons.cancel' => 'Annuler', - 'buttons.add' => 'Ajouter', - 'buttons.upload' => 'Choisir un fichier', - 'buttons.downloadapps' => 'Mettre à jour la liste', - - 'dash.pin_item' => 'Épingler l\'application au tableau de bord', - 'dash.no_apps' => 'Il n\'existe actuellement aucune application épinglée :link1 ou :link2', - 'dash.link1' => 'Ajouter une application', - 'dash.link2' => 'Épingler une application au tableau de bord', - 'dash.pinned_items' => 'Applications épinglées', - - 'apps.app_list' => 'Liste des applications', - 'apps.view_trash' => 'Voir la corbeille', - 'apps.add_application' => 'Ajouter une application', - 'apps.application_name' => 'Nom de l\'application', - 'apps.colour' => 'Couleur', - 'apps.icon' => 'Icône', - 'apps.pinned' => 'Épinglée', - 'apps.title' => 'Titre', - 'apps.hex' => 'Hexadécimal de la couleur', - 'apps.username' => 'Nom d\'utilisateur', - 'apps.password' => 'Mot de passe', - 'apps.config' => 'Config', - 'apps.apikey' => 'Clé de l\'API', - 'apps.enable' => 'Actif', - 'apps.tag_list' => 'Liste des labels', - 'apps.add_tag' => 'Ajouter un label', - 'apps.tag_name' => 'Nom du label', - 'apps.tags' => 'Labels', - 'apps.override' => 'Si différent de l\'url actuelle', - 'apps.preview' => 'Aperçu', - 'apps.apptype' => 'Type d\'application ', - 'apps.only_admin_account' => 'Seulement si vous avez un compte administrateur!', - 'apps.autologin_url' => 'URL de connexion automatique', - 'apps.show_deleted' => 'Afficher les applications supprimées', +return [ + 'settings.system' => 'Système', + 'settings.appearance' => 'Apparence', + 'settings.miscellaneous' => 'Divers', + 'settings.support' => 'Support', + 'settings.donate' => 'Contribuer', + 'settings.advanced' => 'Options avancées', - 'dashboard' => 'Tableau de bord', + 'settings.version' => 'Version', + 'settings.background_image' => 'Image d\'arrière-plan', + 'settings.window_target' => 'Ouverture des liens', + 'settings.window_target.current' => 'Dans l\'onglet courant', + 'settings.window_target.one' => 'Dans le même nouvel onglet', + 'settings.window_target.new' => 'Dans un nouvel onglet', + 'settings.homepage_search' => 'Barre de recherche', + 'settings.search_provider' => 'Moteur de recherche', + 'settings.language' => 'Langue', + 'settings.reset' => 'Réinitialiser les valeurs par défaut', + 'settings.remove' => 'Supprimer', + 'settings.search' => 'Chercher', + 'settings.no_items' => 'Aucun élement trouvé', - 'user.user_list' => 'Utilisateurs', - 'user.add_user' => 'Ajouter un utilisateur', - 'user.username' => 'Nom d\'utilisateur', - 'user.avatar' => 'Avatar', - 'user.email' => 'Email', - 'user.password_confirm' => 'Confirmer le mot de passe', - 'user.secure_front' => 'Autoriser l\'accès public au front - Uniquement appliqué si un mot de passe est défini.', - 'user.autologin' => 'Autorisez la connexion à partir d\'une URL spécifique. Toute personne disposant du lien peut se connecter.', + 'settings.label' => 'Étiquette', + 'settings.value' => 'Valeur', + 'settings.edit' => 'Modifier', + 'settings.view' => 'Vue', - 'url' => 'Url', - 'title' => 'Titre', - 'delete' => 'Effacer', - 'optional' => 'Optionnel', - 'restore' => 'Restaurer', - - 'alert.success.item_created' => 'Application créée avec succès', - 'alert.success.item_updated' => 'Application mise à jour avec succès', - 'alert.success.item_deleted' => 'Application supprimée avec succès', - 'alert.success.item_restored' => 'Application restaurée avec succès', - 'alert.success.updating' => 'Liste des applications mise à jour avec succès', - - 'alert.success.tag_created' => 'Label crée avec succès', - 'alert.success.tag_updated' => 'Label mis à jour avec succès', - 'alert.success.tag_deleted' => 'Label supprimé avec succès', - 'alert.success.tag_restored' => 'Label restauré avec succès', - - 'alert.success.setting_updated' => 'Paramètre mis à jour avec succès', - 'alert.error.not_exist' => 'Ce paramètre n\'existe pas.', - - 'alert.success.user_created' => 'Utilisateur crée avec succès', - 'alert.success.user_updated' => 'Utilisateur mis à jour avec succès', - 'alert.success.user_deleted' => 'Utilisateur supprimé avec succès', - 'alert.success.user_restored' => 'Utilisateur restoré avec succès', - -); + 'options.none' => '- non défini -', + 'options.google' => 'Google', + 'options.ddg' => 'DuckDuckGo', + 'options.bing' => 'Bing', + 'options.qwant' => 'Qwant', + 'options.startpage' => 'Page d\'accueil', + 'options.yes' => 'Oui', + 'options.no' => 'Non', + 'options.nzbhydra' => 'NZBHydra', + 'options.jackett' => 'Jackett', + + 'buttons.save' => 'Enregistrer', + 'buttons.cancel' => 'Annuler', + 'buttons.add' => 'Ajouter', + 'buttons.upload' => 'Choisir un fichier', + 'buttons.downloadapps' => 'Mettre à jour la liste', + + 'dash.pin_item' => 'Épingler l\'application au tableau de bord', + 'dash.no_apps' => 'Il n\'existe actuellement aucune application épinglée :link1 ou :link2', + 'dash.link1' => 'Ajouter une application', + 'dash.link2' => 'Épingler une application au tableau de bord', + 'dash.pinned_items' => 'Applications épinglées', + + 'apps.app_list' => 'Liste des applications', + 'apps.view_trash' => 'Voir la corbeille', + 'apps.add_application' => 'Ajouter une application', + 'apps.application_name' => 'Nom de l\'application', + 'apps.colour' => 'Couleur', + 'apps.icon' => 'Icône', + 'apps.pinned' => 'Épinglée', + 'apps.title' => 'Titre', + 'apps.hex' => 'Hexadécimal de la couleur', + 'apps.username' => 'Nom d\'utilisateur', + 'apps.password' => 'Mot de passe', + 'apps.config' => 'Config', + 'apps.apikey' => 'Clé de l\'API', + 'apps.enable' => 'Actif', + 'apps.tag_list' => 'Liste des labels', + 'apps.add_tag' => 'Ajouter un label', + 'apps.tag_name' => 'Nom du label', + 'apps.tags' => 'Labels', + 'apps.override' => 'Si différent de l\'url actuelle', + 'apps.preview' => 'Aperçu', + 'apps.apptype' => 'Type d\'application ', + 'apps.only_admin_account' => 'Seulement si vous avez un compte administrateur!', + 'apps.autologin_url' => 'URL de connexion automatique', + 'apps.show_deleted' => 'Afficher les applications supprimées', + + 'dashboard' => 'Tableau de bord', + + 'user.user_list' => 'Utilisateurs', + 'user.add_user' => 'Ajouter un utilisateur', + 'user.username' => 'Nom d\'utilisateur', + 'user.avatar' => 'Avatar', + 'user.email' => 'Email', + 'user.password_confirm' => 'Confirmer le mot de passe', + 'user.secure_front' => 'Autoriser l\'accès public au front - Uniquement appliqué si un mot de passe est défini.', + 'user.autologin' => 'Autorisez la connexion à partir d\'une URL spécifique. Toute personne disposant du lien peut se connecter.', + + 'url' => 'Url', + 'title' => 'Titre', + 'delete' => 'Effacer', + 'optional' => 'Optionnel', + 'restore' => 'Restaurer', + + 'alert.success.item_created' => 'Application créée avec succès', + 'alert.success.item_updated' => 'Application mise à jour avec succès', + 'alert.success.item_deleted' => 'Application supprimée avec succès', + 'alert.success.item_restored' => 'Application restaurée avec succès', + 'alert.success.updating' => 'Liste des applications mise à jour avec succès', + + 'alert.success.tag_created' => 'Label crée avec succès', + 'alert.success.tag_updated' => 'Label mis à jour avec succès', + 'alert.success.tag_deleted' => 'Label supprimé avec succès', + 'alert.success.tag_restored' => 'Label restauré avec succès', + + 'alert.success.setting_updated' => 'Paramètre mis à jour avec succès', + 'alert.error.not_exist' => 'Ce paramètre n\'existe pas.', + + 'alert.success.user_created' => 'Utilisateur crée avec succès', + 'alert.success.user_updated' => 'Utilisateur mis à jour avec succès', + 'alert.success.user_deleted' => 'Utilisateur supprimé avec succès', + 'alert.success.user_restored' => 'Utilisateur restoré avec succès', + +]; diff --git a/resources/lang/fr/passwords.php b/resources/lang/fr/passwords.php index a8cb6e39..9bd86bc1 100644 --- a/resources/lang/fr/passwords.php +++ b/resources/lang/fr/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Votre mot de passe a été réinitialisé!', 'sent' => 'Nous avons envoyé votre lien de réinitialisation de mot de passe par e-mail!', 'token' => 'Ce jeton de réinitialisation de mot de passe n\'est pas valide.', - 'user' => "Nous ne pouvons pas trouver un utilisateur avec cette adresse e-mail.", + 'user' => 'Nous ne pouvons pas trouver un utilisateur avec cette adresse e-mail.', ]; diff --git a/resources/lang/hu/app.php b/resources/lang/hu/app.php index 80e3233d..20d90d5f 100644 --- a/resources/lang/hu/app.php +++ b/resources/lang/hu/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'keresés', 'settings.no_items' => 'Nincs találat', - 'settings.label' => 'Címke', 'settings.value' => 'Érték', 'settings.edit' => 'Módosítás', @@ -90,8 +89,7 @@ return [ 'user.password_confirm' => 'Jelszó megerősítés', 'user.secure_front' => 'Nyilvános hozzáférés engedélyezése - Csak jelszó alkalmazása esetén.', 'user.autologin' => 'Bejelentkezés URL-el, Link birtokában bárki bejelentkezhet.', - - + 'url' => 'URL', 'title' => 'Cím', 'delete' => 'Törlés', @@ -117,5 +115,4 @@ return [ 'alert.success.user_deleted' => 'Felhasználó sikeresen törölve', 'alert.success.user_restored' => 'Felhasználó sikeresen visszaállítva', - ]; diff --git a/resources/lang/hu/passwords.php b/resources/lang/hu/passwords.php index c8417a74..c5a1c5a0 100644 --- a/resources/lang/hu/passwords.php +++ b/resources/lang/hu/passwords.php @@ -18,6 +18,6 @@ return [ 'reset' => 'A jelszó vissza lett állítva', 'sent' => 'A jelszó visszaállító e-mail elküldve!', 'token' => 'A jelszó visszaállító token nem érvényes', - 'user' => "Ezzel az e-mail címmel felhasználó nem található", + 'user' => 'Ezzel az e-mail címmel felhasználó nem található', ]; diff --git a/resources/lang/it/app.php b/resources/lang/it/app.php index 4a48d324..5266bc3f 100644 --- a/resources/lang/it/app.php +++ b/resources/lang/it/app.php @@ -1,4 +1,5 @@ 'Sistema', 'settings.appearance' => 'Aspetto', 'settings.miscellaneous' => 'Altre impostazioni', - 'settings.support' => 'Supporto', + 'settings.support' => 'Supporto', 'settings.donate' => 'Dona', - + 'settings.version' => 'Versione', 'settings.background_image' => 'Immagine di sfondo', - 'settings.window_target' => 'Apri link in', - 'settings.window_target.current' => 'Apri in questa scheda', + 'settings.window_target' => 'Apri link in', + 'settings.window_target.current' => 'Apri in questa scheda', 'settings.window_target.one' => 'Apri nella stessa scheda', 'settings.window_target.new' => 'Apri in una nuova scheda', 'settings.homepage_search' => 'Ricerca in homepage', @@ -25,34 +26,34 @@ return [ 'settings.remove' => 'Rimuovi', 'settings.search' => 'Cerca', 'settings.no_items' => 'Nessun elemento trovato', - - 'settings.label' => 'Nome', - 'settings.value' => 'Valore', - 'settings.edit' => 'Modifica', - 'settings.view' => 'Mostra', - + + 'settings.label' => 'Nome', + 'settings.value' => 'Valore', + 'settings.edit' => 'Modifica', + 'settings.view' => 'Mostra', + 'options.none' => '- non impostato -', 'options.google' => 'Google', 'options.ddg' => 'DuckDuckGo', 'options.bing' => 'Bing', 'options.qwant' => 'Qwant', - 'options.startpage' => 'StartPage', + 'options.startpage' => 'StartPage', 'options.yes' => 'Sì', 'options.no' => 'No', - 'options.nzbhydra' => 'NZBHydra', - + 'options.nzbhydra' => 'NZBHydra', + 'buttons.save' => 'Salva', 'buttons.cancel' => 'Annulla', 'buttons.add' => 'Aggiungi', 'buttons.upload' => 'Carica un file', - 'buttons.downloadapps' => 'Aggiorna lista app', - + 'buttons.downloadapps' => 'Aggiorna lista app', + 'dash.pin_item' => 'Fissa un elemento sulla dashboard', 'dash.no_apps' => 'Non ci sono applicazioni fissate, :link1 o :link2', 'dash.link1' => 'Aggiungi un\'applicazione qui', 'dash.link2' => 'Fissa un elemento alla dashboard', 'dash.pinned_items' => 'Elementi fissati', - + 'apps.app_list' => 'Lista applicazioni', 'apps.view_trash' => 'Mostra cestino', 'apps.add_application' => 'Aggiungi applicazione', @@ -67,47 +68,47 @@ return [ 'apps.config' => 'Configurazione', 'apps.apikey' => 'Chiave API', 'apps.enable' => 'Abilitato', - 'apps.tag_list' => 'Lista tag', + 'apps.tag_list' => 'Lista tag', 'apps.add_tag' => 'Aggiungi tag', 'apps.tag_name' => 'Nome tag', 'apps.tags' => 'Tag', 'apps.override' => 'Se diverso dall\'url principale', 'apps.preview' => 'Anteprima', 'apps.apptype' => 'Tipo di applicazione', - - 'dashboard' => 'Home dashboard', - - 'user.user_list' => 'Utenti', + + 'dashboard' => 'Home dashboard', + + 'user.user_list' => 'Utenti', 'user.add_user' => 'Aggiungi utente', 'user.username' => 'Username', 'user.avatar' => 'Logo', 'user.email' => 'Email', 'user.password_confirm' => 'Conferma password', 'user.secure_front' => 'Permetti accesso pubblico alla pagina principale - Vale solo se una password è stata definita.', - 'user.autologin' => 'Abilita login da una URL specifica. Chiunque con questa URL può accedere.', - + 'user.autologin' => 'Abilita login da una URL specifica. Chiunque con questa URL può accedere.', + 'url' => 'Url', 'title' => 'Titolo', - 'delete' => 'Elimina', - 'optional' => 'Opzionale', - 'restore' => 'Ripristina', - + 'delete' => 'Elimina', + 'optional' => 'Opzionale', + 'restore' => 'Ripristina', + 'alert.success.item_created' => 'Elemento creato con successo', 'alert.success.item_updated' => 'Elemento aggiornato con successo', 'alert.success.item_deleted' => 'Elemento cancellato con successo', 'alert.success.item_restored' => 'Elemento ripristinato con successo', - 'alert.success.updating' => 'Aggiornamento lista app', - - 'alert.success.tag_created' => 'Tag creato con successo', + 'alert.success.updating' => 'Aggiornamento lista app', + + 'alert.success.tag_created' => 'Tag creato con successo', 'alert.success.tag_updated' => 'Tag aggiornato con successo', 'alert.success.tag_deleted' => 'Tag eliminato con successo', 'alert.success.tag_restored' => 'Tag ripristinato con successo', - + 'alert.success.setting_updated' => 'Hai modificato questa impostazione con successo', 'alert.error.not_exist' => 'Questa impostazione non esiste.', - + 'alert.success.user_created' => 'Utente creato con successo', 'alert.success.user_updated' => 'Utente aggiornato con successo', 'alert.success.user_deleted' => 'Utente eliminato con successo', 'alert.success.user_restored' => 'Utente ripristinato con successo', -]; +]; diff --git a/resources/lang/it/auth.php b/resources/lang/it/auth.php index ae5a62e9..d18ce217 100644 --- a/resources/lang/it/auth.php +++ b/resources/lang/it/auth.php @@ -1,4 +1,5 @@ '검색', 'settings.no_items' => '항목을 찾을 수 없음', - 'settings.label' => '레이블', 'settings.value' => '값', 'settings.edit' => '편집', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => '사용자를 성공적으로 제거했습니다', 'alert.success.user_restored' => '사용자를 성공적으로 복원했습니다', - ]; diff --git a/resources/lang/ko/passwords.php b/resources/lang/ko/passwords.php index 657b4dbc..63436cae 100644 --- a/resources/lang/ko/passwords.php +++ b/resources/lang/ko/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => '암호가 재설정되었습니다!', 'sent' => '암호 재설정 링크를 전자 메일로 전송했습니다!', 'token' => '이 암호 재설정 토큰은 잘못되었습니다.', - 'user' => "해당 이메일 주소를 가진 사용자를 찾을 수 없습니다.", + 'user' => '해당 이메일 주소를 가진 사용자를 찾을 수 없습니다.', ]; diff --git a/resources/lang/nl/app.php b/resources/lang/nl/app.php index c10cd161..cd60ac01 100644 --- a/resources/lang/nl/app.php +++ b/resources/lang/nl/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'Zoeken', 'settings.no_items' => 'Geen items gevonden', - 'settings.label' => 'Label', 'settings.value' => 'Waarde', 'settings.edit' => 'Bewerken', @@ -91,7 +90,7 @@ return [ 'url' => 'URL', 'title' => 'Titel', 'delete' => 'Verwijderen', - 'optional' => 'Optioneel', + 'optional' => 'Optioneel', 'restore' => 'Herstellen', 'alert.success.item_created' => 'Item met succes aangemaakt', @@ -113,5 +112,4 @@ return [ 'alert.success.user_deleted' => 'Gebruiker met succes verwijderd', 'alert.success.user_restored' => 'Gebruiker met succes hersteld', - ]; diff --git a/resources/lang/nl/passwords.php b/resources/lang/nl/passwords.php index e5bd4b3b..c02abfa7 100644 --- a/resources/lang/nl/passwords.php +++ b/resources/lang/nl/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Uw wachtwoord is opnieuw ingesteld!', 'sent' => 'De link voor het opnieuw instellen van uw wachtwoord is naar u gemaild!', 'token' => 'Deze token voor het opnieuw instellen van een wachtwoord is ongeldig.', - 'user' => "Er bestaat geen gebruiker met het opgegeven e-mailadres.", + 'user' => 'Er bestaat geen gebruiker met het opgegeven e-mailadres.', ]; diff --git a/resources/lang/no/app.php b/resources/lang/no/app.php index b643e205..26802908 100644 --- a/resources/lang/no/app.php +++ b/resources/lang/no/app.php @@ -22,12 +22,11 @@ return [ 'settings.remove' => 'Fjern', 'settings.search' => 'søk', 'settings.no_items' => 'Ingen funn', - - 'settings.label' => 'Merkelapp', - 'settings.value' => 'Verdi', - 'settings.edit' => 'Endre', - 'settings.view' => 'Se', + 'settings.label' => 'Merkelapp', + 'settings.value' => 'Verdi', + 'settings.edit' => 'Endre', + 'settings.view' => 'Se', 'options.none' => '- ikke valgt -', 'options.google' => 'Google', @@ -65,9 +64,9 @@ return [ 'url' => 'Url', 'title' => 'Tittel', - 'delete' => 'Slett', - 'optional' => 'Valgfritt', - 'restore' => 'Tilbakestill', + 'delete' => 'Slett', + 'optional' => 'Valgfritt', + 'restore' => 'Tilbakestill', 'alert.success.item_created' => 'Objektet ble opprettet', 'alert.success.item_updated' => 'Objektet ble oppdatert', @@ -77,5 +76,4 @@ return [ 'alert.success.setting_updated' => 'Du har oppdatert denne innstillingen', 'alert.error.not_exist' => 'Denne innstillingen eksisterer ikke.', - ]; diff --git a/resources/lang/no/passwords.php b/resources/lang/no/passwords.php index 1ffeb0d2..358969a0 100644 --- a/resources/lang/no/passwords.php +++ b/resources/lang/no/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Passordet ditt har blitt tilbakestilt!', 'sent' => 'Vi har sendt deg en e-post med en tilbakestillingslink for ditt passord!', 'token' => 'Denne tilgangstoken er ikke gyldig.', - 'user' => "Vi fant ingen med den e-postadressen.", + 'user' => 'Vi fant ingen med den e-postadressen.', ]; diff --git a/resources/lang/pl/app.php b/resources/lang/pl/app.php index 74153ed7..34e6e367 100644 --- a/resources/lang/pl/app.php +++ b/resources/lang/pl/app.php @@ -22,12 +22,11 @@ return [ 'settings.remove' => 'Usuń', 'settings.search' => 'szukaj', 'settings.no_items' => 'Nic nie znaleziono', - - 'settings.label' => 'Etykieta', - 'settings.value' => 'Wartość', - 'settings.edit' => 'Edytuj', - 'settings.view' => 'Widok', + 'settings.label' => 'Etykieta', + 'settings.value' => 'Wartość', + 'settings.edit' => 'Edytuj', + 'settings.view' => 'Widok', 'options.none' => '- not set -', 'options.google' => 'Google', @@ -65,9 +64,9 @@ return [ 'url' => 'URL', 'title' => 'Tytuł', - 'delete' => 'Usuń', - 'optional' => 'Opcjonalny', - 'restore' => 'Przywróć', + 'delete' => 'Usuń', + 'optional' => 'Opcjonalny', + 'restore' => 'Przywróć', 'alert.success.item_created' => 'Element utworzony', 'alert.success.item_updated' => 'Element zaktualizowany', @@ -77,5 +76,4 @@ return [ 'alert.success.setting_updated' => 'Ustawienie zostało zaktualizowane', 'alert.error.not_exist' => 'Takie ustawienie nie istnieje', - ]; diff --git a/resources/lang/pt/app.php b/resources/lang/pt/app.php index ffaaef17..79385b5b 100644 --- a/resources/lang/pt/app.php +++ b/resources/lang/pt/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'procura', 'settings.no_items' => 'Nenhum item encontrado', - 'settings.label' => 'Etiqueta', 'settings.value' => 'Valor', 'settings.edit' => 'Editar', @@ -112,5 +111,4 @@ return [ 'alert.success.user_deleted' => 'Utilizador apagada com sucesso', 'alert.success.user_restored' => 'Utilizador restaurada com sucesso', - ]; diff --git a/resources/lang/pt/passwords.php b/resources/lang/pt/passwords.php index afcf4b6a..ddfca378 100644 --- a/resources/lang/pt/passwords.php +++ b/resources/lang/pt/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'A sua palavra-passe foi restabelecida!', 'sent' => 'Enviámos-lhe por email o seu link de restauro de palavra-passe!', 'token' => 'Este token de restabelecimento de palavra-passe é inválido.', - 'user' => "Não conseguimos encontrar nenhum utilizador com este endereço de email.", + 'user' => 'Não conseguimos encontrar nenhum utilizador com este endereço de email.', ]; diff --git a/resources/lang/ru/app.php b/resources/lang/ru/app.php index 8aea25a3..5317977a 100644 --- a/resources/lang/ru/app.php +++ b/resources/lang/ru/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'найти', 'settings.no_items' => 'Ничего не найдено', - 'settings.label' => 'Метка', 'settings.value' => 'Значение', 'settings.edit' => 'Редактировать', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => 'Пользователь удален успешно', 'alert.success.user_restored' => 'Пользователь восстановлен успешно', - ]; diff --git a/resources/lang/ru/passwords.php b/resources/lang/ru/passwords.php index b7a57614..dd418785 100644 --- a/resources/lang/ru/passwords.php +++ b/resources/lang/ru/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Ваш пароль сброшен!', 'sent' => 'Мы отправили вам ссылку для сброса пароля!', 'token' => 'Неверный токен для сброса пароля.', - 'user' => "Не могу найти пользователя с таким адресом e-mail.", + 'user' => 'Не могу найти пользователя с таким адресом e-mail.', ]; diff --git a/resources/lang/sl/app.php b/resources/lang/sl/app.php index 046d4dee..cfe8194e 100644 --- a/resources/lang/sl/app.php +++ b/resources/lang/sl/app.php @@ -29,7 +29,6 @@ return [ 'settings.search' => 'išči', 'settings.no_items' => 'Ni najdenih elementov', - 'settings.label' => 'Oznaka', 'settings.value' => 'Vrednost', 'settings.edit' => 'Uredi', @@ -116,5 +115,4 @@ return [ 'alert.success.user_deleted' => 'Uporabnik uspešno izbrisan', 'alert.success.user_restored' => 'Uporabnik uspešno obnovljen', - ]; diff --git a/resources/lang/sl/passwords.php b/resources/lang/sl/passwords.php index 13d234da..fb760b0c 100644 --- a/resources/lang/sl/passwords.php +++ b/resources/lang/sl/passwords.php @@ -17,6 +17,6 @@ return [ 'reset' => 'Tvoje geslo je bilo ponastavljeno!', 'sent' => 'Na tvoj email smo poslali povezavo za ponastavitev gesla!', 'token' => 'Ta ključ za ponastavitev gesla ni veljaven.', - 'user' => "Ne najdemo uporabnika s tem e-naslovom.", + 'user' => 'Ne najdemo uporabnika s tem e-naslovom.', ]; diff --git a/resources/lang/sv/app.php b/resources/lang/sv/app.php index d18f7097..dd4c7572 100644 --- a/resources/lang/sv/app.php +++ b/resources/lang/sv/app.php @@ -1,114 +1,102 @@ 'Systemet', - 'settings.appearance' => 'Utseende', - 'settings.miscellaneous' => 'Övrigt', +return [ + 'settings.system' => 'Systemet', + 'settings.appearance' => 'Utseende', + 'settings.miscellaneous' => 'Övrigt', + 'settings.version' => 'Version', + 'settings.background_image' => 'Bakgrundsbild', + 'settings.window_target' => 'Länken öppnas i', + 'settings.window_target.current' => 'Öppna i denna flik', + 'settings.window_target.one' => 'Öppna i samma flik', + 'settings.window_target.new' => 'Öppna i ny flik', + 'settings.homepage_search' => 'Startsida Sök', + 'settings.search_provider' => 'Sökmotor', + 'settings.language' => 'Språk', + 'settings.reset' => 'Återställ standardinställningar', + 'settings.remove' => 'Avlägsna', + 'settings.search' => 'sök', + 'settings.no_items' => 'Inga poster hittades', - 'settings.version' => 'Version', - 'settings.background_image' => 'Bakgrundsbild', - 'settings.window_target' => 'Länken öppnas i', - 'settings.window_target.current' => 'Öppna i denna flik', - 'settings.window_target.one' => 'Öppna i samma flik', - 'settings.window_target.new' => 'Öppna i ny flik', - 'settings.homepage_search' => 'Startsida Sök', - 'settings.search_provider' => 'Sökmotor', - 'settings.language' => 'Språk', - 'settings.reset' => 'Återställ standardinställningar', - 'settings.remove' => 'Avlägsna', - 'settings.search' => 'sök', - 'settings.no_items' => 'Inga poster hittades', + 'settings.label' => 'Etikett', + 'settings.value' => 'Värde', + 'settings.edit' => 'Ändra', + 'settings.view' => 'Visa', + 'options.none' => '- inte valt -', + 'options.google' => 'Google', + 'options.ddg' => 'DuckDuckGo', + 'options.bing' => 'Bing', + 'options.qwant' => 'Qwant', + 'options.startpage' => 'Startsida', + 'options.yes' => 'Ja', + 'options.no' => 'Nej', - 'settings.label' => 'Etikett', - 'settings.value' => 'Värde', - 'settings.edit' => 'Ändra', - 'settings.view' => 'Visa', - + 'buttons.save' => 'Spara', + 'buttons.cancel' => 'Avbryt', + 'buttons.add' => 'Lägg till', + 'buttons.upload' => 'Ladda upp en fil', + 'buttons.downloadapps' => 'Uppdatera app lista', - 'options.none' => '- inte valt -', - 'options.google' => 'Google', - 'options.ddg' => 'DuckDuckGo', - 'options.bing' => 'Bing', - 'options.qwant' => 'Qwant', - 'options.startpage' => 'Startsida', - 'options.yes' => 'Ja', - 'options.no' => 'Nej', + 'dash.pin_item' => 'Fäst på instrumentpanelen', + 'dash.no_apps' => 'Det finns för närvarande inga fästa applikationer, :link1 eller :link2', + 'dash.link1' => 'Lägg till en applikation här', + 'dash.link2' => 'Fäst ett objekt till instrumentpanelen', + 'dash.pinned_items' => 'Fästa Objekt', + 'apps.app_list' => 'Applikationslista', + 'apps.view_trash' => 'Visa papperskorgen', + 'apps.add_application' => 'Lägg till applikation', + 'apps.application_name' => 'Applikationens namn', + 'apps.colour' => 'Färg', + 'apps.icon' => 'Ikon', + 'apps.pinned' => 'Fäst', + 'apps.title' => 'Titel', + 'apps.hex' => 'Hex-färg', + 'apps.username' => 'Användarnamn', + 'apps.password' => 'Lösenord', + 'apps.config' => 'Konfiguration', + 'apps.apikey' => 'API Nyckel', + 'apps.enable' => 'Aktivera', + 'apps.tag_list' => 'Tagg lista', + 'apps.add_tag' => 'Lägg till tagg', + 'apps.tag_name' => 'Tagg namn', + 'apps.tags' => 'Taggar', + 'apps.override' => 'Om annan än huvudlänk', + 'apps.preview' => 'Förhandsvisa', - 'buttons.save' => 'Spara', - 'buttons.cancel' => 'Avbryt', - 'buttons.add' => 'Lägg till', - 'buttons.upload' => 'Ladda upp en fil', - 'buttons.downloadapps' => 'Uppdatera app lista', + 'user.user_list' => 'Användare', + 'user.add_user' => 'Lägg till användare', + 'user.username' => 'Användarnamn', + 'user.avatar' => 'Avatar', + 'user.email' => 'Epost', + 'user.password_confirm' => 'Upprepa lösenord', + 'user.secure_front' => 'Tillåt allmän åtkomst till framsidan - Upprätthålls endast om ett lösenord är satt.', + 'user.autologin' => 'Tillåt inloggning från en specifik URL. Vem som helst med länken kan logga in.', + 'url' => 'Url', + 'title' => 'Titel', + 'delete' => 'Radera', + 'optional' => 'Valfri', + 'restore' => 'Återställ', - 'dash.pin_item' => 'Fäst på instrumentpanelen', - 'dash.no_apps' => 'Det finns för närvarande inga fästa applikationer, :link1 eller :link2', - 'dash.link1' => 'Lägg till en applikation här', - 'dash.link2' => 'Fäst ett objekt till instrumentpanelen', - 'dash.pinned_items' => 'Fästa Objekt', + 'alert.success.item_created' => 'Artikeln skapad', + 'alert.success.item_updated' => 'Artikeln uppdaterad', + 'alert.success.item_deleted' => 'Artikeln borttagen', + 'alert.success.item_restored' => 'Artikeln återställd', + 'alert.success.updating' => 'Uppdaterar app lista', + 'alert.success.tag_created' => 'Tagg skapad', + 'alert.success.tag_updated' => 'Tagg uppdaterad', + 'alert.success.tag_deleted' => 'Tagg borttagen', + 'alert.success.tag_restored' => 'Tagg återställd', - 'apps.app_list' => 'Applikationslista', - 'apps.view_trash' => 'Visa papperskorgen', - 'apps.add_application' => 'Lägg till applikation', - 'apps.application_name' => 'Applikationens namn', - 'apps.colour' => 'Färg', - 'apps.icon' => 'Ikon', - 'apps.pinned' => 'Fäst', - 'apps.title' => 'Titel', - 'apps.hex' => 'Hex-färg', - 'apps.username' => 'Användarnamn', - 'apps.password' => 'Lösenord', - 'apps.config' => 'Konfiguration', - 'apps.apikey' => 'API Nyckel', - 'apps.enable' => 'Aktivera', - 'apps.tag_list' => 'Tagg lista', - 'apps.add_tag' => 'Lägg till tagg', - 'apps.tag_name' => 'Tagg namn', - 'apps.tags' => 'Taggar', - 'apps.override' => 'Om annan än huvudlänk', - 'apps.preview' => 'Förhandsvisa', + 'alert.success.setting_updated' => 'Inställningen uppdaterad', + 'alert.error.not_exist' => 'Denna inställning existerar inte.', - - 'user.user_list' => 'Användare', - 'user.add_user' => 'Lägg till användare', - 'user.username' => 'Användarnamn', - 'user.avatar' => 'Avatar', - 'user.email' => 'Epost', - 'user.password_confirm' => 'Upprepa lösenord', - 'user.secure_front' => 'Tillåt allmän åtkomst till framsidan - Upprätthålls endast om ett lösenord är satt.', - 'user.autologin' => 'Tillåt inloggning från en specifik URL. Vem som helst med länken kan logga in.', - - - 'url' => 'Url', - 'title' => 'Titel', - 'delete' => 'Radera', - 'optional' => 'Valfri', - 'restore' => 'Återställ', - - - 'alert.success.item_created' => 'Artikeln skapad', - 'alert.success.item_updated' => 'Artikeln uppdaterad', - 'alert.success.item_deleted' => 'Artikeln borttagen', - 'alert.success.item_restored' => 'Artikeln återställd', - 'alert.success.updating' => 'Uppdaterar app lista', - - - 'alert.success.tag_created' => 'Tagg skapad', - 'alert.success.tag_updated' => 'Tagg uppdaterad', - 'alert.success.tag_deleted' => 'Tagg borttagen', - 'alert.success.tag_restored' => 'Tagg återställd', - - - 'alert.success.setting_updated' => 'Inställningen uppdaterad', - 'alert.error.not_exist' => 'Denna inställning existerar inte.', - - - 'alert.success.user_created' => 'Användare skapad', - 'alert.success.user_updated' => 'Anvädare uppdaterad', - 'alert.success.user_deleted' => 'Användare borttagen', - 'alert.success.user_restored' => 'Användare återställd', -); + 'alert.success.user_created' => 'Användare skapad', + 'alert.success.user_updated' => 'Anvädare uppdaterad', + 'alert.success.user_deleted' => 'Användare borttagen', + 'alert.success.user_restored' => 'Användare återställd', +]; diff --git a/resources/lang/tr/app.php b/resources/lang/tr/app.php index 1539259a..b99e96c3 100644 --- a/resources/lang/tr/app.php +++ b/resources/lang/tr/app.php @@ -1,18 +1,18 @@ 'Sistem', 'settings.appearance' => 'Görünüm', 'settings.miscellaneous' => 'Çeşitli', - + 'settings.version' => 'Versiyon', 'settings.background_image' => 'Arkaplan Resmi', 'settings.homepage_search' => 'Anasayfa Arama', @@ -22,13 +22,12 @@ return [ 'settings.remove' => 'Sil', 'settings.search' => 'ara', 'settings.no_items' => 'Öğe bulunamadı', - - - 'settings.label' => 'Etiket', - 'settings.value' => 'Değer', - 'settings.edit' => 'Düzenle', - 'settings.view' => 'Görüntüle', - + + 'settings.label' => 'Etiket', + 'settings.value' => 'Değer', + 'settings.edit' => 'Düzenle', + 'settings.view' => 'Görüntüle', + 'options.none' => '- ayarlanmadı -', 'options.google' => 'Google', 'options.ddg' => 'DuckDuckGo', @@ -36,18 +35,18 @@ return [ 'options.qwant' => 'Qwant', 'options.yes' => 'Evet', 'options.no' => 'Hayır', - + 'buttons.save' => 'Kaydet', 'buttons.cancel' => 'İptal', 'buttons.add' => 'Ekle', 'buttons.upload' => 'Dosya yükle', - + 'dash.pin_item' => 'Ana panele iğnele', 'dash.no_apps' => 'Ana panele iğneli öğeler, :link1 or :link2', 'dash.link1' => 'Yeni uygulama ekle', 'dash.link2' => 'Ana panele iğnele', 'dash.pinned_items' => 'İğnelenen öğeler', - + 'apps.app_list' => 'Uygulama listesi', 'apps.view_trash' => 'Çöpü görüntüle', 'apps.add_application' => 'Uygulama ekle', @@ -60,20 +59,19 @@ return [ 'apps.username' => 'Kullanıcı adı', 'apps.password' => 'Şifre', 'apps.config' => 'Yapılandırma', - + 'url' => 'Adres', 'title' => 'Başlık', - 'delete' => 'Sil', - 'optional' => 'İsteğe bağlı', - 'restore' => 'Eski haline getir', - + 'delete' => 'Sil', + 'optional' => 'İsteğe bağlı', + 'restore' => 'Eski haline getir', + 'alert.success.item_created' => 'Öğe yaratıldı', 'alert.success.item_updated' => 'Öğe güncellendi', 'alert.success.item_deleted' => 'Öğe silindi', 'alert.success.item_restored' => 'Öğe eski haline getirildi', - + 'alert.success.setting_updated' => 'Ayarlama kaydedildi', 'alert.error.not_exist' => 'Böyle bir seçenek yok.', - - + ]; diff --git a/resources/lang/tr/auth.php b/resources/lang/tr/auth.php index e2043f85..1c93ba9e 100644 --- a/resources/lang/tr/auth.php +++ b/resources/lang/tr/auth.php @@ -12,8 +12,8 @@ return [ | these language lines according to your application's requirements. | */ - + 'failed' => 'Kimlik bilgileri doğru değil.', 'throttle' => 'Çok fazla girişim. :seconds saniye sonra tekrar deneyin.', - + ]; diff --git a/resources/lang/tr/pagination.php b/resources/lang/tr/pagination.php index f8dc740f..8c760579 100644 --- a/resources/lang/tr/pagination.php +++ b/resources/lang/tr/pagination.php @@ -1,7 +1,7 @@ '« Önceki', 'next' => 'Sonraki »', - + ]; diff --git a/resources/lang/tr/passwords.php b/resources/lang/tr/passwords.php index 5b3314d7..f9ff9856 100644 --- a/resources/lang/tr/passwords.php +++ b/resources/lang/tr/passwords.php @@ -1,7 +1,7 @@ 'Şifre en az altı karakter olmalı ve onaylamasına uymalıdır.', 'reset' => 'Şifreniz sıfırlandı!', 'sent' => 'Şifre sıfırlama bağlantısı eposta adresinize yollandı!', 'token' => 'Şifre sıfırlama simgesi geçerli değil.', - 'user' => "Adresle ilişkili kullanıcı adı bulunamadı.", - + 'user' => 'Adresle ilişkili kullanıcı adı bulunamadı.', + ]; diff --git a/resources/lang/tr/validation.php b/resources/lang/tr/validation.php index 02a9d887..4cd0c69f 100644 --- a/resources/lang/tr/validation.php +++ b/resources/lang/tr/validation.php @@ -12,7 +12,7 @@ return [ | as the size rules. Feel free to tweak each of these messages here. | */ - + 'accepted' => ':attribute kabul edilmelidir.', 'active_url' => ':attribute geçerli bir adres değil.', 'after' => ':attribute :date tarihinden sonra olmalıdır.', @@ -87,7 +87,7 @@ return [ 'unique' => ':attribute zaten kullanımda.', 'uploaded' => ':attribute yüklenemedi.', 'url' => ':attribute düzeni geçersiz.', - + /* |-------------------------------------------------------------------------- | Custom Validation Language Lines @@ -98,13 +98,13 @@ return [ | specify a specific custom language line for a given attribute rule. | */ - + 'custom' => [ 'attribute-name' => [ 'rule-name' => 'custom-message', ], ], - + /* |-------------------------------------------------------------------------- | Custom Validation Attributes @@ -115,7 +115,7 @@ return [ | of "email". This simply helps us make messages a little cleaner. | */ - + 'attributes' => [], - + ]; diff --git a/routes/api.php b/routes/api.php index 0f37e006..85296795 100644 --- a/routes/api.php +++ b/routes/api.php @@ -12,4 +12,3 @@ use Illuminate\Http\Request; | is assigned the "api" middleware group. Enjoy building your API! | */ - diff --git a/routes/web.php b/routes/web.php index 46e91839..8f6bfd5f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,7 +13,7 @@ use Illuminate\Http\Request; | */ -if(\Config::get('app.url') !== 'http://localhost') { +if (\Config::get('app.url') !== 'http://localhost') { URL::forceRootUrl(\Config::get('app.url')); } @@ -23,7 +23,7 @@ Route::get('/autologin/{uuid}', 'Auth\LoginController@autologin')->name('user.au Route::get('/', 'ItemController@dash')->name('dash'); Route::get('check_app_list', 'ItemController@checkAppList')->name('applist'); -Route::get('single/{appid}', function($appid) { +Route::get('single/{appid}', function ($appid) { return json_encode(\App\Application::single($appid)); })->name('single'); @@ -32,8 +32,6 @@ Route::resources([ 'tags' => 'TagController', ]); - - Route::get('tag/{slug}', 'TagController@show')->name('tags.show'); Route::get('tag/add/{tag}/{item}', 'TagController@add')->name('tags.add'); Route::get('tag/restore/{id}', 'TagController@restore')->name('tags.restore'); @@ -57,11 +55,10 @@ Route::get('view/{name_view}', function ($name_view) { Route::get('titlecolour', function (Request $request) { $color = $request->input('color'); - if($color) { + if ($color) { return title_color($color); - }; - -})->name('titlecolour'); + } +})->name('titlecolour'); Route::resource('users', 'UserController'); @@ -72,7 +69,6 @@ Route::group([ 'as' => 'settings.', 'prefix' => 'settings', ], function () { - Route::get('/', 'SettingsController@index') ->name('index'); Route::get('edit/{id}', 'SettingsController@edit') @@ -80,9 +76,7 @@ Route::group([ Route::get('clear/{id}', 'SettingsController@clear') ->name('clear'); - Route::patch('edit/{id}', 'SettingsController@update'); - }); Auth::routes(); diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index df7814bb..4a7b288d 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -2,8 +2,8 @@ namespace Tests; -use Illuminate\Support\Facades\Hash; use Illuminate\Contracts\Console\Kernel; +use Illuminate\Support\Facades\Hash; trait CreatesApplication { diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index f31e495c..cdb51119 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class ExampleTest extends TestCase { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c6..266ef352 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,8 +2,8 @@ namespace Tests\Unit; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class ExampleTest extends TestCase { From 297c2bb30f3e619d88d8f868b9d8e09352b17485 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Mar 2022 13:54:33 +0000 Subject: [PATCH 2/5] Shift bindings PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP. --- app/Application.php | 6 +++--- app/Item.php | 6 +++--- app/Setting.php | 4 ++-- app/SettingGroup.php | 2 +- app/User.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Application.php b/app/Application.php index 65288106..17a2347a 100644 --- a/app/Application.php +++ b/app/Application.php @@ -43,7 +43,7 @@ class Application extends Model $name = $this->name; $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); - $class = '\App\SupportedApps\\'.$name.'\\'.$name; + $class = \App\SupportedApps::class.$name.'\\'.$name; return $class; } @@ -52,7 +52,7 @@ class Application extends Model { $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); - $class = '\App\SupportedApps\\'.$name.'\\'.$name; + $class = \App\SupportedApps::class.$name.'\\'.$name; return $class; } @@ -114,7 +114,7 @@ class Application extends Model return null; } $classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name); - $app->class = '\App\SupportedApps\\'.$classname.'\\'.$classname; + $app->class = \App\SupportedApps::class.$classname.'\\'.$classname; return $app; } diff --git a/app/Item.php b/app/Item.php index 0e3f75ae..505ddf04 100644 --- a/app/Item.php +++ b/app/Item.php @@ -84,12 +84,12 @@ class Item extends Model public function parents() { - return $this->belongsToMany('App\Item', 'item_tag', 'item_id', 'tag_id'); + return $this->belongsToMany(\App\Item::class, 'item_tag', 'item_id', 'tag_id'); } public function children() { - return $this->belongsToMany('App\Item', 'item_tag', 'tag_id', 'item_id'); + return $this->belongsToMany(\App\Item::class, 'item_tag', 'tag_id', 'item_id'); } public function getLinkAttribute() @@ -257,6 +257,6 @@ class Item extends Model */ public function user() { - return $this->belongsTo('App\User'); + return $this->belongsTo(\App\User::class); } } diff --git a/app/Setting.php b/app/Setting.php index 5c4d3b32..69bede8c 100644 --- a/app/Setting.php +++ b/app/Setting.php @@ -147,7 +147,7 @@ class Setting extends Model public function group() { - return $this->belongsTo('App\SettingGroup', 'group_id'); + return $this->belongsTo(\App\SettingGroup::class, 'group_id'); } /** @@ -232,7 +232,7 @@ class Setting extends Model */ public function users() { - return $this->belongsToMany('App\User')->using('App\SettingUser')->withPivot('uservalue'); + return $this->belongsToMany(\App\User::class)->using(\App\SettingUser::class)->withPivot('uservalue'); } public static function user() diff --git a/app/SettingGroup.php b/app/SettingGroup.php index 5c306caf..45d05d48 100644 --- a/app/SettingGroup.php +++ b/app/SettingGroup.php @@ -22,6 +22,6 @@ class SettingGroup extends Model public function settings() { - return $this->hasMany('App\Setting', 'group_id'); + return $this->hasMany(\App\Setting::class, 'group_id'); } } diff --git a/app/User.php b/app/User.php index 8a8a76f1..36658f54 100644 --- a/app/User.php +++ b/app/User.php @@ -32,7 +32,7 @@ class User extends Authenticatable */ public function items() { - return $this->hasMany('App\Item'); + return $this->hasMany(\App\Item::class); } /** @@ -40,7 +40,7 @@ class User extends Authenticatable */ public function settings() { - return $this->belongsToMany('App\Setting')->withPivot('uservalue'); + return $this->belongsToMany(\App\Setting::class)->withPivot('uservalue'); } public static function currentUser() From 3dac9828c8bfe4c37aa5c84dbe35ddd7af7ed815 Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Mar 2022 13:54:34 +0000 Subject: [PATCH 3/5] Convert to new helper methods Laravel 5 added several new helper functions, including: - `view()` - `response()` - `redirect()` - `config()` - `abort()` Review the [helpers][1] documentation for more details. [1]: https://laravel.com/docs/5.0/helpers --- routes/web.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 8f6bfd5f..eb15c823 100644 --- a/routes/web.php +++ b/routes/web.php @@ -13,8 +13,8 @@ use Illuminate\Http\Request; | */ -if (\Config::get('app.url') !== 'http://localhost') { - URL::forceRootUrl(\Config::get('app.url')); +if (config('app.url') !== 'http://localhost') { + URL::forceRootUrl(config('app.url')); } Route::get('/userselect/{user}', 'Auth\LoginController@setUser')->name('user.set'); From 0f498eca75b86e371b712c7cfea3040e3b0adbdd Mon Sep 17 00:00:00 2001 From: Shift Date: Sat, 19 Mar 2022 13:54:34 +0000 Subject: [PATCH 4/5] Remove explicit `deleted_at` date cast --- app/Item.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/Item.php b/app/Item.php index 505ddf04..ab54c75c 100644 --- a/app/Item.php +++ b/app/Item.php @@ -33,12 +33,7 @@ class Item extends Model 'title', 'url', 'colour', 'icon', 'appdescription', 'description', 'pinned', 'order', 'type', 'class', 'user_id', 'appid', ]; - /** - * The attributes that should be mutated to dates. - * - * @var array - */ - protected $dates = ['deleted_at']; + /** * Scope a query to only include pinned items. From d5bd614cc691ae420211ed8b5982107bc6240115 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Sat, 19 Mar 2022 14:05:01 +0000 Subject: [PATCH 5/5] Update Application.php --- app/Application.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Application.php b/app/Application.php index 17a2347a..65288106 100644 --- a/app/Application.php +++ b/app/Application.php @@ -43,7 +43,7 @@ class Application extends Model $name = $this->name; $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); - $class = \App\SupportedApps::class.$name.'\\'.$name; + $class = '\App\SupportedApps\\'.$name.'\\'.$name; return $class; } @@ -52,7 +52,7 @@ class Application extends Model { $name = preg_replace('/[^\p{L}\p{N}]/u', '', $name); - $class = \App\SupportedApps::class.$name.'\\'.$name; + $class = '\App\SupportedApps\\'.$name.'\\'.$name; return $class; } @@ -114,7 +114,7 @@ class Application extends Model return null; } $classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name); - $app->class = \App\SupportedApps::class.$classname.'\\'.$classname; + $app->class = '\App\SupportedApps\\'.$classname.'\\'.$classname; return $app; }