From d3046288d1a075b4439b5ab8cc7b8be3bce31f7b Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 13:35:39 +0200
Subject: [PATCH 001/127] MeasurementController - Revert feature clean weight
---
app/Http/Controllers/Api/MeasurementController.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index dd80d0c7..79239236 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1487,7 +1487,7 @@ public function data(Request $request)
$min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
$relative_interval = boolval($request->input('relative_interval', 0));
$loadWeather = boolval($request->input('weather', 1));
- $loadCleanWeight = boolval($request->input('clean_weight', 1));
+ $loadCleanWeight = boolval($request->input('clean_weight', 0));
$intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
$groupBySelect = null;
@@ -1634,14 +1634,14 @@ public function data(Request $request)
$time = $values['time'];
if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
{
- $sensors_out[$i] = array_merge($data_time_key_arr[$time], $sensors_out[$i]);
+ $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]);
unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
// add missing time values to sensors
if (count($data_time_key_arr) > 0)
- $sensors_out = array_merge(array_values($data_time_key_arr), $sensors_out);
+ $sensors_out = array_merge($sensors_out, array_values($data_time_key_arr));
}
//return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $clean_weight_query, 'cleanWeight_out'=> $clean_weight_out, 'measurements' => $sensors_out]);
From 85b0036acaf1b0bf91d7b09c1764341ff7b8b075 Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 16:10:36 +0200
Subject: [PATCH 002/127] MeasurementController - Enable net_weight_kg only
---
app/Http/Controllers/Api/MeasurementController.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 79239236..14483089 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1487,7 +1487,7 @@ public function data(Request $request)
$min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
$relative_interval = boolval($request->input('relative_interval', 0));
$loadWeather = boolval($request->input('weather', 1));
- $loadCleanWeight = boolval($request->input('clean_weight', 0));
+ $loadCleanWeight = boolval($request->input('clean_weight', 1));
$intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
$groupBySelect = null;
@@ -1634,8 +1634,13 @@ public function data(Request $request)
$time = $values['time'];
if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
{
- $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]);
- unset($data_time_key_arr[$time]); // to retain missing values and add then later
+ // TODO: if ($request->user()->hasRole('comparator')), merge complete array
+ //$sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]);
+ if (isset($data_time_key_arr[$time]['net_weight_kg']) )
+ {
+ $sensors_out[$i]['net_weight_kg'] = $data_time_key_arr[$time]['net_weight_kg'];
+ unset($data_time_key_arr[$time]); // to retain missing values and add then later
+ }
}
}
}
From cc3a0eae8a414bc6c7c4b735764652a42da36990 Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 16:40:43 +0200
Subject: [PATCH 003/127] MeasurementController - measurements do not force
recalculate sensor definitions
---
app/Http/Controllers/Api/MeasurementController.php | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 14483089..4d689cb9 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1505,7 +1505,7 @@ public function data(Request $request)
$timeZone = $intervalArr['timeZone'];
$whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations();
+ $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(false);
$add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
if($resolution != null)
@@ -1634,13 +1634,8 @@ public function data(Request $request)
$time = $values['time'];
if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
{
- // TODO: if ($request->user()->hasRole('comparator')), merge complete array
- //$sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]);
- if (isset($data_time_key_arr[$time]['net_weight_kg']) )
- {
- $sensors_out[$i]['net_weight_kg'] = $data_time_key_arr[$time]['net_weight_kg'];
- unset($data_time_key_arr[$time]); // to retain missing values and add then later
- }
+ $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
+ unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
From 8899b4e62a0238d8ae8b02b6081de8bd10bb509b Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 16:48:50 +0200
Subject: [PATCH 004/127] MeasurementController - Measurement disable
clean_weight
---
app/Http/Controllers/Api/MeasurementController.php | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 4d689cb9..4df2cd6d 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1487,7 +1487,7 @@ public function data(Request $request)
$min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
$relative_interval = boolval($request->input('relative_interval', 0));
$loadWeather = boolval($request->input('weather', 1));
- $loadCleanWeight = boolval($request->input('clean_weight', 1));
+ $loadCleanWeight = false; //boolval($request->input('clean_weight', 1));
$intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
$groupBySelect = null;
@@ -1634,8 +1634,15 @@ public function data(Request $request)
$time = $values['time'];
if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
{
- $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
- unset($data_time_key_arr[$time]); // to retain missing values and add then later
+ if ($request->user()->hasRole('comparator'))
+ {
+ $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
+ }
+ else if (isset($data_time_key_arr[$time]['net_weight_kg']) )
+ {
+ $sensors_out[$i]['net_weight_kg'] = $data_time_key_arr[$time]['net_weight_kg'];
+ unset($data_time_key_arr[$time]); // to retain missing values and add then later
+ }
}
}
}
From b545920f75140bde5b961af1b5c6b58ee155ab9e Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 16:52:35 +0200
Subject: [PATCH 005/127] MeasurementController - measurements only recalculate
calibrations if on
---
app/Device.php | 2 ++
app/Http/Controllers/Api/MeasurementController.php | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/Device.php b/app/Device.php
index b76fd004..4568e859 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -917,6 +917,8 @@ private function last_sensor_increment_values($data_array=null)
return $out_arr;
}
+ // By default, only return the force recalculation calibrations,
+ // If recalculate is set to false, return all available calibrations.
public function calibrationsMeasurementAbbreviations($recalculate=true)
{
$cache_name = 'device-'.$this->id.'-calibrations-measurement-types-'.$recalculate?'1':'0';
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 4df2cd6d..d50fe1a1 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1505,7 +1505,7 @@ public function data(Request $request)
$timeZone = $intervalArr['timeZone'];
$whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(false);
+ $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(true);
$add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
if($resolution != null)
From 6398716e461f269fb580f10bbb09b5c25eb5f5dd Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:01:47 +0200
Subject: [PATCH 006/127] Update MeasurementController.php
---
app/Http/Controllers/Api/MeasurementController.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index d50fe1a1..4a95fdca 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1556,7 +1556,13 @@ public function data(Request $request)
if ($add_calibrations)
{
foreach ($sensors_out as $i => $data_array)
+ {
+ if ($i==0)
+ {
+ Log::debug('measurements device '.$device->name.' ('.$device->id,'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
+ }
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
+ }
}
}
From 8a728ff5086f1dc31a36fc069d74e4dc98ce604f Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:02:46 +0200
Subject: [PATCH 007/127] Revert "Update MeasurementController.php"
This reverts commit 6398716e461f269fb580f10bbb09b5c25eb5f5dd.
---
app/Http/Controllers/Api/MeasurementController.php | 6 ------
1 file changed, 6 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 4a95fdca..d50fe1a1 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1556,13 +1556,7 @@ public function data(Request $request)
if ($add_calibrations)
{
foreach ($sensors_out as $i => $data_array)
- {
- if ($i==0)
- {
- Log::debug('measurements device '.$device->name.' ('.$device->id,'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
- }
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
- }
}
}
From 376a30d2d597b28537c717f74d078d11324b69d4 Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:03:48 +0200
Subject: [PATCH 008/127] MeasurementController - Add debug log
---
app/Http/Controllers/Api/MeasurementController.php | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index d50fe1a1..fd530b54 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -3,6 +3,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
+use Illuminate\Support\Facades\Log;
use Auth;
use App\User;
use App\Device;
@@ -1556,7 +1557,13 @@ public function data(Request $request)
if ($add_calibrations)
{
foreach ($sensors_out as $i => $data_array)
+ {
+ if ($i==0)
+ {
+ Log::debug('measurements device '.$device->name.' ('.$device->id,'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
+ }
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
+ }
}
}
From d677cae2911369208d12e47d86466e7dff2a281f Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:04:49 +0200
Subject: [PATCH 009/127] Update MeasurementController.php
---
app/Http/Controllers/Api/MeasurementController.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index fd530b54..fb9740dc 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1560,7 +1560,7 @@ public function data(Request $request)
{
if ($i==0)
{
- Log::debug('measurements device '.$device->name.' ('.$device->id,'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
+ Log::debug('measurements device '.$device->name.' ('.$device->id.'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
}
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
}
From baf25ffcb97a7ccd58f519c234d77e01abd65e4b Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:06:51 +0200
Subject: [PATCH 010/127] Update MeasurementController.php
---
app/Http/Controllers/Api/MeasurementController.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index fb9740dc..091ccb3d 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1556,11 +1556,13 @@ public function data(Request $request)
// Apply SensorDefinitions that have 'recalculate' set to true
if ($add_calibrations)
{
+ $log_set = false;
foreach ($sensors_out as $i => $data_array)
{
- if ($i==0)
+ if ($log_set == false && isset($data_array['weight_kg']))
{
Log::debug('measurements device '.$device->name.' ('.$device->id.'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
+ $log_set = true;
}
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
}
From c75663085d3d858a3990406c8aa0e968458b6eb3 Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:10:10 +0200
Subject: [PATCH 011/127] Device - Fix sensor definition if changed
---
app/Device.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/Device.php b/app/Device.php
index 4568e859..9d9ccfaa 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -84,6 +84,8 @@ public function empty_cache($clear_users=true)
Cache::forget('device-'.$this->id.'-hive-'.$this->hive_id.'-user-ids');
Cache::forget('device-'.$this->id.'-hive-'.$this->hive_id.'-rule-ids');
Cache::forget('device-'.$this->id.'-calibrations-measurement-types');
+ Cache::forget('device-'.$this->id.'-calibrations-measurement-types-0');
+ Cache::forget('device-'.$this->id.'-calibrations-measurement-types-1');
Log::debug("Device ID $this->id cache emptied");
From 79842d0b11c0561b8ca2f666ea04df4f6294e393 Mon Sep 17 00:00:00 2001
From: Pim van Gennip
Date: Fri, 10 Apr 2026 17:13:28 +0200
Subject: [PATCH 012/127] MeasurementController - Enable clean_weight again
---
app/Http/Controllers/Api/MeasurementController.php | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 091ccb3d..10adca47 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1488,7 +1488,7 @@ public function data(Request $request)
$min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
$relative_interval = boolval($request->input('relative_interval', 0));
$loadWeather = boolval($request->input('weather', 1));
- $loadCleanWeight = false; //boolval($request->input('clean_weight', 1));
+ $loadCleanWeight = boolval($request->input('clean_weight', 1));
$intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
$groupBySelect = null;
@@ -1643,15 +1643,8 @@ public function data(Request $request)
$time = $values['time'];
if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
{
- if ($request->user()->hasRole('comparator'))
- {
- $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
- }
- else if (isset($data_time_key_arr[$time]['net_weight_kg']) )
- {
- $sensors_out[$i]['net_weight_kg'] = $data_time_key_arr[$time]['net_weight_kg'];
- unset($data_time_key_arr[$time]); // to retain missing values and add then later
- }
+ $sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
+ unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
From a606a7e3646356e4278dc704b97f86a3f9217d9c Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:19 +0000
Subject: [PATCH 013/127] Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.
You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.
For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
---
app/BeeRace.php | 2 +-
app/Category.php | 275 ++-
app/CategoryFactory.php | 420 ++--
app/CategoryInput.php | 126 +-
app/Checklist.php | 75 +-
app/ChecklistFactory.php | 366 ++-
app/Console/Kernel.php | 19 +-
app/Continent.php | 2 +-
app/Device.php | 642 ++---
app/Exceptions/Handler.php | 18 +-
app/Group.php | 57 +-
app/Hive.php | 201 +-
app/HiveFactory.php | 591 +++--
app/HiveLayer.php | 30 +-
app/HiveLayerFrame.php | 13 +-
app/Http/Controllers/AlertController.php | 66 +-
app/Http/Controllers/AlertRuleController.php | 123 +-
.../AlertRuleFormulaController.php | 46 +-
app/Http/Controllers/Api/AlertController.php | 45 +-
.../Controllers/Api/AlertRuleController.php | 277 ++-
.../Api/Auth/VerificationController.php | 48 +-
.../Controllers/Api/CategoryController.php | 16 +-
.../Controllers/Api/ChecklistController.php | 39 +-
.../Api/ChecklistSvgController.php | 18 +-
app/Http/Controllers/Api/Controller.php | 4 +-
.../Api/DashboardGroupController.php | 184 +-
app/Http/Controllers/Api/DeviceController.php | 895 ++++---
app/Http/Controllers/Api/ExportController.php | 667 +++--
.../Controllers/Api/FlashLogController.php | 836 +++----
app/Http/Controllers/Api/GroupController.php | 379 ++-
app/Http/Controllers/Api/HiveController.php | 136 +-
.../Controllers/Api/HiveTagsController.php | 53 +-
app/Http/Controllers/Api/ImageController.php | 32 +-
.../Controllers/Api/InspectionsController.php | 227 +-
.../Controllers/Api/LocationController.php | 157 +-
.../Controllers/Api/MeasurementController.php | 1811 +++++++-------
app/Http/Controllers/Api/QueenController.php | 42 +-
.../Controllers/Api/ResearchController.php | 62 +-
.../Api/ResearchDataController.php | 1312 +++++-----
.../Controllers/Api/SampleCodeController.php | 33 +-
.../Api/SensorDefinitionController.php | 157 +-
.../Controllers/Api/SettingController.php | 80 +-
.../Controllers/Api/TaxonomyController.php | 89 +-
app/Http/Controllers/Api/UserController.php | 378 ++-
.../Controllers/Api/WeatherController.php | 19 +-
app/Http/Controllers/AppController.php | 2 -
app/Http/Controllers/Auth/LoginController.php | 5 +-
.../Controllers/Auth/RegisterController.php | 8 +-
.../Auth/ResetPasswordController.php | 2 +-
.../CalculationModelController.php | 27 +-
app/Http/Controllers/CategoriesController.php | 672 +++--
.../Controllers/CategoryInputsController.php | 48 +-
app/Http/Controllers/ChecklistController.php | 79 +-
.../Controllers/ChecklistSvgController.php | 30 +-
app/Http/Controllers/Controller.php | 4 +-
app/Http/Controllers/DashboardController.php | 294 ++-
.../Controllers/DashboardGroupController.php | 48 +-
app/Http/Controllers/DeviceController.php | 371 ++-
app/Http/Controllers/FlashLogController.php | 235 +-
app/Http/Controllers/GroupController.php | 25 +-
app/Http/Controllers/HiveTagsController.php | 30 +-
app/Http/Controllers/HomeController.php | 2 -
app/Http/Controllers/ImageController.php | 20 +-
.../Controllers/InspectionItemsController.php | 19 +-
.../Controllers/InspectionsController.php | 37 +-
app/Http/Controllers/LanguageController.php | 19 +-
.../Controllers/MeasurementController.php | 19 +-
app/Http/Controllers/PermissionController.php | 19 +-
.../PhysicalQuantityController.php | 19 +-
app/Http/Controllers/ResearchController.php | 2127 ++++++++--------
app/Http/Controllers/RoleController.php | 49 +-
app/Http/Controllers/SampleCodeController.php | 448 ++--
.../SensorDefinitionController.php | 110 +-
app/Http/Controllers/TaxonomyController.php | 111 +-
.../Controllers/TranslationController.php | 253 +-
app/Http/Controllers/UserController.php | 223 +-
app/Http/Middleware/Authenticate.php | 5 +-
.../Middleware/CheckForMaintenanceMode.php | 5 +-
.../EnsureWebappEmailIsVerified.php | 7 +-
.../Middleware/RedirectIfAuthenticated.php | 1 -
app/Http/Middleware/TrustProxies.php | 8 +-
app/Http/Requests/PostCategoryRequest.php | 61 +-
app/Http/Requests/PostHiveRequest.php | 95 +-
app/Http/Requests/PostLocationRequest.php | 51 +-
app/Http/Requests/PostSensorRequest.php | 58 +-
app/Http/Requests/Request.php | 8 +-
app/Image.php | 159 +-
app/Inspection.php | 156 +-
app/InspectionItem.php | 48 +-
app/Language.php | 7 +-
app/Listeners/LogSuccessfulLogin.php | 3 -
app/Location.php | 33 +-
app/Mail/AlertMail.php | 26 +-
app/Mail/DataExport.php | 6 +-
app/Mail/GroupAcceptation.php | 15 +-
app/Mail/GroupInvitation.php | 18 +-
app/Mail/GroupRefusal.php | 15 +-
app/Mail/SampleCodeMail.php | 23 +-
app/Measurement.php | 124 +-
app/Models/Alert.php | 32 +-
app/Models/AlertRule.php | 707 +++---
app/Models/AlertRuleFormula.php | 400 ++-
app/Models/CalculationModel.php | 283 +--
app/Models/ChecklistSvg.php | 12 +-
app/Models/DashboardGroup.php | 24 +-
app/Models/FlashLog.php | 2166 ++++++++---------
app/Models/HiveTag.php | 20 +-
app/Models/Webhook.php | 23 +-
app/Notifications/ResetPassword.php | 7 +-
app/Notifications/VerifyEmail.php | 10 +-
app/Permission.php | 152 +-
app/PhysicalQuantity.php | 82 +-
app/Providers/AppServiceProvider.php | 42 +-
app/Providers/AuthServiceProvider.php | 1 -
app/Providers/BroadcastServiceProvider.php | 2 +-
app/Providers/EventServiceProvider.php | 2 +-
app/Providers/RouteServiceProvider.php | 2 +-
app/Queen.php | 26 +-
app/Research.php | 41 +-
app/Role.php | 162 +-
app/SampleCode.php | 36 +-
app/SensorDefinition.php | 100 +-
app/Setting.php | 14 +-
app/Taxonomy.php | 230 +-
.../MeasurementLegacyCalculationsTrait.php | 302 ++-
app/Traits/MeasurementLoRaDecoderTrait.php | 640 +++--
app/Transformer/HighWeightFix.php | 136 +-
app/Transformer/SensorTransformer.php | 78 +-
app/Transformer/UserTransformer.php | 22 +-
app/Translation.php | 120 +-
app/User.php | 198 +-
app/Weather.php | 225 +-
config/apidoc.php | 2 +-
config/app.php | 8 +-
config/crudgenerator.php | 3 +-
config/database.php | 8 +-
config/debugbar.php | 62 +-
config/entrust.php | 3 +-
config/hashing.php | 2 +-
config/image.php | 6 +-
config/influxdb.php | 2 +-
config/laratrust.php | 12 +-
config/laravellocalization.php | 586 ++---
config/logging.php | 4 +-
config/mail.php | 2 +-
config/queue.php | 2 +-
config/scribe.php | 6 +-
config/webapp.php | 8 +-
database/factories/ModelFactory.php | 44 +-
.../2014_10_12_000000_create_users_table.php | 4 +-
...12_100000_create_password_resets_table.php | 4 +-
...016_04_10_115211_create-category-table.php | 7 +-
...016_04_14_174603_create-location-table.php | 13 +-
.../2016_12_20_121758_create_settings.php | 11 +-
.../2016_12_20_121819_create-hive-table.php | 13 +-
.../2016_12_21_174159_create-sensor-table.php | 9 +-
.../2017_03_21_114148_create_groups_table.php | 4 +-
...2017_03_21_114828_entrust_setup_tables.php | 5 +-
.../2017_04_14_175011_create-queen-table.php | 10 +-
...7_04_14_175022_create-production-table.php | 9 +-
...2017_07_17_095406_add_users_last_login.php | 10 +-
...105927_add_category_nested_set_columns.php | 13 +-
...018_01_31_174432_create_category_input.php | 41 +-
.../2018_02_20_161831_add_category_old_id.php | 13 +-
...8_03_12_223732_create-checklists-table.php | 42 +-
..._04_03_110731_create_inspections_table.php | 33 +-
...3_112937_create_inspection_items_table.php | 12 +-
...03_115056_add_checklist_category_order.php | 19 +-
...2018_04_24_124855_AddCategoryTypeIndex.php | 24 +-
...9_add_location_hive_delete_foreign_key.php | 3 +-
...018_05_18_091519_add_user_policy_check.php | 3 +-
.../2018_06_03_110444_AddLanguageTwoChar.php | 20 +-
...121927_convert_inspections_to_taxonomy.php | 86 +-
...9_152505_add_email_token_to_user_table.php | 16 +-
...019_01_08_101831_add_category_required.php | 16 +-
.../2019_01_14_114237_add_group_extras.php | 6 +-
.../2019_01_14_114804_create_group_hive.php | 13 +-
...2019_01_14_143937_add_group_user_admin.php | 6 +-
...01_28_104628_create_measurements_table.php | 14 +-
.../2019_01_28_223610_add_min_max_values.php | 24 +-
.../2019_01_28_223654_add_high_low_values.php | 22 +-
.../2019_11_21_153657_add_location_roofed.php | 20 +-
...9_11_21_204213_create_researches_table.php | 50 +-
.../2019_12_27_172844_create_images_table.php | 14 +-
..._05_153657_add_inspection_checklist_id.php | 18 +-
...180741_change_sensors_hive_id_nullable.php | 14 +-
...20_01_11_134447_add_dimensions_to_hive.php | 4 +-
..._01_11_135656_add_description_to_queen.php | 4 +-
.../2020_01_11_140516_add_order_to_hive.php | 4 +-
...173757_create_sensor_definitions_table.php | 14 +-
...03_add_last_active_and_hw_id_to_sensor.php | 4 +-
...2020_01_15_110902_add_storage_to_image.php | 4 +-
...0918_change_url_field_length_for_image.php | 4 +-
...0_01_15_121511_add_image_to_inspection.php | 4 +-
...dd_last_weather_time_stamp_to_location.php | 4 +-
...9_152103_add_battery_voltage_to_device.php | 4 +-
..._152416_add_downlink_message_to_device.php | 4 +-
.../2020_06_08_094741_add_locale_to_user.php | 4 +-
...06_25_154728_create_sample_codes_table.php | 14 +-
...08_04_114944_add_hex_color_to_location.php | 4 +-
..._142238_add_research_owner_and_viewers.php | 34 +-
.../2021_02_09_170632_create_alerts_table.php | 6 +-
..._02_09_170935_create_alert_rules_table.php | 6 +-
...44_add_exclude_hive_ids_to_alert_rules.php | 10 +-
...164840_add_alert_rules_last_calculated.php | 16 +-
...1_02_24_095050_create_flash_logs_table.php | 8 +-
...2021_03_26_124313_add_flashlog_columns.php | 4 +-
.../2021_04_09_180304_add_device_datetime.php | 4 +-
...4_09_220304_add_device_datetime_offset.php | 4 +-
...0653_add_queen_hive_delete_foreign_key.php | 3 +-
...e_sensor_definition_delete_foreign_key.php | 3 +-
..._change_sensors_offset_float_to_double.php | 8 +-
...add_alert_on_occurences_to_alert_rules.php | 4 +-
..._191500_add_alert_rules_last_evaluated.php | 16 +-
...27_143213_add_flashlog_time_percentage.php | 4 +-
...2021_09_27_122352_remove_unused_tables.php | 3 +-
...021_09_27_134729_upgrade_db_to_utf8mb4.php | 202 +-
...2346_correct_hive_b_b_depth_and_height.php | 22 +-
...21_10_15_103342_add_rate_limit_to_user.php | 2 +-
...2022_06_20_093325_add_queen_birth_date.php | 12 +-
...22_06_20_123603_create_hive_tags_table.php | 2 +-
...2_135520_create_dashboard_groups_table.php | 7 +-
...4_03_083652_create_organizations_table.php | 71 +-
...o_role_user_and_permission_user_tables.php | 75 +-
..._10_120312_create_checklist_svgs_table.php | 2 +-
...90001_create_alert_rule_formulas_table.php | 5 +-
...1247_add_future_to_alert_rule_formulas.php | 32 +-
...luation_results_to_alert_rule_formulas.php | 3 +-
.../2024_09_28_220019_add_rtc_to_devices.php | 8 +-
...5_073900_add_log_validation_to_devices.php | 1 -
database/seeds/DatabaseSeeder.php | 4 +-
database/seeds/DeviceCorrectionSeeder.php | 63 +-
database/seeds/MeasurementSeeder.php | 228 +-
database/seeds/UserSeeder.php | 12 +-
...16e8b83a448fde4e8cbab313b38ca246d5c580.php | 47 +-
public/docs/source/config.php | 11 +-
public/index.php | 2 -
resources/lang/en/alert.php | 16 +-
resources/lang/en/beep.php | 112 +-
resources/lang/en/crud.php | 76 +-
resources/lang/en/export.php | 90 +-
resources/lang/en/general.php | 154 +-
resources/lang/en/group.php | 34 +-
resources/lang/en/samplecode.php | 12 +-
resources/lang/en/taxonomy.php | 10 +-
resources/lang/nl/alert.php | 16 +-
resources/lang/nl/beep.php | 112 +-
resources/lang/nl/crud.php | 80 +-
resources/lang/nl/export.php | 90 +-
resources/lang/nl/general.php | 154 +-
resources/lang/nl/group.php | 32 +-
resources/lang/nl/passwords.php | 2 +-
resources/lang/nl/samplecode.php | 12 +-
resources/lang/nl/taxonomy.php | 10 +-
resources/lang/nl/validation.php | 142 +-
routes/api.php | 268 +-
routes/web.php | 297 ++-
server.php | 2 -
tests/ExampleTest.php | 8 +-
259 files changed, 13235 insertions(+), 14567 deletions(-)
diff --git a/app/BeeRace.php b/app/BeeRace.php
index 8ce229c7..c790ad34 100644
--- a/app/BeeRace.php
+++ b/app/BeeRace.php
@@ -7,6 +7,6 @@
class BeeRace extends Model
{
protected $fillable = ['name', 'type', 'synonyms', 'continents'];
- protected $guarded = ['id'];
+ protected $guarded = ['id'];
}
diff --git a/app/Category.php b/app/Category.php
index ec7d54aa..86d9b67b 100644
--- a/app/Category.php
+++ b/app/Category.php
@@ -2,55 +2,53 @@
namespace App;
+use Cache;
use Illuminate\Database\Eloquent\Model;
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
-use Cache;
class Category extends Model
{
use NodeTrait;
- protected $table = 'categories';
+ protected $table = 'categories';
protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type', 'required'];
- protected $guarded = ['id'];
- protected $hidden = ['created_at','updated_at', 'category_input_id', 'physical_quantity_id','_lft','_rgt','pivot','input_type','options','old_id'];
+ protected $guarded = ['id'];
- protected $appends = ['input','trans','unit']; //'parent'
+ protected $hidden = ['created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'input_type', 'options', 'old_id'];
- public static $types=
- [
- 'checklist' => 'Hive checklist item',
- 'research' => 'Research specific item',
- 'system' => 'System (required for interface)',
- ];
+ protected $appends = ['input', 'trans', 'unit']; // 'parent'
+
+ public static $types =
+ [
+ 'checklist' => 'Hive checklist item',
+ 'research' => 'Research specific item',
+ 'system' => 'System (required for interface)',
+ ];
public static function boot()
{
parent::boot();
- static::created(function($c)
- {
+ static::created(function ($c) {
$c->forgetCache();
});
- static::updated(function($c)
- {
+ static::updated(function ($c) {
$c->forgetCache();
});
- static::deleted(function($c)
- {
+ static::deleted(function ($c) {
$c->forgetCache();
- Translation::where('type','category')->where('name', $c->name)->delete();
+ Translation::where('type', 'category')->where('name', $c->name)->delete();
});
}
public function forgetCache()
{
-
+
Cache::forget('cat-'.$this->id.'-input-type');
Cache::forget('root-'.$this->id.'-anc');
Cache::forget('root-'.$this->id.'-trans-anc');
@@ -60,9 +58,8 @@ public function forgetCache()
Cache::forget("queen-race-$this->id-name");
$locales = Language::pluck('twochar');
-
- foreach ($locales as $locale)
- {
+
+ foreach ($locales as $locale) {
// Category
Cache::forget('trans-'.$this->id.'-'.$this->name);
Cache::forget('trans-'.$this->id.'-'.$this->name.'-lan');
@@ -73,7 +70,7 @@ public function forgetCache()
Cache::forget('area-type-array-'.$locale);
Cache::forget('area-type-array-'.$locale.'-translated');
}
-
+
self::forgetTaxonomyListCache();
}
@@ -90,12 +87,13 @@ public static function forgetTaxonomyListCache()
// Relations
public function getInputAttribute()
{
- if ($this->category_input_id != null)
- {
+ if ($this->category_input_id != null) {
$type = CategoryInput::where('id', $this->category_input_id)->value('type');
- if ($type)
+ if ($type) {
return $type;
+ }
}
+
return null;
}
@@ -119,25 +117,28 @@ public function getTransAttribute()
return $this->trans();
}
- public function getUnitAttribute($value=null) // PGe 2022-05-23: apparently the $value is filled with '' in case of an append
+ public function getUnitAttribute($value = null) // PGe 2022-05-23: apparently the $value is filled with '' in case of an append
{
- if (empty($value))
+ if (empty($value)) {
$value = 'abbreviation';
+ }
- if ($this->physical_quantity_id != null && $this->physicalQuantity)
+ if ($this->physical_quantity_id != null && $this->physicalQuantity) {
return $this->physicalQuantity()->value($value);
+ }
return null;
}
public function getPhysicalQuantityNameAttribute()
{
- if ($this->physical_quantity_id != null && $this->physicalQuantity)
+ if ($this->physical_quantity_id != null && $this->physicalQuantity) {
return $this->physicalQuantity()->value('name');
+ }
return null;
}
-
+
public function physicalQuantity()
{
return $this->hasOne(PhysicalQuantity::class, 'id', 'physical_quantity_id');
@@ -153,17 +154,18 @@ public function inputType()
return $this->hasOne(CategoryInput::class, 'id', 'category_input_id');
}
-
public function isSystem()
{
- if ($this->type == 'system')
+ if ($this->type == 'system') {
return true;
+ }
$ancTypeArr = $this->ancestors->pluck('type')->toArray();
- if (in_array('system', $ancTypeArr))
+ if (in_array('system', $ancTypeArr)) {
return true;
- //die(print_r(['anc'=>$ancTypeArr, 'cat'=>$this->name]));
+ }
+ // die(print_r(['anc'=>$ancTypeArr, 'cat'=>$this->name]));
return false;
}
@@ -171,8 +173,9 @@ public function isSystem()
public function physicalQuantityId()
{
$quan = $this->physicalQuantity;
- if (isset($quan))
+ if (isset($quan)) {
return $quan->id;
+ }
return null;
}
@@ -180,8 +183,9 @@ public function physicalQuantityId()
public function inputTypeName()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->name;
+ }
return '';
}
@@ -189,8 +193,9 @@ public function inputTypeName()
public function inputTypeType()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->type;
+ }
return '';
}
@@ -198,8 +203,9 @@ public function inputTypeType()
public function inputTypeIcon()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->glyphIcon();
+ }
return '';
}
@@ -207,8 +213,9 @@ public function inputTypeIcon()
public function inputTypeId()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->id;
+ }
return null;
}
@@ -216,47 +223,51 @@ public function inputTypeId()
public function inputRange()
{
$type = $this->inputType;
- $range= [];
- $types= ['boolean','boolean_yes_red','score_quality','score_amount','smileys_3'];
+ $range = [];
+ $types = ['boolean', 'boolean_yes_red', 'score_quality', 'score_amount', 'smileys_3'];
- if (isset($type))
- {
+ if (isset($type)) {
$inputType = $type->type;
- if (in_array($inputType, $types))
- {
+ if (in_array($inputType, $types)) {
$type_trans_array = __("taxonomy.$inputType");
- //dd($type_trans_array);
- for ($i=0; $i < count($type_trans_array); $i++)
+ // dd($type_trans_array);
+ for ($i = 0; $i < count($type_trans_array); $i++) {
$range[] = "$i=".$type->render($i);
- }
- else
- {
- if (isset($type->min)) array_push($range, __('crud.min').': '.$type->min);
- if (isset($type->max)) array_push($range, __('crud.max').': '.$type->max);
+ }
+ } else {
+ if (isset($type->min)) {
+ array_push($range, __('crud.min').': '.$type->min);
+ }
+ if (isset($type->max)) {
+ array_push($range, __('crud.max').': '.$type->max);
+ }
}
}
+
return count($range) == 0 ? null : implode("\n", $range);
}
-public function translation($language_abbr)
+ public function translation($language_abbr)
{
- return Cache::rememberForever('trans-'.$this->id.'-'.$language_abbr, function () use ($language_abbr){
+ return Cache::rememberForever('trans-'.$this->id.'-'.$language_abbr, function () use ($language_abbr) {
$lang_id = Language::where('abbreviation', $language_abbr)->pluck('id');
- if ($lang_id)
- return Translation::where('type','category')->where('language_id', $lang_id)->where('name', $this->name)->value('translation');
-
+ if ($lang_id) {
+ return Translation::where('type', 'category')->where('language_id', $lang_id)->where('name', $this->name)->value('translation');
+ }
+
return $this->name;
});
}
public function translations()
{
- return Cache::rememberForever('trans-'.$this->id.'-'.$this->name.'-lan', function (){
- $trans = Translation::where('type','category')->where('name', $this->name)->pluck('translation','language_id');
- if ($trans)
+ return Cache::rememberForever('trans-'.$this->id.'-'.$this->name.'-lan', function () {
+ $trans = Translation::where('type', 'category')->where('name', $this->name)->pluck('translation', 'language_id');
+ if ($trans) {
return $trans;
-
- return [['translation'=>$this->name, 'language_id'=>0]];
+ }
+
+ return [['translation' => $this->name, 'language_id' => 0]];
});
}
@@ -269,57 +280,61 @@ public function trans()
public function transName($locale = null)
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
-
- return Cache::rememberForever('trans-'.$this->id.'-'.$locale.'-'.$this->name, function () use ($locale){
+ }
+
+ return Cache::rememberForever('trans-'.$this->id.'-'.$locale.'-'.$this->name, function () use ($locale) {
$trans = $this->trans;
+
return isset($trans[$locale]) ? $trans[$locale] : $this->name;
});
}
- public function ancName($locale = null, $sep = " > ")
+ public function ancName($locale = null, $sep = ' > ')
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
-
- return Cache::rememberForever('trans-'.$this->id.'-'.$locale.'-'.$this->name.'-anc', function () use ($locale, $sep){
- $ancest = $this->getAncestors()->map(function($item,$key) use ($locale, $sep){
+ }
+
+ return Cache::rememberForever('trans-'.$this->id.'-'.$locale.'-'.$this->name.'-anc', function () use ($locale, $sep) {
+ $ancest = $this->getAncestors()->map(function ($item, $key) use ($locale, $sep) {
return $item->transName($locale).$sep;
});
+
return $ancest->implode('');
});
}
public function rootName($locale = null)
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
+ }
- $ancest = Cache::rememberForever('root-'.$this->id.'-trans-anc', function ()
- {
+ $ancest = Cache::rememberForever('root-'.$this->id.'-trans-anc', function () {
return $this->getAncestors();
});
- if ($ancest->count() > 0)
+ if ($ancest->count() > 0) {
return $ancest->get(0)->transName($locale);
+ }
- return "";
+ return '';
}
public function rootNodeName()
{
- $ancest = Cache::rememberForever('root-'.$this->id.'-anc', function ()
- {
+ $ancest = Cache::rememberForever('root-'.$this->id.'-anc', function () {
return $this->getAncestors();
});
- if ($ancest->count() > 0)
+ if ($ancest->count() > 0) {
return $ancest->get(0)->name;
+ }
- return "";
+ return '';
}
-
public function useAmount()
{
$i = InspectionItem::where('category_id', $this->id)->count();
@@ -331,36 +346,37 @@ public function useAmount()
$q = Queen::where('race_id', $this->id)->count();
$o = isset($this->old_id) ? 1 : 0;
- $total_usage = $i+$v+$h+$f+$l+$s+$q+$o;
+ $total_usage = $i + $v + $h + $f + $l + $s + $q + $o;
return $total_usage;
}
// // finding on ::type()
- // public function scopeType()
+ // public function scopeType()
// {
// return $this->inputTypeType;
// }
// //finding on ::name()
- // public function scopeName($query, $name)
+ // public function scopeName($query, $name)
// {
// return $query->where('name', $name);
// }
// // finding on ::name()
- // public function scopeTypeName($query, $type, $name)
+ // public function scopeTypeName($query, $type, $name)
// {
// return $query->where('type', $type)->where('name', $name);
// }
- //finding on ::child()
- public static function findCategoryByParentAndName($parent_name, $name)
+ // finding on ::child()
+ public static function findCategoryByParentAndName($parent_name, $name)
{
- //$parent = self::whereJoin('name', $parent_name)->whereJoin('children.name', $name)->first();
+ // $parent = self::whereJoin('name', $parent_name)->whereJoin('children.name', $name)->first();
$parent = self::where('name', $parent_name)->first();
- if (isset($parent))
+ if (isset($parent)) {
return $parent->children()->where('name', $name)->first();
+ }
return new Category;
}
@@ -368,90 +384,95 @@ public static function findCategoryByParentAndName($parent_name, $name)
public static function findCategoryIdByParentAndName($parent_name, $name)
{
$cat = self::findCategoryByParentAndName($parent_name, $name);
- if (isset($cat))
+ if (isset($cat)) {
return $cat->id;
+ }
return null;
}
- public static function descendentsByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function descendentsByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
$category = self::findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn);
- //die(print_r($category->toArray()));
- if (isset($category))
+ // die(print_r($category->toArray()));
+ if (isset($category)) {
return self::whereDescendantOf($category)->get();
+ }
return [];
}
- public static function findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
$root = self::whereIsRoot()->where('name', $root_name)->first();
- if ($root_name === $parent_name && isset($root))
+ if ($root_name === $parent_name && isset($root)) {
$parent = $root;
- else
+ } else {
$parent = self::descendantsAndSelf($root)->whereIn('type', $whereTypeIn)->where('name', $parent_name)->first();
+ }
- //dd($parent);
- if (isset($parent))
+ // dd($parent);
+ if (isset($parent)) {
return $parent->children()->where('name', $name)->first();
+ }
return new Category;
}
- public static function findCategoryIdByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function findCategoryIdByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
$cat = self::findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn);
- if (isset($cat))
+ if (isset($cat)) {
return $cat->id;
+ }
return null;
}
- public static function getRootIds($order=true)
+ public static function getRootIds($order = true)
{
$locale = LaravelLocalization::getCurrentLocale();
- if ($order)
- return self::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->pluck('id')->toArray();
+ if ($order) {
+ return self::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->pluck('id')->toArray();
+ }
return self::whereIsRoot()->whereNotIn('type', ['system'])->get()->pluck('id')->toArray();
}
- public static function getTaxonomy($rootNodes=null, $order=true, $flat=false, $whereNotInTypes=['system'])
+ public static function getTaxonomy($rootNodes = null, $order = true, $flat = false, $whereNotInTypes = ['system'])
{
$locale = LaravelLocalization::getCurrentLocale();
- if (gettype($rootNodes) !== 'array' || count($rootNodes) == 0)
- {
- if ($order === true)
- $rootNodes = self::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->pluck('id');
- else
+ if (gettype($rootNodes) !== 'array' || count($rootNodes) == 0) {
+ if ($order === true) {
+ $rootNodes = self::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->pluck('id');
+ } else {
$rootNodes = self::whereIsRoot()->whereNotIn('type', ['system'])->pluck('id');
+ }
}
-
- $taxonomy = collect();
- foreach ($rootNodes as $node)
- {
- if ($flat == true && ($order === null || $order === false))
- $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node) );
- else if ($flat == true && $order === true)
- $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node)->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE) );
- else if ($flat == false && $order === null)
- $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node)->toTree() );
- else if ($flat == false)
- {
- if (gettype($order) == 'array' && count($order) > 0)
- $taxonomy = $taxonomy->merge(self::descendantsAndSelf($node)->whereNotIn('type', $whereNotInTypes)->sortBy(function($cat, $key) use ($order) { return array_search($cat->id, $order); })->toTree());
- else
- $taxonomy = $taxonomy->merge(self::descendantsAndSelf($node)->whereNotIn('type', $whereNotInTypes)->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->toTree());
+
+ $taxonomy = collect();
+ foreach ($rootNodes as $node) {
+ if ($flat == true && ($order === null || $order === false)) {
+ $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node));
+ } elseif ($flat == true && $order === true) {
+ $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node)->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE));
+ } elseif ($flat == false && $order === null) {
+ $taxonomy = $taxonomy->merge(self::whereNotIn('type', $whereNotInTypes)->descendantsAndSelf($node)->toTree());
+ } elseif ($flat == false) {
+ if (gettype($order) == 'array' && count($order) > 0) {
+ $taxonomy = $taxonomy->merge(self::descendantsAndSelf($node)->whereNotIn('type', $whereNotInTypes)->sortBy(function ($cat, $key) use ($order) {
+ return array_search($cat->id, $order);
+ })->toTree());
+ } else {
+ $taxonomy = $taxonomy->merge(self::descendantsAndSelf($node)->whereNotIn('type', $whereNotInTypes)->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->toTree());
+ }
}
}
return $taxonomy;
}
-
-
}
diff --git a/app/CategoryFactory.php b/app/CategoryFactory.php
index a8d4e0d1..f8855afe 100644
--- a/app/CategoryFactory.php
+++ b/app/CategoryFactory.php
@@ -6,148 +6,122 @@
class CategoryFactory
{
-
- public function __construct()
- {
-
- }
+ public function __construct() {}
public function get_old_ids_array()
{
$checklist_ids = collect();
- $root_cats = Category::whereIsRoot()->whereNotIn('type',['system'])->get();
- foreach ($root_cats as $root)
- {
+ $root_cats = Category::whereIsRoot()->whereNotIn('type', ['system'])->get();
+ foreach ($root_cats as $root) {
$checklist_ids = $checklist_ids->merge(Category::whereDescendantOrSelf($root)->where('old_id', '<>', 'null')->pluck('id'));
}
- foreach ($checklist_ids as $id)
- {
+ foreach ($checklist_ids as $id) {
$checklist_ids = $checklist_ids->merge(Category::whereAncestorOrSelf($id)->pluck('id'));
}
$checklist_ids = $checklist_ids->unique()->toArray();
+
return $checklist_ids;
}
public function parse_taxonomy($saveToDatabase = true)
{
- $content = Storage::get('taxonomy.json');
- $json = json_decode($content);
- $collect = collect($json);
+ $content = Storage::get('taxonomy.json');
+ $json = json_decode($content);
+ $collect = collect($json);
$taxonomy = $collect->flatten(1)->toArray()[0]->body->outline[0]->outline;
- $tax_arr = $this->recurse([], $taxonomy, $saveToDatabase);
+ $tax_arr = $this->recurse([], $taxonomy, $saveToDatabase);
return $tax_arr;
}
- public function recurse($arr, $cat, $save)
- {
- // direct categories
- if (isset($cat->outline))
- {
- if (is_array($cat->outline))
- {
- foreach($cat->outline as $o)
- {
- if (isset($o->_text))
- {
- $lbl = $this->formatCategoryString($o->_text, $save);
- if (isset($o->outline))
- {
- $arr[$lbl] = $this->recurse([], $o, $save);
- }
- else
- {
- $arr = $this->addValue($arr, $o->_text, $save);
- }
- }
- }
- }
- else if (isset($cat->outline->_text))
- {
- $arr = $this->addValue($arr, $cat->outline->_text, $save);
- }
- }
+ public function recurse($arr, $cat, $save)
+ {
+ // direct categories
+ if (isset($cat->outline)) {
+ if (is_array($cat->outline)) {
+ foreach ($cat->outline as $o) {
+ if (isset($o->_text)) {
+ $lbl = $this->formatCategoryString($o->_text, $save);
+ if (isset($o->outline)) {
+ $arr[$lbl] = $this->recurse([], $o, $save);
+ } else {
+ $arr = $this->addValue($arr, $o->_text, $save);
+ }
+ }
+ }
+ } elseif (isset($cat->outline->_text)) {
+ $arr = $this->addValue($arr, $cat->outline->_text, $save);
+ }
+ }
- // sub categories
- foreach($cat as $c)
- {
- if (isset($c->outline))
- {
- $lbl1 = $this->formatCategoryString($c->_text, $save);
- $arr[$lbl1] = [];
+ // sub categories
+ foreach ($cat as $c) {
+ if (isset($c->outline)) {
+ $lbl1 = $this->formatCategoryString($c->_text, $save);
+ $arr[$lbl1] = [];
- foreach ($c->outline as $t)
- {
- if (isset($t->_text))
- {
- $lbl2 = $this->formatCategoryString($t->_text, $save);
+ foreach ($c->outline as $t) {
+ if (isset($t->_text)) {
+ $lbl2 = $this->formatCategoryString($t->_text, $save);
- if (isset($t->outline))
- {
- $arr[$lbl1][$lbl2] = $this->recurse([], $t, $save);
- }
- else
- {
- $arr[$lbl1] = $this->addValue($arr[$lbl1], $t->_text, $save);
- }
- }
- }
- }
- }
+ if (isset($t->outline)) {
+ $arr[$lbl1][$lbl2] = $this->recurse([], $t, $save);
+ } else {
+ $arr[$lbl1] = $this->addValue($arr[$lbl1], $t->_text, $save);
+ }
+ }
+ }
+ }
+ }
- return $arr;
- }
+ return $arr;
+ }
- public function addValue($arr, $txt, $save)
- {
- $lbl = $this->formatCategoryString($txt, $save);
- array_push($arr, $lbl);
- return $arr;
- }
+ public function addValue($arr, $txt, $save)
+ {
+ $lbl = $this->formatCategoryString($txt, $save);
+ array_push($arr, $lbl);
- public function formatCategoryString($str, $save=false)
- {
- $out = str_replace(' / ', '_', $str);
- $out = str_replace(' ', '_', $out);
- $out = strtolower($out);
- $out = urlencode($out);
+ return $arr;
+ }
- if ($save)
- Translation::saveText('en_gb', $out, 'category', $str);
+ public function formatCategoryString($str, $save = false)
+ {
+ $out = str_replace(' / ', '_', $str);
+ $out = str_replace(' ', '_', $out);
+ $out = strtolower($out);
+ $out = urlencode($out);
+
+ if ($save) {
+ Translation::saveText('en_gb', $out, 'category', $str);
+ }
- return $out;
- }
+ return $out;
+ }
- public function saveDynamicCategories($categories, $parent_id=null)
- {
- if (is_array($categories))
- {
- foreach ($categories as $name => $category)
- {
+ public function saveDynamicCategories($categories, $parent_id = null)
+ {
+ if (is_array($categories)) {
+ foreach ($categories as $name => $category) {
- if (is_array($category))
- {
- $cat = new Category;
- $cat->type = 'list';
- $cat->name = $name;
- $cat->parent_id = $parent_id;
- $cat->category_input_id = $this->getCatrgoryInputId('list', 'list');
- $cat->save();
- $this->saveDynamicCategories($category, $cat->id);
- }
- else
- {
- $cat = new Category;
- $cat->type = $name;
- $cat->name = $category;
- $cat->parent_id = $parent_id;
- $cat->category_input_id = $this->getCatrgoryInputId($name, 'list_item');
- $cat->save();
- }
- }
- }
- else
- {
+ if (is_array($category)) {
+ $cat = new Category;
+ $cat->type = 'list';
+ $cat->name = $name;
+ $cat->parent_id = $parent_id;
+ $cat->category_input_id = $this->getCatrgoryInputId('list', 'list');
+ $cat->save();
+ $this->saveDynamicCategories($category, $cat->id);
+ } else {
+ $cat = new Category;
+ $cat->type = $name;
+ $cat->name = $category;
+ $cat->parent_id = $parent_id;
+ $cat->category_input_id = $this->getCatrgoryInputId($name, 'list_item');
+ $cat->save();
+ }
+ }
+ } else {
$cat = new Category;
$cat->type = 'list_item';
$cat->name = $categories;
@@ -155,51 +129,44 @@ public function saveDynamicCategories($categories, $parent_id=null)
$cat->category_input_id = $this->getCatrgoryInputId($categories, 'list_item');
$cat->save();
}
- }
+ }
- public function getCatrgoryInputId($type, $fallbackType)
- {
- if (CategoryInput::where('type', $type)->count() > 0)
- return CategoryInput::where('type', $type)->value('id');
-
- return CategoryInput::where('type', $fallbackType)->value('id');
- }
+ public function getCatrgoryInputId($type, $fallbackType)
+ {
+ if (CategoryInput::where('type', $type)->count() > 0) {
+ return CategoryInput::where('type', $type)->value('id');
+ }
+ return CategoryInput::where('type', $fallbackType)->value('id');
+ }
- public function saveStaticCategories($categories)
- {
- foreach ($categories as $base_key => $base_cat)
- {
+ public function saveStaticCategories($categories)
+ {
+ foreach ($categories as $base_key => $base_cat) {
$base = new Category;
- $base->type = $base_key;
- $base->name = $base_key;
+ $base->type = $base_key;
+ $base->name = $base_key;
$base->save();
- foreach ($base_cat as $cat_key => $cat_obj)
- {
-
- if (is_array($cat_obj))
- {
+ foreach ($base_cat as $cat_key => $cat_obj) {
+
+ if (is_array($cat_obj)) {
$parent = new Category;
- $parent->type = 'category';
- $parent->name = $cat_key;
+ $parent->type = 'category';
+ $parent->name = $cat_key;
$parent->parent_id = $base->id;
$parent->save();
- foreach ($cat_obj as $name => $type)
- {
-
- if (is_array($type))
- {
+ foreach ($cat_obj as $name => $type) {
+
+ if (is_array($type)) {
$child = new Category;
- $child->type = 'select';
- $child->name = $name;
+ $child->type = 'select';
+ $child->name = $name;
$child->parent_id = $parent->id;
- $child->options = implode(',',$type);
+ $child->options = implode(',', $type);
$child->save();
- }
- else
- {
+ } else {
$cat = new Category;
$cat->type = $type;
$cat->name = $name;
@@ -207,12 +174,10 @@ public function saveStaticCategories($categories)
$cat->save();
}
}
- }
- else
- {
+ } else {
$cat = new Category;
- $cat->type = 'category';
- $cat->name = $cat_obj;
+ $cat->type = 'category';
+ $cat->name = $cat_obj;
$cat->parent_id = $base->id;
$cat->save();
}
@@ -220,91 +185,86 @@ public function saveStaticCategories($categories)
}
Category::fixTree(); // kalnoy/nestedset: to fix the tree to fill _lft and _rgt columns
- }
-
-
+ }
- public function saveOldCategories()
- {
- $categories = [
- 'action' =>[
- 'food'=>[
- 'sugar_concentration_perc'=>'number',
- 'litres_of_suger_water'=>'number',
- ],
- 'disease'=>[
- 'varroa_treatment'=>['apistan','formic_acid','lactic_acid','oxalic_acid','powdered_sugar','other'],
- ],
- 'reminder'=>[
- 'reminder'=>'text',
- 'remind_date'=>'date',
+ public function saveOldCategories()
+ {
+ $categories = [
+ 'action' => [
+ 'food' => [
+ 'sugar_concentration_perc' => 'number',
+ 'litres_of_suger_water' => 'number',
],
- 'colony'=>[
- 'split_colony'=>'boolean',
- 'merge_colonies'=>'boolean',
- ],
- 'size',
- 'queen'=>[
- 'queen_introduced'=>'text',
- 'queen_cells_removed'=>'number',
- 'queen_cells_left'=>'number',
- ],
- 'harvest'=>[
- 'kg_honey_harvested'=>'number',
- 'frames_with_honey_left'=>'number',
- ],
- 'tools',
- 'other'
+ 'disease' => [
+ 'varroa_treatment' => ['apistan', 'formic_acid', 'lactic_acid', 'oxalic_acid', 'powdered_sugar', 'other'],
+ ],
+ 'reminder' => [
+ 'reminder' => 'text',
+ 'remind_date' => 'date',
+ ],
+ 'colony' => [
+ 'split_colony' => 'boolean',
+ 'merge_colonies' => 'boolean',
+ ],
+ 'size',
+ 'queen' => [
+ 'queen_introduced' => 'text',
+ 'queen_cells_removed' => 'number',
+ 'queen_cells_left' => 'number',
+ ],
+ 'harvest' => [
+ 'kg_honey_harvested' => 'number',
+ 'frames_with_honey_left' => 'number',
+ ],
+ 'tools',
+ 'other',
],
- 'condition' =>[
- 'overall'=>[
- 'positive_impression'=>'score',
- 'needs_attention'=>'boolean',
- 'notes'=>'text',
- ],
- 'activity',
- 'brood',
- 'development'=>[
- 'frames_with_bees'=>'number',
- 'all_stages_of_brood_types'=>['eggs','larvae','pupae'],
- 'queen_present'=>'boolean',
- 'queen_cells'=>'number',
- 'queen_cells_types'=>['swarm','supercedure','emergency'],
- ],
- 'disease'=>[
- 'varroa_count'=>'number',
- ],
- 'flight',
- 'food'=>[
- 'sufficient_food'=>'score',
- 'frames_with_honey'=>'number',
- 'frames_with_pollen'=>'number',
- ],
- 'frame_stability',
+ 'condition' => [
+ 'overall' => [
+ 'positive_impression' => 'score',
+ 'needs_attention' => 'boolean',
+ 'notes' => 'text',
+ ],
+ 'activity',
+ 'brood',
+ 'development' => [
+ 'frames_with_bees' => 'number',
+ 'all_stages_of_brood_types' => ['eggs', 'larvae', 'pupae'],
+ 'queen_present' => 'boolean',
+ 'queen_cells' => 'number',
+ 'queen_cells_types' => ['swarm', 'supercedure', 'emergency'],
+ ],
+ 'disease' => [
+ 'varroa_count' => 'number',
+ ],
+ 'flight',
+ 'food' => [
+ 'sufficient_food' => 'score',
+ 'frames_with_honey' => 'number',
+ 'frames_with_pollen' => 'number',
+ ],
+ 'frame_stability',
'health',
- 'loss'=>[
- 'colony_lost'=>'boolean',
- 'colony_lost_reason'=>'text',
- ],
- 'size',
- 'space',
- 'strength',
- 'temper',
- 'queen',
- 'winter_hardness',
- 'other'
+ 'loss' => [
+ 'colony_lost' => 'boolean',
+ 'colony_lost_reason' => 'text',
+ ],
+ 'size',
+ 'space',
+ 'strength',
+ 'temper',
+ 'queen',
+ 'winter_hardness',
+ 'other',
],
- 'hive_layer'=>['brood','honey','grid','empty'],
- 'hive_frame'=>['wax','block','other'],
- 'location' =>['fixed','movable','temporary','other'],
- 'production'=>['honey', 'wax', 'pollen', 'other'],
- 'setting' =>['app', 'general', 'sensor'],
- 'sensor' =>['beep','hiveeyes','arnia','manual','other'],
- ];
+ 'hive_layer' => ['brood', 'honey', 'grid', 'empty'],
+ 'hive_frame' => ['wax', 'block', 'other'],
+ 'location' => ['fixed', 'movable', 'temporary', 'other'],
+ 'production' => ['honey', 'wax', 'pollen', 'other'],
+ 'setting' => ['app', 'general', 'sensor'],
+ 'sensor' => ['beep', 'hiveeyes', 'arnia', 'manual', 'other'],
+ ];
$this->saveStaticCategories($categories);
- }
-
+ }
}
-
-
diff --git a/app/CategoryInput.php b/app/CategoryInput.php
index 6083d0f7..573ccf34 100644
--- a/app/CategoryInput.php
+++ b/app/CategoryInput.php
@@ -3,17 +3,13 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
-use Moment\Moment;
-use App\Category;
-use App\Hive;
-use App\Location;
use LaravelLocalization;
class CategoryInput extends Model
{
protected $table = 'category_inputs';
- public $fillable = ['name','type','min','max','decimals','icon'];
+ public $fillable = ['name', 'type', 'min', 'max', 'decimals', 'icon'];
public $hidden = ['icon'];
@@ -30,14 +26,17 @@ public function name_plus()
{
$out = $this->name;
- if (isset($this->min))
+ if (isset($this->min)) {
$out .= ' | min:'.$this->min;
+ }
- if (isset($this->max))
+ if (isset($this->max)) {
$out .= ' | max:'.$this->max;
+ }
- if (isset($this->decimals))
+ if (isset($this->decimals)) {
$out .= ' | decimals:'.$this->decimals;
+ }
return $out;
}
@@ -47,61 +46,64 @@ public static function getTypeId($type)
return CategoryInput::where('type', $type)->value('id');
}
-
public static function selectList()
{
- $list = [];
+ $list = [];
- foreach(CategoryInput::orderBy('name')->get() as $ci)
- $list[$ci->id] = $ci->name_plus();
-
- return $list;
+ foreach (CategoryInput::orderBy('name')->get() as $ci) {
+ $list[$ci->id] = $ci->name_plus();
+ }
+
+ return $list;
}
public function render($val, $locale = null)
{
- if (!isset($val) || $val === null)
+ if (! isset($val) || $val === null) {
return null;
+ }
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
+ }
- $intVal = intval($val);
+ $intVal = intval($val);
$type_array = __('taxonomy.'.$this->type);
- switch($this->type)
- {
+ switch ($this->type) {
case 'select':
case 'options':
case 'list_item':
$name = null;
$cat = Category::find($intVal);
- if ($cat)
+ if ($cat) {
$name = $cat->transName($locale);
+ }
- if ($name)
+ if ($name) {
$val = $name;
+ }
break;
case 'list':
$optionNames = [];
- foreach(explode(',', $val) as $option)
- {
+ foreach (explode(',', $val) as $option) {
$name = null;
$cat = Category::find($option);
- if ($cat)
+ if ($cat) {
$name = $cat->transName($locale);
+ }
- if ($name)
+ if ($name) {
array_push($optionNames, $name);
+ }
}
- $val = implode(',',$optionNames);
+ $val = implode(',', $optionNames);
break;
case 'date':
- if (isset($val) && $val != null)
- {
+ if (isset($val) && $val != null) {
$time = strtotime($val);
$val = date('Y-m-d H:i:s', $time);
}
@@ -112,74 +114,76 @@ public function render($val, $locale = null)
case 'score_quality':
case 'score_amount':
case 'smileys_3':
- if ($intVal > -1 && $intVal < count($type_array))
+ if ($intVal > -1 && $intVal < count($type_array)) {
$val = $type_array[$intVal];
+ }
break;
case 'select_hive':
$hive = Hive::find($intVal);
- if ($hive)
+ if ($hive) {
$val = $hive->name;
+ }
break;
case 'select_apiary':
case 'select_location':
$loc = Location::find($intVal);
- if ($loc)
+ if ($loc) {
$val = $loc->name;
+ }
break;
}
+
return $val;
}
public function glyphIcon()
{
- $icons =
- [
- 'boolean' => 'ok-sign',
+ $icons =
+ [
+ 'boolean' => 'ok-sign',
'boolean_yes_red' => 'remove-sign',
- 'date' => 'calendar',
- 'list' => 'list-alt',
+ 'date' => 'calendar',
+ 'list' => 'list-alt',
'list_item' => 'unchecked',
- 'number' => 'stats',
+ 'number' => 'stats',
'number_0_decimals' => 'stats',
'number_1_decimals' => 'stats',
'number_2_decimals' => 'stats',
'number_3_decimals' => 'stats',
- 'number_negative' => 'stats',
+ 'number_negative' => 'stats',
'number_percentage' => 'resize-horizontal',
- 'number_positive' => 'stats',
- 'options' => 'record',
- 'text' => 'align-left',
- 'barcode' => 'barcode',
+ 'number_positive' => 'stats',
+ 'options' => 'record',
+ 'text' => 'align-left',
+ 'barcode' => 'barcode',
'bee_subspecies' => 'queen',
- 'color_picker' => 'eyedropper',
- 'file' => 'save-file',
- 'grade' => 'bookmark',
- 'image' => 'picture',
- 'label' => 'tag',
- 'number_degrees' => 'view-360',
- 'score' => 'star-empty',
- 'score_amount' => 'star-empty',
+ 'color_picker' => 'eyedropper',
+ 'file' => 'save-file',
+ 'grade' => 'bookmark',
+ 'image' => 'picture',
+ 'label' => 'tag',
+ 'number_degrees' => 'view-360',
+ 'score' => 'star-empty',
+ 'score_amount' => 'star-empty',
'score_quality' => 'star-empty',
- 'select' => 'collapse-down',
- 'select_apiary'=> 'th',
- 'select_continent'=> 'globe',
- 'select_country'=> 'globe',
- 'select_hive' => 'credit-card',
+ 'select' => 'collapse-down',
+ 'select_apiary' => 'th',
+ 'select_continent' => 'globe',
+ 'select_country' => 'globe',
+ 'select_hive' => 'credit-card',
'select_hive_layer' => 'credit-card',
'select_hive_layer_frame' => 'credit-card',
- 'select_location'=> 'map-marker',
- 'slider' => 'minus',
+ 'select_location' => 'map-marker',
+ 'slider' => 'minus',
'smileys_3' => 'star',
- ];
+ ];
- return isset($icons[$this->type]) ? $icons[$this->type] : 'alert';
+ return isset($icons[$this->type]) ? $icons[$this->type] : 'alert';
}
-
}
-
diff --git a/app/Checklist.php b/app/Checklist.php
index 2022894f..5ab63c5f 100644
--- a/app/Checklist.php
+++ b/app/Checklist.php
@@ -2,12 +2,9 @@
namespace App;
+use Auth;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
-use App\Category;
-use App\Taxonomy;
-use Auth;
-
use Illuminate\Support\Facades\DB;
class Checklist extends Model
@@ -22,10 +19,10 @@ class Checklist extends Model
protected $table = 'checklists';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -35,16 +32,16 @@ class Checklist extends Model
*/
protected $fillable = ['name', 'type', 'description'];
- protected $hidden = ['pivot','deleted_at', 'users'];
+ protected $hidden = ['pivot', 'deleted_at', 'users'];
+
+ protected $appends = ['category_ids', 'required_ids', 'owner', 'researches'];
- protected $appends = ['category_ids', 'required_ids', 'owner', 'researches'];
-
// check for deletion of linked items
- protected static function boot() {
+ protected static function boot()
+ {
parent::boot();
-
- static::deleting(function($item)
- {
+
+ static::deleting(function ($item) {
DB::table('checklist_category')->where('checklist_id', $item->id)->delete();
DB::table('checklist_user')->where('checklist_id', $item->id)->delete();
DB::table('checklist_hive')->where('checklist_id', $item->id)->delete();
@@ -53,7 +50,7 @@ protected static function boot() {
public function getCategoryIdsAttribute()
{
- return $this->categoryIdArray();
+ return $this->categoryIdArray();
}
public function getRequiredIdsAttribute()
@@ -63,16 +60,14 @@ public function getRequiredIdsAttribute()
public function getOwnerAttribute()
{
- return $this->users->contains(Auth::user());
+ return $this->users->contains(Auth::user());
}
public function getResearchesAttribute()
{
- return $this->researches()->pluck('name');
+ return $this->researches()->pluck('name');
}
-
-
public function categories()
{
return $this->belongsToMany(Category::class, 'checklist_category')->withPivot('order')->orderBy('order');
@@ -97,48 +92,48 @@ public function researches()
{
return $this->belongsToMany(Research::class, 'checklist_research');
}
-
- public function getOrderedChecklist($selectedCatIds=[], $includeNotSelected=true)
+
+ public function getOrderedChecklist($selectedCatIds = [], $includeNotSelected = true)
{
$taxonomyRootIds = Taxonomy::getRootIds();
- $cheklistRootIds = array_intersect($selectedCatIds, $taxonomyRootIds); // order root nodes by defined order in checklist
- if ($includeNotSelected)
- $cheklistRootIds = array_merge($cheklistRootIds, array_diff($taxonomyRootIds, $cheklistRootIds)); // add rest of (not selected categories)
+ $cheklistRootIds = array_intersect($selectedCatIds, $taxonomyRootIds); // order root nodes by defined order in checklist
+ if ($includeNotSelected) {
+ $cheklistRootIds = array_merge($cheklistRootIds, array_diff($taxonomyRootIds, $cheklistRootIds));
+ } // add rest of (not selected categories)
$taxonomy = Taxonomy::getTaxonomy($cheklistRootIds, $selectedCatIds);
+
return $taxonomy;
}
public function syncCategories($categories)
{
- if (isset($categories) && count($categories) > 0)
- {
+ if (isset($categories) && count($categories) > 0) {
$cat_with_order = array_flip($categories);
- foreach ($cat_with_order as $cat_id => $value)
- {
- $parents = Taxonomy::ancestorsOf($cat_id)->whereNotIn('type',['system'])->pluck('id')->toArray();
- if (count($parents) > 0)
- {
- foreach ($parents as $p)
- {
- if (in_array($p, $categories) == false)
- $cat_with_order[$p] = ['order'=>$value];
+ foreach ($cat_with_order as $cat_id => $value) {
+ $parents = Taxonomy::ancestorsOf($cat_id)->whereNotIn('type', ['system'])->pluck('id')->toArray();
+ if (count($parents) > 0) {
+ foreach ($parents as $p) {
+ if (in_array($p, $categories) == false) {
+ $cat_with_order[$p] = ['order' => $value];
+ }
}
}
- $cat_with_order[$cat_id] = ['order'=>$value];
+ $cat_with_order[$cat_id] = ['order' => $value];
}
- if (count($categories) > 0)
- {
+ if (count($categories) > 0) {
$this->categories()->sync($cat_with_order);
$this->touch(); // set Checklist updated_at
+
return true;
}
}
+
return false;
}
public static function selectList()
{
- return Checklist::orderBy('name')->pluck('name','id');
+ return Checklist::orderBy('name')->pluck('name', 'id');
}
}
diff --git a/app/ChecklistFactory.php b/app/ChecklistFactory.php
index ab4808a2..da59f035 100644
--- a/app/ChecklistFactory.php
+++ b/app/ChecklistFactory.php
@@ -2,239 +2,224 @@
namespace App;
-use App\Checklist;
-use App\Category;
-use App\CategoryFactory;
-use App\User;
-use App\Inspection;
-use App\InspectionItem;
-
-class ChecklistFactory
+class ChecklistFactory
{
-
public function __construct()
{
- $this->categoryFactory = new CategoryFactory;
- $this->std_checklist_type = 'beep_v2';
- $this->std_checklist_name = 'Beep v2';
- $this->old_inspection_items = ['notes'=>27, 'attention'=>26, 'impression'=>25, 'reminder'=>8, 'reminder_date'=>9];
- $this->old_inspection_texts = ['Varroatelling: '=>37, 'Resterende moerdoppen: '=>17];
+ $this->categoryFactory = new CategoryFactory;
+ $this->std_checklist_type = 'beep_v2';
+ $this->std_checklist_name = 'Beep v2';
+ $this->old_inspection_items = ['notes' => 27, 'attention' => 26, 'impression' => 25, 'reminder' => 8, 'reminder_date' => 9];
+ $this->old_inspection_texts = ['Varroatelling: ' => 37, 'Resterende moerdoppen: ' => 17];
$this->old_list_category_ids = [6, 32, 35]; // lists
}
-
// Convert category_id's and tables from old database (v1: seeded categories) to new (v2: dynamic taxonomy categories)
- public function convertUsersChecklists($users, $debug=false)
+ public function convertUsersChecklists($users, $debug = false)
{
// remove already existing copies of checklists
Checklist::where('type', 'like', '%_copy%')->forceDelete();
// perform magic
- $count = ['locations'=>0, 'inspections'=>0, 'conditions'=>0, 'actions'=>0, 'hives'=>0, 'hive_layers'=>0, 'hive_layer_frames'=>0, 'queens'=>0, 'sensors'=>0];
+ $count = ['locations' => 0, 'inspections' => 0, 'conditions' => 0, 'actions' => 0, 'hives' => 0, 'hive_layers' => 0, 'hive_layer_frames' => 0, 'queens' => 0, 'sensors' => 0];
- $this->non_system_categories = Category::where('old_id','!=',null)->get();//getTaxonomy(null, false, true);
- print_r(['non_system_categories'=>$this->non_system_categories->pluck('old_id','id')->toArray()]);
+ $this->non_system_categories = Category::where('old_id', '!=', null)->get(); // getTaxonomy(null, false, true);
+ print_r(['non_system_categories' => $this->non_system_categories->pluck('old_id', 'id')->toArray()]);
- $stdChecklist = $this->getStandardChecklist();
- $fallBackOfFallBacks = Category::where('name','not_assigned_in_migration')->value('id',938); // id=938
- $fallback_loc_type_id = $fallBackOfFallBacks;
+ $stdChecklist = $this->getStandardChecklist();
+ $fallBackOfFallBacks = Category::where('name', 'not_assigned_in_migration')->value('id', 938); // id=938
+ $fallback_loc_type_id = $fallBackOfFallBacks;
$fallback_hive_type_id = $fallBackOfFallBacks;
- $fallback_bee_race_id = $fallBackOfFallBacks;
- $fallback_hive_layer_id= $fallBackOfFallBacks;
- $fallback_hive_frame_id= $fallBackOfFallBacks;
- $fallback_sensor_id = $fallBackOfFallBacks;
-
- $loc_type_cats = Category::descendentsByRootParentAndName('apiary', 'apiary', 'type');
- $hive_type_cats = Category::descendentsByRootParentAndName('hive', 'hive', 'type');
- $bee_race_cats = Category::descendentsByRootParentAndName('bee_colony', 'characteristics', 'subspecies');
+ $fallback_bee_race_id = $fallBackOfFallBacks;
+ $fallback_hive_layer_id = $fallBackOfFallBacks;
+ $fallback_hive_frame_id = $fallBackOfFallBacks;
+ $fallback_sensor_id = $fallBackOfFallBacks;
+
+ $loc_type_cats = Category::descendentsByRootParentAndName('apiary', 'apiary', 'type');
+ $hive_type_cats = Category::descendentsByRootParentAndName('hive', 'hive', 'type');
+ $bee_race_cats = Category::descendentsByRootParentAndName('bee_colony', 'characteristics', 'subspecies');
$hive_layer_cats = Category::descendentsByRootParentAndName('hive', 'app', 'hive_layer');
$hive_frame_cats = Category::descendentsByRootParentAndName('hive', 'app', 'hive_frame');
- $hive_sensor_cats= Category::descendentsByRootParentAndName('hive', 'app', 'sensor');
-
- if ($loc_type_cats->where('name','fixed')->count() > 0)
- $fallback_loc_type_id = $loc_type_cats->where('name','fixed')->pluck('id')[0];
+ $hive_sensor_cats = Category::descendentsByRootParentAndName('hive', 'app', 'sensor');
- if ($hive_type_cats->where('name','custom')->count() > 0)
- $fallback_hive_type_id = $hive_type_cats->where('name','custom')->pluck('id')[0];
+ if ($loc_type_cats->where('name', 'fixed')->count() > 0) {
+ $fallback_loc_type_id = $loc_type_cats->where('name', 'fixed')->pluck('id')[0];
+ }
- if ($bee_race_cats->where('name','other')->count() > 0)
- $fallback_bee_race_id = $bee_race_cats->where('name','other')->pluck('id')[0];
+ if ($hive_type_cats->where('name', 'custom')->count() > 0) {
+ $fallback_hive_type_id = $hive_type_cats->where('name', 'custom')->pluck('id')[0];
+ }
- if ($hive_layer_cats->where('name','brood')->count() > 0)
- $fallback_hive_layer_id = $hive_layer_cats->where('name','brood')->pluck('id')[0];
+ if ($bee_race_cats->where('name', 'other')->count() > 0) {
+ $fallback_bee_race_id = $bee_race_cats->where('name', 'other')->pluck('id')[0];
+ }
- if ($hive_frame_cats->where('name','wax')->count() > 0)
- $fallback_hive_frame_id = $hive_frame_cats->where('name','wax')->pluck('id')[0];
+ if ($hive_layer_cats->where('name', 'brood')->count() > 0) {
+ $fallback_hive_layer_id = $hive_layer_cats->where('name', 'brood')->pluck('id')[0];
+ }
- if ($hive_sensor_cats->where('name','other')->count() > 0)
- $fallback_sensor_id = $hive_sensor_cats->where('name','other')->pluck('id')[0];
+ if ($hive_frame_cats->where('name', 'wax')->count() > 0) {
+ $fallback_hive_frame_id = $hive_frame_cats->where('name', 'wax')->pluck('id')[0];
+ }
- print_r(['new_cat_ids'=> ['loc'=>$loc_type_cats->pluck('name','id')->toArray(), 'hive'=>$hive_type_cats->pluck('name','id')->toArray(), 'bee'=>$bee_race_cats->pluck('name','id')->toArray(), 'layer'=>$hive_layer_cats->pluck('name','id')->toArray(), 'frame'=>$hive_frame_cats->pluck('name','id')->toArray(), 'sensor'=>$hive_sensor_cats->pluck('name','id')->toArray()]]);
- print_r(['fallback_ids'=>['loc'=>$fallback_loc_type_id, 'hive'=>$fallback_hive_type_id, 'bee'=>$fallback_bee_race_id, 'layer'=>$fallback_hive_layer_id, 'frame'=>$fallback_hive_frame_id, 'sensor'=>$fallback_sensor_id]]);
+ if ($hive_sensor_cats->where('name', 'other')->count() > 0) {
+ $fallback_sensor_id = $hive_sensor_cats->where('name', 'other')->pluck('id')[0];
+ }
+
+ print_r(['new_cat_ids' => ['loc' => $loc_type_cats->pluck('name', 'id')->toArray(), 'hive' => $hive_type_cats->pluck('name', 'id')->toArray(), 'bee' => $bee_race_cats->pluck('name', 'id')->toArray(), 'layer' => $hive_layer_cats->pluck('name', 'id')->toArray(), 'frame' => $hive_frame_cats->pluck('name', 'id')->toArray(), 'sensor' => $hive_sensor_cats->pluck('name', 'id')->toArray()]]);
+ print_r(['fallback_ids' => ['loc' => $fallback_loc_type_id, 'hive' => $fallback_hive_type_id, 'bee' => $fallback_bee_race_id, 'layer' => $fallback_hive_layer_id, 'frame' => $fallback_hive_frame_id, 'sensor' => $fallback_sensor_id]]);
- foreach ($users as $user)
- {
+ foreach ($users as $user) {
// create or get checklist
- if ($debug == false || $user->checklists()->count() == 0)
+ if ($debug == false || $user->checklists()->count() == 0) {
$this->createUserChecklist($user, $stdChecklist);
+ }
// 'location' =>['fixed','movable','temporary','other'], (65,66,67,68)
- foreach ($user->locations as $location)
+ foreach ($user->locations as $location) {
$count['locations'] += $this->changeCategoryIdToNew($loc_type_cats, $location, 'category_id', $fallback_loc_type_id);
+ }
// 'sensor' =>['beep','hiveeyes','arnia','manual','other']
- foreach ($user->sensors as $sensor)
+ foreach ($user->sensors as $sensor) {
$count['sensors'] += $this->changeCategoryIdToNew($hive_sensor_cats, $sensor, 'category_id', $fallback_sensor_id);
-
+ }
// Change hives/inspections
- foreach ($user->hives()->withTrashed()->get() as $hive)
- {
- $count['hives'] += $this->changeCategoryIdToNew($hive_type_cats, $hive, 'hive_type_id', $fallback_hive_type_id);
- if($hive->queen()->count() > 0)
+ foreach ($user->hives()->withTrashed()->get() as $hive) {
+ $count['hives'] += $this->changeCategoryIdToNew($hive_type_cats, $hive, 'hive_type_id', $fallback_hive_type_id);
+ if ($hive->queen()->count() > 0) {
$count['queens'] += $this->changeCategoryIdToNew($bee_race_cats, $hive->queen, 'race_id', $fallback_bee_race_id);
+ }
// Transfer hive_layers, hive_layer_frame category_id's to taxonomy
// hive_layer.category_id, hive_layer_frame.category_id
// 'hive_layer'=>['brood','honey','grid','empty'], (56,57,58,59)
// 'hive_frame'=>['wax','block','other'], (61,62,63)
- foreach ($hive->layers()->withTrashed()->get() as $hive_layer)
- {
+ foreach ($hive->layers()->withTrashed()->get() as $hive_layer) {
$count['hive_layers'] += $this->changeCategoryIdToNew($hive_layer_cats, $hive_layer, 'category_id', $fallback_hive_layer_id);
- foreach ($hive_layer->frames()->withTrashed()->get() as $layer_frame)
+ foreach ($hive_layer->frames()->withTrashed()->get() as $layer_frame) {
$count['hive_layer_frames'] += $this->changeCategoryIdToNew($hive_frame_cats, $layer_frame, 'category_id', $fallback_hive_frame_id);
+ }
}
- //die(print_r($hive->actions()->pluck('created_at')->toArray()));
- //die(print_r(['user'=>$user->name, 'count'=>$count]));
+ // die(print_r($hive->actions()->pluck('created_at')->toArray()));
+ // die(print_r(['user'=>$user->name, 'count'=>$count]));
}
- print_r(['id'=>$user->id, 'user'=>$user->name, 'count'=>$count]);
+ print_r(['id' => $user->id, 'user' => $user->name, 'count' => $count]);
}
- print_r(['total_count'=>$count]);
+ print_r(['total_count' => $count]);
- if ($debug)
- die('End of debug output');
+ if ($debug) {
+ exit('End of debug output');
+ }
}
public function createUserChecklist($user, $checklist)
{
- $hasNewChecklist = $user->checklists()->where('type',$checklist->type.'_copy')->count() > 0 ? true : false;
-
- if ($hasNewChecklist == false)
- {
- $new = ['type'=>$checklist->type.'_copy', 'name'=>$checklist->name.' - '.$user->name];
+ $hasNewChecklist = $user->checklists()->where('type', $checklist->type.'_copy')->count() > 0 ? true : false;
+
+ if ($hasNewChecklist == false) {
+ $new = ['type' => $checklist->type.'_copy', 'name' => $checklist->name.' - '.$user->name];
$chk = $user->checklists()->create($new);
$chk->syncCategories($checklist->category_ids);
}
}
-
public function getStandardChecklist()
{
- $query = Checklist::where('type', $this->std_checklist_type)->orderBy('id', 'desc');
- $check_model = [ 'name' => $this->std_checklist_name, 'type' => $this->std_checklist_type, 'description' => 'Beep v1 kastkaart / hive checklist'];
- $check = null;
+ $query = Checklist::where('type', $this->std_checklist_type)->orderBy('id', 'desc');
+ $check_model = ['name' => $this->std_checklist_name, 'type' => $this->std_checklist_type, 'description' => 'Beep v1 kastkaart / hive checklist'];
+ $check = null;
- if ($query->count() == 0)
- {
+ if ($query->count() == 0) {
$check = new Checklist($check_model);
$check->save();
// create standard checklist
$checklist_ids = $this->categoryFactory->get_old_ids_array();
- //die(print_r($checklist_ids));
+ // die(print_r($checklist_ids));
$check->categories()->sync($checklist_ids);
- }
- else
- {
+ } else {
$check = $query->first();
}
- //print_r(['getStandardChecklist'=>$check->toArray()]);
-
+ // print_r(['getStandardChecklist'=>$check->toArray()]);
+
return $check;
}
// $a => action/condition: {'hive_id', 'category_id', 'text', 'number', 'score', 'boolean', 'date'}
private function createInspectionItem($a, $ins, $debug)
{
- $cat_id = null;
- $cat_type = null;
- $ins_i = null;
- $ins_id = $ins->id;
- $old_id = $a->category_id;
- $found = $this->non_system_categories->where('old_id',$old_id)->where('type', '!=', 'system')->count();
+ $cat_id = null;
+ $cat_type = null;
+ $ins_i = null;
+ $ins_id = $ins->id;
+ $old_id = $a->category_id;
+ $found = $this->non_system_categories->where('old_id', $old_id)->where('type', '!=', 'system')->count();
$is_core_item = array_search($old_id, $this->old_inspection_items);
-
- if ($is_core_item !== false)
- {
- if ($debug)
- echo("INS $ins->id: Found inspection core item $is_core_item \r\n");
- }
- else if ($found == 0)
- {
- //print_r($this->non_system_categories->sortBy('old_id')->pluck('old_id','name')->toArray());
- echo("INS $ins->id: $old_id not found in ".$this->non_system_categories->count()." non_system_categories\r\n");
- //print_r($a->toArray());
- //die(print_r($this->non_system_categories->toArray()));
+
+ if ($is_core_item !== false) {
+ if ($debug) {
+ echo "INS $ins->id: Found inspection core item $is_core_item \r\n";
+ }
+ } elseif ($found == 0) {
+ // print_r($this->non_system_categories->sortBy('old_id')->pluck('old_id','name')->toArray());
+ echo "INS $ins->id: $old_id not found in ".$this->non_system_categories->count()." non_system_categories\r\n";
+
+ // print_r($a->toArray());
+ // die(print_r($this->non_system_categories->toArray()));
return 0;
- }
- else if ($found == 1)
- {
- $cat = $this->non_system_categories->where('old_id',$old_id)->first();
- $cat_id = $cat->id;
- $cat_type = $cat->input;
- if ($debug)
- echo("INS $ins->id: Found 1 cat with $old_id: $cat_id\r\n");
- }
- else if ($found > 1) // boolean + value item
- {
- if ($debug)
- echo("INS $ins->id: Found $found cat with $old_id \r\n");
-
- foreach ($this->non_system_categories->where('old_id',$old_id) as $cat)
- {
- if ($cat->isSystem() == false)
- {
+ } elseif ($found == 1) {
+ $cat = $this->non_system_categories->where('old_id', $old_id)->first();
+ $cat_id = $cat->id;
+ $cat_type = $cat->input;
+ if ($debug) {
+ echo "INS $ins->id: Found 1 cat with $old_id: $cat_id\r\n";
+ }
+ } elseif ($found > 1) { // boolean + value item
+ if ($debug) {
+ echo "INS $ins->id: Found $found cat with $old_id \r\n";
+ }
+
+ foreach ($this->non_system_categories->where('old_id', $old_id) as $cat) {
+ if ($cat->isSystem() == false) {
$cat_type = $cat->input;
- if($cat_type == 'boolean' || $cat_type == 'boolean_yes_red')
- {
- $data = ['value'=>'1', 'inspection_id'=>$ins_id, 'category_id'=>$cat->id];
+ if ($cat_type == 'boolean' || $cat_type == 'boolean_yes_red') {
+ $data = ['value' => '1', 'inspection_id' => $ins_id, 'category_id' => $cat->id];
$ins_i = InspectionItem::create($data);
- if ($debug)
- echo("INS $ins->id: $cat_type created cat $cat->id\r\n");
- }
- else
- {
+ if ($debug) {
+ echo "INS $ins->id: $cat_type created cat $cat->id\r\n";
+ }
+ } else {
$cat_id = $cat->id;
}
}
}
}
-
- $value = null;
+ $value = null;
-
- if (isset($a) && gettype($a) == 'object')
- {
- if ($a->text !== null)
+ if (isset($a) && gettype($a) == 'object') {
+ if ($a->text !== null) {
$value = substr($a->text, 0, 1024);
- else if ($a->number !== null)
+ } elseif ($a->number !== null) {
$value = "$a->number";
- else if($a->score !== null)
+ } elseif ($a->score !== null) {
$value = "$a->score";
- else if($a->boolean !== null)
+ } elseif ($a->boolean !== null) {
$value = "$a->boolean";
- else if($a->date !== null)
+ } elseif ($a->date !== null) {
$value = "$a->date";
+ }
}
- if ($value === null || $value === 'null' || $value === '')
- {
- if ($debug == false)
+ if ($value === null || $value === 'null' || $value === '') {
+ if ($debug == false) {
$a->delete();
+ }
return 0;
}
@@ -244,33 +229,26 @@ private function createInspectionItem($a, $ins, $debug)
// Items that have to be processed before new InspectionItem creation
// Save core item, or gather list items
- if ($is_core_item !== false)
- {
+ if ($is_core_item !== false) {
$ins->$is_core_item = $value;
$ins->save();
$value = null; // don't create an inspection item, because a core item is already created
$ins_i = true; // delete former item
- }
- else if (in_array($old_id, $this->old_list_category_ids)) // boolean list
- {
- $values = explode(',',$value);
- //print_r(["old_ids options (list=$old_id)"=>$values]);
- $cat_ids= [];
- foreach ($values as $val)
- {
- $cat_opt = $this->non_system_categories->where('old_id',$val)->first(); // check if there is a list option with the name (or id) of the old_id
- if ($cat_opt)
- {
+ } elseif (in_array($old_id, $this->old_list_category_ids)) { // boolean list
+ $values = explode(',', $value);
+ // print_r(["old_ids options (list=$old_id)"=>$values]);
+ $cat_ids = [];
+ foreach ($values as $val) {
+ $cat_opt = $this->non_system_categories->where('old_id', $val)->first(); // check if there is a list option with the name (or id) of the old_id
+ if ($cat_opt) {
$cat_opt_id = $cat_opt->id;
- if ($cat_opt->input == 'boolean' || $cat_opt->input == 'boolean_yes_red')
- {
- $data = ['value'=>'1', 'inspection_id'=>$ins_id, 'category_id'=>$cat_opt_id];
+ if ($cat_opt->input == 'boolean' || $cat_opt->input == 'boolean_yes_red') {
+ $data = ['value' => '1', 'inspection_id' => $ins_id, 'category_id' => $cat_opt_id];
$ins_i = InspectionItem::create($data);
- if ($debug)
- echo("INS $ins->id: boolean_list_item_created cat $cat_opt_id from old_id $val\r\n");
- }
- else if ($cat_opt_id) // list items
- {
+ if ($debug) {
+ echo "INS $ins->id: boolean_list_item_created cat $cat_opt_id from old_id $val\r\n";
+ }
+ } elseif ($cat_opt_id) { // list items
array_push($cat_ids, $cat_opt_id);
}
}
@@ -278,28 +256,24 @@ private function createInspectionItem($a, $ins, $debug)
}
$value = implode(',', $cat_ids);
}
-
+
// Save to new inspection item
- if ($value !== null && $value !== '' && $cat_id !== null)
- {
- if ($cat_type == 'text')
- {
+ if ($value !== null && $value !== '' && $cat_id !== null) {
+ if ($cat_type == 'text') {
$preFixText = array_search($old_id, $this->old_inspection_texts);
- if ($preFixText !== false)
- {
- $value = $preFixText.$value;
- }
- else if ($debug)
- {
- echo("INS $ins->id: No prefix Text item for old_id=$old_id ".Category::where('id',$cat_id)->first()->ancName()."\r\n");
+ if ($preFixText !== false) {
+ $value = $preFixText.$value;
+ } elseif ($debug) {
+ echo "INS $ins->id: No prefix Text item for old_id=$old_id ".Category::where('id', $cat_id)->first()->ancName()."\r\n";
}
}
-
- $data = ['value'=>"$value", 'inspection_id'=>$ins_id, 'category_id'=>$cat_id];
+
+ $data = ['value' => "$value", 'inspection_id' => $ins_id, 'category_id' => $cat_id];
$ins_i = InspectionItem::create($data);
- if ($debug && $ins_i)
- echo("INS $ins->id: InspectionItem created type: $cat_type, cat: $cat_id, value: $value\r\n");
+ if ($debug && $ins_i) {
+ echo "INS $ins->id: InspectionItem created type: $cat_type, cat: $cat_id, value: $value\r\n";
+ }
// if ($debug)
// {
@@ -307,46 +281,42 @@ private function createInspectionItem($a, $ins, $debug)
// print_r(['cat_id'=>$cat_id, 'ins_i'=>$ins_i]);
// }
}
-
- if ($ins_i)
- {
- if ($debug == false)
+
+ if ($ins_i) {
+ if ($debug == false) {
$a->delete();
+ }
return 1;
}
+
return 0;
}
- private function changeCategoryIdToNew($categories, $item, $cat_field='category_id', $fallback_cat_id=null)
+ private function changeCategoryIdToNew($categories, $item, $cat_field = 'category_id', $fallback_cat_id = null)
{
- if (gettype($item) == 'object')
- {
+ if (gettype($item) == 'object') {
$new_cat_id = null;
- $new_cat = $categories->where('old_id', $item->$cat_field);
+ $new_cat = $categories->where('old_id', $item->$cat_field);
- if ($new_cat->count() > 0)
- {
+ if ($new_cat->count() > 0) {
$new_cat_id = $new_cat->pluck('id')[0];
- }
- else
- {
- if ($categories->where('id', $item->$cat_field)->count() == 0) // if new category id is already assigned, ignore
+ } else {
+ if ($categories->where('id', $item->$cat_field)->count() == 0) { // if new category id is already assigned, ignore
$new_cat_id = $fallback_cat_id;
+ }
}
- //print_r(['item'=>$item->name, "$cat_field"=>$item->$cat_field, 'new_cat_id'=>$new_cat_id, 'fallback_cat_id'=>$fallback_cat_id]);
+ // print_r(['item'=>$item->name, "$cat_field"=>$item->$cat_field, 'new_cat_id'=>$new_cat_id, 'fallback_cat_id'=>$fallback_cat_id]);
- if ($new_cat_id && $item->$cat_field != $new_cat_id)
- {
+ if ($new_cat_id && $new_cat_id != $item->$cat_field) {
$item->$cat_field = $new_cat_id;
+
return $item->save();
}
+ } else {
+ print_r(['changeCategoryIdToNew unknown item' => $item]);
}
- else
- {
- print_r(['changeCategoryIdToNew unknown item'=>$item]);
- }
+
return 0;
}
-
}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 03c5140d..61422433 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -2,13 +2,12 @@
namespace App\Console;
+use App\Models\AlertRule;
+use App\Models\FlashLog;
+use App\Weather;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
-use App\Weather;
-use App\Models\FlashLog;
-use App\Models\AlertRule;
-
class Kernel extends ConsoleKernel
{
/**
@@ -23,28 +22,24 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->call(
- function ()
- {
+ function () {
Weather::updateLocations();
}
)->everyFiveMinutes();
$schedule->call(
- function ()
- {
+ function () {
AlertRule::parseRules();
}
)->everyMinute();
$schedule->call(
- function ()
- {
+ function () {
FlashLog::parseUnparsedFlashlogs();
}
)->everyFiveMinutes();
@@ -58,7 +53,7 @@ function ()
protected function commands()
{
$this->load(__DIR__.'/Commands');
-
+
require base_path('routes/console.php');
}
}
diff --git a/app/Continent.php b/app/Continent.php
index 27dc6bbd..33174970 100644
--- a/app/Continent.php
+++ b/app/Continent.php
@@ -7,6 +7,6 @@
class Continent extends Model
{
protected $fillable = ['name', 'abbr'];
- protected $guarded = ['id'];
+ protected $guarded = ['id'];
}
diff --git a/app/Device.php b/app/Device.php
index b76fd004..4691947e 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -2,109 +2,110 @@
namespace App;
+use App\Models\Alert;
+use App\Models\FlashLog;
+use Auth;
+use Cache;
+use DB;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use DB;
-use Cache;
-use Auth;
-use InfluxDB;
-use App\Models\Alert;
-use App\Models\FlashLog;
use Moment\Moment;
class Device extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
+
+ protected $table = 'sensors';
- protected $table = 'sensors';
protected $cascadeDeletes = ['sensorDefinitions'];
- protected $fillable = ['user_id', 'hive_id', 'category_id', 'name', 'key', 'last_message_received', 'hardware_id', 'firmware_version', 'hardware_version', 'boot_count', 'measurement_interval_min', 'measurement_transmission_ratio', 'ble_pin', 'battery_voltage', 'next_downlink_message', 'last_downlink_result', 'datetime', 'datetime_offset_sec', 'former_key_list', 'rtc', 'log_file_info'];
- protected $guarded = ['id'];
- protected $hidden = ['user_id', 'category_id', 'deleted_at', 'hive', 'former_key_list'];
- protected $appends = ['type','hive_name', 'location_name', 'owner', 'online'];
- protected $casts = ['log_file_info'=>'array'];
- public $timestamps = false;
+ protected $fillable = ['user_id', 'hive_id', 'category_id', 'name', 'key', 'last_message_received', 'hardware_id', 'firmware_version', 'hardware_version', 'boot_count', 'measurement_interval_min', 'measurement_transmission_ratio', 'ble_pin', 'battery_voltage', 'next_downlink_message', 'last_downlink_result', 'datetime', 'datetime_offset_sec', 'former_key_list', 'rtc', 'log_file_info'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['user_id', 'category_id', 'deleted_at', 'hive', 'former_key_list'];
+
+ protected $appends = ['type', 'hive_name', 'location_name', 'owner', 'online'];
+
+ protected $casts = ['log_file_info' => 'array'];
+
+ public $timestamps = false;
public static function boot()
{
parent::boot();
static::created(function ($d) {
- //Log::info("Created Device $d->id $d->name");
+ // Log::info("Created Device $d->id $d->name");
$d->empty_cache();
});
static::updated(function ($d) {
$empty_cache = false;
- if ($d->wasChanged('deleted_at'))
- {
+ if ($d->wasChanged('deleted_at')) {
Log::info("Updated Device id=$d->id deleted_at to $d->deleted_at");
$empty_cache = true;
}
- if ($d->wasChanged('user_id'))
- {
+ if ($d->wasChanged('user_id')) {
Log::info("Updated Device id=$d->id user_id to $d->user_id");
$empty_cache = true;
}
- if ($d->wasChanged('firmware_version'))
- {
+ if ($d->wasChanged('firmware_version')) {
Log::info("Updated Device id=$d->id firmware_version to $d->firmware_version");
$empty_cache = true;
}
- if ($d->wasChanged('hive_id'))
- {
+ if ($d->wasChanged('hive_id')) {
Log::info("Updated Device id=$d->id hive_id to $d->hive_id");
$empty_cache = true;
}
- if ($d->wasChanged('key'))
- {
+ if ($d->wasChanged('key')) {
Log::info("Updated Device id=$d->id key to $d->key");
$empty_cache = true;
}
- if ($d->wasChanged('name'))
- {
+ if ($d->wasChanged('name')) {
Log::info("Updated Device id=$d->id name to $d->name");
$empty_cache = true;
}
- if ($empty_cache)
+ if ($empty_cache) {
$d->empty_cache();
+ }
});
static::deleted(function ($d) {
- //Log::info("Deleted Device $d->id $d->name");
+ // Log::info("Deleted Device $d->id $d->name");
$d->empty_cache();
});
}
- public function empty_cache($clear_users=true)
+ public function empty_cache($clear_users = true)
{
Cache::forget('device-'.$this->id.'-hive-'.$this->hive_id.'-user-ids');
Cache::forget('device-'.$this->id.'-hive-'.$this->hive_id.'-rule-ids');
Cache::forget('device-'.$this->id.'-calibrations-measurement-types');
-
+
Log::debug("Device ID $this->id cache emptied");
- if ($clear_users)
+ if ($clear_users) {
User::emptyIdCache($this->user_id, 'device');
+ }
}
-
- public static function cacheRequestRate($name, $retention_sec=86400)
+ public static function cacheRequestRate($name, $retention_sec = 86400)
{
- Cache::remember($name.'-time', $retention_sec, function () use ($name)
- {
+ Cache::remember($name.'-time', $retention_sec, function () use ($name) {
Cache::forget($name.'-count');
+
return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count');
- else
+ } else {
Cache::put($name.'-count', 1);
+ }
}
@@ -116,59 +117,66 @@ public function getTypeAttribute()
public function getHiveNameAttribute()
{
- if (isset($this->hive))
+ if (isset($this->hive)) {
return $this->hive->name;
+ }
return '';
}
public function getLocationIdAttribute()
{
- if (isset($this->hive))
+ if (isset($this->hive)) {
return $this->hive->location_id;
+ }
return null;
}
public function getLocationNameAttribute()
{
- if (isset($this->hive))
+ if (isset($this->hive)) {
return $this->hive->getLocationAttribute();
+ }
return '';
}
public function getOwnerAttribute()
{
- if (Auth::check() && $this->user_id == Auth::user()->id)
+ if (Auth::check() && $this->user_id == Auth::user()->id) {
return true;
+ }
return false;
}
public function getOnlineAttribute()
{
- $refresh_min = max(15, $this->getRefreshMin() * 2);
- $min_msg_date = date('Y-m-d H:i:s', time()-(60*$refresh_min)); // at least
- if (isset($this->last_message_received) && $this->last_message_received > $min_msg_date)
+ $refresh_min = max(15, $this->getRefreshMin() * 2);
+ $min_msg_date = date('Y-m-d H:i:s', time() - (60 * $refresh_min)); // at least
+ if (isset($this->last_message_received) && $this->last_message_received > $min_msg_date) {
return true;
+ }
return false;
}
public function checkLogOutdated()
{
- if (isset($this->log_file_info['created_date']))
- return ($this->flashlogs()->where('updated_at' , '>', $this->log_file_info['created_date'])->count() > 0);
-
+ if (isset($this->log_file_info['created_date'])) {
+ return $this->flashlogs()->where('updated_at', '>', $this->log_file_info['created_date'])->count() > 0;
+ }
+
return false;
}
public function researchNames()
{
$res = $this->researches();
- if ($res->count() > 0)
+ if ($res->count() > 0) {
return implode(', ', $res->pluck('name')->toArray());
+ }
return '';
}
@@ -178,27 +186,28 @@ public function allKeys()
{
$keys = [$this->key];
- if (isset($this->former_key_list))
- {
+ if (isset($this->former_key_list)) {
$keys = array_merge($keys, explode(',', $this->former_key_list));
}
// add upper or lowercase key
$add_keys = [];
- foreach ($keys as $key)
- {
+ foreach ($keys as $key) {
$key_low = strtolower($key);
$key_upp = strtoupper($key);
- if ($key_low !== $key)
+ if ($key_low !== $key) {
$add_keys[] = $key_low;
+ }
- if ($key_upp !== $key)
+ if ($key_upp !== $key) {
$add_keys[] = $key_upp;
+ }
}
- if (count($add_keys) > 0)
+ if (count($add_keys) > 0) {
$keys = array_merge($keys, $add_keys);
+ }
- //die(print_r($where_keys));
+ // die(print_r($where_keys));
return $keys;
}
@@ -207,32 +216,36 @@ public function influxWhereKeys()
$keys = $this->allKeys();
$where_keys = '("key" = \''.implode('\' OR "key" = \'', $keys).'\')';
- //die(print_r($where_keys));
+
+ // die(print_r($where_keys));
return $where_keys;
}
public function addFormerKey($key)
{
- if (!isset($key) || $key == '' || $key == null)
+ if (! isset($key) || $key == '' || $key == null) {
return false;
+ }
$keys = [];
- if (isset($this->former_key_list))
+ if (isset($this->former_key_list)) {
$keys = explode(',', $this->former_key_list);
+ }
- if (in_array($key, $keys) === false)
+ if (in_array($key, $keys) === false) {
$keys[] = $key;
+ }
- if (count($keys) > 0)
- {
+ if (count($keys) > 0) {
$this->former_key_list = implode(',', $keys);
$this->save();
+
return true;
}
+
return false;
}
-
public function sensorDefinitions()
{
return $this->hasMany(SensorDefinition::class);
@@ -253,54 +266,58 @@ public function activeTypeDateSensorDefinitions($input_measurement_id, $output_m
$io_sds = $this->sensorDefinitions()->where('input_measurement_id', $input_measurement_id)->where('output_measurement_id', $output_measurement_id)->get();
// If empty collection, or only one, return sensor_defs collection for all data
- if ($io_sds->count() < 2)
+ if ($io_sds->count() < 2) {
return $io_sds;
+ }
// If more than 1, chech which one to use
$sd_during = $io_sds->whereBetween('updated_at', [$start, $end])->sortByDesc('updated_at')->unique('input_measurement_id', 'output_measurement_id');
- if ($sd_during->count() > 0)
- {
- foreach($sd_during as $sd)
+ if ($sd_during->count() > 0) {
+ foreach ($sd_during as $sd) {
$sd_ids[] = $sd->id;
+ }
}
// Add first before or at start
$sd_before = $io_sds->where('updated_at', '<=', $start)->sortByDesc('updated_at')->first();
- if ($sd_before)
+ if ($sd_before) {
$sd_ids[] = $sd_before->id;
+ }
// If none, add first after end
- if (count($sd_ids) == 0)
- {
+ if (count($sd_ids) == 0) {
$sd_next = $io_sds->where('updated_at', '>=', $end)->sortBy('updated_at')->first();
- if ($sd_next)
+ if ($sd_next) {
$sd_ids[] = $sd_next->id;
+ }
}
// If none, add the only calibration
- if (count($sd_ids) == 0&& $io_sds->count() == 1)
+ if (count($sd_ids) == 0 && $io_sds->count() == 1) {
$sd_ids[] = $io_sds->first()->id;
+ }
return $this->sensorDefinitions()->whereIn('id', $sd_ids)->orderBy('updated_at', 'desc')->get();
}
- public function hive()
+ public function hive()
{
return $this->belongsTo(Hive::class);
}
public function location()
{
- if (isset($this->hive))
+ if (isset($this->hive)) {
return $this->hive->location()->first();
+ }
return null;
}
- public function user()
+ public function user()
{
return $this->belongsTo(User::class);
}
@@ -323,33 +340,34 @@ public function flashLogs()
public function getMeasurementsPerDay()
{
$device_interval_min = isset($this->measurement_interval_min) && $this->measurement_interval_min > 0 ? $this->measurement_interval_min : 15;
+
return round(1440 / $device_interval_min);
}
- public function getFlashLogsHtml($start_date='2019-01-01')
+ public function getFlashLogsHtml($start_date = '2019-01-01')
{
- $flogs = $this->flashlogs()->where('created_at', '>', $start_date)->orderByDesc('created_at')->get(); // get files after start, because can only be filled with data about start date
+ $flogs = $this->flashlogs()->where('created_at', '>', $start_date)->orderByDesc('created_at')->get(); // get files after start, because can only be filled with data about start date
$flogs_count = $flogs->count();
$flogs_valid = 0;
- $html = '';
+ $html = '';
- $meas_per_day = isset($this->interval_min) && $this->interval_min > 0 ? round(1440/$this->interval_min) : 96;
- foreach ($flogs as $fl)
- {
- if ($fl->bytes_received < 100) // neglect small files
+ $meas_per_day = isset($this->interval_min) && $this->interval_min > 0 ? round(1440 / $this->interval_min) : 96;
+ foreach ($flogs as $fl) {
+ if ($fl->bytes_received < 100) { // neglect small files
continue;
+ }
$logpd = $fl->logs_per_day;
$logperc = min(100, round(100 * $logpd / $meas_per_day));
- $days = $fl->getLogDays();
- $logd = $days ? round($days).' days x '.$logperc.'%' : '';
- $pers = $fl->persisted_days ? ', '.round($fl->persisted_days).' days persisted' : '';
- $post = $pers || $logd ? ' ('.$logd.$pers.')' : '';
- $name = $fl->id.'. '.substr($fl->created_at, 0, 10).$post;
+ $days = $fl->getLogDays();
+ $logd = $days ? round($days).' days x '.$logperc.'%' : '';
+ $pers = $fl->persisted_days ? ', '.round($fl->persisted_days).' days persisted' : '';
+ $post = $pers || $logd ? ' ('.$logd.$pers.')' : '';
+ $name = $fl->id.'. '.substr($fl->created_at, 0, 10).$post;
$valid = $fl->validLog();
- $icon_h= $fl->getFixAndErrorHtmlIcons();
-
+ $icon_h = $fl->getFixAndErrorHtmlIcons();
+
$flogs_valid += $valid;
$color = $valid ? 'style="color: green;" title="Flash log id:'.$fl->id.' has '.$logd.' valid weight/time data"' : 'title="Flash log '.$fl->id.' should be checked for valid data: has '.$logd.' of data, but end date might not be within 1 hour of the upload date."';
$html .= ''.$icon_h.' '.$name.' ';
@@ -357,38 +375,38 @@ public function getFlashLogsHtml($start_date='2019-01-01')
$html .= ' ';
- $all_valid = $flogs_count > 0 && $flogs_count == $flogs_valid ? true : false;
- $html_valid = ''.$flogs_valid.'/'.$flogs_count.'
';
+ $all_valid = $flogs_count > 0 && $flogs_count == $flogs_valid ? true : false;
+ $html_valid = ''.$flogs_valid.'/'.$flogs_count.'
';
return "$html_valid $html
";
}
-
public function getRefreshMin()
{
$int_min = isset($this->measurement_interval_min) ? $this->measurement_interval_min : 0;
$int_mul = isset($this->measurement_transmission_ratio) ? $this->measurement_transmission_ratio : 1;
+
return $int_min * $int_mul;
}
public function hiveUserIds()
{
$hive_id = $this->hive_id;
- return Cache::remember('device-'.$this->id.'-hive-'.$hive_id.'-user-ids', env('CACHE_TIMEOUT_LONG'), function () use ($hive_id)
- {
+
+ return Cache::remember('device-'.$this->id.'-hive-'.$hive_id.'-user-ids', env('CACHE_TIMEOUT_LONG'), function () use ($hive_id) {
$user_ids = [$this->user_id];
- if (isset($hive_id))
- {
+ if (isset($hive_id)) {
$group_user_ids = DB::table('group_user')
- ->join('group_hive', function ($join) use ($hive_id) {
- $join->on('group_user.group_id' , '=', 'group_hive.group_id')
- ->where('group_hive.hive_id', '=', $hive_id);
- })
- ->pluck('group_user.user_id')
- ->toArray();
+ ->join('group_hive', function ($join) use ($hive_id) {
+ $join->on('group_user.group_id', '=', 'group_hive.group_id')
+ ->where('group_hive.hive_id', '=', $hive_id);
+ })
+ ->pluck('group_user.user_id')
+ ->toArray();
$user_ids = array_unique(array_merge($user_ids, $group_user_ids));
}
+
return $user_ids;
});
}
@@ -396,21 +414,21 @@ public function hiveUserIds()
public function hiveUserRuleIds()
{
$hive_id = $this->hive_id;
- return Cache::remember('device-'.$this->id.'-hive-'.$hive_id.'-rule-ids', env('CACHE_TIMEOUT_LONG'), function () use ($hive_id)
- {
+
+ return Cache::remember('device-'.$this->id.'-hive-'.$hive_id.'-rule-ids', env('CACHE_TIMEOUT_LONG'), function () use ($hive_id) {
$rule_ids = $this->user->alert_rules()->pluck('id')->toArray();
- if (isset($hive_id))
- {
+ if (isset($hive_id)) {
$group_rule_ids = DB::table('alert_rules')
- ->join('group_user', 'group_user.user_id', '=', 'alert_rules.user_id')
- ->join('group_hive', function ($join) use ($hive_id) {
- $join->on('group_user.group_id' , '=', 'group_hive.group_id')
- ->where('group_hive.hive_id', '=', $hive_id);
- })
- ->pluck('alert_rules.id')
- ->toArray();
+ ->join('group_user', 'group_user.user_id', '=', 'alert_rules.user_id')
+ ->join('group_hive', function ($join) use ($hive_id) {
+ $join->on('group_user.group_id', '=', 'group_hive.group_id')
+ ->where('group_hive.hive_id', '=', $hive_id);
+ })
+ ->pluck('alert_rules.id')
+ ->toArray();
$rule_ids = array_unique(array_merge($rule_ids, $group_rule_ids));
}
+
return $rule_ids;
});
}
@@ -432,135 +450,136 @@ public function hiveUserRuleIds()
)
*/
- public function getAlertSensorValues($measurement_abbr, $influx_func='MEAN', $interval_min=null, $limit=null, $start=null, $table='sensors')
+ public function getAlertSensorValues($measurement_abbr, $influx_func = 'MEAN', $interval_min = null, $limit = null, $start = null, $table = 'sensors')
{
- //die(print_r([$names, $valid_sensors]));
- $device_int_min= isset($this->measurement_interval_min) ? $this->measurement_interval_min : 15;
- $time_int_min = isset($interval_min) && $interval_min > $device_int_min ? $interval_min : $device_int_min;
- $val_min_ago = null;
+ // die(print_r([$names, $valid_sensors]));
+ $device_int_min = isset($this->measurement_interval_min) ? $this->measurement_interval_min : 15;
+ $time_int_min = isset($interval_min) && $interval_min > $device_int_min ? $interval_min : $device_int_min;
+ $val_min_ago = null;
// Get values from cache
- if ($table == 'sensors' && $limit == 1 && $interval_min <= $time_int_min)
- {
+ if ($table == 'sensors' && $limit == 1 && $interval_min <= $time_int_min) {
$cached_time = Cache::get('set-measurements-device-'.$this->id.'-time');
$cached_data = Cache::get('set-measurements-device-'.$this->id.'-data');
$val_min_ago = round((time() - intval($cached_time)) / 60);
- if ($cached_data && $val_min_ago < $time_int_min && isset($cached_data['time']) && isset($cached_data[$measurement_abbr]))
- return ['values'=>[["time"=>$cached_data['time'], "$measurement_abbr"=>$cached_data[$measurement_abbr]]], 'query'=>'', 'from'=>'cache', 'min_ago'=>$val_min_ago];
+ if ($cached_data && $val_min_ago < $time_int_min && isset($cached_data['time']) && isset($cached_data[$measurement_abbr])) {
+ return ['values' => [['time' => $cached_data['time'], "$measurement_abbr" => $cached_data[$measurement_abbr]]], 'query' => '', 'from' => 'cache', 'min_ago' => $val_min_ago];
+ }
}
// Get values from Influx
- $where_limit = isset($limit) ? ' LIMIT '.$limit : '';
- $where = $this->influxWhereKeys();
- $where_time = isset($start) ? 'AND time >= \''.$start.'\' ' : '';
+ $where_limit = isset($limit) ? ' LIMIT '.$limit : '';
+ $where = $this->influxWhereKeys();
+ $where_time = isset($start) ? 'AND time >= \''.$start.'\' ' : '';
$group_by_time = 'GROUP BY time('.$time_int_min.'m) ';
- $deriv_time = '';
- if ($influx_func == 'DERIVATIVE') // don't groupby time, but set derivative time
- {
+ $deriv_time = '';
+ if ($influx_func == 'DERIVATIVE') { // don't groupby time, but set derivative time
$group_by_time = '';
- $deriv_time = ','.$time_int_min.'m';
+ $deriv_time = ','.$time_int_min.'m';
}
- $query = 'SELECT '.$influx_func.'("'.$measurement_abbr.'"'.$deriv_time.') AS "'.$measurement_abbr.'" FROM "'.$table.'" WHERE '.$where.' '.$where_time.$group_by_time.'ORDER BY time DESC'.$where_limit;
- $values = Device::getInfluxQuery($query, 'alert');
+ $query = 'SELECT '.$influx_func.'("'.$measurement_abbr.'"'.$deriv_time.') AS "'.$measurement_abbr.'" FROM "'.$table.'" WHERE '.$where.' '.$where_time.$group_by_time.'ORDER BY time DESC'.$where_limit;
+ $values = Device::getInfluxQuery($query, 'alert');
- if (count($values) > 0)
- {
+ if (count($values) > 0) {
$last_vals = $values[0];
- if ($last_vals['time'])
- {
- $last_mom = new Moment($last_vals['time']);
+ if ($last_vals['time']) {
+ $last_mom = new Moment($last_vals['time']);
$val_min_ago = round($last_mom->fromNow()->getMinutes());
}
}
- return ['values'=>$values,'query'=>$query, 'from'=>'influx', 'min_ago'=>$val_min_ago];
+ return ['values' => $values, 'query' => $query, 'from' => 'influx', 'min_ago' => $val_min_ago];
}
public static function selectList()
{
$list = [];
- if (Auth::user()->hasRole(['superadmin','admin']))
+ if (Auth::user()->hasRole(['superadmin', 'admin'])) {
$list = Device::all();
- else
+ } else {
$list = Auth::user()->devices;
+ }
- $list_out = [];
+ $list_out = [];
- foreach($list as $i)
- {
+ foreach ($list as $i) {
$id = $i->id;
$label = $i->name.' ('.$i->key.')';
$list_out[$id] = $label;
}
+
return $list_out;
}
-
public function last_sensor_measurement_time_value($name)
{
$arr = $this->last_sensor_values_array($name);
- if ($arr && count($arr) > 0 && in_array($name, array_keys($arr)))
+ if ($arr && count($arr) > 0 && in_array($name, array_keys($arr))) {
return $arr[$name];
+ }
return null;
}
-
- public static function getInfluxQuery($query, $from='device')
+ public static function getInfluxQuery($query, $from = 'device')
{
Device::cacheRequestRate('influx-get');
Device::cacheRequestRate('influx-'.$from);
- $client = new \Influx;
- $options = ['precision'=> 's'];
- $values = [];
+ $client = new \Influx;
+ $options = ['precision' => 's'];
+ $values = [];
- try{
- $result = $client::query($query, $options);
- $values = $result->getPoints();
+ try {
+ $result = $client::query($query, $options);
+ $values = $result->getPoints();
} catch (\Exception $e) {
// return Response::json('influx-group-by-query-error', 500);
- //die($e->getMessage());
+ // die($e->getMessage());
}
+
return $values;
}
// Provide a list of sensor names that exist within the $where clase and $table
- public static function getAvailableSensorNamesNoCache($names, $where, $table='sensors', $output_sensors_only=true, $cache_name='names-nocache')
+ public static function getAvailableSensorNamesNoCache($names, $where, $table = 'sensors', $output_sensors_only = true, $cache_name = 'names-nocache')
{
- $weather = $table == 'weather' ? true : false;
- $valid_sensors = Measurement::getValidMeasurements();
+ $weather = $table == 'weather' ? true : false;
+ $valid_sensors = Measurement::getValidMeasurements();
$output_sensors = Measurement::getValidMeasurements(true, $weather);
- $out = [];
+ $out = [];
$valid_sensors = $output_sensors_only ? $output_sensors : array_keys($valid_sensors);
$valid_sensors = array_intersect($valid_sensors, $names);
- if (count($valid_sensors) == 0)
+ if (count($valid_sensors) == 0) {
return $out;
+ }
$fields = [];
- foreach ($valid_sensors as $field)
- {
+ foreach ($valid_sensors as $field) {
$fields[] = 'count("'.$field.'") as "'.$field.'"';
}
$valid_fields = implode(', ', $fields);
- $query = 'SELECT '.$valid_fields.' FROM "'.$table.'" WHERE '.$where.' GROUP BY "name,time" ORDER BY time DESC LIMIT 1';
+ $query = 'SELECT '.$valid_fields.' FROM "'.$table.'" WHERE '.$where.' GROUP BY "name,time" ORDER BY time DESC LIMIT 1';
$values = Device::getInfluxQuery($query, $cache_name);
- if (count($values) > 0)
+ if (count($values) > 0) {
$sensors = $values[0];
- else
+ } else {
return $out;
+ }
- $sensors = array_filter($sensors, function($value) { return !is_null($value) && $value !== '' && $value > 0; });
+ $sensors = array_filter($sensors, function ($value) {
+ return ! is_null($value) && $value !== '' && $value > 0;
+ });
$out = array_keys($sensors);
$out = array_intersect($out, $valid_sensors);
@@ -570,62 +589,59 @@ public static function getAvailableSensorNamesNoCache($names, $where, $table='se
}
// Provide a list of sensor names that exist within the $where clase and $table (cached)
- public static function getAvailableSensorNamesFromData($device_name, $names, $where, $table='sensors', $output_sensors_only=true, $cache=true)
+ public static function getAvailableSensorNamesFromData($device_name, $names, $where, $table = 'sensors', $output_sensors_only = true, $cache = true)
{
- $output_name = $output_sensors_only ? 'output' : 'valid';
- $names_name = gettype($names) == 'array' ? implode('-', $names) : $names;
+ $output_name = $output_sensors_only ? 'output' : 'valid';
+ $names_name = gettype($names) == 'array' ? implode('-', $names) : $names;
- $cache_string = 'device-'.$device_name.'-'.$table.'-measurement-names-'.$names_name.'-'.$output_name;
- $cache_array = Cache::get($cache_string);
+ $cache_string = 'device-'.$device_name.'-'.$table.'-measurement-names-'.$names_name.'-'.$output_name;
+ $cache_array = Cache::get($cache_string);
$forget = 0;
- if (gettype($cache_array) != 'array' || count($cache_array) == 0 || $cache == false)
- {
+ if (gettype($cache_array) != 'array' || count($cache_array) == 0 || $cache == false) {
$forget = 1;
Cache::forget($cache_string);
}
- //die(print_r(['forget'=>$forget, 'key'=>$cache_string, 'data'=>$cache_array]));
+ // die(print_r(['forget'=>$forget, 'key'=>$cache_string, 'data'=>$cache_array]));
- return Cache::remember($cache_string, env('CACHE_TIMEOUT_LONG', 3600), function () use ($names, $where, $table, $output_sensors_only)
- {
+ return Cache::remember($cache_string, env('CACHE_TIMEOUT_LONG', 3600), function () use ($names, $where, $table, $output_sensors_only) {
return Device::getAvailableSensorNamesNoCache($names, $where, $table, $output_sensors_only, 'names');
});
}
-
- public function last_sensor_values_array($fields='*', $limit=1)
+ public function last_sensor_values_array($fields = '*', $limit = 1)
{
- if (gettype($fields) == 'array')
+ if (gettype($fields) == 'array') {
$cache_fields = implode('-', $fields);
- else
+ } else {
$cache_fields = $fields;
+ }
- $cache_name = 'device-'.$this->id.'-fields-'.$cache_fields.'-limit-'.$limit;
+ $cache_name = 'device-'.$this->id.'-fields-'.$cache_fields.'-limit-'.$limit;
$last_dev_time = Cache::get('set-measurements-device-'.$this->id.'-time'); // not fields and limit based, set in MeasurementController::storeMeasurements
$last_req_time = Cache::get('last-values-'.$cache_name.'-request-time');
$last_req_vals = Cache::get('last-values-'.$cache_name);
- if ($last_req_vals != null && $last_dev_time < $last_req_time) // only request Influx if newer data is available
- {
+ if ($last_req_vals != null && $last_dev_time < $last_req_time) { // only request Influx if newer data is available
$last_req_vals['from_cache'] = true;
+
return $last_req_vals;
}
$fields = $fields != '*' ? '"'.$fields.'"' : '*';
- $groupby= $fields == '*' || strpos(',' ,$fields) ? 'GROUP BY "name,time"' : '';
+ $groupby = $fields == '*' || strpos(',', $fields) ? 'GROUP BY "name,time"' : '';
$output = null;
- try
- {
- $query = 'SELECT '.$fields.' from "sensors" WHERE '.$this->influxWhereKeys().' AND time > now() - 365d AND time <= now() '.$groupby.' ORDER BY time DESC LIMIT '.$limit;
- //die(print_r($query));
+ try {
+ $query = 'SELECT '.$fields.' from "sensors" WHERE '.$this->influxWhereKeys().' AND time > now() - 365d AND time <= now() '.$groupby.' ORDER BY time DESC LIMIT '.$limit;
+ // die(print_r($query));
$values = Device::getInfluxQuery($query, 'last');
- //die(print_r($values));
+ // die(print_r($values));
$output = $limit == 1 ? $values[0] : $values;
- $output = array_filter($output, function($value) { return !is_null($value) && $value !== ''; });
- }
- catch(\Exception $e)
- {
+ $output = array_filter($output, function ($value) {
+ return ! is_null($value) && $value !== '';
+ });
+ } catch (\Exception $e) {
return false;
}
@@ -635,149 +651,145 @@ public function last_sensor_values_array($fields='*', $limit=1)
return $output;
}
- public function getMeasurementCount($from='2019-01-01 00:00:00', $to=null)
+ public function getMeasurementCount($from = '2019-01-01 00:00:00', $to = null)
{
- $where = $this->influxWhereKeys();
- $where_time = isset($from) ? 'AND time >= \''.$from.'\' ' : '';
- $where_time .= isset($to) ? 'AND time <= \''.$to.'\' ' : 'AND time <= \''.date('Y-m-d H:i:s').'\' ';
+ $where = $this->influxWhereKeys();
+ $where_time = isset($from) ? 'AND time >= \''.$from.'\' ' : '';
+ $where_time .= isset($to) ? 'AND time <= \''.$to.'\' ' : 'AND time <= \''.date('Y-m-d H:i:s').'\' ';
$group_by_time = 'GROUP BY time(24h) ';
$query = 'SELECT count("bv") AS "cnt" FROM "sensors" WHERE '.$where.' '.$where_time;
$cnt = Device::getInfluxQuery($query, 'measurement_count');
- //die(print_r($cnt));
- if (isset($cnt) && isset($cnt[0]['cnt']))
+ // die(print_r($cnt));
+ if (isset($cnt) && isset($cnt[0]['cnt'])) {
return intval($cnt[0]['cnt']);
+ }
return 0;
}
- public function addSensorDefinitionMeasurements($data_array, $value, $input_measurement_id=null, $date=null, $sensor_defs=null)
+ public function addSensorDefinitionMeasurements($data_array, $value, $input_measurement_id = null, $date = null, $sensor_defs = null)
{
- if ($input_measurement_id != null)
- {
+ if ($input_measurement_id != null) {
// Get the right sensordefinition
- $sensor_def = null;
+ $sensor_def = null;
- if ($sensor_defs == null)
- $sensor_defs = $this->sensorDefinitions->where('input_measurement_id', $input_measurement_id); // get appropriate sensor definitions
- else
- $sensor_defs = $sensor_defs->where('input_measurement_id', $input_measurement_id); // get appropriate sensor definitions
+ if ($sensor_defs == null) {
+ $sensor_defs = $this->sensorDefinitions->where('input_measurement_id', $input_measurement_id);
+ } // get appropriate sensor definitions
+ else {
+ $sensor_defs = $sensor_defs->where('input_measurement_id', $input_measurement_id);
+ } // get appropriate sensor definitions
- if ($sensor_defs->count() == 0)
- {
+ if ($sensor_defs->count() == 0) {
// add nothing to $data_array
- }
- else if ($sensor_defs->count() == 1)
- {
+ } elseif ($sensor_defs->count() == 1) {
$sensor_def = $sensor_defs->last(); // get the only sensor definition, before or after setting
- }
- else // there are multiple, so get the one appropriate for the $date
- {
+ } else { // there are multiple, so get the one appropriate for the $date
$before_date = isset($date) ? $date : date('Y-m-d H:i:s');
- if ($sensor_defs->where('updated_at', '<=', $before_date)->count() == 0) // not found before $date, but there are after, so get the first (earliest)
+ if ($sensor_defs->where('updated_at', '<=', $before_date)->count() == 0) { // not found before $date, but there are after, so get the first (earliest)
$sensor_def = $sensor_defs->first();
- else
- $sensor_def = $sensor_defs->where('updated_at', '<=', $before_date)->last(); // be aware that last() gets the last value of the ASCENDING list (so most recent)
+ } else {
+ $sensor_def = $sensor_defs->where('updated_at', '<=', $before_date)->last();
+ } // be aware that last() gets the last value of the ASCENDING list (so most recent)
}
// Calculate the extra value based on the sensor definition
- if (isset($sensor_def))
- {
+ if (isset($sensor_def)) {
$measurement_abbr_o = $sensor_def->output_abbr;
- if (!isset($data_array[$measurement_abbr_o]) || $sensor_def->input_measurement_id == $sensor_def->output_measurement_id) // only add value to $data_array if it does not yet exist, or input and output are the same
- {
+ if (! isset($data_array[$measurement_abbr_o]) || $sensor_def->input_measurement_id == $sensor_def->output_measurement_id) { // only add value to $data_array if it does not yet exist, or input and output are the same
$calibrated_measurement_val = $sensor_def->calibrated_measurement_value($value);
- if ($calibrated_measurement_val !== null) // do not add sensor measurement is outside measurement min/max value
+ if ($calibrated_measurement_val !== null) { // do not add sensor measurement is outside measurement min/max value
$data_array[$measurement_abbr_o] = $calibrated_measurement_val;
+ }
}
}
}
+
return $data_array;
}
// CLEANED WEIGHT FUNCTIONS
// get the resolution in minutes
- private function translateResolutionToMinutes($resolution){
- $index = strlen($resolution) -1;
+ private function translateResolutionToMinutes($resolution)
+ {
+ $index = strlen($resolution) - 1;
$value = substr($resolution, 0, $index);
$unit = substr($resolution, $index);
$minutes = null;
- if($unit=="m"){
+ if ($unit == 'm') {
$minutes = $value;
- }
- elseif($unit=="h"){
- $minutes = $value*60;
- }
- elseif($unit=="d"){
- $minutes = $value*60*24;
+ } elseif ($unit == 'h') {
+ $minutes = $value * 60;
+ } elseif ($unit == 'd') {
+ $minutes = $value * 60 * 24;
}
return $minutes;
}
// if there is only a small time frame between inspections, this time frame should be queried in a smaller resolution
- private function mapToSmallerResolution($resolution){
- $index = strlen($resolution) -1;
+ private function mapToSmallerResolution($resolution)
+ {
+ $index = strlen($resolution) - 1;
$unit = substr($resolution, $index);
- if($unit=="m"){
- $resolution = "1m";
- }
- elseif($unit=="h"){
- $resolution = "15m";
- }
- elseif($unit=="d"){
- $resolution = "1h";
+ if ($unit == 'm') {
+ $resolution = '1m';
+ } elseif ($unit == 'h') {
+ $resolution = '15m';
+ } elseif ($unit == 'd') {
+ $resolution = '1h';
}
+
return $resolution;
}
- public function getCleanedWeightQuery($resolution, $start_date, $end_date, $limit=5000, $threshold=0.75, $frame=2, $timeZone='UTC')
+ public function getCleanedWeightQuery($resolution, $start_date, $end_date, $limit = 5000, $threshold = 0.75, $frame = 2, $timeZone = 'UTC')
{
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
- $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- $groupByResolution = 'GROUP BY time('.$resolution.') FILL('.$fill.')';
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+ $groupByResolution = 'GROUP BY time('.$resolution.') FILL('.$fill.')';
$groupByKeyResolution = 'GROUP BY "key",time('.$resolution.') FILL('.$fill.')';
- $groupBySelectOuter = 'CUMULATIVE_SUM(SUM(weight_delta)) as net_weight_kg';
- $innerQuery = $this->getInnerCleanQuery($resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone);
-
- if ($innerQuery === null)
+ $groupBySelectOuter = 'CUMULATIVE_SUM(SUM(weight_delta)) as net_weight_kg';
+ $innerQuery = $this->getInnerCleanQuery($resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone);
+
+ if ($innerQuery === null) {
return null;
+ }
+
+ $sensorQuery = 'SELECT '.$groupBySelectOuter.' FROM '.$innerQuery.' WHERE '.$whereTime.' '.$groupByKeyResolution.' LIMIT '.$limit;
+ $cleanedWeightQuery = 'SELECT mean(net_weight_kg) as net_weight_kg FROM ('.$sensorQuery.') WHERE '.$whereTime.' '.$groupByResolution.' LIMIT '.$limit; // this is necessary to fill with null values when data is missing
- $sensorQuery = 'SELECT '.$groupBySelectOuter.' FROM '.$innerQuery.' WHERE '.$whereTime.' '.$groupByKeyResolution.' LIMIT '.$limit;
- $cleanedWeightQuery = 'SELECT mean(net_weight_kg) as net_weight_kg FROM ('.$sensorQuery.') WHERE '.$whereTime.' '.$groupByResolution.' LIMIT '.$limit; // this is necessary to fill with null values when data is missing
-
return $cleanedWeightQuery;
}
- public function getInnerCleanQuery($resolution, $start_date, $end_date, $limit=5000, $threshold=0.75, $frame=2, $timeZone='UTC')
+ public function getInnerCleanQuery($resolution, $start_date, $end_date, $limit = 5000, $threshold = 0.75, $frame = 2, $timeZone = 'UTC')
{
- $wherekeys=$this->influxWhereKeys();
-
+ $wherekeys = $this->influxWhereKeys();
- $whereTreshold = 'weight_delta < '.$threshold.' AND weight_delta >'.-1*$threshold;
+ $whereTreshold = 'weight_delta < '.$threshold.' AND weight_delta >'.-1 * $threshold;
$inspections = [];
-
- if ($this->hive)
- {
- $inspections = $this -> hive -> getAllInspectionDates();
+
+ if ($this->hive) {
+ $inspections = $this->hive->getAllInspectionDates();
sort($inspections);
// choose inspections in time frame only and convert to utc
$filteredInspections = [];
- foreach($inspections as $inspection){
+ foreach ($inspections as $inspection) {
$inspection_stamp = new Moment($inspection, $timeZone);
$inspection_utc = $inspection_stamp->setTimezone('UTC')->format($this->timeFormat);
- if($inspection_utc >= $start_date & $inspection_utc <= $end_date){
+ if ($inspection_utc >= $start_date & $inspection_utc <= $end_date) {
array_push($filteredInspections, $inspection_utc);
}
}
$inspections = $filteredInspections;
}
- #return Response::json( ['status'=>$inspections] );
+ // return Response::json( ['status'=>$inspections] );
// array for time frames shortly before and after inspections
$inspectionTuples = [];
@@ -787,31 +799,31 @@ public function getInnerCleanQuery($resolution, $start_date, $end_date, $limit=5
$inspectionFrame = $frame;
// create first tuple / or the only tuple needed
- if(count($inspections) != 0){
+ if (count($inspections) != 0) {
$periodTuples[0] = ['\''.$start_date.'\'', '\''.$inspections[0].'\''.' - '.$inspectionFrame.'h', $resolution];
- }else{
+ } else {
$periodTuples[0] = ['\''.$start_date.'\'', '\''.$end_date.'\'', $resolution];
}
// create all tuples
$length = count($inspections);
$i = 0;
- while($i <= $length-1){
+ while ($i <= $length - 1) {
$cur = current($inspections);
- if(($i != $length-1)){
+ if (($i != $length - 1)) {
$nex = next($inspections);
- }else{
+ } else {
$nex = $end_date;
}
$i++;
// check if two or more inspection time frames should be merged into one. update $nex in that case
$inter = $cur;
- while(($i <= $length-1) && ((strtotime($nex) - strtotime($inter))/(60*60)<= 2*$inspectionFrame )){
+ while (($i <= $length - 1) && ((strtotime($nex) - strtotime($inter)) / (60 * 60) <= 2 * $inspectionFrame)) {
$inter = $nex;
- if(($i != $length-1)){
+ if (($i != $length - 1)) {
$nex = next($inspections);
- } else{
+ } else {
$nex = $end_date;
}
$i++;
@@ -824,109 +836,100 @@ public function getInnerCleanQuery($resolution, $start_date, $end_date, $limit=5
$difference = round(abs(strtotime($nex) - strtotime($inter)) / 60);
$transRes = $this->translateResolutionToMinutes($resolution);
$useRes = $resolution;
- if(!is_null($transRes) & (($difference - 2*60*$inspectionFrame)< $transRes)){
- $useRes = $this -> mapToSmallerResolution($resolution);
+ if (! is_null($transRes) & (($difference - 2 * 60 * $inspectionFrame) < $transRes)) {
+ $useRes = $this->mapToSmallerResolution($resolution);
}
// add period tuple
- if($i <= $length-1){
- $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$nex.'\' - '.$inspectionFrame.'h', $useRes];
- }else{
- $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$end_date.'\'', $useRes];
+ if ($i <= $length - 1) {
+ $periodTuples[$i + 1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$nex.'\' - '.$inspectionFrame.'h', $useRes];
+ } else {
+ $periodTuples[$i + 1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$end_date.'\'', $useRes];
}
}
- $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+ $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- if($resolution != null)
- {
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ if ($resolution != null) {
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
$groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
$groupInspection = 'GROUP BY time(15m)';
$groupBySelectOuter = 'CUMULATIVE_SUM(SUM(weight_delta)) as weight_kg_noOutlier';
$groupBySelectInnerInspection = 'DERIVATIVE(MEAN(weight_kg), 15m) as weight_delta';
- #$groupBySelectInnerPeriod = 'derivative(mean(weight_kg), '.$resolution.') as weight_delta';
+ // $groupBySelectInnerPeriod = 'derivative(mean(weight_kg), '.$resolution.') as weight_delta';
}
-
$sensors_out = [];
- if ($groupBySelectOuter != null && $groupBySelectOuter != '')
- {
+ if ($groupBySelectOuter != null && $groupBySelectOuter != '') {
$inspectionQueries = [];
- foreach($inspectionTuples as $i => $tuple){
+ foreach ($inspectionTuples as $i => $tuple) {
$inspectionQueries[$i] = '(SELECT * FROM ( SELECT '.$groupBySelectInnerInspection.' FROM "sensors" WHERE '.$wherekeys.
' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' '.$groupInspection.' FILL(linear) LIMIT '.$limit.') WHERE '.$whereTreshold.')';
}
$periodQueries = [];
- foreach($periodTuples as $i => $tuple){
- $periodQueries[$i] = '(SELECT DERIVATIVE(MEAN(weight_kg), '.$tuple[2].') as weight_delta FROM "sensors" WHERE '.$wherekeys.
+ foreach ($periodTuples as $i => $tuple) {
+ $periodQueries[$i] = '(SELECT DERIVATIVE(MEAN(weight_kg), '.$tuple[2].') as weight_delta FROM "sensors" WHERE '.$wherekeys.
' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' GROUP BY time('.$tuple[2].') FILL(linear) LIMIT '.$limit.')';
}
- $allQueries = array_merge($periodQueries, $inspectionQueries);
+ $allQueries = array_merge($periodQueries, $inspectionQueries);
$innerQuery = implode(', ', $allQueries);
}
+
return $innerQuery;
}
// END OF CLEANED WEIGHT FUNCTIONS
- private function last_sensor_increment_values($data_array=null)
+ private function last_sensor_increment_values($data_array = null)
{
$output = [];
- $limit = 2;
+ $limit = 2;
- if ($data_array != null)
- {
+ if ($data_array != null) {
$output[0] = $data_array;
- $output[1] = $this->last_sensor_values_array(implode('","',array_keys($data_array)), 1);
- }
- else
- {
+ $output[1] = $this->last_sensor_values_array(implode('","', array_keys($data_array)), 1);
+ } else {
$output_sensors = Measurement::where('show_in_charts', '=', 1)->pluck('abbreviation')->toArray();
- $output = $this->last_sensor_values_array(implode('","',$output_sensors), $limit);
+ $output = $this->last_sensor_values_array(implode('","', $output_sensors), $limit);
}
- $out_arr= [];
+ $out_arr = [];
- if (count($output) < $limit)
+ if (count($output) < $limit) {
return null;
+ }
- for ($i=0; $i < $limit; $i++)
- {
- if (isset($output[$i]) && gettype($output[$i]) == 'array')
- {
- foreach ($output[$i] as $key => $val)
- {
- if ($val != null)
- {
+ for ($i = 0; $i < $limit; $i++) {
+ if (isset($output[$i]) && gettype($output[$i]) == 'array') {
+ foreach ($output[$i] as $key => $val) {
+ if ($val != null) {
$value = $key == 'time' ? strtotime($val) : floatval($val);
- if ($i == 0) // desc array, so most recent value: $i == 0
- {
+ if ($i == 0) { // desc array, so most recent value: $i == 0
$out_arr[$key] = $value;
- }
- else if (isset($out_arr[$key]))
- {
+ } elseif (isset($out_arr[$key])) {
$out_arr[$key] = $out_arr[$key] - $value;
}
}
}
}
}
- //die(print_r($out_arr));
+ // die(print_r($out_arr));
return $out_arr;
}
- public function calibrationsMeasurementAbbreviations($recalculate=true)
+ public function calibrationsMeasurementAbbreviations($recalculate = true)
{
- $cache_name = 'device-'.$this->id.'-calibrations-measurement-types-'.$recalculate?'1':'0';
- return Cache::rememberForever($cache_name, function () use ($recalculate){
+ $cache_name = 'device-'.$this->id.'-calibrations-measurement-types-'.$recalculate ? '1' : '0';
+
+ return Cache::rememberForever($cache_name, function () use ($recalculate) {
$out = [];
- if ($recalculate)
+ if ($recalculate) {
$cals = $this->sensorDefinitions()->where('recalculate', '=', true)->whereColumn('input_measurement_id', '!=', 'output_measurement_id')->orderBy('updated_at', 'asc')->get();
- else
+ } else {
$cals = $this->sensorDefinitions()->whereColumn('input_measurement_id', '!=', 'output_measurement_id')->orderBy('updated_at', 'asc')->get();
+ }
foreach ($cals as $cal) {
if (isset($cal->input_abbr)) {
@@ -943,5 +946,4 @@ public function calibrationsMeasurementAbbreviations($recalculate=true)
return $out;
});
}
-
}
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 2dcc4acf..2fba1c6c 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -3,7 +3,6 @@
namespace App\Exceptions;
use Exception;
-use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
@@ -16,6 +15,7 @@ class Handler extends ExceptionHandler
protected $dontReport = [
//
];
+
/**
* A list of the inputs that are never flashed for validation exceptions.
*
@@ -25,33 +25,31 @@ class Handler extends ExceptionHandler
'password',
'password_confirmation',
];
+
/**
* Report or log an exception.
*
- * @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}
+
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
- * @param \Exception $exception
* @return \Illuminate\Http\Response
*/
-
public function render($request, Exception $exception)
{
// PGe added redirect in case of (ugly) tokenmismatch exception error page
- if($exception instanceof \Illuminate\Session\TokenMismatchException)
- {
- return redirect()
- ->back()
- ->withInput($request->except('_token'))
- ->withMessage('Your session expired, please log in again');
+ if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
+ return redirect()
+ ->back()
+ ->withInput($request->except('_token'))
+ ->withMessage('Your session expired, please log in again');
}
return parent::render($request, $exception);
diff --git a/app/Group.php b/app/Group.php
index 6e835cef..7cbd3914 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -2,27 +2,25 @@
namespace App;
+use Auth;
+use Cache;
+use DB;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use DB;
-use Auth;
-use Cache;
-use App\Hive;
-
class Group extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
public $timestamps = false;
- public $fillable = ['type','name','description','hex_color','icon'];
+ public $fillable = ['type', 'name', 'description', 'hex_color', 'icon'];
- protected $hidden= ['pivot', 'deleted_at', 'type', 'icon'];
+ protected $hidden = ['pivot', 'deleted_at', 'type', 'icon'];
- public $appends = ['hives','users','admin','creator']; // 'hive_ids'
+ public $appends = ['hives', 'users', 'admin', 'creator']; // 'hive_ids'
// Caching
public static function boot()
@@ -43,63 +41,61 @@ public static function boot()
}
// Cache functions
- public function empty_cache($clear_users=true)
+ public function empty_cache($clear_users = true)
{
Cache::forget('group-'.$this->id.'-hives');
Log::debug("Group ID $this->id cache emptied");
- if ($clear_users)
- {
+ if ($clear_users) {
foreach ($this->group_users as $user) {
$user->emptyCache('group');
}
- // clear group users cache after clearing users cache
+ // clear group users cache after clearing users cache
Cache::forget('group-'.$this->id.'-users');
}
}
-
-
// Relations
public function getHivesAttribute()
{
- return Cache::remember('group-'.$this->id.'-hives', env('CACHE_TIMEOUT_LONG'), function () {
+ return Cache::remember('group-'.$this->id.'-hives', env('CACHE_TIMEOUT_LONG'), function () {
return $this->group_hives()->with(['layers', 'queen'])->get();
});
}
public function getHiveIdsAttribute()
{
- $hive_ids = DB::table('group_hive')->where('group_id',$this->id)->pluck('hive_id')->toArray();
- return $hive_ids; //Hive::whereIn('id',$hive_ids)->pluck('id');
+ $hive_ids = DB::table('group_hive')->where('group_id', $this->id)->pluck('hive_id')->toArray();
+
+ return $hive_ids; // Hive::whereIn('id',$hive_ids)->pluck('id');
}
public function getUsersAttribute()
{
return Cache::remember('group-'.$this->id.'-users', env('CACHE_TIMEOUT_LONG'), function () {
- return $this->group_users()->withPivot('admin', 'creator', 'invited', 'accepted', 'declined', 'token')->get()->map(function ($item, $key)
- {
- $user = $item->only(['id','name','avatar','email']);
- $user['admin'] = (bool)$item->pivot->admin;
- $user['creator'] = (bool)$item->pivot->creator;
+ return $this->group_users()->withPivot('admin', 'creator', 'invited', 'accepted', 'declined', 'token')->get()->map(function ($item, $key) {
+ $user = $item->only(['id', 'name', 'avatar', 'email']);
+ $user['admin'] = (bool) $item->pivot->admin;
+ $user['creator'] = (bool) $item->pivot->creator;
$user['invited'] = $item->pivot->invited;
- $user['accepted']= $item->pivot->accepted;
- $user['declined']= $item->pivot->declined;
- $user['token'] = $item->pivot->token;
- return $user;
+ $user['accepted'] = $item->pivot->accepted;
+ $user['declined'] = $item->pivot->declined;
+ $user['token'] = $item->pivot->token;
+
+ return $user;
});
});
}
public function getAdminAttribute()
{
- return (bool)($this->getUsersAttribute()->where('id',Auth::user()->id)->where('admin',1)->count() > 0); // myself
+ return (bool) ($this->getUsersAttribute()->where('id', Auth::user()->id)->where('admin', 1)->count() > 0); // myself
}
public function getCreatorAttribute()
{
- return (bool)($this->getUsersAttribute()->where('id',Auth::user()->id)->where('creator',1)->count() > 0); // myself
+ return (bool) ($this->getUsersAttribute()->where('id', Auth::user()->id)->where('creator', 1)->count() > 0); // myself
}
public function group_users()
@@ -114,12 +110,11 @@ public function group_hives()
public function delete()
{
- // delete all related items
+ // delete all related items
$this->group_hives()->detach();
$this->group_users()->detach();
// delete the user
return parent::delete();
}
-
}
diff --git a/app/Hive.php b/app/Hive.php
index c6808f2c..981b52ca 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -2,23 +2,26 @@
namespace App;
+use Auth;
+use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use App\Http\Resources\InspectionCollection;
-use Auth;
-use Cache;
class Hive extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
+
+ protected $cascadeDeletes = ['queen', 'inspections', 'layers', 'frames'];
- protected $cascadeDeletes = ['queen','inspections','layers','frames'];
protected $fillable = ['user_id', 'location_id', 'hive_type_id', 'color', 'name', 'bb_width_cm', 'bb_depth_cm', 'bb_height_cm', 'fr_width_cm', 'fr_height_cm', 'order'];
- protected $guarded = ['id'];
- protected $hidden = ['user_id','deleted_at','pivot'];
- protected $appends = ['type','location','attention','impression','notes','reminder','reminder_date','inspection_count','sensors','owner','editable','group_ids','last_inspection_date'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['user_id', 'deleted_at', 'pivot'];
+
+ protected $appends = ['type', 'location', 'attention', 'impression', 'notes', 'reminder', 'reminder_date', 'inspection_count', 'sensors', 'owner', 'editable', 'group_ids', 'last_inspection_date'];
public $timestamps = false;
@@ -26,36 +29,32 @@ public static function boot()
{
parent::boot();
- static::created(function($h)
- {
+ static::created(function ($h) {
$h->empty_cache();
});
- static::updated(function($h)
- {
+ static::updated(function ($h) {
$h->empty_cache();
});
- static::deleting(function($h)
- {
+ static::deleting(function ($h) {
// remove device-hive link
- foreach ($h->devices as $d)
- {
+ foreach ($h->devices as $d) {
$d->hive_id = null;
$d->save();
- };
+ }
// remove hive id from AlertRules exclude_hive_ids
$ars = $h->user->alert_rules;
- if (isset($ars) && count($ars) > 0)
- {
- foreach ($ars as $a)
+ if (isset($ars) && count($ars) > 0) {
+ foreach ($ars as $a) {
$a->remove_hive_id_from_exclude_hive_ids($h->id);
+ }
}
$h->empty_cache();
});
}
- public function empty_cache($clear_user=true)
+ public function empty_cache($clear_user = true)
{
Cache::forget("hive-$this->id-layer-count-honey");
Cache::forget("hive-$this->id-layer-count-brood");
@@ -66,15 +65,17 @@ public function empty_cache($clear_user=true)
Log::debug("Hive ID $this->id cache emptied");
- foreach($this->groups as $group)
+ foreach ($this->groups as $group) {
$group->empty_cache(true);
+ }
- if ($clear_user)
+ if ($clear_user) {
User::emptyIdCache($this->user_id, 'apiary');
+ }
}
- // Relations
- public function getTypeAttribute()
+ // Relations
+ public function getTypeAttribute()
{
return Cache::rememberForever("hive-type-$this->hive_type_id-name", function () {
return Category::find($this->hive_type_id)->name;
@@ -84,16 +85,17 @@ public function getTypeAttribute()
public function getLocationAttribute()
{
$loc_name = '';
- if (isset($this->location_id))
- {
+ if (isset($this->location_id)) {
$cache_name = "hive-$this->id-location-name";
- $location = Location::find($this->location_id);
- $loc_name = Cache::rememberForever($cache_name, function () use ($location) {
+ $location = Location::find($this->location_id);
+ $loc_name = Cache::rememberForever($cache_name, function () use ($location) {
return isset($location->name) ? $location->name : '';
});
- if ($loc_name == '')
+ if ($loc_name == '') {
Cache::forget($cache_name);
+ }
}
+
return $loc_name;
}
@@ -135,9 +137,10 @@ public function getInspectionCountAttribute()
public function getHoneylayersAttribute()
{
$cat_id = Cache::rememberForever('hive-layer-type-id-honey', function () {
- return Category::findCategoryIdByParentAndName('hive_layer','honey');
+ return Category::findCategoryIdByParentAndName('hive_layer', 'honey');
});
- return Cache::rememberForever("hive-$this->id-layer-count-honey", function () use ($cat_id) {
+
+ return Cache::rememberForever("hive-$this->id-layer-count-honey", function () use ($cat_id) {
return $this->layers()->where('category_id', $cat_id)->count();
});
}
@@ -145,9 +148,10 @@ public function getHoneylayersAttribute()
public function getBroodlayersAttribute()
{
$cat_id = Cache::rememberForever('hive-layer-type-id-brood', function () {
- return Category::findCategoryIdByParentAndName('hive_layer','brood');
+ return Category::findCategoryIdByParentAndName('hive_layer', 'brood');
});
- return Cache::rememberForever("hive-$this->id-layer-count-brood", function () use ($cat_id) {
+
+ return Cache::rememberForever("hive-$this->id-layer-count-brood", function () use ($cat_id) {
return $this->layers()->where('category_id', $cat_id)->count();
});
}
@@ -155,9 +159,10 @@ public function getBroodlayersAttribute()
public function getFeedingBoxAttribute()
{
$cat_id = Cache::rememberForever('hive-layer-type-id-feeding_box', function () {
- return Category::findCategoryIdByParentAndName('hive_layer','feeding_box');
+ return Category::findCategoryIdByParentAndName('hive_layer', 'feeding_box');
});
- return Cache::rememberForever("hive-$this->id-layer-count-feeding_box", function () use ($cat_id) {
+
+ return Cache::rememberForever("hive-$this->id-layer-count-feeding_box", function () use ($cat_id) {
return $this->layers()->where('category_id', $cat_id)->count();
});
}
@@ -165,9 +170,10 @@ public function getFeedingBoxAttribute()
public function getQueenExcluderAttribute()
{
$cat_id = Cache::rememberForever('hive-layer-type-id-queen_excluder', function () {
- return Category::findCategoryIdByParentAndName('hive_layer','queen_excluder');
+ return Category::findCategoryIdByParentAndName('hive_layer', 'queen_excluder');
});
- return Cache::rememberForever("hive-$this->id-layer-count-queen_excluder", function () use ($cat_id) {
+
+ return Cache::rememberForever("hive-$this->id-layer-count-queen_excluder", function () use ($cat_id) {
return $this->layers()->where('category_id', $cat_id)->count();
});
}
@@ -184,24 +190,26 @@ public function hasDevices()
public function getNameAndLocationAttribute()
{
- $out = $this->name;
+ $out = $this->name;
$out .= isset($this->location_id) ? ' - '.$this->getLocationAttribute() : '';
+
return $out;
}
private function getLastInspectionItem($name)
{
$inspection = Cache::remember("hive-$this->id-last-inspection-item", 5, function () {
- return $this->inspections()->orderBy('created_at','desc')->first();
+ return $this->inspections()->orderBy('created_at', 'desc')->first();
});
- if (isset($inspection->{$name}))
+ if (isset($inspection->{$name})) {
return $inspection->{$name};
+ }
}
public function getAllInspectionDates()
{
- $item = $this->inspections()-> pluck('created_at')->toArray();
-
+ $item = $this->inspections()->pluck('created_at')->toArray();
+
return $item;
}
@@ -212,9 +220,10 @@ public function getGroupIdsAttribute()
public function getOwnerAttribute()
{
- if (Auth::check() && $this->user_id == Auth::user()->id)
+ if (Auth::check() && $this->user_id == Auth::user()->id) {
return true;
-
+ }
+
return false;
}
@@ -223,17 +232,16 @@ public function getEditableAttribute()
// removed editable for owner, because this is already implied in ownership
// if ($this->getOwnerAttribute())
// return true;
-
- if (Auth::check())
- {
+
+ if (Auth::check()) {
$user_editable_hive_ids = Auth::user()->groupHives(true)->pluck('id')->toArray();
+
return in_array($this->id, $user_editable_hive_ids);
}
+
return false;
}
-
-
public function queen()
{
return $this->hasOne(Queen::class);
@@ -243,8 +251,8 @@ public function type()
{
return $this->belongsTo(Category::class, 'hive_type_id');
}
-
- public function user()
+
+ public function user()
{
return $this->belongsTo(User::class);
}
@@ -279,7 +287,7 @@ public function frames()
{
return $this->hasManyThrough(HiveLayerFrame::class, HiveLayer::class, 'hive_id', 'layer_id');
}
-
+
public function devices()
{
return $this->hasMany(Device::class);
@@ -287,28 +295,27 @@ public function devices()
public function inspections_by_date($request)
{
- $search = $request->filled('search') ? $request->input('search') : null;
- $attention = $request->filled('attention') ? boolval($request->input('attention')) : null;
- $reminder = $request->filled('reminder') ? boolval($request->input('reminder')) : null;
- $impression = $request->filled('impression') ? explode(',', $request->input('impression')) : null;
- $id = $request->filled('id') ? $request->input('id') : null;
+ $search = $request->filled('search') ? $request->input('search') : null;
+ $attention = $request->filled('attention') ? boolval($request->input('attention')) : null;
+ $reminder = $request->filled('reminder') ? boolval($request->input('reminder')) : null;
+ $impression = $request->filled('impression') ? explode(',', $request->input('impression')) : null;
+ $id = $request->filled('id') ? $request->input('id') : null;
$inspections = $this->inspections;
- if (isset($id))
- {
+ if (isset($id)) {
$inspections = $inspections->where('id', $id);
- }
- else
- {
- if ($request->filled('start'))
+ } else {
+ if ($request->filled('start')) {
$inspections = $inspections->where('created_at', '>=', $request->input('start'));
+ }
- if ($request->filled('end'))
+ if ($request->filled('end')) {
$inspections = $inspections->where('created_at', '<=', $request->input('end'));
+ }
- if (!empty($search)) {
- $inspections = $inspections->filter(function($item) use ($search){
+ if (! empty($search)) {
+ $inspections = $inspections->filter(function ($item) use ($search) {
$match = 0;
$match += stristr($item->notes, $search) !== false ? 1 : 0;
$match += stristr($item->reminder, $search) !== false ? 1 : 0;
@@ -325,58 +332,60 @@ public function inspections_by_date($request)
});
}
- if (isset($attention))
+ if (isset($attention)) {
$inspections = $inspections->where('attention', $attention);
+ }
- if (isset($reminder))
+ if (isset($reminder)) {
$inspections = $inspections->whereNotNull('reminder');
+ }
- if (isset($impression))
+ if (isset($impression)) {
$inspections = $inspections->whereIn('impression', $impression);
-
+ }
+
}
- //die(print_r(['search'=>$search, 'id'=>$id, 'ins'=>$inspections->toArray()]));
+ // die(print_r(['search'=>$search, 'id'=>$id, 'ins'=>$inspections->toArray()]));
return $inspections->sortByDesc('created_at');
}
- public function inspection_items_by_date($request, $locale, $paginated_result=true)
+ public function inspection_items_by_date($request, $locale, $paginated_result = true)
{
// Get the available dates
$paginated_result = boolval($request->input('paginated_result', $paginated_result));
- $page_index = $request->filled('page') ? $request->input('page') : 1;
- $items_per_page = intval($request->input('items_per_page', 5));
-
- $inspect_coll = $this->inspections_by_date($request);
- //dd($inspect_coll);
- $inspections = $inspect_coll->paginate(env('INSPECTIONS_PER_PAGE', $items_per_page), $page_index, true);
- $items_by_date = Inspection::item_names($inspections, true);
+ $page_index = $request->filled('page') ? $request->input('page') : 1;
+ $items_per_page = intval($request->input('items_per_page', 5));
+
+ $inspect_coll = $this->inspections_by_date($request);
+ // dd($inspect_coll);
+ $inspections = $inspect_coll->paginate(env('INSPECTIONS_PER_PAGE', $items_per_page), $page_index, true);
+ $items_by_date = Inspection::item_names($inspections, true);
// Add category header
- for ($i=count($items_by_date)-1; $i >= 0; $i--) // must be processed backwards, because items are added
- {
- $item = $items_by_date[$i];
- $rootName = explode(' > ', $item['anc'])[0];
- $piRootName = $i == 0 ? null : explode(' > ', $items_by_date[$i-1]['anc'])[0];
- if ($piRootName == null || $piRootName != $rootName)
- {
- $spliceIndex = $i == 0 ? 0 : $i;
+ for ($i = count($items_by_date) - 1; $i >= 0; $i--) { // must be processed backwards, because items are added
+ $item = $items_by_date[$i];
+ $rootName = explode(' > ', $item['anc'])[0];
+ $piRootName = $i == 0 ? null : explode(' > ', $items_by_date[$i - 1]['anc'])[0];
+ if ($piRootName == null || $piRootName != $rootName) {
+ $spliceIndex = $i == 0 ? 0 : $i;
array_splice($items_by_date, $spliceIndex, 0, [['anc' => null, 'name' => $rootName, 'items' => null]]);
}
}
- if ($paginated_result === false && count($inspections->items()) > 0)
+ if ($paginated_result === false && count($inspections->items()) > 0) {
$inspections = $inspections->toArray()['data'];
+ }
- return ['inspections'=>$inspections, 'items_by_date'=>$items_by_date];
+ return ['inspections' => $inspections, 'items_by_date' => $items_by_date];
}
- public static function selectList($onlyMine=false)
+ public static function selectList($onlyMine = false)
{
- if ($onlyMine)
- return Auth::user()->hives()->orderBy('name')->pluck('name','id');
- else
- return Hive::orderBy('name')->pluck('name','id');
+ if ($onlyMine) {
+ return Auth::user()->hives()->orderBy('name')->pluck('name', 'id');
+ } else {
+ return Hive::orderBy('name')->pluck('name', 'id');
+ }
}
-
}
diff --git a/app/HiveFactory.php b/app/HiveFactory.php
index c8f82cd0..cc9c43ee 100644
--- a/app/HiveFactory.php
+++ b/app/HiveFactory.php
@@ -2,316 +2,295 @@
namespace App;
-use Auth;
-use Moment\Moment;
-
class HiveFactory
{
-
public function __construct()
{
$this->layer_order = 0;
}
- public function createHive($user_id, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $hive_layers)
- {
- $this->layer_order = 0;
-
- $hive = new Hive();
- $hive->name = $name;
- $hive->order = $order;
- $hive->bb_width_cm = $bb_width_cm;
- $hive->bb_depth_cm = $bb_depth_cm;
- $hive->bb_height_cm = $bb_height_cm;
- $hive->fr_width_cm = $fr_width_cm;
- $hive->fr_height_cm = $fr_height_cm;
- $hive->user_id = $user_id;
- $hive->color = $color;
- $hive->location_id = $location->id;
- $hive->hive_type_id = $hive_type_id != '' && $hive_type_id != null ? $hive_type_id : 63;
- $hive->save();
-
- $layers = collect();
- if (isset($hive_layers))
- {
- foreach ($hive_layers as $layer)
- $layers->add($this->createLayer($layer['type'], $layer['order'], $layer['color']));
- }
- else
- {
- $layersBrood = $this->createLayers('brood', $broodLayerAmount, $color, $this->layer_order);
- $layersHoney = $this->createLayers('honey', $honeyLayerAmount, $color, $this->layer_order);
- $layers = $layersBrood->merge($layersHoney);
- }
-
- $hive->layers()->saveMany($layers);
-
- foreach ($layers as $layer)
- {
- if ($layer->type == 'brood' || $layer->type == 'honey')
- $layer->frames()->saveMany($this->createLayerFrames($frameAmount));
- }
-
- $location->hives()->save($hive);
-
- return $hive;
- }
-
- public function updateHive(Hive $hive, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $hive_layers, $timeZone)
- {
-
- // First set inspection because location will be fixed after setting in hive
- $inspection_items = [];
- $locationChange = false;
-
- if ($location->id != $hive->location_id)
- {
- $locationChange = true;
-
- $from_apiary_id = Category::findCategoryIdByRootParentAndName('hive', 'relocation', 'previous_apiary', ['system','checklist']);
- if ($from_apiary_id)
- $inspection_items[$from_apiary_id] = $hive->getLocationAttribute();
-
- $to_apiary_id = Category::findCategoryIdByRootParentAndName('hive', 'location', 'apiary', ['system','checklist']);
- if ($to_apiary_id)
- $inspection_items[$to_apiary_id] = $location->name;
- }
-
- // Edit hive
- $hive->name = $name;
- $hive->order = $order;
- $hive->bb_width_cm = $bb_width_cm;
- $hive->bb_depth_cm = $bb_depth_cm;
- $hive->bb_height_cm = $bb_height_cm;
- $hive->fr_width_cm = $fr_width_cm;
- $hive->fr_height_cm = $fr_height_cm;
- $hive->location_id = $location->id;
- $hive->color = $color;
- $hive->hive_type_id = $hive_type_id;
- $hive->save();
-
- $layers = collect();
- $broodLayerDiff = 0;
- $honeyLayerDiff = 0;
- $feedingBoxDiff = 0;
- $queenExcluderDiff = 0;
- $frameDiff = 0;
-
- $feedingBoxAmount = 0;
- $queenExcluderAmount= 0;
-
- if (isset($hive_layers)) // edit by layers object
- {
-
- $broodLayerAmount = 0;
- $honeyLayerAmount = 0;
-
- $broodLayerDiff = -1 * $hive->getBroodlayersAttribute();
- $honeyLayerDiff = -1 * $hive->getHoneylayersAttribute();
- $feedingBoxDiff = -1 * $hive->getFeedingBoxAttribute();
- $queenExcluderDiff = -1 * $hive->getQueenExcluderAttribute();
- $foundLayerIds = [];
-
- foreach ($hive_layers as $layer)
- {
- $layer_type = $layer['type'];
- $layer_type_cat_id = Category::findCategoryIdByRootParentAndName('hive', 'hive_layer', $layer_type);
-
- if ($layer_type_cat_id === null)
- $layer_type_cat_id = Category::findCategoryIdByRootParentAndName('hive', 'hive_layer', 'brood'); // set by deafult to brood
-
- if ($layer_type == 'brood')
- {
- $broodLayerDiff++;
- $broodLayerAmount++;
- }
- else if ($layer_type == 'honey')
- {
- $honeyLayerDiff++;
- $honeyLayerAmount++;
- }
- else if ($layer_type == 'feeding_box')
- {
- $feedingBoxDiff++;
- $feedingBoxAmount++;
- }
- else if ($layer_type == 'queen_excluder')
- {
- $queenExcluderDiff++;
- $queenExcluderAmount++;
- }
-
- if (!isset($layer['id'])) // create new layer
- {
- $new_layer = $hive->layers()->save($this->createLayer($layer_type, $layer['order'], $layer['color']));
- $foundLayerIds[] = $new_layer->id;
- }
- else // edit existing layer
- {
- $l = $hive->layers()->find($layer['id']);
- if ($l)
- {
- $foundLayerIds[] = $layer['id'];
- $l->category_id = $layer_type_cat_id;
- $l->order = $layer['order'];
- $l->color = $layer['color'];
- $l->save();
- }
- }
- }
- // delete removed layers
- foreach ($hive->layers as $layer)
- {
- if (isset($layer['id']) && !in_array($layer['id'], $foundLayerIds))
- $hive->layers()->find($layer['id'])->delete();
- }
- }
- else // edit by $broodLayerAmount and $honeyLayerAmount (v2)
- {
-
- $layersBrood = collect();
- $layersHoney = collect();
-
- // get highest layer order
- $layer_order = -999999;
- foreach ($hive->layers as $l)
- $layer_order = max($layer_order, $l->order);
-
- if ($layer_order == -999999)
- $layer_order = 0;
-
- // Create or delete layers
- $broodLayerDiff = $broodLayerAmount - $hive->getBroodlayersAttribute();
- if ($broodLayerDiff > 0)
- {
- $layersBrood = $this->createLayers('brood', $broodLayerDiff, $color, $layer_order+1);
- $layers->merge($layersBrood);
- $hive->layers()->saveMany($layersBrood);
- }
- else if ($broodLayerDiff < 0)
- {
- $category_id = Category::findCategoryIdByParentAndName('hive_layer', 'brood');
- if ($category_id)
- $hive->layers()->where('category_id',$category_id)->limit(-1*$broodLayerDiff)->delete();
- }
-
- $honeyLayerDiff = $honeyLayerAmount - $hive->getHoneylayersAttribute();
- if ($honeyLayerDiff > 0)
- {
- $layersHoney = $this->createLayers('honey', $honeyLayerDiff, $color, $layer_order+1);
- $layers->merge($layersBrood);
- $hive->layers()->saveMany($layersHoney);
- }
- else if ($honeyLayerDiff < 0)
- {
- $category_id = Category::findCategoryIdByParentAndName('hive_layer', 'honey');
- if ($category_id)
- $hive->layers()->where('category_id',$category_id)->limit(-1*$honeyLayerDiff)->delete();
- }
- }
-
-
- // Adjust frames
- foreach ($hive->layers()->get() as $layer)
- {
- if ($layer->type == 'brood' || $layer->type == 'honey'){
- $frameDiff = $frameAmount - $layer->frames()->count();
- // echo $frameAmount;
- // echo $layer->frames()->count();
- // echo $frameDiff;
- // die();
-
- if ($frameDiff > 0)
- {
- $layer->frames()->saveMany($this->createLayerFrames($frameDiff));
- }
- else if ($frameDiff < 0)
- {
- $category_id = Category::findCategoryIdByParentAndName('hive_frame', 'wax');
- if ($category_id)
- $layer->frames()->where('category_id',$category_id)->limit(-1*$frameDiff)->delete();
- }
- }
- }
-
- // Create auto inspection
- if ($broodLayerDiff != 0 || $honeyLayerDiff != 0 || $frameDiff != 0 || $feedingBoxDiff != 0 || $queenExcluderDiff != 0 || $locationChange)
- {
- // Inspection items to add
- $brood_layers_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'brood_layers', ['system','checklist']);
- if ($brood_layers_id)
- $inspection_items[$brood_layers_id] = $broodLayerAmount;
-
- $honey_layers_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'supers', ['system','checklist']);
- if ($honey_layers_id)
- $inspection_items[$honey_layers_id] = $honeyLayerAmount;
-
- $frames_per_layer_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'frames_per_layer', ['system','checklist']);
- if ($frames_per_layer_id)
- $inspection_items[$frames_per_layer_id] = $frameAmount;
-
- $feeding_box_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'feeding_box', ['system','checklist']);
- if ($feeding_box_id)
- $inspection_items[$feeding_box_id] = $feedingBoxAmount;
-
- $queen_exluder_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'queen_excluder', ['system','checklist']);
- if ($queen_exluder_id)
- $inspection_items[$queen_exluder_id] = $queenExcluderAmount;
-
- $notes = Translation::translate('hive').' '.strtolower(Translation::translate('action'));
- Inspection::createInspection($inspection_items, $hive->id, $location->id, $notes, $timeZone);
- }
-
- return $hive;
- }
-
- private function createLayers($type, $amount, $color, $order=0)
- {
- $layers = collect([]);
- for ($i=0; $i < $amount ;$i++)
- {
- $layers->push($this->createLayer($type, $order, $color));
- $order++;
- }
-
- return $layers;
- }
-
- private function createLayer($type, $order, $color)
- {
- $layer = new HiveLayer();
- $layer->order = $order;
- $layer->color = $color;
- $layer->category_id = Category::findCategoryIdByParentAndName('hive_layer', $type);
- return $layer;
- }
-
- private function createLayerFrames($amount)
- {
- $frames = collect([]);
- for ($i=0; $i < $amount ;$i++)
- {
- $frames->push($this->createLayerFrame('wax', $i));
- }
-
- return $frames;
- }
-
- private function createLayerFrame($type, $order)
- {
- $frame = new HiveLayerFrame();
- $frame->order = $order;
- $frame->category_id = Category::findCategoryIdByParentAndName('hive_frame', $type);
- return $frame;
- }
-
- public function createMultipleHives($user_id, $amount, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $count_start, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $hive_layers)
- {
- $hives = collect([]);
- for ($i=0; $i < $amount ;$i++)
- {
- $hives->push($this->createHive($user_id, $location, $name.' '.($count_start+$i), $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, null, $hive_layers));
- }
- return $hives;
- }
-}
\ No newline at end of file
+ public function createHive($user_id, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $hive_layers)
+ {
+ $this->layer_order = 0;
+
+ $hive = new Hive;
+ $hive->name = $name;
+ $hive->order = $order;
+ $hive->bb_width_cm = $bb_width_cm;
+ $hive->bb_depth_cm = $bb_depth_cm;
+ $hive->bb_height_cm = $bb_height_cm;
+ $hive->fr_width_cm = $fr_width_cm;
+ $hive->fr_height_cm = $fr_height_cm;
+ $hive->user_id = $user_id;
+ $hive->color = $color;
+ $hive->location_id = $location->id;
+ $hive->hive_type_id = $hive_type_id != '' && $hive_type_id != null ? $hive_type_id : 63;
+ $hive->save();
+
+ $layers = collect();
+ if (isset($hive_layers)) {
+ foreach ($hive_layers as $layer) {
+ $layers->add($this->createLayer($layer['type'], $layer['order'], $layer['color']));
+ }
+ } else {
+ $layersBrood = $this->createLayers('brood', $broodLayerAmount, $color, $this->layer_order);
+ $layersHoney = $this->createLayers('honey', $honeyLayerAmount, $color, $this->layer_order);
+ $layers = $layersBrood->merge($layersHoney);
+ }
+
+ $hive->layers()->saveMany($layers);
+
+ foreach ($layers as $layer) {
+ if ($layer->type == 'brood' || $layer->type == 'honey') {
+ $layer->frames()->saveMany($this->createLayerFrames($frameAmount));
+ }
+ }
+
+ $location->hives()->save($hive);
+
+ return $hive;
+ }
+
+ public function updateHive(Hive $hive, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $hive_layers, $timeZone)
+ {
+
+ // First set inspection because location will be fixed after setting in hive
+ $inspection_items = [];
+ $locationChange = false;
+
+ if ($location->id != $hive->location_id) {
+ $locationChange = true;
+
+ $from_apiary_id = Category::findCategoryIdByRootParentAndName('hive', 'relocation', 'previous_apiary', ['system', 'checklist']);
+ if ($from_apiary_id) {
+ $inspection_items[$from_apiary_id] = $hive->getLocationAttribute();
+ }
+
+ $to_apiary_id = Category::findCategoryIdByRootParentAndName('hive', 'location', 'apiary', ['system', 'checklist']);
+ if ($to_apiary_id) {
+ $inspection_items[$to_apiary_id] = $location->name;
+ }
+ }
+
+ // Edit hive
+ $hive->name = $name;
+ $hive->order = $order;
+ $hive->bb_width_cm = $bb_width_cm;
+ $hive->bb_depth_cm = $bb_depth_cm;
+ $hive->bb_height_cm = $bb_height_cm;
+ $hive->fr_width_cm = $fr_width_cm;
+ $hive->fr_height_cm = $fr_height_cm;
+ $hive->location_id = $location->id;
+ $hive->color = $color;
+ $hive->hive_type_id = $hive_type_id;
+ $hive->save();
+
+ $layers = collect();
+ $broodLayerDiff = 0;
+ $honeyLayerDiff = 0;
+ $feedingBoxDiff = 0;
+ $queenExcluderDiff = 0;
+ $frameDiff = 0;
+
+ $feedingBoxAmount = 0;
+ $queenExcluderAmount = 0;
+
+ if (isset($hive_layers)) { // edit by layers object
+
+ $broodLayerAmount = 0;
+ $honeyLayerAmount = 0;
+
+ $broodLayerDiff = -1 * $hive->getBroodlayersAttribute();
+ $honeyLayerDiff = -1 * $hive->getHoneylayersAttribute();
+ $feedingBoxDiff = -1 * $hive->getFeedingBoxAttribute();
+ $queenExcluderDiff = -1 * $hive->getQueenExcluderAttribute();
+ $foundLayerIds = [];
+
+ foreach ($hive_layers as $layer) {
+ $layer_type = $layer['type'];
+ $layer_type_cat_id = Category::findCategoryIdByRootParentAndName('hive', 'hive_layer', $layer_type);
+
+ if ($layer_type_cat_id === null) {
+ $layer_type_cat_id = Category::findCategoryIdByRootParentAndName('hive', 'hive_layer', 'brood');
+ } // set by deafult to brood
+
+ if ($layer_type == 'brood') {
+ $broodLayerDiff++;
+ $broodLayerAmount++;
+ } elseif ($layer_type == 'honey') {
+ $honeyLayerDiff++;
+ $honeyLayerAmount++;
+ } elseif ($layer_type == 'feeding_box') {
+ $feedingBoxDiff++;
+ $feedingBoxAmount++;
+ } elseif ($layer_type == 'queen_excluder') {
+ $queenExcluderDiff++;
+ $queenExcluderAmount++;
+ }
+
+ if (! isset($layer['id'])) { // create new layer
+ $new_layer = $hive->layers()->save($this->createLayer($layer_type, $layer['order'], $layer['color']));
+ $foundLayerIds[] = $new_layer->id;
+ } else { // edit existing layer
+ $l = $hive->layers()->find($layer['id']);
+ if ($l) {
+ $foundLayerIds[] = $layer['id'];
+ $l->category_id = $layer_type_cat_id;
+ $l->order = $layer['order'];
+ $l->color = $layer['color'];
+ $l->save();
+ }
+ }
+ }
+ // delete removed layers
+ foreach ($hive->layers as $layer) {
+ if (isset($layer['id']) && ! in_array($layer['id'], $foundLayerIds)) {
+ $hive->layers()->find($layer['id'])->delete();
+ }
+ }
+ } else { // edit by $broodLayerAmount and $honeyLayerAmount (v2)
+
+ $layersBrood = collect();
+ $layersHoney = collect();
+
+ // get highest layer order
+ $layer_order = -999999;
+ foreach ($hive->layers as $l) {
+ $layer_order = max($layer_order, $l->order);
+ }
+
+ if ($layer_order == -999999) {
+ $layer_order = 0;
+ }
+
+ // Create or delete layers
+ $broodLayerDiff = $broodLayerAmount - $hive->getBroodlayersAttribute();
+ if ($broodLayerDiff > 0) {
+ $layersBrood = $this->createLayers('brood', $broodLayerDiff, $color, $layer_order + 1);
+ $layers->merge($layersBrood);
+ $hive->layers()->saveMany($layersBrood);
+ } elseif ($broodLayerDiff < 0) {
+ $category_id = Category::findCategoryIdByParentAndName('hive_layer', 'brood');
+ if ($category_id) {
+ $hive->layers()->where('category_id', $category_id)->limit(-1 * $broodLayerDiff)->delete();
+ }
+ }
+
+ $honeyLayerDiff = $honeyLayerAmount - $hive->getHoneylayersAttribute();
+ if ($honeyLayerDiff > 0) {
+ $layersHoney = $this->createLayers('honey', $honeyLayerDiff, $color, $layer_order + 1);
+ $layers->merge($layersBrood);
+ $hive->layers()->saveMany($layersHoney);
+ } elseif ($honeyLayerDiff < 0) {
+ $category_id = Category::findCategoryIdByParentAndName('hive_layer', 'honey');
+ if ($category_id) {
+ $hive->layers()->where('category_id', $category_id)->limit(-1 * $honeyLayerDiff)->delete();
+ }
+ }
+ }
+
+ // Adjust frames
+ foreach ($hive->layers()->get() as $layer) {
+ if ($layer->type == 'brood' || $layer->type == 'honey') {
+ $frameDiff = $frameAmount - $layer->frames()->count();
+ // echo $frameAmount;
+ // echo $layer->frames()->count();
+ // echo $frameDiff;
+ // die();
+
+ if ($frameDiff > 0) {
+ $layer->frames()->saveMany($this->createLayerFrames($frameDiff));
+ } elseif ($frameDiff < 0) {
+ $category_id = Category::findCategoryIdByParentAndName('hive_frame', 'wax');
+ if ($category_id) {
+ $layer->frames()->where('category_id', $category_id)->limit(-1 * $frameDiff)->delete();
+ }
+ }
+ }
+ }
+
+ // Create auto inspection
+ if ($broodLayerDiff != 0 || $honeyLayerDiff != 0 || $frameDiff != 0 || $feedingBoxDiff != 0 || $queenExcluderDiff != 0 || $locationChange) {
+ // Inspection items to add
+ $brood_layers_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'brood_layers', ['system', 'checklist']);
+ if ($brood_layers_id) {
+ $inspection_items[$brood_layers_id] = $broodLayerAmount;
+ }
+
+ $honey_layers_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'supers', ['system', 'checklist']);
+ if ($honey_layers_id) {
+ $inspection_items[$honey_layers_id] = $honeyLayerAmount;
+ }
+
+ $frames_per_layer_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'frames_per_layer', ['system', 'checklist']);
+ if ($frames_per_layer_id) {
+ $inspection_items[$frames_per_layer_id] = $frameAmount;
+ }
+
+ $feeding_box_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'feeding_box', ['system', 'checklist']);
+ if ($feeding_box_id) {
+ $inspection_items[$feeding_box_id] = $feedingBoxAmount;
+ }
+
+ $queen_exluder_id = Category::findCategoryIdByRootParentAndName('hive', 'configuration', 'queen_excluder', ['system', 'checklist']);
+ if ($queen_exluder_id) {
+ $inspection_items[$queen_exluder_id] = $queenExcluderAmount;
+ }
+
+ $notes = Translation::translate('hive').' '.strtolower(Translation::translate('action'));
+ Inspection::createInspection($inspection_items, $hive->id, $location->id, $notes, $timeZone);
+ }
+
+ return $hive;
+ }
+
+ private function createLayers($type, $amount, $color, $order = 0)
+ {
+ $layers = collect([]);
+ for ($i = 0; $i < $amount; $i++) {
+ $layers->push($this->createLayer($type, $order, $color));
+ $order++;
+ }
+
+ return $layers;
+ }
+
+ private function createLayer($type, $order, $color)
+ {
+ $layer = new HiveLayer;
+ $layer->order = $order;
+ $layer->color = $color;
+ $layer->category_id = Category::findCategoryIdByParentAndName('hive_layer', $type);
+
+ return $layer;
+ }
+
+ private function createLayerFrames($amount)
+ {
+ $frames = collect([]);
+ for ($i = 0; $i < $amount; $i++) {
+ $frames->push($this->createLayerFrame('wax', $i));
+ }
+
+ return $frames;
+ }
+
+ private function createLayerFrame($type, $order)
+ {
+ $frame = new HiveLayerFrame;
+ $frame->order = $order;
+ $frame->category_id = Category::findCategoryIdByParentAndName('hive_frame', $type);
+
+ return $frame;
+ }
+
+ public function createMultipleHives($user_id, $amount, Location $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $count_start, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $hive_layers)
+ {
+ $hives = collect([]);
+ for ($i = 0; $i < $amount; $i++) {
+ $hives->push($this->createHive($user_id, $location, $name.' '.($count_start + $i), $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, null, $hive_layers));
+ }
+
+ return $hives;
+ }
+}
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index c1ba6105..fa91b60f 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -2,19 +2,22 @@
namespace App;
+use Cache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use Cache;
class HiveLayer extends Model
{
use SoftDeletes;
protected $fillable = ['hive_id', 'category_id', 'order', 'color'];
- protected $guarded = ['id',];
- protected $hidden = ['category_id', 'hive_id', 'created_at', 'deleted_at', 'frames'];
- protected $appends = ['type', 'framecount'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['category_id', 'hive_id', 'created_at', 'deleted_at', 'frames'];
+
+ protected $appends = ['type', 'framecount'];
public $timestamps = false;
@@ -36,12 +39,13 @@ public static function boot()
});
}
- public function empty_cache($clear_hive=true)
+ public function empty_cache($clear_hive = true)
{
Log::debug("Hive layer ID $this->id cache emptied");
- if ($clear_hive)
+ if ($clear_hive) {
$this->hive->empty_cache();
+ }
}
// Relations
@@ -57,7 +61,7 @@ public function getTypeAttribute()
});
}
- public function hive()
+ public function hive()
{
return $this->belongsTo(Hive::class);
}
@@ -80,16 +84,14 @@ public static function deleteNonBroodAndHoneyFrames()
$brood_and_honey_cats[] = Category::findCategoryIdByParentAndName('hive_layer', 'honey');
$layers = HiveLayer::whereNotIn('category_id', $brood_and_honey_cats)->get();
- echo("Processing ".$layers->count()." non brood-and-honey layers, not in: ".implode(', ',$brood_and_honey_cats)."\n");
- foreach($layers as $layer)
- {
+ echo 'Processing '.$layers->count().' non brood-and-honey layers, not in: '.implode(', ', $brood_and_honey_cats)."\n";
+ foreach ($layers as $layer) {
$type = $layer->type;
- if ($type != 'brood' && $type != 'honey' && $layer->framecount > 0)
- {
- echo("Layer $layer->id type $type removing $layer->framecount frames\n");
+ if ($type != 'brood' && $type != 'honey' && $layer->framecount > 0) {
+ echo "Layer $layer->id type $type removing $layer->framecount frames\n";
$layer->frames()->delete();
}
}
- echo("Finished processing ".$layers->count()." non brood-and-honey layers, not in: ".implode(', ',$brood_and_honey_cats)."\n");
+ echo 'Finished processing '.$layers->count().' non brood-and-honey layers, not in: '.implode(', ', $brood_and_honey_cats)."\n";
}
}
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index d552eacc..933c70b8 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -10,18 +10,21 @@ class HiveLayerFrame extends Model
use SoftDeletes;
protected $fillable = ['layer_id', 'category_id', 'present', 'order'];
- protected $guarded = ['id'];
- protected $hidden = ['category_id', 'layer_id', 'created_at', 'deleted_at'];
- protected $appends = ['type'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['category_id', 'layer_id', 'created_at', 'deleted_at'];
+
+ protected $appends = ['type'];
public $timestamps = false;
-
+
// Relations
public function getTypeAttribute()
{
return Category::find($this->category_id)->name;
}
-
+
public function layer()
{
return $this->belongsTo(HiveLayer::class, 'layer_id');
diff --git a/app/Http/Controllers/AlertController.php b/app/Http/Controllers/AlertController.php
index 85e09896..b06e93a0 100644
--- a/app/Http/Controllers/AlertController.php
+++ b/app/Http/Controllers/AlertController.php
@@ -2,10 +2,8 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-use App\User;
use App\Models\Alert;
+use App\User;
use Illuminate\Http\Request;
class AlertController extends Controller
@@ -17,39 +15,30 @@ class AlertController extends Controller
*/
public function index(Request $request)
{
- $rule_id = $request->input('rule_id');
+ $rule_id = $request->input('rule_id');
$device_id = $request->input('device_id');
- $user_id = $request->input('user_id');
- $no_meas = boolval($request->input('no_measurements', 0));
- $users = User::all()->pluck('name', 'id');
+ $user_id = $request->input('user_id');
+ $no_meas = boolval($request->input('no_measurements', 0));
+ $users = User::all()->pluck('name', 'id');
$perPage = 100;
- if (!empty($rule_id))
- {
+ if (! empty($rule_id)) {
$alert = Alert::where('alert_rule_id', $rule_id)
->paginate($perPage);
- }
- else if (!empty($device_id))
- {
+ } elseif (! empty($device_id)) {
$alert = Alert::where('device_id', $device_id)
->paginate($perPage);
- }
- else if (!empty($user_id))
- {
+ } elseif (! empty($user_id)) {
$alert = Alert::where('user_id', $user_id)
->orderByDesc('updated_at')
->paginate($perPage);
- }
- else if ($no_meas)
- {
+ } elseif ($no_meas) {
$alert = Alert::where('alert_value', '=', 0)->paginate($perPage);
- }
- else
- {
+ } else {
$alert = Alert::orderByDesc('updated_at')->paginate($perPage);
}
- return view('alert.index', compact('alert','rule_id','device_id','user_id','no_meas','users'));
+ return view('alert.index', compact('alert', 'rule_id', 'device_id', 'user_id', 'no_meas', 'users'));
}
/**
@@ -59,27 +48,27 @@ public function index(Request $request)
*/
public function create()
{
- $alert = new Alert();
+ $alert = new Alert;
+
return view('alert.create');
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'alert_rule_id' => 'required',
- 'measurement_id' => 'required',
- 'alert_value' => 'required',
- 'user_id' => 'required'
- ]);
+ 'alert_rule_id' => 'required',
+ 'measurement_id' => 'required',
+ 'alert_value' => 'required',
+ 'user_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
Alert::create($requestData);
return redirect('alert')->with('flash_message', 'Alert added!');
@@ -89,7 +78,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -103,7 +91,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -116,21 +103,19 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'alert_rule_id' => 'required',
- 'measurement_id' => 'required',
- 'alert_value' => 'required',
- 'user_id' => 'required'
- ]);
+ 'alert_rule_id' => 'required',
+ 'measurement_id' => 'required',
+ 'alert_value' => 'required',
+ 'user_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
$alert = Alert::findOrFail($id);
$alert->update($requestData);
@@ -141,7 +126,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/AlertRuleController.php b/app/Http/Controllers/AlertRuleController.php
index 10f60379..5583736c 100644
--- a/app/Http/Controllers/AlertRuleController.php
+++ b/app/Http/Controllers/AlertRuleController.php
@@ -2,16 +2,12 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
-use App\User;
use App\Models\AlertRule;
+use App\User;
+use Cache;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
-use Cache;
-
class AlertRuleController extends Controller
{
/**
@@ -24,35 +20,25 @@ public function index(Request $request)
$perPage = 100;
$user_id = $request->input('user_id');
$rule_id = $request->input('rule_id');
- $users = User::all()->pluck('name', 'id');
+ $users = User::all()->pluck('name', 'id');
$no_meas = boolval($request->input('no_measurements', 0));
$default_rule = boolval($request->input('default_rule', 0));
- if (!empty($user_id)) {
+ if (! empty($user_id)) {
$alertrule = AlertRule::where('user_id', $user_id)
->paginate($perPage);
- }
- else if (!empty($rule_id))
- {
+ } elseif (! empty($rule_id)) {
$alertrule = AlertRule::where('id', $rule_id)
->paginate($perPage);
- }
- else if ($default_rule)
- {
+ } elseif ($default_rule) {
$alertrule = AlertRule::where('default_rule', 1)->get()->paginate($perPage);
- }
- else if ($no_meas)
- {
+ } elseif ($no_meas) {
$alertrule = AlertRule::where('calculation_minutes', '>', 0)->get()->where('no_value', '=', 1)->paginate($perPage);
- }
- else
- {
+ } else {
$alertrule = AlertRule::paginate($perPage);
}
-
-
- return view('alert-rule.index', compact('alertrule','rule_id','user_id','users','no_meas','default_rule'));
+ return view('alert-rule.index', compact('alertrule', 'rule_id', 'user_id', 'users', 'no_meas', 'default_rule'));
}
/**
@@ -62,7 +48,8 @@ public function index(Request $request)
*/
public function create()
{
- $alertrule = new AlertRule();
+ $alertrule = new AlertRule;
+
return view('alert-rule.create');
}
@@ -76,53 +63,56 @@ public function parse(Request $request, $id)
$alertrule->last_calculated_at = null;
$log_on = env('LOG_ALERT_RULE_PARSING', false);
-
- if($log_on)
+
+ if ($log_on) {
Log::info("Manual trigger of AlertRule $id via ->parseRule(null, null, $log_on)");
+ }
$alerts = $alertrule->parseRule(null, null, $log_on);
return redirect('alert-rule')->with('success', "Alert Rule ($id) $alertrule->name parsed. Result: ".json_encode($alerts));
}
-
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'measurement_id' => 'required',
- 'calculation' => 'required',
- 'comparator' => 'required',
- 'comparison' => 'required',
- 'threshold_value' => 'required'
- ]);
+ 'measurement_id' => 'required',
+ 'calculation' => 'required',
+ 'comparator' => 'required',
+ 'comparison' => 'required',
+ 'threshold_value' => 'required',
+ ]);
$requestData = $request->all();
- if ($request->filled('exclude_hive_ids'))
- $requestData['exclude_hive_ids'] = implode(",", $requestData['exclude_hive_ids']);
- else
+ if ($request->filled('exclude_hive_ids')) {
+ $requestData['exclude_hive_ids'] = implode(',', $requestData['exclude_hive_ids']);
+ } else {
$requestData['exclude_hive_ids'] = null;
+ }
- if ($request->filled('exclude_months'))
- $requestData['exclude_months'] = implode(",", $requestData['exclude_months']);
- else
+ if ($request->filled('exclude_months')) {
+ $requestData['exclude_months'] = implode(',', $requestData['exclude_months']);
+ } else {
$requestData['exclude_months'] = null;
+ }
- if ($request->filled('exclude_hours'))
- $requestData['exclude_hours'] = implode(",", $requestData['exclude_hours']);
- else
+ if ($request->filled('exclude_hours')) {
+ $requestData['exclude_hours'] = implode(',', $requestData['exclude_hours']);
+ } else {
$requestData['exclude_hours'] = null;
-
+ }
+
AlertRule::create($requestData);
- if (boolval($requestData['default_rule']))
+ if (boolval($requestData['default_rule'])) {
Cache::forget('alert-rules-default');
+ }
return redirect('alert-rule')->with('flash_message', 'AlertRule added!');
}
@@ -131,7 +121,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -145,7 +134,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -158,42 +146,44 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'measurement_id' => 'required',
- 'calculation' => 'required',
- 'comparator' => 'required',
- 'comparison' => 'required',
- 'threshold_value' => 'required'
- ]);
+ 'measurement_id' => 'required',
+ 'calculation' => 'required',
+ 'comparator' => 'required',
+ 'comparison' => 'required',
+ 'threshold_value' => 'required',
+ ]);
$requestData = $request->all();
-
- if ($request->filled('exclude_hive_ids'))
- $requestData['exclude_hive_ids'] = implode(",", $requestData['exclude_hive_ids']);
- else
+
+ if ($request->filled('exclude_hive_ids')) {
+ $requestData['exclude_hive_ids'] = implode(',', $requestData['exclude_hive_ids']);
+ } else {
$requestData['exclude_hive_ids'] = null;
+ }
- if ($request->filled('exclude_months'))
- $requestData['exclude_months'] = implode(",", $requestData['exclude_months']);
- else
+ if ($request->filled('exclude_months')) {
+ $requestData['exclude_months'] = implode(',', $requestData['exclude_months']);
+ } else {
$requestData['exclude_months'] = null;
+ }
- if ($request->filled('exclude_hours'))
- $requestData['exclude_hours'] = implode(",", $requestData['exclude_hours']);
- else
+ if ($request->filled('exclude_hours')) {
+ $requestData['exclude_hours'] = implode(',', $requestData['exclude_hours']);
+ } else {
$requestData['exclude_hours'] = null;
+ }
$alertrule = AlertRule::findOrFail($id);
$alertrule->update($requestData);
- if (boolval($requestData['default_rule']))
+ if (boolval($requestData['default_rule'])) {
Cache::forget('alert-rules-default');
+ }
return redirect('alert-rule')->with('flash_message', 'AlertRule updated!');
}
@@ -202,7 +192,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index 9c4730e0..a4ef9254 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
use App\Models\AlertRuleFormula;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 25;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$alertruleformula = AlertRuleFormula::where('alert_rule_id', 'LIKE', "%$keyword%")
->orWhere('measurement_id', 'LIKE', "%$keyword%")
->orWhere('calculation', 'LIKE', "%$keyword%")
@@ -44,29 +41,29 @@ public function index(Request $request)
*/
public function create()
{
- $alertruleformula = new AlertRuleFormula();
+ $alertruleformula = new AlertRuleFormula;
+
return view('alert-rule-formula.create');
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'alert_rule_id' => 'required',
- 'measurement_id' => 'required',
- 'calculation' => 'required',
- 'comparator' => 'required',
- 'comparison' => 'required',
- 'threshold_value' => 'required'
- ]);
+ 'alert_rule_id' => 'required',
+ 'measurement_id' => 'required',
+ 'calculation' => 'required',
+ 'comparator' => 'required',
+ 'comparison' => 'required',
+ 'threshold_value' => 'required',
+ ]);
$requestData = $request->all();
-
+
AlertRuleFormula::create($requestData);
return redirect('alert-rule-formula')->with('flash_message', 'AlertRuleFormula added!');
@@ -76,7 +73,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -90,7 +86,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -103,23 +98,21 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'alert_rule_id' => 'required',
- 'measurement_id' => 'required',
- 'calculation' => 'required',
- 'comparator' => 'required',
- 'comparison' => 'required',
- 'threshold_value' => 'required'
- ]);
+ 'alert_rule_id' => 'required',
+ 'measurement_id' => 'required',
+ 'calculation' => 'required',
+ 'comparator' => 'required',
+ 'comparison' => 'required',
+ 'threshold_value' => 'required',
+ ]);
$requestData = $request->all();
-
+
$alertruleformula = AlertRuleFormula::findOrFail($id);
$alertruleformula->update($requestData);
@@ -130,7 +123,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/Api/AlertController.php b/app/Http/Controllers/Api/AlertController.php
index 112fdbb3..ec5e71ef 100644
--- a/app/Http/Controllers/Api/AlertController.php
+++ b/app/Http/Controllers/Api/AlertController.php
@@ -2,16 +2,15 @@
namespace App\Http\Controllers\Api;
-use App\Http\Requests;
use App\Http\Controllers\Controller;
-
use App\Models\Alert;
-use Illuminate\Http\Request;
use Auth;
+use Illuminate\Http\Request;
/**
* @group Api\AlertController
* Manage your alerts
+ *
* @authenticated
*/
class AlertController extends Controller
@@ -19,34 +18,40 @@ class AlertController extends Controller
/**
* api/alerts GET
* List all user alerts that are not deleted.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
- if ($request->user()->alerts()->count() > 0)
- return response()->json(['alerts'=>$request->user()->alerts()->get()]);
+ if ($request->user()->alerts()->count() > 0) {
+ return response()->json(['alerts' => $request->user()->alerts()->get()]);
+ }
- return response()->json(['error'=>'no alerts available'],404);
+ return response()->json(['error' => 'no alerts available'], 404);
}
/**
* api/alerts/{id} POST
* Create the specified user alert.
+ *
* @authenticated
- * @bodyParam alert_rule_id integer required The alert rule that has been alerted for.
- * @bodyParam measurement_id integer required The physical quantity / unit to alert for.
- * @bodyParam alert_value string required The alert value.
+ *
+ * @bodyParam alert_rule_id integer required The alert rule that has been alerted for.
+ * @bodyParam measurement_id integer required The physical quantity / unit to alert for.
+ * @bodyParam alert_value string required The alert value.
* @bodyParam show boolean Set to false (0) if the alert should NOT be shown anymore.
+ *
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, [
- 'alert_rule_id' => 'required|integer|exists:alert_rules,id',
- 'measurement_id' => 'required|integer|exists:measurements,id',
- 'alert_value' => 'required|string',
- ]);
+ 'alert_rule_id' => 'required|integer|exists:alert_rules,id',
+ 'measurement_id' => 'required|integer|exists:measurements,id',
+ 'alert_value' => 'required|string',
+ ]);
$alert = Auth::user()->alerts()->create($request->except('user_id'));
return response()->json($alert, 201);
@@ -55,7 +60,9 @@ public function store(Request $request)
/**
* api/alerts/{id} GET
* Display the specified user alert.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function show($id)
@@ -68,8 +75,11 @@ public function show($id)
/**
* api/alerts/{id} PATCH
* Update the specified user alert.
+ *
* @authenticated
+ *
* @bodyParam show boolean Set to false (0) if the alert should NOT be shown anymore.
+ *
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
@@ -83,17 +93,20 @@ public function update(Request $request, $id)
/**
* api/alerts/{id} DELETE
* Delete the specified user alert, or all if id === 'all', or specific id's when provided &alert_ids=1,4,7
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $id)
{
- if ($request->filled('alert_ids'))
+ if ($request->filled('alert_ids')) {
Auth::user()->alerts()->whereIn('id', $request->input('alert_ids'))->delete();
- else if ($id === 'all')
+ } elseif ($id === 'all') {
Auth::user()->alerts()->delete();
- else
+ } else {
Auth::user()->alerts()->findOrFail($id)->delete();
+ }
return response()->json(null, 204);
}
diff --git a/app/Http/Controllers/Api/AlertRuleController.php b/app/Http/Controllers/Api/AlertRuleController.php
index 7225698b..f514dfb9 100644
--- a/app/Http/Controllers/Api/AlertRuleController.php
+++ b/app/Http/Controllers/Api/AlertRuleController.php
@@ -2,21 +2,19 @@
namespace App\Http\Controllers\Api;
-use App\Http\Requests;
use App\Http\Controllers\Controller;
-
use App\Models\AlertRule;
use App\Models\AlertRuleFormula;
+use Auth;
+use Cache;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
-
-use Auth;
use Validator;
-use Cache;
/**
* @group Api\AlertRuleController
* Manage your alert rules
+ *
* @authenticated
*/
class AlertRuleController extends Controller
@@ -24,49 +22,59 @@ class AlertRuleController extends Controller
/**
* api/alert-rules GET
* List all user alert rules that are not deleted.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
- if ($request->user()->alert_rules()->count() > 0)
- return response()->json(['alert_rules'=>$request->user()->alert_rules()->get()]);
+ if ($request->user()->alert_rules()->count() > 0) {
+ return response()->json(['alert_rules' => $request->user()->alert_rules()->get()]);
+ }
- return response()->json(['error'=>'no alert_rules available'],404);
+ return response()->json(['error' => 'no alert_rules available'], 404);
}
/**
* api/alert-rules-default GET
* List all default alert rules that are available.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function default_rules(Request $request)
{
-
- $alert_rules = Cache::remember('alert-rules-default', env('CACHE_TIMEOUT_LONG'), function (){
+
+ $alert_rules = Cache::remember('alert-rules-default', env('CACHE_TIMEOUT_LONG'), function () {
$dar = AlertRule::where('default_rule', 1)->get();
- return $dar->makeHidden(['user_id','webhook_url','exclude_hive_ids','timezone','last_evaluated_at'])->toArray();
+
+ return $dar->makeHidden(['user_id', 'webhook_url', 'exclude_hive_ids', 'timezone', 'last_evaluated_at'])->toArray();
});
- if (count($alert_rules) > 0)
- return response()->json(['alert-rules'=>$alert_rules]);
+ if (count($alert_rules) > 0) {
+ return response()->json(['alert-rules' => $alert_rules]);
+ }
Cache::forget('alert-rules-default');
- return response()->json(['error'=>'no default alert rules available'],404);
+
+ return response()->json(['error' => 'no default alert rules available'], 404);
}
/**
* api/alert-rules/{id} POST
* Create the specified user alert rule.
+ *
* @authenticated
- * @bodyParam formulas.*.measurement_id integer required The physical quantity / unit to alert for.
+ *
+ * @bodyParam formulas.*.measurement_id integer required The physical quantity / unit to alert for.
* @bodyParam formulas.*.calculation string required Calculation to be done with measurement value(s): (min, max, ave, der, cnt) -> Minimum, Maximum, Average (mean), Derivative, Count.
* @bodyParam formulas.*.comparator string required Logical comparator to perform with comparison calculation result and threshold_value (=, <, >, <=, >=).
* @bodyParam formulas.*.comparison string required Comparison function to perform with measurement value(s): (val, dif, abs, abs_dif) -> Value, Difference, Absolute value, Absolute value of the difference.
- * @bodyParam formulas.*.threshold_value float required The threshold value beyond which the alert will be sent.
- * @bodyParam name string The name of the alert rule.
- * @bodyParam description string The description of the alert rule.
+ * @bodyParam formulas.*.threshold_value float required The threshold value beyond which the alert will be sent.
+ * @bodyParam name string The name of the alert rule.
+ * @bodyParam description string The description of the alert rule.
* @bodyParam formulas.*.period_minutes integer The amount of minutes used for calculating the (min, max, ave, der, cnt) of the measurement value(s). If not provided, the last recorded value is used as a reference.
* @bodyParam exclude_months array Array of month indexes (1-12). If not filled the standard alert is 'always on'. Example: [1,2,3,11,12]
* @bodyParam exclude_hours array Array of hour indexes (0-23). If not filled the standard alert is 'always on'. Example: [0,1,2,3,22,23]
@@ -75,85 +83,87 @@ public function default_rules(Request $request)
* @bodyParam alert_via_email boolean Set to false (0) if an e-mail should NOT be sent on alert. Default: true (1).
* @bodyParam webhook_url string URL of optional endpoint to call on alert for web hook integration.
* @bodyParam active boolean Set to false (0) if the alert should NOT be active. Default: true (1).
+ *
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
- 'name' => 'nullable|string',
- 'description' => 'nullable|string',
- 'measurement_id' => 'required_without:formulas|integer|exists:measurements,id',
- 'calculation' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$calculations))],
- 'comparator' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparators))],
- 'comparison' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparisons))],
- 'threshold_value' => 'required_without:formulas|numeric',
- 'formulas' => 'required_without:calculation|array',
- 'formulas.*.alert_rule_id' => 'nullable|integer|exists:alert_rules,id',
+ 'name' => 'nullable|string',
+ 'description' => 'nullable|string',
+ 'measurement_id' => 'required_without:formulas|integer|exists:measurements,id',
+ 'calculation' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$calculations))],
+ 'comparator' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparators))],
+ 'comparison' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparisons))],
+ 'threshold_value' => 'required_without:formulas|numeric',
+ 'formulas' => 'required_without:calculation|array',
+ 'formulas.*.alert_rule_id' => 'nullable|integer|exists:alert_rules,id',
'formulas.*.measurement_id' => 'required|integer|exists:measurements,id',
- 'formulas.*.calculation' => ['required', Rule::in(array_keys(AlertRuleFormula::$calculations))],
- 'formulas.*.comparator' => ['required', Rule::in(array_keys(AlertRuleFormula::$comparators))],
- 'formulas.*.comparison' => ['required', Rule::in(array_keys(AlertRuleFormula::$comparisons))],
+ 'formulas.*.calculation' => ['required', Rule::in(array_keys(AlertRuleFormula::$calculations))],
+ 'formulas.*.comparator' => ['required', Rule::in(array_keys(AlertRuleFormula::$comparators))],
+ 'formulas.*.comparison' => ['required', Rule::in(array_keys(AlertRuleFormula::$comparisons))],
'formulas.*.period_minutes' => 'required|integer|min:0',
- 'formulas.*.threshold_value'=> 'required|numeric',
- 'formulas.*.future' => 'required|boolean',
- 'formulas.*.logical' => ['nullable', Rule::in(array_keys(AlertRuleFormula::$logicals))],
- 'calculation_minutes' => ['required', Rule::in(AlertRule::$calc_minutes)],
- 'exclude_months.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_months))],
- 'exclude_hours.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_hours))],
- 'exclude_hive_ids.*' => ['nullable', 'integer'/*, Rule::in($request->user()->allHives()->pluck('id'))*/],
- 'alert_on_occurrences' => 'nullable|integer',
- 'alert_via_email' => 'nullable|boolean',
- 'webhook_url' => 'nullable|url',
- 'active' => 'nullable|boolean',
+ 'formulas.*.threshold_value' => 'required|numeric',
+ 'formulas.*.future' => 'required|boolean',
+ 'formulas.*.logical' => ['nullable', Rule::in(array_keys(AlertRuleFormula::$logicals))],
+ 'calculation_minutes' => ['required', Rule::in(AlertRule::$calc_minutes)],
+ 'exclude_months.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_months))],
+ 'exclude_hours.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_hours))],
+ 'exclude_hive_ids.*' => ['nullable', 'integer'/* , Rule::in($request->user()->allHives()->pluck('id')) */],
+ 'alert_on_occurrences' => 'nullable|integer',
+ 'alert_via_email' => 'nullable|boolean',
+ 'webhook_url' => 'nullable|url',
+ 'active' => 'nullable|boolean',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
+
+ $requestData = $request->except('default_rule', 'formulas'); // never let users create a default rule via the API
-
- $requestData = $request->except('default_rule','formulas'); // never let users create a default rule via the API
-
- $requestData['name'] = substr($request->input('name'), 0, 50);
- $requestData['description'] = substr($request->input('description'), 0, 255);
+ $requestData['name'] = substr($request->input('name'), 0, 50);
+ $requestData['description'] = substr($request->input('description'), 0, 255);
$requestData['alert_on_occurrences'] = $request->input('alert_on_occurrences', 1);
- if ($request->filled('exclude_hive_ids'))
- $requestData['exclude_hive_ids'] = implode(",", $requestData['exclude_hive_ids']);
- else
+ if ($request->filled('exclude_hive_ids')) {
+ $requestData['exclude_hive_ids'] = implode(',', $requestData['exclude_hive_ids']);
+ } else {
$requestData['exclude_hive_ids'] = null;
+ }
- if ($request->filled('exclude_months'))
- $requestData['exclude_months'] = implode(",", $requestData['exclude_months']);
- else
+ if ($request->filled('exclude_months')) {
+ $requestData['exclude_months'] = implode(',', $requestData['exclude_months']);
+ } else {
$requestData['exclude_months'] = null;
+ }
- if ($request->filled('exclude_hours'))
- $requestData['exclude_hours'] = implode(",", $requestData['exclude_hours']);
- else
+ if ($request->filled('exclude_hours')) {
+ $requestData['exclude_hours'] = implode(',', $requestData['exclude_hours']);
+ } else {
$requestData['exclude_hours'] = null;
+ }
- if ($request->filled('formulas'))
- {
+ if ($request->filled('formulas')) {
$formulas = $request->input('formulas');
- if (count($formulas) > 0)
- {
+ if (count($formulas) > 0) {
// For backwards compatibility, set 1st formula values on AlertRule
- $requestData['measurement_id'] = $formulas[0]['measurement_id'];
- $requestData['calculation'] = $formulas[0]['calculation'];
- $requestData['comparator'] = $formulas[0]['comparator'];
- $requestData['comparison'] = $formulas[0]['comparison'];
+ $requestData['measurement_id'] = $formulas[0]['measurement_id'];
+ $requestData['calculation'] = $formulas[0]['calculation'];
+ $requestData['comparator'] = $formulas[0]['comparator'];
+ $requestData['comparison'] = $formulas[0]['comparison'];
$requestData['calculation_minutes'] = $formulas[0]['period_minutes'];
- $requestData['threshold_value'] = $formulas[0]['threshold_value'];
+ $requestData['threshold_value'] = $formulas[0]['threshold_value'];
}
}
$alertrule = Auth::user()->alert_rules()->create($requestData);
// Add formulas
- if (isset($formulas) && count($formulas) > 0)
- {
- foreach ($formulas as $f)
+ if (isset($formulas) && count($formulas) > 0) {
+ foreach ($formulas as $f) {
$alertrule->alert_rule_formulas()->create($f);
+ }
}
return response()->json($alertrule, 201);
@@ -162,7 +172,9 @@ public function store(Request $request)
/**
* api/alert-rules/{id} GET
* Display the specified user alert rules.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function show($id)
@@ -175,14 +187,16 @@ public function show($id)
/**
* api/alert-rules/{id} PATCH
* Update the specified user alert rule.
+ *
* @authenticated
- * @bodyParam name string The name of the alert rule.
- * @bodyParam description string The description of the alert rule.
- * @bodyParam measurement_id integer required The physical quantity / unit to alert for.
+ *
+ * @bodyParam name string The name of the alert rule.
+ * @bodyParam description string The description of the alert rule.
+ * @bodyParam measurement_id integer required The physical quantity / unit to alert for.
* @bodyParam calculation string required Calculation to be done with measurement value(s): (min, max, ave, der, cnt) -> Minimum, Maximum, Average (mean), Derivative, Count.
* @bodyParam comparator string required Logical comparator to perform with comparison calculation result and threshold_value (=, <, >, <=, >=).
* @bodyParam comparison string required Comparison function to perform with measurement value(s): (val, dif, abs, abs_dif) -> Value, Difference, Absolute value, Absolute value of the difference.
- * @bodyParam threshold_value float required The threshold value beyond which the alert will be sent.
+ * @bodyParam threshold_value float required The threshold value beyond which the alert will be sent.
* @bodyParam calculation_minutes integer The amount of minutes used for calculating the (min, max, ave, der, cnt) of the measurement value(s). If not provided, the last recorded value is used as a reference.
* @bodyParam exclude_months array Array of month indexes (1-12). If not filled the standard alert is 'always on'. Example: [1,2,3,11,12]
* @bodyParam exclude_hours array Array of hour indexes (0-23). If not filled the standard alert is 'always on'. Example: [0,1,2,3,22,23]
@@ -191,95 +205,98 @@ public function show($id)
* @bodyParam alert_via_email boolean Set to false (0) if an e-mail should NOT be sent on alert. Default: true (1).
* @bodyParam webhook_url string URL of optional endpoint to call on alert for web hook integration.
* @bodyParam active boolean Set to false (0) if the alert should NOT be active. Default: true (1).
+ *
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
- 'name' => 'nullable|string',
- 'description' => 'nullable|string',
- 'measurement_id' => 'required_without:formulas|integer|exists:measurements,id',
- 'calculation' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$calculations))],
- 'comparator' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparators))],
- 'comparison' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparisons))],
- 'threshold_value' => 'required_without:formulas|numeric',
- 'formulas' => 'required_without:calculation|array',
- 'formulas.*.alert_rule_id' => 'nullable|integer|min:'.$id.'|max:'.$id,
+ 'name' => 'nullable|string',
+ 'description' => 'nullable|string',
+ 'measurement_id' => 'required_without:formulas|integer|exists:measurements,id',
+ 'calculation' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$calculations))],
+ 'comparator' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparators))],
+ 'comparison' => ['required_without:formulas', Rule::in(array_keys(AlertRule::$comparisons))],
+ 'threshold_value' => 'required_without:formulas|numeric',
+ 'formulas' => 'required_without:calculation|array',
+ 'formulas.*.alert_rule_id' => 'nullable|integer|min:'.$id.'|max:'.$id,
'formulas.*.measurement_id' => 'required|integer|exists:measurements,id',
- 'formulas.*.calculation' => ['required', Rule::in(array_keys(AlertRule::$calculations))],
- 'formulas.*.comparator' => ['required', Rule::in(array_keys(AlertRule::$comparators))],
- 'formulas.*.comparison' => ['required', Rule::in(array_keys(AlertRule::$comparisons))],
+ 'formulas.*.calculation' => ['required', Rule::in(array_keys(AlertRule::$calculations))],
+ 'formulas.*.comparator' => ['required', Rule::in(array_keys(AlertRule::$comparators))],
+ 'formulas.*.comparison' => ['required', Rule::in(array_keys(AlertRule::$comparisons))],
'formulas.*.period_minutes' => 'required|integer|min:0',
- 'formulas.*.threshold_value'=> 'required|numeric',
- 'formulas.*.future' => 'required|boolean',
- 'formulas.*.logical' => ['nullable', Rule::in(array_keys(AlertRuleFormula::$logicals))],
- 'calculation_minutes' => ['required', Rule::in(AlertRule::$calc_minutes)],
- 'exclude_months.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_months))],
- 'exclude_hours.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_hours))],
- 'exclude_hive_ids.*' => ['nullable', 'integer'/*, Rule::in($request->user()->allHives()->pluck('id'))*/],
- 'alert_on_occurrences' => 'nullable|integer',
- 'alert_via_email' => 'nullable|boolean',
- 'webhook_url' => 'nullable|url',
- 'active' => 'nullable|boolean'
+ 'formulas.*.threshold_value' => 'required|numeric',
+ 'formulas.*.future' => 'required|boolean',
+ 'formulas.*.logical' => ['nullable', Rule::in(array_keys(AlertRuleFormula::$logicals))],
+ 'calculation_minutes' => ['required', Rule::in(AlertRule::$calc_minutes)],
+ 'exclude_months.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_months))],
+ 'exclude_hours.*' => ['nullable', 'integer', Rule::in(array_keys(AlertRule::$exclude_hours))],
+ 'exclude_hive_ids.*' => ['nullable', 'integer'/* , Rule::in($request->user()->allHives()->pluck('id')) */],
+ 'alert_on_occurrences' => 'nullable|integer',
+ 'alert_via_email' => 'nullable|boolean',
+ 'webhook_url' => 'nullable|url',
+ 'active' => 'nullable|boolean',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
-
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
- $alertrule = Auth::user()->alert_rules()->findOrFail($id);
- $requestData = $request->except('default_rule','formulas'); // never let users create a default rule via the API
+ $alertrule = Auth::user()->alert_rules()->findOrFail($id);
+ $requestData = $request->except('default_rule', 'formulas'); // never let users create a default rule via the API
- $requestData['name'] = substr($request->input('name'), 0, 50);
- $requestData['description'] = substr($request->input('description'), 0, 255);
+ $requestData['name'] = substr($request->input('name'), 0, 50);
+ $requestData['description'] = substr($request->input('description'), 0, 255);
$requestData['alert_on_occurrences'] = $request->input('alert_on_occurrences', 1);
- if ($request->filled('exclude_hive_ids'))
- $requestData['exclude_hive_ids'] = implode(",", $requestData['exclude_hive_ids']);
- else
+ if ($request->filled('exclude_hive_ids')) {
+ $requestData['exclude_hive_ids'] = implode(',', $requestData['exclude_hive_ids']);
+ } else {
$requestData['exclude_hive_ids'] = null;
+ }
- if ($request->filled('exclude_months'))
- $requestData['exclude_months'] = implode(",", $requestData['exclude_months']);
- else
+ if ($request->filled('exclude_months')) {
+ $requestData['exclude_months'] = implode(',', $requestData['exclude_months']);
+ } else {
$requestData['exclude_months'] = null;
+ }
- if ($request->filled('exclude_hours'))
- $requestData['exclude_hours'] = implode(",", $requestData['exclude_hours']);
- else
+ if ($request->filled('exclude_hours')) {
+ $requestData['exclude_hours'] = implode(',', $requestData['exclude_hours']);
+ } else {
$requestData['exclude_hours'] = null;
+ }
$alertrule->update($requestData);
// Edit formulas
- if ($request->filled('formulas'))
- {
- $formulas_input = $request->input('formulas');
- $formulas_input_ids = [];
- $formulas_input_new = [];
-
- foreach ($formulas_input as $f)
- {
- if (isset($f['id']))
+ if ($request->filled('formulas')) {
+ $formulas_input = $request->input('formulas');
+ $formulas_input_ids = [];
+ $formulas_input_new = [];
+
+ foreach ($formulas_input as $f) {
+ if (isset($f['id'])) {
$formulas_input_ids[$f['id']] = $f;
- else
+ } else {
$formulas_input_new[] = $f;
+ }
}
// update or remove non existing formulas
- foreach ($alertrule->formulas as $f)
- {
+ foreach ($alertrule->formulas as $f) {
// Update existing
- if (isset($formulas_input_ids[$f->id]))
+ if (isset($formulas_input_ids[$f->id])) {
$f->update($formulas_input_ids[$f->id]);
- else // or delete (iuf not in array)
+ } else { // or delete (iuf not in array)
$f->delete();
+ }
}
// add new formulas
- if (count($formulas_input_new) > 0)
- {
- foreach ($formulas_input_new as $f)
+ if (count($formulas_input_new) > 0) {
+ foreach ($formulas_input_new as $f) {
$alertrule->alert_rule_formulas()->create($f);
+ }
}
}
@@ -289,7 +306,9 @@ public function update(Request $request, $id)
/**
* api/alert-rules/{id} DELETE
* Delete the specified user alert rule.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
*/
public function destroy($id)
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index d1fd003b..803da308 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -3,10 +3,10 @@
namespace App\Http\Controllers\Api\Auth;
use App\Http\Controllers\Controller;
+use App\User;
+use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Http\Request;
-use Illuminate\Auth\Events\Verified;
-use App\User;
/**
* @group Api\Auth\VerificationController
@@ -34,7 +34,6 @@ class VerificationController extends Controller
*/
protected $redirectTo = '/webapp#!/login?msg=email_verified';
-
/**
* Create a new controller instance.
*
@@ -42,16 +41,14 @@ class VerificationController extends Controller
*/
public function __construct()
{
- //$this->middleware('auth');
+ // $this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:10,1')->only('verify');
- $this->redirectTo = env('WEBAPP_URL',"/").env('WEBAPP_EMAIL_VERIFY_URL','login')."?msg=email_verified";
+ $this->redirectTo = env('WEBAPP_URL', '/').env('WEBAPP_EMAIL_VERIFY_URL', 'login').'?msg=email_verified';
}
-
/**
* Show the email verification notice.
- *
*/
public function show()
{
@@ -61,28 +58,23 @@ public function show()
/**
* Mark the authenticated user's email address as verified.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function verify(Request $request)
{
$user = null;
- // ->route('id') gets route user id and getKey() gets current user id()
+ // ->route('id') gets route user id and getKey() gets current user id()
// do not forget that you must send Authorization header to get the user from the request
- if ($request->user() && $request->route('id') == $request->user()->getKey())
- {
+ if ($request->user() && $request->route('id') == $request->user()->getKey()) {
$user = $request->user();
- }
- else
- {
+ } else {
$user = User::find($request->route('id'));
}
$email = '';
- if ($user && $user->markEmailAsVerified())
- {
+ if ($user && $user->markEmailAsVerified()) {
$email = '&email='.$user->email;
event(new Verified($user));
}
@@ -93,37 +85,33 @@ public function verify(Request $request)
/**
* Resend the email verification notification.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function resend(Request $request)
{
$user = null;
- //die(print_r($request->input()));
- if ($request->filled(['email']))
- {
+ // die(print_r($request->input()));
+ if ($request->filled(['email'])) {
$email = $request->input('email');
- $user = User::where('email', '=', $email)->first();
- }
- else
- {
+ $user = User::where('email', '=', $email)->first();
+ } else {
$user = $request->user();
}
- if($user === null)
+ if ($user === null) {
return response()->json('invalid_user', 400);
+ }
- //die(print_r($user));
+ // die(print_r($user));
if ($user->hasVerifiedEmail()) {
return response()->json('email_verified', 422);
-// return redirect($this->redirectPath());
+ // return redirect($this->redirectPath());
}
$user->sendApiEmailVerificationNotification();
return response()->json('email_verification_sent');
-// return back()->with('resent', true);
+ // return back()->with('resent', true);
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Api/CategoryController.php b/app/Http/Controllers/Api/CategoryController.php
index d6e3f2c4..b9e89d13 100644
--- a/app/Http/Controllers/Api/CategoryController.php
+++ b/app/Http/Controllers/Api/CategoryController.php
@@ -4,22 +4,24 @@
use App\Category;
use App\CategoryInput;
-use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
+use Illuminate\Http\Request;
/**
* @group Api\CategoryController
* All categories in the categorization tree used for hive inspections
* Only used to get listing (index) or one category (show)
+ *
* @authenticated
*/
class CategoryController extends Controller
{
-
/**
* api/categoryinputs
* List of all available input types of the inspection categories
+ *
* @authenticated
+ *
* @response[
{
"id": 1,
@@ -49,28 +51,32 @@ class CategoryController extends Controller
*/
public function inputs(Request $request)
{
- //die($category);
+ // die($category);
return response()->json(CategoryInput::all());
}
/**
* api/categories/{id}
* Display the specified category.
+ *
* @authenticated
- * @param \App\Category $category
+ *
* @return \Illuminate\Http\Response
*/
public function show(Request $request, Category $category)
{
- //die($category);
+ // die($category);
return response()->json($category);
}
/**
* api/categories
* Display a listing of the inspection categories.
+ *
* @authenticated
+ *
* @return \Illuminate\Http\Response
+ *
* @response[
{
"id": 1,
diff --git a/app/Http/Controllers/Api/ChecklistController.php b/app/Http/Controllers/Api/ChecklistController.php
index 05642f92..8e0c40ad 100644
--- a/app/Http/Controllers/Api/ChecklistController.php
+++ b/app/Http/Controllers/Api/ChecklistController.php
@@ -3,13 +3,13 @@
namespace App\Http\Controllers\Api;
use App\Checklist;
-use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
-use Moment\Moment;
+use Illuminate\Http\Request;
/**
* @group Api\ChecklistController
* Manage your personal inspection checklists
+ *
* @authenticated
*/
class ChecklistController extends Controller
@@ -22,62 +22,59 @@ class ChecklistController extends Controller
public function index(Request $request)
{
$checklists = $request->user()->allChecklists()->orderBy('name')->get();
+
return response()->json($checklists);
}
-
public function store(Request $request)
{
$requestData = $request->except(['user_id']);
- $checklist = Checklist::create($requestData);
+ $checklist = Checklist::create($requestData);
$request->user()->checklists()->attach($checklist);
- if ($request->filled('categories'))
- {
+ if ($request->filled('categories')) {
$categories = explode(',', $request->input('categories'));
$checklist->syncCategories($categories);
}
- return response()->json(['checklist_id'=>$checklist->id], 201);
- }
+ return response()->json(['checklist_id' => $checklist->id], 201);
+ }
public function show(Request $request, $id)
{
$checklist = $request->user()->allChecklists()->find($id);
- if ($checklist)
- {
+ if ($checklist) {
$selected = $checklist->categoryIdArray();
$checklist->taxonomy = $checklist->getOrderedChecklist($selected);
+
return response()->json($checklist); // formatting for jsTree
}
+
return response()->json(null, 404);
}
-
public function update(Request $request, $id)
{
-
+
$requestData = $request->except(['user_id']);
-
+
$checklist = $request->user()->checklists()->find($id);
- if ($checklist)
- {
+ if ($checklist) {
$checklist->update($requestData);
-
- if ($request->filled('categories'))
- {
+
+ if ($request->filled('categories')) {
$categories = explode(',', $request->input('categories'));
$checklist->syncCategories($categories);
- return response()->json(['checklist_id'=>$checklist->id]);
+
+ return response()->json(['checklist_id' => $checklist->id]);
}
}
+
return response()->json('Nothing updated', 500);
}
-
public function destroy(Request $request, $id)
{
return response()->json($request->user()->checklists()->findOrFail($id)->delete());
}
-
}
diff --git a/app/Http/Controllers/Api/ChecklistSvgController.php b/app/Http/Controllers/Api/ChecklistSvgController.php
index 5143edee..96b31693 100644
--- a/app/Http/Controllers/Api/ChecklistSvgController.php
+++ b/app/Http/Controllers/Api/ChecklistSvgController.php
@@ -3,14 +3,12 @@
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
-use App\Models\ChecklistSvg;
use Illuminate\Http\Request;
/**
* @group Api\ChecklistSvgController
* Manage stored SVG checklists (for off-line input)
+ *
* @authenticated
*/
class ChecklistSvgController extends Controller
@@ -19,7 +17,7 @@ class ChecklistSvgController extends Controller
api/checklist-svg GET
Show your list of stored SVG inspections
@authenticated
- **/
+ **/
public function index(Request $request)
{
$checklist_svg = $request->user()->checklistSvgs;
@@ -36,10 +34,10 @@ public function index(Request $request)
@bodyParam name string The name of the inspection SVG
@bodyParam last_print datetime The last print datetime
@authenticated
- **/
+ **/
public function store(Request $request)
{
-
+
$checklist_svg = $request->user()->checklistSvgs()->create($request->all());
return response()->json($checklist_svg, 201);
@@ -49,7 +47,7 @@ public function store(Request $request)
api/checklist-svg/{id} GET
Show an SVG inspection
@authenticated
- **/
+ **/
public function show($id)
{
$checklist_svg = $request->user()->checklistSvgs()->findOrFail($id);
@@ -61,10 +59,10 @@ public function show($id)
api/checklist-svg/{id} PATCH
Edit an SVG inspection
@authenticated
- **/
+ **/
public function update(Request $request, $id)
{
-
+
$checklist_svg = $request->user()->checklistSvgs()->findOrFail($id);
$checklist_svg->update($request->all());
@@ -75,7 +73,7 @@ public function update(Request $request, $id)
api/checklist-svg/{id} DELETE
Delete an SVG inspection
@authenticated
- **/
+ **/
public function destroy($id)
{
$request->user()->checklistSvgs()->destroy($id);
diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php
index 17269a58..039f64ce 100644
--- a/app/Http/Controllers/Api/Controller.php
+++ b/app/Http/Controllers/Api/Controller.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
diff --git a/app/Http/Controllers/Api/DashboardGroupController.php b/app/Http/Controllers/Api/DashboardGroupController.php
index e38e13ae..d9560b19 100644
--- a/app/Http/Controllers/Api/DashboardGroupController.php
+++ b/app/Http/Controllers/Api/DashboardGroupController.php
@@ -2,23 +2,20 @@
namespace App\Http\Controllers\Api;
-use App\Http\Controllers\Controller;
-use App\Http\Controllers\Api\MeasurementController;
-use App\Http\Requests;
-
use App\Hive;
+use App\Http\Controllers\Controller;
use App\Measurement;
use App\Models\DashboardGroup;
+use Cache;
use Illuminate\Http\Request;
-
use Illuminate\Validation\Rule;
-use Validator;
use Str;
-use Cache;
+use Validator;
/**
* @group Api\DashboardGroupController
* Store and retreive DashboardGroups to create public dashboard with a fixed set of measurements
+ *
* @authenticated
*/
class DashboardGroupController extends Controller
@@ -27,10 +24,11 @@ class DashboardGroupController extends Controller
api/dashboardgroups GET
List all user Dashboard groups
@authenticated
- **/
+ **/
public function index(Request $request)
{
$dgroup = $request->user()->dashboardGroups;
+
return response()->json($dgroup);
}
@@ -39,67 +37,60 @@ public function index(Request $request)
Get public user Dashboard groups
@urlParam hive_id integer Hive ID of which the data should be loaded
@authenticated
- **/
+ **/
public function public(Request $request, string $code)
{
- $inputs = $request->all();
+ $inputs = $request->all();
$inputs['code'] = strip_tags($code);
$validator = Validator::make($inputs, [
- 'code' => 'required|string|min:6|exists:dashboard_groups,code',
+ 'code' => 'required|string|min:6|exists:dashboard_groups,code',
'hive_id' => 'nullable|integer|exists:hives,id',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()], 422);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()], 422);
+ }
// Create output
- $hive_id= $request->filled('hive_id') ? $request->input('hive_id') : null;
-
- $out = Cache::remember('dashboard-code'.$code.'-hive-'.$hive_id.'-data', env('CACHE_TIMEOUT_LONG'), function () use ($code, $hive_id)
- {
- $out = [];
+ $hive_id = $request->filled('hive_id') ? $request->input('hive_id') : null;
+
+ $out = Cache::remember('dashboard-code'.$code.'-hive-'.$hive_id.'-data', env('CACHE_TIMEOUT_LONG'), function () use ($code, $hive_id) {
+ $out = [];
$dgroup = DashboardGroup::where('code', $code)->first();
- if ($dgroup)
- {
- $out = [];
-
- if (is_array($dgroup->hive_ids) && count($dgroup->hive_ids) > 0)
- {
+ if ($dgroup) {
+ $out = [];
+
+ if (is_array($dgroup->hive_ids) && count($dgroup->hive_ids) > 0) {
// only on first meta call
- if ($hive_id === null)
- {
+ if ($hive_id === null) {
$out = $dgroup->toArray();
- $out['sensormeasurements'] = Measurement::all();
+ $out['sensormeasurements'] = Measurement::all();
}
-
+
$user = $dgroup->user;
- $hives= $dgroup->hives;
-
+ $hives = $dgroup->hives;
+
$out['hives'] = [];
- foreach($hives as $hive)
- {
- if ($hive && (!isset($hive_id) || $hive->id == $hive_id)) // all or only selected hive
- {
- $hive_array = [];
-
- $device = $hive->hasDevices() ? $hive->devices->first() : null;
+ foreach ($hives as $hive) {
+ if ($hive && (! isset($hive_id) || $hive->id == $hive_id)) { // all or only selected hive
+ $hive_array = [];
+
+ $device = $hive->hasDevices() ? $hive->devices->first() : null;
$hive_array['device_online'] = isset($device) ? $device->online : '';
- if (isset($hive_id)) // request specific hive data
- {
- $hive_array['last_inspection_date'] = $dgroup->show_inspections ? $hive->last_inspection_date : '';
- $hive_array['impression'] = $dgroup->show_inspections ? $hive->impression : '';
+ if (isset($hive_id)) { // request specific hive data
+ $hive_array['last_inspection_date'] = $dgroup->show_inspections ? $hive->last_inspection_date : '';
+ $hive_array['impression'] = $dgroup->show_inspections ? $hive->impression : '';
$hive_array['notes'] = $dgroup->show_inspections ? $hive->notes : '';
- $apiary = isset($hive->location_id) ? $hive->location()->first() : null;
- $hive_array['lat'] = isset($apiary) ? $apiary->coordinate_lat : '';
- $hive_array['lon'] = isset($apiary) ? $apiary->coordinate_lon : '';
- $hive_array['location_name'] = $hive->location;
+ $apiary = isset($hive->location_id) ? $hive->location()->first() : null;
+ $hive_array['lat'] = isset($apiary) ? $apiary->coordinate_lat : '';
+ $hive_array['lon'] = isset($apiary) ? $apiary->coordinate_lon : '';
+ $hive_array['location_name'] = $hive->location;
- //$last_connection = $device->last_message_received;
+ // $last_connection = $device->last_message_received;
- if (isset($device))
- {
+ if (isset($device)) {
$data_request = [
'id' => $device->id,
'hive_id' => $hive->id,
@@ -112,30 +103,26 @@ public function public(Request $request, string $code)
return $user;
});
$result = (new MeasurementController)->data($request);
- if ($result->getStatusCode() == 200)
- {
- $m = $result->original;
+ if ($result->getStatusCode() == 200) {
+ $m = $result->original;
$cnt = count($m['measurements']);
- if ($cnt > 0)
- {
- $hive_array['index'] = $m['index'];
- $hive_array['interval'] = $m['interval'];
- $hive_array['relative_interval']= $m['relative_interval'];
- $hive_array['resolution'] = $m['resolution'];
- $hive_array['sensorDefinitions']= $m['sensorDefinitions'];
- $hive_array['measurements'] = $m['measurements'];
- $hive_array['start'] = $m['measurements'][0]['time'];
- $hive_array['end'] = $m['measurements'][$cnt-1]['time'];
+ if ($cnt > 0) {
+ $hive_array['index'] = $m['index'];
+ $hive_array['interval'] = $m['interval'];
+ $hive_array['relative_interval'] = $m['relative_interval'];
+ $hive_array['resolution'] = $m['resolution'];
+ $hive_array['sensorDefinitions'] = $m['sensorDefinitions'];
+ $hive_array['measurements'] = $m['measurements'];
+ $hive_array['start'] = $m['measurements'][0]['time'];
+ $hive_array['end'] = $m['measurements'][$cnt - 1]['time'];
}
}
}
- }
- else // request meta data
- {
- $hive_array['id'] = $hive->id;
- $hive_array['name'] = $hive->name;
+ } else { // request meta data
+ $hive_array['id'] = $hive->id;
+ $hive_array['name'] = $hive->name;
$hive_array['sensors'] = $hive->sensors;
- $hive_array['layers'] = $hive->layers;
+ $hive_array['layers'] = $hive->layers;
}
$out['hives'][] = $hive_array;
@@ -143,33 +130,35 @@ public function public(Request $request, string $code)
}
}
}
+
return $out;
});
- if (count($out) == 0)
+ if (count($out) == 0) {
return response()->json(null, 404);
-
+ }
+
return response()->json($out);
}
-
public function store(Request $request)
{
$validator = Validator::make($request->input(), [
- 'hive_ids.*' => 'required|exists:hives,id',
- 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
- 'speed' => 'required|integer|min:1|max:84600',
- 'name' => 'nullable|string',
- 'description' => 'nullable|string',
- 'logo_url' => 'nullable|url',
- 'show_inspections' => 'boolean',
- 'show_all' => 'boolean',
+ 'hive_ids.*' => 'required|exists:hives,id',
+ 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
+ 'speed' => 'required|integer|min:1|max:84600',
+ 'name' => 'nullable|string',
+ 'description' => 'nullable|string',
+ 'logo_url' => 'nullable|url',
+ 'show_inspections' => 'boolean',
+ 'show_all' => 'boolean',
'hide_measurements' => 'boolean',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()], 422);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()], 422);
+ }
- $dgArray = $request->all();
+ $dgArray = $request->all();
$dgArray['code'] = strtoupper(Str::random(6));
$dgroup = $request->user()->dashboardGroups()->create($dgArray);
@@ -177,53 +166,54 @@ public function store(Request $request)
return response()->json($dgroup, 201);
}
-
public function show($id)
{
$dgroup = $request->user()->dashboardGroups()->findOrFail($id);
+
return $dgroup;
}
-
public function update(Request $request, $id)
{
$validator = Validator::make($request->input(), [
- 'hive_ids.*' => 'required|exists:hives,id',
- 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
- 'speed' => 'required|integer|min:1|max:84600',
- 'name' => 'nullable|string',
- 'description' => 'nullable|string',
- 'logo_url' => 'nullable|url',
- 'show_inspections' => 'boolean',
- 'show_all' => 'boolean',
+ 'hive_ids.*' => 'required|exists:hives,id',
+ 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
+ 'speed' => 'required|integer|min:1|max:84600',
+ 'name' => 'nullable|string',
+ 'description' => 'nullable|string',
+ 'logo_url' => 'nullable|url',
+ 'show_inspections' => 'boolean',
+ 'show_all' => 'boolean',
'hide_measurements' => 'boolean',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()], 422);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()], 422);
+ }
$dgroup = $request->user()->dashboardGroups()->findOrFail($id);
// Empty cache
$code = $dgroup->code;
Cache::forget('dashboard-code'.$code.'-hive-null-data');
- foreach ($dgroup->hive_ids as $hive_id)
+ foreach ($dgroup->hive_ids as $hive_id) {
Cache::forget('dashboard-code'.$code.'-hive-'.$hive_id.'-data');
+ }
$dgroup->update($request->all());
-
return response()->json($dgroup, 200);
}
-
public function destroy(Request $request, $id)
{
$g = $request->user()->dashboardGroups()->findOrFail($id);
- if ($g){
+ if ($g) {
$g->destroy($id);
+
return response()->json(null, 204);
}
+
return response()->json(null, 404);
}
}
diff --git a/app/Http/Controllers/Api/DeviceController.php b/app/Http/Controllers/Api/DeviceController.php
index 7b163a96..d3033a63 100644
--- a/app/Http/Controllers/Api/DeviceController.php
+++ b/app/Http/Controllers/Api/DeviceController.php
@@ -1,55 +1,51 @@
request($type, $url, ['headers'=>['Authorization'=>'Bearer '.env('TTN_API_KEY')], 'json' => $data]);
- }
- catch(RequestException $e)
- {
- if (!$e->hasResponse())
+ // die(print_r([$url, $type, $server, json_encode($data)]));
+ try {
+ $response = $guzzle->request($type, $url, ['headers' => ['Authorization' => 'Bearer '.env('TTN_API_KEY')], 'json' => $data]);
+ } catch (RequestException $e) {
+ if (! $e->hasResponse()) {
return Response::json('no_ttn_response', 500);
-
+ }
+
$response = $e->getResponse();
}
return $response;
}
-
/**
api/devices GET
List all user Devices
@@ -93,44 +89,38 @@ private function doTTNRequest($deviceId=null, $type='GET', $data=null, $server=n
]
}
]
- */
+ */
public function index(Request $request)
{
-
- if ($request->filled('hardware_id'))
- {
- $hw_id = strtolower($request->input('hardware_id'));
+
+ if ($request->filled('hardware_id')) {
+ $hw_id = strtolower($request->input('hardware_id'));
$devices = $request->user()->allDevices()->where('hardware_id', $hw_id)->with('sensorDefinitions');
// TODO: Exception for old hardware id's (including 0e as first byte) that have been stored, can be removed after implementation of issue #36 (correct hw_id in native apps, LoRa message parsers and database update of old id's)
- if ($devices->count() == 0 && strlen($hw_id) == 18)
+ if ($devices->count() == 0 && strlen($hw_id) == 18) {
$devices = $request->user()->allDevices()->where('hardware_id', '0e'.$hw_id)->with('sensorDefinitions');
- }
- else
- {
+ }
+ } else {
$devices = $request->user()->allDevices()->with('sensorDefinitions');
}
// Check for device hijacking
$reactNativeApp = false;
- if ($request->hasHeader('X-ClientId') && ($request->header('X-ClientId') == 'android' || $request->header('X-ClientId') == 'ios'))
+ if ($request->hasHeader('X-ClientId') && ($request->header('X-ClientId') == 'android' || $request->header('X-ClientId') == 'ios')) {
$reactNativeApp = true;
+ }
- if ($devices->count() == 0)
- {
- if ($this->canUserClaimDeviceFromRequest($request, false, 'GET /devices') === false)
- {
- if ($reactNativeApp)
- return Response::json(['info'=>'device_not_yours'], 200);
+ if ($devices->count() == 0) {
+ if ($this->canUserClaimDeviceFromRequest($request, false, 'GET /devices') === false) {
+ if ($reactNativeApp) {
+ return Response::json(['info' => 'device_not_yours'], 200);
+ }
return Response::json('device_not_yours', 403);
- }
- else if ($reactNativeApp)
- {
+ } elseif ($reactNativeApp) {
return Response::json([], 200);
- }
- else if ($request->filled('hardware_id')) // Provide less confusing message to Android App listing of unexisting BEEP base
- {
+ } elseif ($request->filled('hardware_id')) { // Provide less confusing message to Android App listing of unexisting BEEP base
return Response::json('New BEEP base found', 404);
}
@@ -144,39 +134,43 @@ public function index(Request $request)
api/devices/ttn/{dev_id} GET
Get a BEEP TTS Cloud Device by Device ID (BEEP hardware_id)
@authenticated
- */
+ */
public function getTTNDevice(Request $request, $dev_id)
{
- if ($this->canUserClaimDeviceFromRequest($request, false, '/devices/ttn/'.$dev_id) === false)
- {
- return Response::json("device_not_yours", 403);
+ if ($this->canUserClaimDeviceFromRequest($request, false, '/devices/ttn/'.$dev_id) === false) {
+ return Response::json('device_not_yours', 403);
}
$response = $this->doTTNRequest($dev_id);
+
return Response::json(json_decode($response->getBody()), $response->getStatusCode());
}
+
/**
api/devices/ttn/{dev_id} POST
Create a BEEP TTS Cloud Device by Device ID, lorawan_device.dev_eui, and lorawan_device.app_key
@authenticated
- */
+ */
public function postTTNDevice(Request $request, $dev_id)
{
$validator = Validator::make($request->input(), [
'lorawan_device.dev_eui' => 'required|alpha-num|size:16',
- 'lorawan_device.app_key' => 'required|alpha-num|size:32'
+ 'lorawan_device.app_key' => 'required|alpha-num|size:32',
]);
- if ($validator->fails())
- return Response::json(['errors'=>$validator->errors()], 422);
+ if ($validator->fails()) {
+ return Response::json(['errors' => $validator->errors()], 422);
+ }
$dev_eui = $request->input('lorawan_device.dev_eui');
$app_key = $request->input('lorawan_device.app_key');
- if ($this->canUserClaimDevice(null, $dev_eui, $dev_id, true, 'postTTNDevice') === false)
- return Response::json("device_not_yours", 403);
+ if ($this->canUserClaimDevice(null, $dev_eui, $dev_id, true, 'postTTNDevice') === false) {
+ return Response::json('device_not_yours', 403);
+ }
$response = $this->updateOrCreateTTNDevice($dev_id, $dev_eui, $app_key);
+
return Response::json(json_decode($response->getBody()), $response->getStatusCode());
}
@@ -184,17 +178,16 @@ public function postTTNDevice(Request $request, $dev_id)
api/devices/tts/{step}/{dev_id}/{dev_eui} POST
Debug BEEP TTS Cloud Device by lorawan_device.device_id, and lorawan_device.dev_eui
@authenticated
- */
- public function debugTtsDevice(Request $request, $step, $dev_id, $dev_eui, $app_key=null)
+ */
+ public function debugTtsDevice(Request $request, $step, $dev_id, $dev_eui, $app_key = null)
{
- if ($request->user()->hasRole('superadmin'))
- {
+ if ($request->user()->hasRole('superadmin')) {
$response = null;
-
+
switch ($step) {
case 'get':
$response = $this->doTTNRequest($dev_id);
- //die(json_decode($response->getBody())->ids->dev_eui);
+ // die(json_decode($response->getBody())->ids->dev_eui);
break;
case 'delete_ns':
$response = $this->doTTNRequest($dev_id, 'DELETE', null, 'ns');
@@ -222,35 +215,37 @@ public function debugTtsDevice(Request $request, $step, $dev_id, $dev_eui, $app_
break;
}
- if ($response)
+ if ($response) {
return Response::json(json_decode($response->getBody()), $response->getStatusCode());
+ }
}
+
return Response::json('debug_error', 500);
}
private function createApplicationDevice($dev_id, $dev_eui)
{
$data = [
- "end_device" => [
- "ids" => [
- "device_id" => $dev_id,
- "dev_eui" => $dev_eui,
- "join_eui" => env('TTN_APP_EUI')
+ 'end_device' => [
+ 'ids' => [
+ 'device_id' => $dev_id,
+ 'dev_eui' => $dev_eui,
+ 'join_eui' => env('TTN_APP_EUI'),
],
- "join_server_address" => env('TTN_APP_URL'),
- "network_server_address" => env('TTN_APP_URL'),
- "application_server_address"=> env('TTN_APP_URL')
+ 'join_server_address' => env('TTN_APP_URL'),
+ 'network_server_address' => env('TTN_APP_URL'),
+ 'application_server_address' => env('TTN_APP_URL'),
],
- "field_mask" => [
- "paths" => [
- "join_server_address",
- "network_server_address",
- "application_server_address",
- "ids.dev_eui",
- "ids.join_eui"
- ]
- ]
- ];
+ 'field_mask' => [
+ 'paths' => [
+ 'join_server_address',
+ 'network_server_address',
+ 'application_server_address',
+ 'ids.dev_eui',
+ 'ids.join_eui',
+ ],
+ ],
+ ];
return $this->doTTNRequest(null, 'POST', $data);
}
@@ -258,43 +253,43 @@ private function createApplicationDevice($dev_id, $dev_eui)
private function linkDeviceToNetworkServer($dev_id, $dev_eui)
{
$data = [
- "end_device" => [
- "multicast" => false,
- "supports_join" => true,
- "lorawan_version" => "MAC_V1_0_2",
- "ids" => [
- "device_id" => $dev_id,
- "dev_eui" => $dev_eui,
- "join_eui" => env('TTN_APP_EUI')
+ 'end_device' => [
+ 'multicast' => false,
+ 'supports_join' => true,
+ 'lorawan_version' => 'MAC_V1_0_2',
+ 'ids' => [
+ 'device_id' => $dev_id,
+ 'dev_eui' => $dev_eui,
+ 'join_eui' => env('TTN_APP_EUI'),
],
- "mac_settings" => [
- "supports_32_bit_f_cnt" => true,
- "rx2_data_rate_index" => 0,
- "rx2_frequency" => 869525000
+ 'mac_settings' => [
+ 'supports_32_bit_f_cnt' => true,
+ 'rx2_data_rate_index' => 0,
+ 'rx2_frequency' => 869525000,
],
- "supports_class_c" => false,
- "supports_class_b" => false,
- "lorawan_phy_version" => "PHY_V1_0_2_REV_A",
- "frequency_plan_id" => "EU_863_870_TTN"
+ 'supports_class_c' => false,
+ 'supports_class_b' => false,
+ 'lorawan_phy_version' => 'PHY_V1_0_2_REV_A',
+ 'frequency_plan_id' => 'EU_863_870_TTN',
],
- "field_mask" => [
- "paths" => [
- "multicast",
- "supports_join",
- "lorawan_version",
- "ids.device_id",
- "ids.dev_eui",
- "ids.join_eui",
- "mac_settings.supports_32_bit_f_cnt",
- "mac_settings.rx2_data_rate_index",
- "mac_settings.rx2_frequency",
- "supports_class_c",
- "supports_class_b",
- "lorawan_phy_version",
- "frequency_plan_id"
- ]
- ]
- ];
+ 'field_mask' => [
+ 'paths' => [
+ 'multicast',
+ 'supports_join',
+ 'lorawan_version',
+ 'ids.device_id',
+ 'ids.dev_eui',
+ 'ids.join_eui',
+ 'mac_settings.supports_32_bit_f_cnt',
+ 'mac_settings.rx2_data_rate_index',
+ 'mac_settings.rx2_frequency',
+ 'supports_class_c',
+ 'supports_class_b',
+ 'lorawan_phy_version',
+ 'frequency_plan_id',
+ ],
+ ],
+ ];
return $this->doTTNRequest($dev_id, 'PUT', $data, 'ns');
}
@@ -302,21 +297,21 @@ private function linkDeviceToNetworkServer($dev_id, $dev_eui)
private function linkDeviceToApplicationServer($dev_id, $dev_eui)
{
$data = [
- "end_device" => [
- "ids" => [
- "device_id" => $dev_id,
- "dev_eui" => $dev_eui,
- "join_eui" => env('TTN_APP_EUI')
- ]
+ 'end_device' => [
+ 'ids' => [
+ 'device_id' => $dev_id,
+ 'dev_eui' => $dev_eui,
+ 'join_eui' => env('TTN_APP_EUI'),
+ ],
+ ],
+ 'field_mask' => [
+ 'paths' => [
+ 'ids.device_id',
+ 'ids.dev_eui',
+ 'ids.join_eui',
+ ],
],
- "field_mask" => [
- "paths" => [
- "ids.device_id",
- "ids.dev_eui",
- "ids.join_eui"
- ]
- ]
- ];
+ ];
return $this->doTTNRequest($dev_id, 'PUT', $data, 'as');
}
@@ -324,50 +319,49 @@ private function linkDeviceToApplicationServer($dev_id, $dev_eui)
private function linkDeviceToJoinServer($dev_id, $dev_eui, $app_key)
{
$data = [
- "end_device" => [
- "ids" => [
- "device_id" => $dev_id,
- "dev_eui" => $dev_eui,
- "join_eui" => env('TTN_APP_EUI')
+ 'end_device' => [
+ 'ids' => [
+ 'device_id' => $dev_id,
+ 'dev_eui' => $dev_eui,
+ 'join_eui' => env('TTN_APP_EUI'),
+ ],
+ 'network_server_address' => env('TTN_APP_URL'),
+ 'application_server_address' => env('TTN_APP_URL'),
+ 'root_keys' => [
+ 'app_key' => [
+ 'key' => $app_key,
+ ],
+ ],
+ ],
+ 'field_mask' => [
+ 'paths' => [
+ 'network_server_address',
+ 'application_server_address',
+ 'ids.device_id',
+ 'ids.dev_eui',
+ 'ids.join_eui',
+ 'root_keys.app_key.key',
],
- "network_server_address" => env('TTN_APP_URL'),
- "application_server_address" => env('TTN_APP_URL'),
- "root_keys" => [
- "app_key" => [
- "key" => $app_key
- ]
- ]
],
- "field_mask" => [
- "paths" => [
- "network_server_address",
- "application_server_address",
- "ids.device_id",
- "ids.dev_eui",
- "ids.join_eui",
- "root_keys.app_key.key"
- ]
- ]
- ];
+ ];
return $this->doTTNRequest($dev_id, 'PUT', $data, 'js');
}
- private function updateOrCreateTTNDevice($dev_id, $dev_eui, $app_key, $server='')
+ private function updateOrCreateTTNDevice($dev_id, $dev_eui, $app_key, $server = '')
{
- $dev_id = strtolower($dev_id);
+ $dev_id = strtolower($dev_id);
$dev_eui = strtolower($dev_eui);
$device_check = $this->doTTNRequest($dev_id);
- if ($device_check->getStatusCode() == 200) // if device exists, delete device to renew settings
- {
+ if ($device_check->getStatusCode() == 200) { // if device exists, delete device to renew settings
// Add former Dev EUI to Device
$device = Device::where('hardware_id', $dev_id)->first();
- if ($device)
- {
+ if ($device) {
$former_tts_device = json_decode($device_check->getBody());
- if ($former_tts_device && isset($former_tts_device->ids->dev_eui))
+ if ($former_tts_device && isset($former_tts_device->ids->dev_eui)) {
$device->addFormerKey($former_tts_device->ids->dev_eui);
+ }
}
// Delete js, as, ns, and device first
@@ -375,90 +369,74 @@ private function updateOrCreateTTNDevice($dev_id, $dev_eui, $app_key, $server=''
$this->doTTNRequest($dev_id, 'DELETE', null, 'as');
$this->doTTNRequest($dev_id, 'DELETE', null, 'ns');
$delete = $this->doTTNRequest($dev_id, 'DELETE');
- if ($delete->getStatusCode() != 200) // if 200 ok (deleted) go on re-creating the device with other settings
+ if ($delete->getStatusCode() != 200) { // if 200 ok (deleted) go on re-creating the device with other settings
return $delete;
+ }
}
$step1 = $this->createApplicationDevice($dev_id, $dev_eui);
- if ($step1->getStatusCode() == 200 || $step1->getStatusCode() == 201)
- {
+ if ($step1->getStatusCode() == 200 || $step1->getStatusCode() == 201) {
$step2 = $this->linkDeviceToNetworkServer($dev_id, $dev_eui);
- if ($step2->getStatusCode() == 200 || $step2->getStatusCode() == 201)
- {
+ if ($step2->getStatusCode() == 200 || $step2->getStatusCode() == 201) {
$step3 = $this->linkDeviceToApplicationServer($dev_id, $dev_eui);
- if ($step3->getStatusCode() == 200 || $step3->getStatusCode() == 201)
- {
+ if ($step3->getStatusCode() == 200 || $step3->getStatusCode() == 201) {
return $this->linkDeviceToJoinServer($dev_id, $dev_eui, $app_key);
- }
- else
- {
+ } else {
return $step3;
- }
- }
- else
- {
+ }
+ } else {
return $step2;
- }
- }
- else
- {
+ }
+ } else {
return $step1;
}
}
- private function canUserClaimDevice($id=null, $key=null, $hwi=null, $undeleteTrashed=true, $from='')
+ private function canUserClaimDevice($id = null, $key = null, $hwi = null, $undeleteTrashed = true, $from = '')
{
- $can_claim = 0;
+ $can_claim = 0;
$device_exists = 0;
- $user_devices = Auth::user()->devices; // device collection
- $user_id = Auth::user()->id;
-
- if (isset($id))
- {
+ $user_devices = Auth::user()->devices; // device collection
+ $user_id = Auth::user()->id;
+
+ if (isset($id)) {
$device_exists += Device::withTrashed()->where('id', $id)->count();
$can_claim += $user_devices->where('id', $id)->count();
}
-
- if (isset($key))
- {
+
+ if (isset($key)) {
$device_exists += Device::where('key', $key)->count();
$can_claim += $user_devices->where('key', $key)->count();
}
-
- if (isset($hwi))
- {
+
+ if (isset($hwi)) {
$device_exists += Device::withTrashed()->where('hardware_id', $hwi)->count();
$can_claim += $user_devices->where('hardware_id', $hwi)->count();
}
- //
- if ($can_claim == 0 && $device_exists > 0)
- {
- // $device is probably deleted
+ //
+ if ($can_claim == 0 && $device_exists > 0) {
+ // $device is probably deleted
$device = Device::onlyTrashed()->where('hardware_id', $hwi)->orWhere('id', $id)->orWhere('key', $key)->first();
- if ($device)
- {
- if ($device->user_id === $user_id) // If deleted device is owned by user, undelete it
- {
+ if ($device) {
+ if ($device->user_id === $user_id) { // If deleted device is owned by user, undelete it
$deleted_date = $device->deleted_at;
$device->restore();
$can_claim = 1;
Log::info("UserID=$user_id (device->user_id=$device->user_id) restored deleted Device with: ID=$device->id, HWI=$hwi, KEY=$key (from: $from)");
-
+
// also restore trashed sensordefinitions if available
$sensor_definitions_deleted = SensorDefinition::onlyTrashed()->where('device_id', $device->id)->where('deleted_at', $deleted_date)->get();
- $sensor_def_count = $sensor_definitions_deleted->count();
- if ($sensor_def_count > 0)
- {
- foreach ($sensor_definitions_deleted as $sd)
+ $sensor_def_count = $sensor_definitions_deleted->count();
+ if ($sensor_def_count > 0) {
+ foreach ($sensor_definitions_deleted as $sd) {
$sd->restore();
+ }
Log::info("UserID=$user_id restored $sensor_def_count sensor definitions from Device ID=$device->id (from: $from)");
}
-
- }
- else // reset device and assign to user
- {
+
+ } else { // reset device and assign to user
$device->restore(); // is required in stead of directly save, to prevent PDO error Duplicate entry sensors.sensors_key_unique
$device->log_file_info = null;
$device->former_key_list = null;
@@ -470,39 +448,39 @@ private function canUserClaimDevice($id=null, $key=null, $hwi=null, $undeleteTra
Log::info("UserID=$user_id claimed deleted Device with: ID=$id, HWI=$hwi, KEY=$key (from: $from)");
}
}
- // else if $can_claim == 0 device exists, but is bound to another user
+ // else if $can_claim == 0 device exists, but is bound to another user
}
- if ($can_claim > 0 || $device_exists == 0)
+ if ($can_claim > 0 || $device_exists == 0) {
return true;
+ }
Log::error("UserID=$user_id cannot claim DeviceID=$id: HWI=$hwi, KEY=$key (from: $from)");
-
+
return false;
}
- private function canUserClaimDeviceFromRequest(Request $request, $undeleteTrashed=true, $from='canUserClaimDeviceFromRequest')
+ private function canUserClaimDeviceFromRequest(Request $request, $undeleteTrashed = true, $from = 'canUserClaimDeviceFromRequest')
{
- $id = $request->filled('id') ? $request->input('id') : null;
+ $id = $request->filled('id') ? $request->input('id') : null;
$key = $request->filled('key') ? strtolower($request->input('key')) : null;
$hwi = $request->filled('hardware_id') ? strtolower($request->input('hardware_id')) : null;
-
+
return $this->canUserClaimDevice($id, $key, $hwi, $undeleteTrashed, $from);
}
-
-
/**
api/devices/{id} GET
List one Device by id
@authenticated
- */
+ */
public function show(Request $request, $id)
{
$device = $request->user()->allDevices()->with('sensorDefinitions')->findOrFail($id);
-
- if ($device)
+
+ if ($device) {
return Response::json($device);
+ }
return Response::json('no_devices_found', 404);
}
@@ -529,62 +507,55 @@ public function show(Request $request, $id)
@bodyParam last_downlink_result string Result received from BEEP base after downlink message (LoRaWAN port 5)
@bodyParam create_ttn_device boolean If true, create a new LoRaWAN device in the BEEP TTN console. If succesfull, create the device.
@bodyParam app_key string BEEP base LoRaWAN application key that you would like to store in TTN
- */
-
+ */
public function store(Request $request)
{
$device_array = $request->input();
-
- if ($request->filled('create_ttn_device') && $request->input('create_ttn_device') == true && $request->filled('hardware_id'))
- {
- if ($request->user()->hasRole(['superadmin', 'admin']) == false)
- {
- if ($this->canUserClaimDeviceFromRequest($request, true, 'POST /devices') === false)
- return Response::json("device_not_yours", 403);
+ if ($request->filled('create_ttn_device') && $request->input('create_ttn_device') == true && $request->filled('hardware_id')) {
+
+ if ($request->user()->hasRole(['superadmin', 'admin']) == false) {
+ if ($this->canUserClaimDeviceFromRequest($request, true, 'POST /devices') === false) {
+ return Response::json('device_not_yours', 403);
+ }
$device_count = Device::where('user_id', $request->user()->id)->count();
- if ($device_count > 50)
- return Response::json("max_ttn_devices_reached_please_request_more", 403);
+ if ($device_count > 50) {
+ return Response::json('max_ttn_devices_reached_please_request_more', 403);
+ }
}
- $dev_id = strtolower($request->input('hardware_id'));
+ $dev_id = strtolower($request->input('hardware_id'));
$dev_eui = $request->filled('key') ? $request->input('key') : bin2hex(random_bytes(8)); // doubles output length
$app_key = $request->filled('app_key') ? $request->input('app_key') : bin2hex(random_bytes(16)); // doubles output length
$response = $this->updateOrCreateTTNDevice($dev_id, $dev_eui, $app_key);
- if ($response->getStatusCode() == 200 || $response->getStatusCode() == 201)
- {
- $device_array['hardware_id']= $dev_id;
- $device_array['key'] = $dev_eui;
- $device_array['app_key'] = $app_key;
- }
- else
- {
+ if ($response->getStatusCode() == 200 || $response->getStatusCode() == 201) {
+ $device_array['hardware_id'] = $dev_id;
+ $device_array['key'] = $dev_eui;
+ $device_array['app_key'] = $app_key;
+ } else {
return Response::json(json_decode($response->getBody()), $response->getStatusCode());
}
}
- $timeZone = $request->input('timezone','UTC');
- $result = $this->updateOrCreateDevice($device_array, $timeZone);
+ $timeZone = $request->input('timezone', 'UTC');
+ $result = $this->updateOrCreateDevice($device_array, $timeZone);
- if (gettype($result) == 'object' && $request->filled('create_ttn_device') && isset($device_array['app_key']))
- {
- $device = Device::find($result->id);
+ if (gettype($result) == 'object' && $request->filled('create_ttn_device') && isset($device_array['app_key'])) {
+ $device = Device::find($result->id);
$device->app_key = $device_array['app_key'];
$device->app_eui = strtolower(env('TTN_APP_EUI'));
- }
- else
- {
+ } else {
$device = $result;
}
- if (gettype($device) == 'array' && isset($device['http_response_code'])) // error code from TTN
- {
+ if (gettype($device) == 'array' && isset($device['http_response_code'])) { // error code from TTN
$http_response_code = $device['http_response_code'];
unset($device['http_response_code']);
+
return Response::json($device, $http_response_code);
}
@@ -611,28 +582,27 @@ public function store(Request $request)
@bodyParam battery_voltage float Last measured battery voltage
@bodyParam next_downlink_message string Hex string to send via downlink at next connection (LoRaWAN port 6)
@bodyParam last_downlink_result string Result received from BEEP base after downlink message (LoRaWAN port 5)
- */
+ */
public function storeMultiple(Request $request)
{
- //die(print_r($request->input()));
- $timeZone = $request->input('timezone','UTC');
+ // die(print_r($request->input()));
+ $timeZone = $request->input('timezone', 'UTC');
- foreach ($request->input() as $device)
- {
+ foreach ($request->input() as $device) {
$result = $this->updateOrCreateDevice($device, $timeZone);
- if ($result == null || gettype($result) == 'array')
- {
- if (gettype($result) == 'array' && isset($result['http_response_code']))
- {
+ if ($result == null || gettype($result) == 'array') {
+ if (gettype($result) == 'array' && isset($result['http_response_code'])) {
$http_response_code = $result['http_response_code'];
unset($result['http_response_code']);
+
return Response::json($result, $http_response_code);
}
+
return Response::json($result, 400);
}
}
-
+
return $this->index($request);
}
@@ -657,23 +627,22 @@ public function storeMultiple(Request $request)
@bodyParam battery_voltage float Last measured battery voltage
@bodyParam next_downlink_message string Hex string to send via downlink at next connection (LoRaWAN port 6)
@bodyParam last_downlink_result string Result received from BEEP base after downlink message (LoRaWAN port 5)
- */
+ */
public function update(Request $request, $id)
{
- $result = null;
- $timeZone = $request->input('timezone','UTC');
+ $result = null;
+ $timeZone = $request->input('timezone', 'UTC');
- if ($id)
- {
- $device = $request->input();
+ if ($id) {
+ $device = $request->input();
$device['id'] = $id;
- $result = $this->updateOrCreateDevice($device, $timeZone);
+ $result = $this->updateOrCreateDevice($device, $timeZone);
}
- if (gettype($result) == 'array' && isset($result['http_response_code']))
- {
+ if (gettype($result) == 'array' && isset($result['http_response_code'])) {
$http_response_code = $result['http_response_code'];
unset($result['http_response_code']);
+
return Response::json($result, $http_response_code);
}
@@ -687,64 +656,59 @@ public function updateOrCreateDevice($device, $timeZone)
$hwi = isset($device['hardware_id']) ? strtolower($device['hardware_id']) : null;
// Get $sid from hardware_id key combination
- if (isset($key) && !isset($id) && isset($hwi))
- {
+ if (isset($key) && ! isset($id) && isset($hwi)) {
$dev = Device::where('hardware_id', $hwi)->where('key', $key)->first();
- if ($dev)
+ if ($dev) {
$sid = $dev->id;
+ }
}
// user webapp generated key fix for required hw id
- if (isset($key) && !isset($id) && !isset($hwi))
- {
+ if (isset($key) && ! isset($id) && ! isset($hwi)) {
$hwi = $key;
$device['hardware_id'] = $device['key'];
}
$validator = Validator::make($device, [
- 'key' => ['required_without_all:id,hardware_id','string','min:4',Rule::unique('sensors', 'key')->ignore($sid)->whereNull('deleted_at')],
- 'name' => 'nullable|string',
- 'id' => ['required_without_all:key,hardware_id','integer', Rule::unique('sensors')->ignore($sid)],
- 'hardware_id' => ['required_without_all:key,id','string'],
- 'hive_id' => 'nullable|integer|exists:hives,id',
- 'type' => 'nullable|string|exists:categories,name',
- 'delete' => 'nullable|boolean'
+ 'key' => ['required_without_all:id,hardware_id', 'string', 'min:4', Rule::unique('sensors', 'key')->ignore($sid)->whereNull('deleted_at')],
+ 'name' => 'nullable|string',
+ 'id' => ['required_without_all:key,hardware_id', 'integer', Rule::unique('sensors')->ignore($sid)],
+ 'hardware_id' => ['required_without_all:key,id', 'string'],
+ 'hive_id' => 'nullable|integer|exists:hives,id',
+ 'type' => 'nullable|string|exists:categories,name',
+ 'delete' => 'nullable|boolean',
]);
- if ($validator->fails())
- {
- return ['errors'=>$validator->errors().' (KEY/DEV EUI: '.$key.', HW ID: '.$hwi.')', 'http_response_code'=>400];
- }
- else
- {
- if ($this->canUserClaimDevice($sid, $key, $hwi, true, 'updateOrCreateDevice') === false)
- return ['errors'=>'Cannot create device: (KEY/DEV EUI: '.$key.', HW ID: '.$hwi.')', 'http_response_code'=>400];
+ if ($validator->fails()) {
+ return ['errors' => $validator->errors().' (KEY/DEV EUI: '.$key.', HW ID: '.$hwi.')', 'http_response_code' => 400];
+ } else {
+ if ($this->canUserClaimDevice($sid, $key, $hwi, true, 'updateOrCreateDevice') === false) {
+ return ['errors' => 'Cannot create device: (KEY/DEV EUI: '.$key.', HW ID: '.$hwi.')', 'http_response_code' => 400];
+ }
$valid_data = $validator->validated();
$device_new = [];
$device_obj = null;
- $device_id = null;
- $user = Auth::user();
+ $device_id = null;
+ $user = Auth::user();
- if ($user)
- {
- if (isset($sid))
+ if ($user) {
+ if (isset($sid)) {
$device_obj = $user->devices()->find($sid);
- else if (isset($device['hardware_id']))
+ } elseif (isset($device['hardware_id'])) {
$device_obj = $user->devices()->where('hardware_id', $device['hardware_id'])->first();
- else if (isset($hwi))
+ } elseif (isset($hwi)) {
$device_obj = $user->devices()->where('hardware_id', $hwi)->first();
- else if (isset($device['key']))
+ } elseif (isset($device['key'])) {
$device_obj = $user->devices()->where('key', $device['key'])->first();
- else if (isset($key))
+ } elseif (isset($key)) {
$device_obj = $user->devices()->where('key', $key)->first();
+ }
}
- if ($device_obj != null)
- {
+ if ($device_obj != null) {
// delete
- if (isset($valid_data['delete']) && boolval($valid_data['delete']) === true)
- {
+ if (isset($valid_data['delete']) && boolval($valid_data['delete']) === true) {
// try
// {
// $client = new \Influx;
@@ -756,138 +720,149 @@ public function updateOrCreateDevice($device, $timeZone)
// return ['errors'=>'Data values of device with key '.$device_obj->key.' cannot be deleted, try again later...', 'http_response_code'=>500];
// }
$device_obj->delete();
+
return 'device_deleted';
}
// edit
$device_new = $device_obj->toArray();
- $device_id = $device_obj->id;
+ $device_id = $device_obj->id;
}
- $typename = isset($device['type']) ? $device['type'] : 'beep';
+ $typename = isset($device['type']) ? $device['type'] : 'beep';
$device_new['category_id'] = Category::findCategoryIdByParentAndName('sensor', $typename);
- // $device_new['id'] = $device_id;
- //die(print_r([$device_obj, $device]));
+ // $device_new['id'] = $device_id;
+ // die(print_r([$device_obj, $device]));
// Update devicename if BEEPBASE-[####] and not a new name is being set
$reset_device_name = false;
- if ($typename == 'beep' && isset($device['key']) && isset($device['app_key']))
- {
- if (!isset($device['name']))
+ if ($typename == 'beep' && isset($device['key']) && isset($device['app_key'])) {
+ if (! isset($device['name'])) {
$reset_device_name = true;
- else if (isset($device) && isset($device_obj) && $device['name'] == $device_obj['name'] && substr($device_obj['name'], 0, 9) == 'BEEPBASE-')
+ } elseif (isset($device) && isset($device_obj) && $device['name'] == $device_obj['name'] && substr($device_obj['name'], 0, 9) == 'BEEPBASE-') {
$reset_device_name = true;
+ }
}
-
- if ($reset_device_name)
- {
+
+ if ($reset_device_name) {
$device_new['name'] = 'BEEPBASE-'.strtoupper(substr($device['key'], -4, 4));
- }
- else if (isset($device['name']))
- {
- $device_new['name'] = $device['name'];
+ } elseif (isset($device['name'])) {
+ $device_new['name'] = $device['name'];
}
- if (isset($device['key']))
+ if (isset($device['key'])) {
$device_new['key'] = $device['key'];
-
- if (isset($device['hive_id']))
- {
+ }
+
+ if (isset($device['hive_id'])) {
$device_change = false;
- if (!isset($device_new['hive_id']))
+ if (! isset($device_new['hive_id'])) {
$device_new['hive_id'] = null;
+ }
- if (($device['hive_id'] != null && $device_new['hive_id'] == null) || $device['hive_id'] != $device_new['hive_id'])
+ if (($device['hive_id'] != null && $device_new['hive_id'] == null) || $device['hive_id'] != $device_new['hive_id']) {
$device_change = true;
+ }
// Create auto inspection
- if ($device_change)
- {
+ if ($device_change) {
// First set inspection because location will be fixed after setting in hive
- // Inspection items to add
- $device_added = Category::findCategoryByRootParentAndName('hive', 'device', 'id_added', ['system']);
+ // Inspection items to add
+ $device_added = Category::findCategoryByRootParentAndName('hive', 'device', 'id_added', ['system']);
$device_removed = Category::findCategoryByRootParentAndName('hive', 'device', 'id_removed', ['system']);
- if (isset($device_removed) && ($device['hive_id'] == null || ($device['hive_id'] != null && $device_new['hive_id'] != null))) // removed, or hive_id changed
- {
- $notes = $device_removed->transName().': '.$device_new['name'];
- $items = [];
+ if (isset($device_removed) && ($device['hive_id'] == null || ($device['hive_id'] != null && $device_new['hive_id'] != null))) { // removed, or hive_id changed
+ $notes = $device_removed->transName().': '.$device_new['name'];
+ $items = [];
$items[$device_removed->id] = $sid;
Inspection::createInspection($items, $device_new['hive_id'], null, $notes, $timeZone); // set inspection to old hive id (from unchanged device object)
}
- if (isset($device_added) && $device['hive_id'] != null) // device added, or changed to new id
- {
- $notes = $device_added->transName().': '.$device_new['name'];
- $items = [];
+ if (isset($device_added) && $device['hive_id'] != null) { // device added, or changed to new id
+ $notes = $device_added->transName().': '.$device_new['name'];
+ $items = [];
$items[$device_added->id] = $sid;
- Inspection::createInspection($items, $device['hive_id'], null, $notes, $timeZone);
+ Inspection::createInspection($items, $device['hive_id'], null, $notes, $timeZone);
}
}
// change hive
$device_new['hive_id'] = $device['hive_id'];
}
-
- if (isset($device['last_message_received']))
+
+ if (isset($device['last_message_received'])) {
$device_new['last_message_received'] = $device['last_message_received'];
-
- if (isset($device['hardware_id']))
+ }
+
+ if (isset($device['hardware_id'])) {
$device_new['hardware_id'] = $hwi;
-
- if (isset($device['firmware_version']))
+ }
+
+ if (isset($device['firmware_version'])) {
$device_new['firmware_version'] = $device['firmware_version'];
-
- if (isset($device['hardware_version']))
+ }
+
+ if (isset($device['hardware_version'])) {
$device_new['hardware_version'] = $device['hardware_version'];
-
- if (isset($device['boot_count']))
+ }
+
+ if (isset($device['boot_count'])) {
$device_new['boot_count'] = $device['boot_count'];
-
- if (isset($device['measurement_interval_min']))
+ }
+
+ if (isset($device['measurement_interval_min'])) {
$device_new['measurement_interval_min'] = $device['measurement_interval_min'];
-
- if (isset($device['measurement_transmission_ratio']))
+ }
+
+ if (isset($device['measurement_transmission_ratio'])) {
$device_new['measurement_transmission_ratio'] = $device['measurement_transmission_ratio'];
-
- if (isset($device['ble_pin']))
+ }
+
+ if (isset($device['ble_pin'])) {
$device_new['ble_pin'] = $device['ble_pin'];
-
- if (isset($device['battery_voltage']))
+ }
+
+ if (isset($device['battery_voltage'])) {
$device_new['battery_voltage'] = $device['battery_voltage'];
-
- if (isset($device['next_downlink_message']))
+ }
+
+ if (isset($device['next_downlink_message'])) {
$device_new['next_downlink_message'] = $device['next_downlink_message'];
-
- if (isset($device['last_downlink_result']))
+ }
+
+ if (isset($device['last_downlink_result'])) {
$device_new['last_downlink_result'] = $device['last_downlink_result'];
-
- return Auth::user()->devices()->updateOrCreate(['id'=>$device_id], $device_new);
+ }
+
+ return Auth::user()->devices()->updateOrCreate(['id' => $device_id], $device_new);
}
return null;
}
/**
- * api/devices/clocksync POST
- * Trigger a clock synchronization downlink to a device via The Things Network
- * @authenticated
- * @bodyParam key string required The DEV EUI of the device to send the clock sync command to
- * @response {
- * "status": "Clock sync downlink scheduled",
- * "device_id": "0123450a18494a83ee",
- * "scheduled_time": "2024-01-15 14:30:00",
- * "timestamp": 1705327800
- * }
- */
+ * api/devices/clocksync POST
+ * Trigger a clock synchronization downlink to a device via The Things Network
+ *
+ * @authenticated
+ *
+ * @bodyParam key string required The DEV EUI of the device to send the clock sync command to
+ *
+ * @response {
+ * "status": "Clock sync downlink scheduled",
+ * "device_id": "0123450a18494a83ee",
+ * "scheduled_time": "2024-01-15 14:30:00",
+ * "timestamp": 1705327800
+ * }
+ */
public function clocksync(Request $request)
{
// Validate the request
$validator = Validator::make($request->all(), [
- 'key' => 'required|string'
+ 'key' => 'required|string',
]);
if ($validator->fails()) {
@@ -904,24 +879,24 @@ public function clocksync(Request $request)
$device = Auth::user()->allDevices()->where('key', $key)->first();
}
- if (!$device) {
+ if (! $device) {
return Response::json(['error' => 'Device not found or access denied'], 404);
}
// Check if device has hardware_id (required for TTN)
- if (!$device->hardware_id) {
+ if (! $device->hardware_id) {
return Response::json(['error' => 'Device has no hardware_id configured for TTN'], 422);
}
// Calculate the next scheduled transmission time
$now = time();
$timezone = 'Europe/Amsterdam'; // CET timezone as specified
-
+
// Get device timing information
$last_message_received = $device->last_message_received ? strtotime($device->last_message_received) : null;
$measurement_interval_min = $device->measurement_interval_min ?: 15; // Default to 15 minutes if not set
-
- if (!$last_message_received) {
+
+ if (! $last_message_received) {
return Response::json(['error' => 'Device has no last_message_received timestamp'], 422);
}
@@ -929,22 +904,22 @@ public function clocksync(Request $request)
$interval_seconds = $measurement_interval_min * 60;
$time_since_last = $now - $last_message_received;
$messages_missed = floor($time_since_last / $interval_seconds);
-
+
// Next message time is the last message time plus the next interval
$next_message_time = $last_message_received + (($messages_missed + 1) * $interval_seconds);
-
+
// Add a small buffer (30 seconds) to ensure the device is listening
$scheduled_downlink_time = $next_message_time + 30;
-
+
// Convert to CET timezone
- $cet_time = new \DateTime();
+ $cet_time = new \DateTime;
$cet_time->setTimezone(new \DateTimeZone($timezone));
$cet_time->setTimestamp($scheduled_downlink_time);
$cet_timestamp = $cet_time->getTimestamp();
// Create the payload: A5 + hex timestamp
$hex_timestamp = dechex($cet_timestamp);
- $payload_hex = 'A5' . $hex_timestamp;
+ $payload_hex = 'A5'.$hex_timestamp;
$payload_base64 = base64_encode(hex2bin($payload_hex));
// Prepare the downlink data
@@ -952,23 +927,23 @@ public function clocksync(Request $request)
'downlinks' => [
[
'frm_payload' => $payload_base64,
- 'f_port' => 6
- ]
- ]
+ 'f_port' => 6,
+ ],
+ ],
];
// Send the downlink via TTN
try {
- $guzzle = new Client();
- $url = env('TTN_API_URL') . '/as/applications/' . env('TTN_APP_NAME') . '/webhooks/' . env('TTN_APP_NAME') . '/devices/' . $device->hardware_id . '/down/push';
-
+ $guzzle = new Client;
+ $url = env('TTN_API_URL').'/as/applications/'.env('TTN_APP_NAME').'/webhooks/'.env('TTN_APP_NAME').'/devices/'.$device->hardware_id.'/down/push';
+
$response = $guzzle->request('POST', $url, [
'headers' => [
- 'Authorization' => 'Bearer ' . env('TTN_API_KEY'),
+ 'Authorization' => 'Bearer '.env('TTN_API_KEY'),
'Content-Type' => 'application/json',
- 'User-Agent' => 'beep-base-test'
+ 'User-Agent' => 'beep-base-test',
],
- 'json' => $downlink_data
+ 'json' => $downlink_data,
]);
if ($response->getStatusCode() == 202 || $response->getStatusCode() == 200) {
@@ -981,44 +956,47 @@ public function clocksync(Request $request)
'device_id' => $device->hardware_id,
'scheduled_time' => $cet_time->format('Y-m-d H:i:s'),
'timestamp' => $cet_timestamp,
- 'payload' => $payload_hex
+ 'payload' => $payload_hex,
], 200);
} else {
return Response::json([
'error' => 'Failed to schedule downlink',
- 'status_code' => $response->getStatusCode()
+ 'status_code' => $response->getStatusCode(),
], 500);
}
} catch (RequestException $e) {
$error_response = $e->hasResponse() ? json_decode($e->getResponse()->getBody(), true) : null;
Log::error('TTN downlink failed', [
'device_id' => $device->hardware_id,
- 'error' => $error_response ?: $e->getMessage()
+ 'error' => $error_response ?: $e->getMessage(),
]);
-
+
return Response::json([
'error' => 'Failed to send downlink to TTN',
- 'details' => $error_response ?: $e->getMessage()
+ 'details' => $error_response ?: $e->getMessage(),
], 500);
}
}
/**
- * api/devices/lora_reset POST
- * Send a LoRa reset command to a device
- * @authenticated
- * @bodyParam key string required DEV EUI of the device to reset
- * @response {
- * "status": "LoRa reset downlink scheduled",
- * "device_id": "0123450d3707d834ee",
- * "payload": "940D"
- * }
- */
+ * api/devices/lora_reset POST
+ * Send a LoRa reset command to a device
+ *
+ * @authenticated
+ *
+ * @bodyParam key string required DEV EUI of the device to reset
+ *
+ * @response {
+ * "status": "LoRa reset downlink scheduled",
+ * "device_id": "0123450d3707d834ee",
+ * "payload": "940D"
+ * }
+ */
public function lora_reset(Request $request)
{
// Validate the request
$validator = Validator::make($request->all(), [
- 'key' => 'required|string'
+ 'key' => 'required|string',
]);
if ($validator->fails()) {
@@ -1035,12 +1013,12 @@ public function lora_reset(Request $request)
$device = Auth::user()->allDevices()->where('key', $key)->first();
}
- if (!$device) {
+ if (! $device) {
return Response::json(['error' => 'Device not found or access denied'], 404);
}
// Check if device has hardware_id (required for TTN)
- if (!$device->hardware_id) {
+ if (! $device->hardware_id) {
return Response::json(['error' => 'Device has no hardware_id configured for TTN'], 422);
}
@@ -1053,23 +1031,23 @@ public function lora_reset(Request $request)
'downlinks' => [
[
'frm_payload' => $payload_base64,
- 'f_port' => 6
- ]
- ]
+ 'f_port' => 6,
+ ],
+ ],
];
// Send the downlink via TTN
try {
- $guzzle = new Client();
- $url = env('TTN_API_URL') . '/as/applications/' . env('TTN_APP_NAME') . '/webhooks/' . env('TTN_APP_NAME') . '/devices/' . $device->hardware_id . '/down/push';
-
+ $guzzle = new Client;
+ $url = env('TTN_API_URL').'/as/applications/'.env('TTN_APP_NAME').'/webhooks/'.env('TTN_APP_NAME').'/devices/'.$device->hardware_id.'/down/push';
+
$response = $guzzle->request('POST', $url, [
'headers' => [
- 'Authorization' => 'Bearer ' . env('TTN_API_KEY'),
+ 'Authorization' => 'Bearer '.env('TTN_API_KEY'),
'Content-Type' => 'application/json',
- 'User-Agent' => 'beep-base-test'
+ 'User-Agent' => 'beep-base-test',
],
- 'json' => $downlink_data
+ 'json' => $downlink_data,
]);
if ($response->getStatusCode() == 202 || $response->getStatusCode() == 200) {
@@ -1080,47 +1058,50 @@ public function lora_reset(Request $request)
return Response::json([
'status' => 'LoRa reset downlink scheduled',
'device_id' => $device->hardware_id,
- 'payload' => $payload_hex
+ 'payload' => $payload_hex,
], 200);
} else {
return Response::json([
'error' => 'Failed to schedule downlink',
- 'status_code' => $response->getStatusCode()
+ 'status_code' => $response->getStatusCode(),
], 500);
}
} catch (RequestException $e) {
$error_response = $e->hasResponse() ? json_decode($e->getResponse()->getBody(), true) : null;
Log::error('TTN downlink failed', [
'device_id' => $device->hardware_id,
- 'error' => $error_response ?: $e->getMessage()
+ 'error' => $error_response ?: $e->getMessage(),
]);
-
+
return Response::json([
'error' => 'Failed to send downlink to TTN',
- 'details' => $error_response ?: $e->getMessage()
+ 'details' => $error_response ?: $e->getMessage(),
], 500);
}
}
/**
- * api/devices/interval POST
- * Set the measurement interval for a device
- * @authenticated
- * @bodyParam key string required DEV EUI of the device
- * @bodyParam interval integer required Measurement interval in minutes (1-1440)
- * @response {
- * "status": "Interval downlink scheduled",
- * "device_id": "0123450d3707d834ee",
- * "interval_minutes": 15,
- * "payload": "9D010F"
- * }
- */
+ * api/devices/interval POST
+ * Set the measurement interval for a device
+ *
+ * @authenticated
+ *
+ * @bodyParam key string required DEV EUI of the device
+ * @bodyParam interval integer required Measurement interval in minutes (1-1440)
+ *
+ * @response {
+ * "status": "Interval downlink scheduled",
+ * "device_id": "0123450d3707d834ee",
+ * "interval_minutes": 15,
+ * "payload": "9D010F"
+ * }
+ */
public function interval(Request $request)
{
// Validate the request
$validator = Validator::make($request->all(), [
'key' => 'required|string',
- 'interval' => 'required|integer|min:1|max:1440'
+ 'interval' => 'required|integer|min:1|max:1440',
]);
if ($validator->fails()) {
@@ -1138,19 +1119,19 @@ public function interval(Request $request)
$device = Auth::user()->allDevices()->where('key', $key)->first();
}
- if (!$device) {
+ if (! $device) {
return Response::json(['error' => 'Device not found or access denied'], 404);
}
// Check if device has hardware_id (required for TTN)
- if (!$device->hardware_id) {
+ if (! $device->hardware_id) {
return Response::json(['error' => 'Device has no hardware_id configured for TTN'], 422);
}
// Create the payload for interval setting
// Convert interval to hex (2 bytes, big endian)
$interval_hex = str_pad(dechex($interval), 4, '0', STR_PAD_LEFT);
- $payload_hex = '9D01' . $interval_hex;
+ $payload_hex = '9D01'.$interval_hex;
$payload_base64 = base64_encode(hex2bin($payload_hex));
// Prepare the downlink data
@@ -1158,23 +1139,23 @@ public function interval(Request $request)
'downlinks' => [
[
'frm_payload' => $payload_base64,
- 'f_port' => 6
- ]
- ]
+ 'f_port' => 6,
+ ],
+ ],
];
// Send the downlink via TTN
try {
- $guzzle = new Client();
- $url = env('TTN_API_URL') . '/as/applications/' . env('TTN_APP_NAME') . '/webhooks/' . env('TTN_APP_NAME') . '/devices/' . $device->hardware_id . '/down/push';
-
+ $guzzle = new Client;
+ $url = env('TTN_API_URL').'/as/applications/'.env('TTN_APP_NAME').'/webhooks/'.env('TTN_APP_NAME').'/devices/'.$device->hardware_id.'/down/push';
+
$response = $guzzle->request('POST', $url, [
'headers' => [
- 'Authorization' => 'Bearer ' . env('TTN_API_KEY'),
+ 'Authorization' => 'Bearer '.env('TTN_API_KEY'),
'Content-Type' => 'application/json',
- 'User-Agent' => 'beep-base-test'
+ 'User-Agent' => 'beep-base-test',
],
- 'json' => $downlink_data
+ 'json' => $downlink_data,
]);
if ($response->getStatusCode() == 202 || $response->getStatusCode() == 200) {
@@ -1186,25 +1167,25 @@ public function interval(Request $request)
'status' => 'Interval downlink scheduled',
'device_id' => $device->hardware_id,
'interval_minutes' => $interval,
- 'payload' => $payload_hex
+ 'payload' => $payload_hex,
], 200);
} else {
return Response::json([
'error' => 'Failed to schedule downlink',
- 'status_code' => $response->getStatusCode()
+ 'status_code' => $response->getStatusCode(),
], 500);
}
} catch (RequestException $e) {
$error_response = $e->hasResponse() ? json_decode($e->getResponse()->getBody(), true) : null;
Log::error('TTN downlink failed', [
'device_id' => $device->hardware_id,
- 'error' => $error_response ?: $e->getMessage()
+ 'error' => $error_response ?: $e->getMessage(),
]);
-
+
return Response::json([
'error' => 'Failed to send downlink to TTN',
- 'details' => $error_response ?: $e->getMessage()
+ 'details' => $error_response ?: $e->getMessage(),
], 500);
}
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/Api/ExportController.php b/app/Http/Controllers/Api/ExportController.php
index a760915e..fcc98fd3 100644
--- a/app/Http/Controllers/Api/ExportController.php
+++ b/app/Http/Controllers/Api/ExportController.php
@@ -2,67 +2,64 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
-use Illuminate\Support\Str;
-use Illuminate\Support\Facades\Log;
-use App\Http\Controllers\Controller;
-use Response;
-use Storage;
-use Mail;
-use Cache;
use App\Device;
-use App\Setting;
use App\Hive;
-use App\User;
-use App\Category;
+use App\Http\Controllers\Controller;
use App\Inspection;
-use App\InspectionItem;
-use App\Measurement;
-use App\Models\FlashLog;
use App\Mail\DataExport;
-use App\Exports\HiveExport;
+use App\Measurement;
+use App\User;
+use Cache;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Str;
+use Mail;
use Moment\Moment;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
-
+use Response;
+use Storage;
use Validator;
/**
* @group Api\ExportController
* Export all data to an Excel file by email (GDPR)
+ *
* @authenticated
*/
class ExportController extends Controller
{
- protected $valid_sensors = [];
+ protected $valid_sensors = [];
+
protected $output_sensors = [];
+
protected $output_weather = [];
public function __construct()
{
- $this->valid_sensors = Measurement::getValidMeasurements();
+ $this->valid_sensors = Measurement::getValidMeasurements();
$this->output_sensors = Measurement::getValidMeasurements(true);
$this->output_weather = Measurement::getValidMeasurements(true, true);
- $this->client = new \Influx;
- //die(print_r($this->valid_sensors));
+ $this->client = new \Influx;
+ // die(print_r($this->valid_sensors));
}
private function cacheRequestRate($name)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count');
- else
+ } else {
Cache::put($name.'-count', 1);
+ }
}
-
/**
api/export GET
Generate an Excel file with all user data and send by e-mail or as download link
@@ -70,208 +67,206 @@ private function cacheRequestRate($name)
@bodyParam groupdata boolean 1: also include group data in export. 0, of not filled: only export my own data. Default: 0. Example: 0
@bodyParam sensordata boolean 1: also include measurement data in export. 0, of not filled: do not add measurement data. Default: set in environment settings. Example: 0
@bodyParam link boolean 1: Save the export to a file and provide the link, 0, or not filled means: send the Excel as an attachment to an email to the user's email address. Default: 0. Example: 1
- **/
+ **/
public function all(Request $request)
{
- $fileName = strtolower(env('APP_NAME')).'-export-user-'.$request->user()->id;
- $user = $request->user();
+ $fileName = strtolower(env('APP_NAME')).'-export-user-'.$request->user()->id;
+ $user = $request->user();
- $sensor_urls = [];
+ $sensor_urls = [];
$download_url = null;
- $download = true;
- $sensordata = boolval($request->input('sensordata', env('EXPORT_INFLUX_SENSORDATA', false)));
- $group_data = boolval($request->input('groupdata', false)); // include group data
- $return_link = boolval($request->input('link', false));
+ $download = true;
+ $sensordata = boolval($request->input('sensordata', env('EXPORT_INFLUX_SENSORDATA', false)));
+ $group_data = boolval($request->input('groupdata', false)); // include group data
+ $return_link = boolval($request->input('link', false));
- $date_start = $user->created_at;
- $date_until = date('Y-m-d H:i:s');
+ $date_start = $user->created_at;
+ $date_until = date('Y-m-d H:i:s');
$date_user_created = $date_start;
- $date_until_today = $date_until;
+ $date_until_today = $date_until;
// Fill dates array
- $assets = ["users"=>0, "apiaries"=>0, "hives"=>0, "inspections"=>0, "devices"=>0, "measurements"=>0, "weather"=>0, "flashlogs"=>0];
+ $assets = ['users' => 0, 'apiaries' => 0, 'hives' => 0, 'inspections' => 0, 'devices' => 0, 'measurements' => 0, 'weather' => 0, 'flashlogs' => 0];
$spreadsheet_array = [];
- if ($download)
- {
+ if ($download) {
// Fill export array
-
+
// Define header rows of tabs
$spreadsheet_array[__('export.users')] = [
- [__('export.name'),
- __('export.email'),
- __('export.avatar'),
- __('export.created_at'),
- __('export.updated_at'),
- __('export.last_login')]
- ];
+ [__('export.name'),
+ __('export.email'),
+ __('export.avatar'),
+ __('export.created_at'),
+ __('export.updated_at'),
+ __('export.last_login')],
+ ];
// add user data to sheet data arrays
- //foreach ($users as $user)
- $spreadsheet_array[__('export.users')][] = $this->getUser($user);
-
+ // foreach ($users as $user)
+ $spreadsheet_array[__('export.users')][] = $this->getUser($user);
$spreadsheet_array[__('export.locations')] = [
- ['Location_id',
- __('export.owner'),
- __('export.name'),
- __('export.type'),
- __('export.hives'),
- __('export.coordinate_lat'),
- __('export.coordinate_lon'),
- __('export.address'),
- __('export.postal_code'),
- __('export.city'),
- __('export.country_code'),
- __('export.continent'),
- __('export.created_at'),
- __('export.deleted_at')]
- ];
+ ['Location_id',
+ __('export.owner'),
+ __('export.name'),
+ __('export.type'),
+ __('export.hives'),
+ __('export.coordinate_lat'),
+ __('export.coordinate_lon'),
+ __('export.address'),
+ __('export.postal_code'),
+ __('export.city'),
+ __('export.country_code'),
+ __('export.continent'),
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
$spreadsheet_array[__('export.hives')] = [
- ['Hive_id',
- __('export.owner'),
- __('export.name'),
- __('export.type'),
- 'Location_id',
- __('export.color'),
- __('export.queen'),
- __('export.queen_color'),
- __('export.queen_born'),
- __('export.queen_fertilized'),
- __('export.queen_clipped'),
- __('export.brood_layers'),
- __('export.honey_layers'),
- __('export.frames'),
- __('export.created_at'),
- __('export.deleted_at')]
- ];
+ ['Hive_id',
+ __('export.owner'),
+ __('export.name'),
+ __('export.type'),
+ 'Location_id',
+ __('export.color'),
+ __('export.queen'),
+ __('export.queen_color'),
+ __('export.queen_born'),
+ __('export.queen_fertilized'),
+ __('export.queen_clipped'),
+ __('export.brood_layers'),
+ __('export.honey_layers'),
+ __('export.frames'),
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
$spreadsheet_array[__('export.inspections')] = [
- ['Inspection_id',
- __('export.owner'),
- __('export.created_at'),
- 'Hive_id',
- __('export.hive_name'),
- 'Location_id',
- __('export.impression'),
- __('export.attention'),
- __('export.reminder'),
- __('export.reminder_date'),
- __('export.notes')]
- ];
+ ['Inspection_id',
+ __('export.owner'),
+ __('export.created_at'),
+ 'Hive_id',
+ __('export.hive_name'),
+ 'Location_id',
+ __('export.impression'),
+ __('export.attention'),
+ __('export.reminder'),
+ __('export.reminder_date'),
+ __('export.notes')],
+ ];
$spreadsheet_array[__('export.devices')] = [
- ['Device_id',
- __('export.owner'),
- __('export.name'),
- 'Hive_id',
- 'Location_id',
- 'Type',
- 'last_message_received',
- 'hardware_id',
- 'firmware_version',
- 'hardware_version',
- 'boot_count',
- 'measurement_interval_min',
- 'measurement_transmission_ratio',
- 'ble_pin',
- 'battery_voltage',
- 'next_downlink_message',
- 'last_downlink_result',
- __('export.created_at'),
- __('export.deleted_at')]
- ];
-
- if ($sensordata)
+ ['Device_id',
+ __('export.owner'),
+ __('export.name'),
+ 'Hive_id',
+ 'Location_id',
+ 'Type',
+ 'last_message_received',
+ 'hardware_id',
+ 'firmware_version',
+ 'hardware_version',
+ 'boot_count',
+ 'measurement_interval_min',
+ 'measurement_transmission_ratio',
+ 'ble_pin',
+ 'battery_voltage',
+ 'next_downlink_message',
+ 'last_downlink_result',
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
+
+ if ($sensordata) {
$spreadsheet_array['Sensor data'] = [
- ['Device_id',
- 'Date from',
- 'Date to',
- 'Data file']
- ];
+ ['Device_id',
+ 'Date from',
+ 'Date to',
+ 'Data file'],
+ ];
+ }
- if ($sensordata)
+ if ($sensordata) {
$spreadsheet_array['Device Flashlogs'] = [
- ['Device_id',
- 'Hive_id',
- 'Number of messages in file',
- 'Log saved to disk',
- 'Log parsed correctly',
- 'Log has timestamps',
- 'Bytes received',
- 'Raw log file',
- 'Stripped log file',
- 'Parsed log file',
- __('export.created_at'),
- __('export.deleted_at')]
- ];
-
- if ($sensordata)
+ ['Device_id',
+ 'Hive_id',
+ 'Number of messages in file',
+ 'Log saved to disk',
+ 'Log parsed correctly',
+ 'Log has timestamps',
+ 'Bytes received',
+ 'Raw log file',
+ 'Stripped log file',
+ 'Parsed log file',
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
+ }
+
+ if ($sensordata) {
$spreadsheet_array['Weather data'] = [
- ['Device_id',
- 'Date from',
- 'Date to',
- 'Data file']
- ];
+ ['Device_id',
+ 'Date from',
+ 'Date to',
+ 'Data file'],
+ ];
+ }
// Add item names to header row of inspections
// first combine all user's itemnames
- $item_ancs = [];
+ $item_ancs = [];
$item_names = [];
$u_inspections = $group_data ? $user->allInspections()->get() : $user->inspections()->get();
$ins = Inspection::item_names($u_inspections);
- foreach ($ins as $in)
- {
+ foreach ($ins as $in) {
$name = $in['anc'].$in['name'];
- if (!in_array($name, $item_ancs))
- {
- $item_ancs[] = $name;
- $item_names[] = $in;
+ if (! in_array($name, $item_ancs)) {
+ $item_ancs[] = $name;
+ $item_names[] = $in;
}
}
- foreach ($item_ancs as $name)
+ foreach ($item_ancs as $name) {
$spreadsheet_array[__('export.inspections')][0][] = $name;
+ }
$spreadsheet_array[__('export.inspections')][0][] = __('export.deleted_at');
-
// Fill dates array with counts of data, and select the data for each user by consent
- $u = $user;
+ $u = $user;
$user_id = $u->id;
-
+
// add user data
- $u_apiaries = $group_data ? $user->allLocations() : $user->locations();
- $user_apiaries = $u_apiaries->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $u_apiaries = $group_data ? $user->allLocations() : $user->locations();
+ $user_apiaries = $u_apiaries->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- $u_hives = $group_data ? $user->allHives() : $user->hives();
- $user_hives = $u_hives->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $u_hives = $group_data ? $user->allHives() : $user->hives();
+ $user_hives = $u_hives->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- $u_devices = $group_data ? $user->allDevices() : $user->devices();
- $user_devices = $u_devices->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $u_devices = $group_data ? $user->allDevices() : $user->devices();
+ $user_devices = $u_devices->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- $u_flashlogs = $group_data ? $user->allFlashlogs() : $user->flashlogs();
- $user_flashlogs = $u_flashlogs->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $u_flashlogs = $group_data ? $user->allFlashlogs() : $user->flashlogs();
+ $user_flashlogs = $u_flashlogs->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
$user_measurements = [];
$user_weather_data = [];
-
+
// add hive inspections (also from collaborators)
$hive_inspection_ids = [];
- foreach ($user_hives as $hive)
- {
+ foreach ($user_hives as $hive) {
$hive_inspections = $hive->inspections()->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->get();
- foreach ($hive_inspections as $ins)
+ foreach ($hive_inspections as $ins) {
$hive_inspection_ids[] = $ins->id;
-
- }
- $hive_inspections = Inspection::whereIn('id', $hive_inspection_ids)->with('items')->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ }
- //die(print_r([$date_until, $hive_inspections->toArray(), $user_hives->toArray()]));
+ }
+ $hive_inspections = Inspection::whereIn('id', $hive_inspection_ids)->with('items')->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ // die(print_r([$date_until, $hive_inspections->toArray(), $user_hives->toArray()]));
// PGe 2026-02-13: Why is this in the export? $user_measurements and $user_weather_data do not seem to be used...
@@ -284,14 +279,14 @@ public function all(Request $request)
// $user_dloc_coords = [];
// // Add sensor data
- // foreach ($user_devices as $device)
+ // foreach ($user_devices as $device)
// {
// $user_device_keys[]= $device->influxWhereKeys();
// $loc = $device->location();
- // if ($loc && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
+ // if ($loc && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
// $user_dloc_coords[] = '("lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\')';
// }
-
+
// $keys_count = count($user_device_keys);
// $user_device_keys = '('.implode(' OR ', $user_device_keys).')';
// Log::info("export all Influx bv count data $keys_count keys from $date_user_created to $date_until_today");
@@ -306,7 +301,7 @@ public function all(Request $request)
// }
// if (count($points) > 0)
// {
- // foreach ($points as $point)
+ // foreach ($points as $point)
// $user_measurements[substr($point['time'],0,10)] = $point['count'];
// }
@@ -323,62 +318,56 @@ public function all(Request $request)
// }
// if (count($weather) > 0)
// {
- // foreach ($weather as $point)
+ // foreach ($weather as $point)
// $user_weather_data[substr($point['time'],0,10)] = $point['count'];
// }
// }
// }
-
-
// Fill objects for consent period
$locas = $this->getLocations($user_id, $user_apiaries, $date_user_created, $date_until_today);
- foreach ($locas as $loca)
+ foreach ($locas as $loca) {
$spreadsheet_array[__('export.locations')][] = $loca;
+ }
$hives = $this->getHives($user_id, $user_hives, $date_user_created, $date_until_today);
- foreach ($hives as $hive)
+ foreach ($hives as $hive) {
$spreadsheet_array[__('export.hives')][] = $hive;
+ }
$insps = $this->getInspections($user_id, $hive_inspections, $item_ancs, $date_user_created, $date_until_today);
- foreach ($insps as $insp)
+ foreach ($insps as $insp) {
$spreadsheet_array[__('export.inspections')][] = $insp;
+ }
+ if ($sensordata && $user_devices->count() > 0) {
- if ($sensordata && $user_devices->count() > 0)
- {
-
$flash = $this->getFlashlogs($user_id, $user_flashlogs, $date_user_created, $date_until_today);
- foreach ($flash as $fla)
+ foreach ($flash as $fla) {
$spreadsheet_array['Device Flashlogs'][] = $fla;
-
-
- foreach ($user_devices as $device)
- {
+ }
+
+ foreach ($user_devices as $device) {
// Add device to spreadsheet
- if ($device->created_at < $date_until_today)
- {
+ if ($device->created_at < $date_until_today) {
$spreadsheet_array[__('export.devices')][] = $this->getDevice($user_id, $device);
-
+
// Export data to file per device / period
- $where = $device->influxWhereKeys().' AND time >= \''.$date_user_created.'\' AND time <= \''.$date_until_today.'\'';
- $dataName = strtolower(env('APP_NAME')).'-export-device-id-'.$device->id.'-sensor-data-'.substr($date_user_created,0,10).'-'.substr($date_until_today,0,10).'-'.Str::random(10).'.csv';
+ $where = $device->influxWhereKeys().' AND time >= \''.$date_user_created.'\' AND time <= \''.$date_until_today.'\'';
+ $dataName = strtolower(env('APP_NAME')).'-export-device-id-'.$device->id.'-sensor-data-'.substr($date_user_created, 0, 10).'-'.substr($date_until_today, 0, 10).'-'.Str::random(10).'.csv';
$filePath = $this->exportCsvFromInflux($where, $dataName, '*', 'sensors');
- if ($filePath)
- {
+ if ($filePath) {
$spreadsheet_array['Sensor data'][] = [$device->id, $date_user_created, $date_until_today, $filePath];
$sensor_urls[$dataName] = $filePath;
}
// Export data to file per device location / period
$loc = $device->location();
- if ($loc && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
- {
- $where = '"lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\' AND time >= \''.$date_user_created.'\' AND time <= \''.$date_until_today.'\'';
- $dataName = strtolower(env('APP_NAME')).'-export-device-id-'.$device->id.'-weather-data-'.substr($date_user_created,0,10).'-'.substr($date_until_today,0,10).'-'.Str::random(10).'.csv';
+ if ($loc && isset($loc->coordinate_lat) && isset($loc->coordinate_lon)) {
+ $where = '"lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\' AND time >= \''.$date_user_created.'\' AND time <= \''.$date_until_today.'\'';
+ $dataName = strtolower(env('APP_NAME')).'-export-device-id-'.$device->id.'-weather-data-'.substr($date_user_created, 0, 10).'-'.substr($date_until_today, 0, 10).'-'.Str::random(10).'.csv';
$filePath = $this->exportCsvFromInflux($where, $dataName, '*', 'weather');
- if ($filePath)
- {
+ if ($filePath) {
$spreadsheet_array['Weather data'][] = [$device->id, $date_user_created, $date_until_today, $filePath];
$sensor_urls[$dataName] = $filePath;
}
@@ -392,33 +381,28 @@ public function all(Request $request)
}
// send e-mail with attachment
- if ($export_result && isset($export_result['path']))
- {
- //$path = $file->storagePath.'/'.$fileName.'.'.$fileType;
+ if ($export_result && isset($export_result['path'])) {
+ // $path = $file->storagePath.'/'.$fileName.'.'.$fileType;
$path = $export_result['path'];
$link = $export_result['url'];
$disk = env('EXPORT_STORAGE', 'public');
-
- if ($return_link === false)
- {
+
+ if ($return_link === false) {
Mail::to($user->email)->send(new DataExport($user, $disk, $path));
$del = Storage::disk($disk)->delete($path);
- return response()->json(['link'=>null, 'del'=>$del, 'delf'=>$path, 'email'=>1],200);
- }
- else
- {
- return response()->json(['link'=>$link, 'email'=>0],200);
+
+ return response()->json(['link' => null, 'del' => $del, 'delf' => $path, 'email' => 1], 200);
+ } else {
+ return response()->json(['link' => $link, 'email' => 0], 200);
}
- }
- else
- {
- return response()->json(['error'=>'export-error'],404);
+ } else {
+ return response()->json(['error' => 'export-error'], 404);
}
}
- private function export($spreadsheetArray, $fileName='export', $date_start='Account created', $date_until='Today', $group_data=false)
+ private function export($spreadsheetArray, $fileName = 'export', $date_start = 'Account created', $date_until = 'Today', $group_data = false)
{
- $spreadsheet = new Spreadsheet();
+ $spreadsheet = new Spreadsheet;
$sheet = $spreadsheet->getActiveSheet();
$title = 'BEEP account data export';
$group = $group_data ? __('export.incl_group') : '';
@@ -436,27 +420,25 @@ private function export($spreadsheetArray, $fileName='export', $date_start='Acco
$sheet->setCellValue('C6', count($spreadsheetArray));
$row = 8;
- foreach ($spreadsheetArray as $title => $data)
- {
+ foreach ($spreadsheetArray as $title => $data) {
$row_title = $row > 8 ? $title.$group : $title;
$sheet->setCellValue('A'.$row, $row_title);
- $sheet->setCellValue('C'.$row, count($data)-1);
+ $sheet->setCellValue('C'.$row, count($data) - 1);
$row++;
}
-
+
// Fill sheet with tabs and data
- foreach ($spreadsheetArray as $title => $data)
- {
+ foreach ($spreadsheetArray as $title => $data) {
$sheet = $spreadsheet->createSheet();
$sheet->setTitle($title);
$sheet->fromArray($data);
}
-
+
// save sheet
$fileName = $fileName.'-'.Str::random(20);
$filePath = 'exports/'.$fileName.'.xlsx';
$writer = new Xlsx($spreadsheet);
- //$writer->setOffice2003Compatibility(true);
+ // $writer->setOffice2003Compatibility(true);
ob_start();
$writer->save('php://output');
@@ -464,13 +446,13 @@ private function export($spreadsheetArray, $fileName='export', $date_start='Acco
ob_end_clean();
$disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']))
- return ['url'=>Storage::disk($disk)->url($filePath), 'path'=>$filePath];
+ if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])) {
+ return ['url' => Storage::disk($disk)->url($filePath), 'path' => $filePath];
+ }
return null;
}
-
private function getUser(User $user)
{
return [
@@ -479,14 +461,13 @@ private function getUser(User $user)
$user->avatar,
$user->created_at,
$user->updated_at,
- $user->last_login
+ $user->last_login,
];
}
- private function getLocations($user_id, $locations, $date_start=null, $date_until=null)
+ private function getLocations($user_id, $locations, $date_start = null, $date_until = null)
{
- return $locations->where('created_at', '<=', $date_until)->sortBy('name')->map(function($item) use ($user_id)
- {
+ return $locations->where('created_at', '<=', $date_until)->sortBy('name')->map(function ($item) {
return [
$item->id,
$item->owner,
@@ -505,15 +486,14 @@ private function getLocations($user_id, $locations, $date_start=null, $date_unti
];
});
}
-
- private function getHives($user_id, $hives, $date_start=null, $date_until=null)
+
+ private function getHives($user_id, $hives, $date_start = null, $date_until = null)
{
- return $hives->where('created_at', '<=', $date_until)->sortBy('name')->map(function($item) use ($user_id)
- {
+ return $hives->where('created_at', '<=', $date_until)->sortBy('name')->map(function ($item) {
$queen = $item->queen;
return [
- $item->id,
+ $item->id,
$item->owner,
$item->name,
$item->type,
@@ -536,9 +516,9 @@ private function getHives($user_id, $hives, $date_start=null, $date_until=null)
private function getDevice($user_id, $item)
{
return [
- $item->id,
+ $item->id,
$item->owner,
- $item->name,
+ $item->name,
$item->hive_id,
$item->location_id,
$item->getTypeAttribute(),
@@ -554,16 +534,15 @@ private function getDevice($user_id, $item)
$item->next_downlink_message,
$item->last_downlink_result,
$item->created_at,
- $item->deleted_at
+ $item->deleted_at,
];
}
- private function getFlashlogs($user_id, $flashlogs, $date_start=null, $date_until=null)
+ private function getFlashlogs($user_id, $flashlogs, $date_start = null, $date_until = null)
{
- return $flashlogs->where('created_at', '<=', $date_until)->sortBy('name')->map(function($item) use ($user_id)
- {
+ return $flashlogs->where('created_at', '<=', $date_until)->sortBy('name')->map(function ($item) {
return [
- $item->device_id,
+ $item->device_id,
$item->hive_id,
$item->log_messages,
$item->log_saved,
@@ -579,46 +558,41 @@ private function getFlashlogs($user_id, $flashlogs, $date_start=null, $date_unti
});
}
- private function getInspections($user_id, $inspections, $item_names, $date_start=null, $date_until=null)
+ private function getInspections($user_id, $inspections, $item_names, $date_start = null, $date_until = null)
{
// array of inspection items and data
$inspection_data = array_fill_keys($item_names, '');
$inspections = $inspections->where('created_at', '>=', $date_start)->where('created_at', '<=', $date_until)->sortByDesc('created_at');
-
- $table = $inspections->map(function($inspection) use ($inspection_data, $user_id)
- {
- if (isset($inspection->items))
- {
- foreach ($inspection->items as $inspectionItem)
- {
- $array_key = $inspectionItem->anc.$inspectionItem->name;
+ $table = $inspections->map(function ($inspection) use ($inspection_data) {
+ if (isset($inspection->items)) {
+ foreach ($inspection->items as $inspectionItem) {
+ $array_key = $inspectionItem->anc.$inspectionItem->name;
$inspection_data[$array_key] = $inspectionItem->humanReadableValue();
}
}
$locationId = ($inspection->locations()->count() > 0 ? $inspection->locations()->first()->id : ($inspection->hives()->count() > 0 ? $inspection->hives()->first()->location_id : ''));
-
- $reminder_date= '';
- if (isset($inspection->reminder_date) && $inspection->reminder_date != null)
- {
- $reminder_mom = new Moment($inspection->reminder_date);
+
+ $reminder_date = '';
+ if (isset($inspection->reminder_date) && $inspection->reminder_date != null) {
+ $reminder_mom = new Moment($inspection->reminder_date);
$reminder_date = $reminder_mom->format('Y-m-d H:i:s');
}
- $smileys = __('taxonomy.smileys_3');
- $boolean = __('taxonomy.boolean');
-
+ $smileys = __('taxonomy.smileys_3');
+ $boolean = __('taxonomy.boolean');
+
// add general inspection data columns
$pre = [
'inspection_id' => $inspection->id,
__('export.owner') => $inspection->owner,
__('export.created_at') => $inspection->created_at,
- __('export.hive') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->id : '',
- __('export.hive_name') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->name : '',
- __('export.location') => $locationId,
- __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
- __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
+ __('export.hive') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->id : '',
+ __('export.hive_name') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->name : '',
+ __('export.location') => $locationId,
+ __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
+ __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
__('export.reminder') => $inspection->reminder,
__('export.reminder_date') => $reminder_date,
__('export.notes') => $inspection->notes,
@@ -628,93 +602,93 @@ private function getInspections($user_id, $inspections, $item_names, $date_start
return array_values($dat);
});
- //die(print_r($table));
+
+ // die(print_r($table));
return $table;
}
-
- private function exportCsvFromInflux($where, $fileName='device-export-', $measurements='*', $database='sensors', $separator=',')
+ private function exportCsvFromInflux($where, $fileName = 'device-export-', $measurements = '*', $database = 'sensors', $separator = ',')
{
- $options= ['precision'=>'rfc3339', 'format'=>'csv'];
+ $options = ['precision' => 'rfc3339', 'format' => 'csv'];
$groupByTime = env('EXPORT_INFLUX_GROUPBY_TIME', '6h');
- $groupBy= 'GROUP BY time('.$groupByTime.') fill(none)';
+ $groupBy = 'GROUP BY time('.$groupByTime.') fill(none)';
- if ($database == 'sensors')
- {
- if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0)
+ if ($database == 'sensors') {
+ if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0) {
$names = $measurements;
- else
+ } else {
$names = $this->output_sensors;
-
+ }
+
$queryList = Device::getAvailableSensorNamesNoCache($names, $where, $database);
- if (count($queryList) == 0)
+ if (count($queryList) == 0) {
$queryList = $names;
-
- foreach ($queryList as $i => $name)
+ }
+
+ foreach ($queryList as $i => $name) {
$queryList[$i] = 'MEAN("'.$name.'") AS "'.$name.'"';
+ }
$groupBySelect = implode(', ', $queryList);
$query = 'SELECT '.$groupBySelect.' FROM "'.$database.'" WHERE '.$where.' '.$groupBy;
- }
- else // i.e. weather data
- {
- if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0)
+ } else { // i.e. weather data
+ if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0) {
$names = $measurements;
- else
+ } else {
$names = $this->output_weather;
+ }
- foreach ($names as $i => $name)
+ foreach ($names as $i => $name) {
$names[$i] = 'MEAN("'.$name.'") AS "'.$name.'"';
+ }
$groupBySelectWeather = implode(', ', $names);
$query = 'SELECT '.$groupBySelectWeather.' FROM "'.$database.'" WHERE '.$where.' '.$groupBy;
}
-
- try{
- $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
+
+ try {
+ $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
} catch (InfluxDB\Exception $e) {
return null;
}
- if (count($data) == 0)
+ if (count($data) == 0) {
return null;
+ }
$csv_file = $data;
- //format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
- $csv_file = "";
+ // format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
+ $csv_file = '';
$csv_sens = array_keys($data[0]);
$csv_head = [];
- foreach ($csv_sens as $sensor_name)
- {
- $meas = Measurement::where('abbreviation', $sensor_name)->first();
+ foreach ($csv_sens as $sensor_name) {
+ $meas = Measurement::where('abbreviation', $sensor_name)->first();
$csv_head[] = $meas ? $meas->pq_name_unit().' ('.$sensor_name.')' : $sensor_name;
}
$csv_head = '"'.implode('"'.$separator.'"', $csv_head).'"'."\r\n";
// format CSV file body
$csv_body = [];
- foreach ($data as $sensor_values)
- {
+ foreach ($data as $sensor_values) {
$csv_body[] = implode($separator, $sensor_values);
}
$csv_file = $csv_head.implode("\r\n", $csv_body);
// return the CSV file content in a file on disk
$filePath = 'exports/'.$fileName;
- $disk = env('EXPORT_STORAGE', 'public');
+ $disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv']))
+ if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv'])) {
return Storage::disk($disk)->url($filePath);
+ }
return null;
}
-
-
/**
api/export/csv POST
Generate a CSV measurement data export from InfluxDB. Make sure not to load a too large timespan (i.e. > 30 days), because the call will not succeed due to memory overload.
@@ -725,68 +699,73 @@ private function exportCsvFromInflux($where, $fileName='device-export-', $measur
@bodyParam separator string Symbol that should be used to separate columns in CSV file. Example: ;
@bodyParam measurements string Comma separated list of measurement types to load. If you want a lot of data (i.e. > 30 days), make sure not to load more than one measurement. Example: 'am2315_t,am2315_h,mhz_co2'
@bodyParam link boolean filled means: save the export to a file and provide the link, not filled means: output a text/html header with text containing the .csv content. Example:
- **/
+ **/
public function generate_csv(Request $request)
{
$validator = Validator::make($request->all(), [
'device_id' => 'required|exists:sensors,id',
- 'start' => 'required|date',
- 'end' => 'required|date',
+ 'start' => 'required|date',
+ 'end' => 'required|date',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
-
- $device_id = $request->input('device_id');
- $start = $request->input('start');
- $end = $request->input('end');
- $separator = $request->input('separator', ';');
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
+
+ $device_id = $request->input('device_id');
+ $start = $request->input('start');
+ $end = $request->input('end');
+ $separator = $request->input('separator', ';');
$measurements = $request->input('measurements', '*');
- $return_link = boolval($request->input('link', false));
- $device = $request->user()->allDevices()->find($device_id);
+ $return_link = boolval($request->input('link', false));
+ $device = $request->user()->allDevices()->find($device_id);
- if ($device == null)
+ if ($device == null) {
return Response::json('invalid-user-device', 500);
+ }
+
+ $options = ['precision' => 'rfc3339', 'format' => 'csv'];
- $options= ['precision'=>'rfc3339', 'format'=>'csv'];
-
- if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0)
+ if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0) {
$names = $measurements;
- else
+ } else {
$names = $this->output_sensors;
-
+ }
+
$whereDeviceTime = $device->influxWhereKeys().' AND time >= \''.$start.'\' AND time < \''.$end.'\'';
- $queryList = Device::getAvailableSensorNamesNoCache($names, $whereDeviceTime); // ($names, $table, $where, $limit='', $output_sensors_only=true)
+ $queryList = Device::getAvailableSensorNamesNoCache($names, $whereDeviceTime); // ($names, $table, $where, $limit='', $output_sensors_only=true)
- if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0)
- $groupBySelect = implode(', ', $queryList);
- else
- $groupBySelect = '"'.implode('","',$names).'"';
+ if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0) {
+ $groupBySelect = implode(', ', $queryList);
+ } else {
+ $groupBySelect = '"'.implode('","', $names).'"';
+ }
$query = 'SELECT '.$groupBySelect.' FROM "sensors" WHERE '.$whereDeviceTime;
-
- try{
+
+ try {
$this->cacheRequestRate('influx-get');
$this->cacheRequestRate('influx-csv');
- $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
+ $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
} catch (InfluxDB\Exception $e) {
return Response::json('influx-query-error: '.$query, 500);
}
- if (count($data) == 0)
+ if (count($data) == 0) {
return Response::json('influx-query-empty', 500);
+ }
// format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
- $csv_file = "";
+ $csv_file = '';
$csv_sens = array_keys($data[0]);
$csv_head = [];
- foreach ($csv_sens as $sensor_name)
- {
- $meas = Measurement::where('abbreviation', $sensor_name)->first();
- $col_head = $meas ? $meas->pq_name_unit() : $sensor_name;
- if (in_array($col_head, $csv_head) && $col_head != $sensor_name) // two similar heads, so add $sensor_name
+ foreach ($csv_sens as $sensor_name) {
+ $meas = Measurement::where('abbreviation', $sensor_name)->first();
+ $col_head = $meas ? $meas->pq_name_unit() : $sensor_name;
+ if (in_array($col_head, $csv_head) && $col_head != $sensor_name) { // two similar heads, so add $sensor_name
$col_head .= ' - '.$sensor_name;
+ }
$csv_head[] = $col_head;
}
@@ -794,25 +773,23 @@ public function generate_csv(Request $request)
// format CSV file body
$csv_body = [];
- foreach ($data as $sensor_values)
- {
+ foreach ($data as $sensor_values) {
$csv_body[] = implode($separator, $sensor_values);
}
$csv_file = $csv_head.implode("\r\n", $csv_body);
- if ($return_link)
- {
+ if ($return_link) {
// return the CSV file content in a file on disk
- $disk = env('EXPORT_STORAGE', 'public');
+ $disk = env('EXPORT_STORAGE', 'public');
$filePath = 'exports/beep-export-user-'.$request->user()->id.'-device-'.$device->name.'-'.$start.'-'.$end.'-'.Str::random(20).'.csv';
$filePath = str_replace(' ', '', $filePath);
- if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv']))
- return Response::json(['link'=>Storage::disk($disk)->url($filePath)]);
- else
- return Response::json(['message'=>'export_not_saved'], 500);
+ if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv'])) {
+ return Response::json(['link' => Storage::disk($disk)->url($filePath)]);
+ } else {
+ return Response::json(['message' => 'export_not_saved'], 500);
+ }
}
return response($csv_file)->header('Content-Type', 'text/html; charset=UTF-8');
}
-
}
diff --git a/app/Http/Controllers/Api/FlashLogController.php b/app/Http/Controllers/Api/FlashLogController.php
index 753574d4..faafba85 100644
--- a/app/Http/Controllers/Api/FlashLogController.php
+++ b/app/Http/Controllers/Api/FlashLogController.php
@@ -2,86 +2,83 @@
namespace App\Http\Controllers\Api;
-use App\Measurement;
use App\Device;
+use App\Http\Controllers\Controller;
+use App\Measurement;
use App\Models\FlashLog;
+use Auth;
+use Cache;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
-use App\Http\Controllers\Controller;
-use Moment\Moment;
-use Storage;
-use Cache;
-use Auth;
-use Str;
/**
* @group Api\FlashLogController
+ *
* @authenticated
*/
class FlashLogController extends Controller
{
-
- protected $precision = 's';
- protected $timeFormat = 'Y-m-d H:i:s';
- protected $maxDataPoints = 5000;
+ protected $precision = 's';
+
+ protected $timeFormat = 'Y-m-d H:i:s';
+
+ protected $maxDataPoints = 5000;
public function __construct()
{
- $this->client = new \Influx;
- $this->valid_sensors = Measurement::getValidMeasurements();
+ $this->client = new \Influx;
+ $this->valid_sensors = Measurement::getValidMeasurements();
}
- private function cacheRequestRate($name, $amount=1)
+ private function cacheRequestRate($name, $amount = 1)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count', $amount);
- else
+ } else {
Cache::put($name.'-count', $amount);
+ }
}
-
- private function getUserFlashlogs($id=null)
+ private function getUserFlashlogs($id = null)
{
- if (Auth::check() === false)
+ if (Auth::check() === false) {
return [];
+ }
- if (Auth::user()->hasRole('superadmin'))
- {
- if (isset($id))
+ if (Auth::user()->hasRole('superadmin')) {
+ if (isset($id)) {
return Flashlog::find($id);
+ }
return Flashlog::orderByDesc('id')->get();
- }
- else
- {
- if (Auth::user()->researchesOwned->count() > 0) // research owners: show flashlogs from all owned researches default_user_ids
- {
+ } else {
+ if (Auth::user()->researchesOwned->count() > 0) { // research owners: show flashlogs from all owned researches default_user_ids
// get own + consented users->devices->flashlogs
$user_ids = [Auth::user()->id];
- foreach (Auth::user()->allResearches()->get() as $research)
- {
- if (isset($research->default_user_ids))
+ foreach (Auth::user()->allResearches()->get() as $research) {
+ if (isset($research->default_user_ids)) {
$user_ids = array_merge($user_ids, $research->default_user_ids);
-
+ }
+
}
$user_ids = array_unique($user_ids);
- if (isset($id))
+ if (isset($id)) {
return Flashlog::whereIn('user_id', $user_ids)->find($id);
+ }
return Flashlog::whereIn('user_id', $user_ids)->orderByDesc('id')->get();
- }
- else // normal users, show your own, and editable group hive flashlogs
- {
- if (isset($id))
+ } else { // normal users, show your own, and editable group hive flashlogs
+ if (isset($id)) {
return Auth::user()->allFlashlogs()->find($id);
+ }
return Auth::user()->allFlashlogs()->orderByDesc('id')->get();
}
@@ -91,6 +88,7 @@ private function getUserFlashlogs($id=null)
/**
* api/flashlogs GET
* Provide a list of the available flashlogs
+ *
* @authenticated
*/
public function index(Request $request)
@@ -101,11 +99,14 @@ public function index(Request $request)
/**
* api/flashlogs/{id} GET
* Provide the contents of the log_file_parsed property of the flashlog
+ *
* @authenticated
+ *
* @queryParam id integer required Flashlog ID to parse
- * @bodyParam matches_min integer Flashlog minimum amount of inline measurements that should be matched. Default: 5. Example: 2
- * @bodyParam match_props integer Flashlog minimum amount of measurement properties that should match. Default: 9. Example: 7
- * @bodyParam db_records integer Flashlog minimum amount of inline measurements that should be matched. Default: 80. Example: 15
+ *
+ * @bodyParam matches_min integer Flashlog minimum amount of inline measurements that should be matched. Default: 5. Example: 2
+ * @bodyParam match_props integer Flashlog minimum amount of measurement properties that should match. Default: 9. Example: 7
+ * @bodyParam db_records integer Flashlog minimum amount of inline measurements that should be matched. Default: 80. Example: 15
* @bodyParam block_id integer Flashlog block index to get both Flashlog as database data from. Example: 1
* @bodyParam block_data_index integer Flashlog data index to get both Flashlog as database data from. Example: 0
* @bodyParam data_minutes integer Flashlog data amount of minutes to show data from. Default: 10080 (1 week).
@@ -117,18 +118,21 @@ public function index(Request $request)
public function show(Request $request, $id)
{
$out = $this->parse($request, $id);
+
return response()->json($out, isset($out['error']) ? 500 : 200);
}
-
/**
* api/flashlogs/{id} POST
* Fill the missing database values with Flashlog values that match
+ *
* @authenticated
+ *
* @queryParam id integer required Flashlog ID to parse
- * @bodyParam matches_min integer Flashlog minimum amount of inline measurements that should be matched. Default: 5. Example: 2
- * @bodyParam match_props integer Flashlog minimum amount of measurement properties that should match. Default: 9. Example: 7
- * @bodyParam db_records integer Flashlog minimum amount of inline measurements that should be matched. Default: 80. Example: 15
+ *
+ * @bodyParam matches_min integer Flashlog minimum amount of inline measurements that should be matched. Default: 5. Example: 2
+ * @bodyParam match_props integer Flashlog minimum amount of measurement properties that should match. Default: 9. Example: 7
+ * @bodyParam db_records integer Flashlog minimum amount of inline measurements that should be matched. Default: 80. Example: 15
* @bodyParam block_id integer Flashlog block index to get both Flashlog as database data from. Example: 1
* @bodyParam from_cache boolean get Flashlog parse result from cache (24 hours). Default: true. Example: false
* @bodyParam save_result boolean Flashlog save the parsed result as new log_file_parsed. Default: false. Example: false
@@ -136,27 +140,29 @@ public function show(Request $request, $id)
public function persist(Request $request, $id)
{
$out = $this->parse($request, $id, true);
+
return response()->json($out, isset($out['error']) ? 500 : 200);
}
/**
* api/flashlogs/{id} DELETE
* Delete a block of data (block_id filled), or the whole Flashlog file
+ *
* @authenticated
+ *
* @queryParam id integer required Flashlog ID to delete the complete Flashlog file
+ *
* @bodyParam block_id integer Flashlog block index to delete (only the) previously persisted data from the database
*/
public function delete(Request $request, $id)
{
- if ($request->filled('block_id'))
- {
+ if ($request->filled('block_id')) {
$out = $this->parse($request, $id, false, true);
+
return response()->json($out, isset($out['error']) ? 500 : 200);
- }
- else
- {
- return response()->json(["error"=>"deleting complete flashlog file ($id) not yet supported"], 500);
- //return $this->destroy($request, $id);
+ } else {
+ return response()->json(['error' => "deleting complete flashlog file ($id) not yet supported"], 500);
+ // return $this->destroy($request, $id);
}
}
@@ -164,24 +170,21 @@ public function delete(Request $request, $id)
private function storeInfluxDataArrays($data_arrays, $device)
{
// store posted data
- $client = $this->client;
- $points = [];
- $sensor_tags = ['key' => strtolower($device->key), 'device_name' => $device->name, 'hardware_id' => strtolower($device->hardware_id), 'user_id' => $device->user_id, 'from_flashlog'=>1];
-
- foreach ($data_arrays as $data_array)
- {
- if (isset($data_array['time']))
- {
- $time = strtotime($data_array['time']);
+ $client = $this->client;
+ $points = [];
+ $sensor_tags = ['key' => strtolower($device->key), 'device_name' => $device->name, 'hardware_id' => strtolower($device->hardware_id), 'user_id' => $device->user_id, 'from_flashlog' => 1];
+
+ foreach ($data_arrays as $data_array) {
+ if (isset($data_array['time'])) {
+ $time = strtotime($data_array['time']);
$array = array_intersect_key($data_array, $this->valid_sensors);
foreach ($array as $key => $value) {
$array[$key] = floatval($value);
}
- if (count($array) > 0)
- {
- array_push($points,
+ if (count($array) > 0) {
+ array_push($points,
new \InfluxDB\Point(
'sensors', // name of the measurement
null, // the measurement value
@@ -193,182 +196,162 @@ private function storeInfluxDataArrays($data_arrays, $device)
}
}
}
- //die(print_r($points));
+ // die(print_r($points));
$stored = false;
- if (count($points) > 0)
- {
- try
- {
+ if (count($points) > 0) {
+ try {
$this->cacheRequestRate('influx-write');
$stored = $client::writePoints($points, \InfluxDB\Database::PRECISION_SECONDS);
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
Log::error($e->getMessage());
- //die(print_r($e->getMessage()));
+ // die(print_r($e->getMessage()));
}
}
+
return $stored;
}
-
-
- private function diff_percentage($val1, $val2, $round_decimals=1)
+ private function diff_percentage($val1, $val2, $round_decimals = 1)
{
- if ($val1 === $val2)
+ if ($val1 === $val2) {
return 0;
+ }
- $rval1= round($val1,$round_decimals);
- $rval2= round($val2,$round_decimals);
+ $rval1 = round($val1, $round_decimals);
+ $rval2 = round($val2, $round_decimals);
$diff = abs($rval1 - $rval2);
- $ave = ($rval1 + $rval2) / 2;
+ $ave = ($rval1 + $rval2) / 2;
+
return $ave != 0 ? min(100, max(0, round(100 * $diff / $ave, 1))) : 0;
}
-
- private function matchPercentage($array1, $array2, $match_props=9, $max_diff_percentage=0) // flashlog_array, database_array
+ private function matchPercentage($array1, $array2, $match_props = 9, $max_diff_percentage = 0) // flashlog_array, database_array
{
- //$matches = [];
- $secDiff = [];
- $match_count = 0;
- $array2_index = 0;
+ // $matches = [];
+ $secDiff = [];
+ $match_count = 0;
+ $array2_index = 0;
$array1_length = count($array1);
$array2_length = count($array2);
$array_min_len = min($array1_length, $array2_length);
- $errors = [];
+ $errors = [];
$perc_diff_sum = 0;
$perc_diff_cnt = 0;
- $should_match = ['weight_kg'=>0,'t_i'=>0,'t_0'=>0,'t_1'=>0]; // reject match, because weight_kg, t_i, t_0, or t_1 do not match
+ $should_match = ['weight_kg' => 0, 't_i' => 0, 't_0' => 0, 't_1' => 0]; // reject match, because weight_kg, t_i, t_0, or t_1 do not match
$should_m_keys = array_keys($should_match); // reject match, because weight_kg, t_i, t_0, or t_1 do not match
-
- if ($array1_length > 0 && $array2_length > 0)
- {
- for ($i=0; $i < $array1_length; $i++)
- {
- $f = (array)$array1[$i];
-
- for ($j=$array2_index; $j < $array2_length; $j++)
- {
- $d = $array2[$j];
- $d_time = $d['time'];
+
+ if ($array1_length > 0 && $array2_length > 0) {
+ for ($i = 0; $i < $array1_length; $i++) {
+ $f = (array) $array1[$i];
+
+ for ($j = $array2_index; $j < $array2_length; $j++) {
+ $d = $array2[$j];
+ $d_time = $d['time'];
unset($d['time']); // remove for count
$d_val_count = count($d);
-
- if ($d_val_count < $match_props)
- {
+
+ if ($d_val_count < $match_props) {
$array2_index = $j;
+
continue;
}
- if (isset($f['bv']) && isset($d['bv']) && $this->diff_percentage($f['bv'], $d['bv'], 3) <= $max_diff_percentage) // first fast check on similar battery voltages
- {
+ if (isset($f['bv']) && isset($d['bv']) && $this->diff_percentage($f['bv'], $d['bv'], 3) <= $max_diff_percentage) { // first fast check on similar battery voltages
// loop through both array measurements values
- $matches = 0;
+ $matches = 0;
$should_match_diff = [];
- foreach (array_keys($d) as $m_key)
- {
- if (isset($d[$m_key]) && isset($f[$m_key]))
- {
+ foreach (array_keys($d) as $m_key) {
+ if (isset($d[$m_key]) && isset($f[$m_key])) {
$diff_perc = $this->diff_percentage($d[$m_key], $f[$m_key]);
$perc_diff_sum += $diff_perc;
$perc_diff_cnt++;
- if ($diff_perc <= $max_diff_percentage) // m_key matches
+ if ($diff_perc <= $max_diff_percentage) { // m_key matches
$matches++;
- else if (in_array($m_key, $should_m_keys))
+ } elseif (in_array($m_key, $should_m_keys)) {
$should_match_diff[$m_key] = $diff_perc;
-
+ }
+
}
}
// check validity of this match
- if ($matches >= $d_val_count-1)
- {
+ if ($matches >= $d_val_count - 1) {
$match_ok = true;
- foreach ($should_match_diff as $m_key => $diff)
- {
+ foreach ($should_match_diff as $m_key => $diff) {
$should_match[$m_key] = $should_match[$m_key] + 1;
- if ($m_key == 'weight_kg' && abs($d[$m_key]) > 200 && abs($f[$m_key]) < 200) // are still be ok, because uncalibrated db values can be replaced
- {
+ if ($m_key == 'weight_kg' && abs($d[$m_key]) > 200 && abs($f[$m_key]) < 200) { // are still be ok, because uncalibrated db values can be replaced
$errors[$m_key] = "$should_match[$m_key] $m_key values uncalibrated";
- }
- else
- {
+ } else {
// reject match, because weight_kg, t_i, t_0, or t_1 does not match
$match_ok = false;
$errors[$m_key] = "$should_match[$m_key] $m_key values differ";
}
}
- if ($match_ok) // count this measurement as a match
- {
+ if ($match_ok) { // count this measurement as a match
$secDiff[] = strtotime($f['time']) - strtotime($d_time);
$match_count++;
}
$array2_index = $j;
+
continue 2;
}
}
}
}
}
- $secDiffAvg = count($secDiff) > 0 ? round(array_sum($secDiff)/count($secDiff)) : null;
- $matchDiffAvg = $perc_diff_cnt > 0 ? round($perc_diff_sum/$perc_diff_cnt, 1) : null;
- $percMatch = $array_min_len > 0 ? round(100 * ($match_count / $array_min_len), 1): 0;
- //die(print_r([$percMatch, $secDiffAvg, $matches]));
- return ['sec_diff'=>$secDiffAvg, 'perc_match'=>$percMatch, 'match_count'=>$match_count, 'avg_diff'=>$matchDiffAvg, 'errors'=>implode(', ', $errors)];
+ $secDiffAvg = count($secDiff) > 0 ? round(array_sum($secDiff) / count($secDiff)) : null;
+ $matchDiffAvg = $perc_diff_cnt > 0 ? round($perc_diff_sum / $perc_diff_cnt, 1) : null;
+ $percMatch = $array_min_len > 0 ? round(100 * ($match_count / $array_min_len), 1) : 0;
+
+ // die(print_r([$percMatch, $secDiffAvg, $matches]));
+ return ['sec_diff' => $secDiffAvg, 'perc_match' => $percMatch, 'match_count' => $match_count, 'avg_diff' => $matchDiffAvg, 'errors' => implode(', ', $errors)];
}
-
- private function parse(Request $request, $id, $persist=false, $delete=false)
+ private function parse(Request $request, $id, $persist = false, $delete = false)
{
$flashlog_id = intval($id);
- $matches_min = intval($request->input('matches_min', env('FLASHLOG_MIN_MATCHES', 5))); // minimum amount of inline measurements that should be matched
- $match_props = intval($request->input('match_props', env('FLASHLOG_MATCH_PROPS', 7))); // minimum amount of measurement properties that should match
- $db_records = intval($request->input('db_records', env('FLASHLOG_DB_RECORDS', 15)));// amount of DB records to fetch to match each block
-
+ $matches_min = intval($request->input('matches_min', env('FLASHLOG_MIN_MATCHES', 5))); // minimum amount of inline measurements that should be matched
+ $match_props = intval($request->input('match_props', env('FLASHLOG_MATCH_PROPS', 7))); // minimum amount of measurement properties that should match
+ $db_records = intval($request->input('db_records', env('FLASHLOG_DB_RECORDS', 15))); // amount of DB records to fetch to match each block
+
$save_result = boolval($request->input('save_result', false));
- $from_cache = boolval($request->input('from_cache', true));
- $show_log = boolval($request->input('show_log', false));
- $export_csv = boolval($request->input('csv', false)); // if filled, only save data and return a download link
- $export_json = boolval($request->input('json', false)); // if filled, only save data and return a download link
- $block_id = $request->filled('block_id') ? intval($request->input('block_id')) : -1;
- $block_data_i= intval($request->input('block_data_index', -1));
- $data_minutes= intval($request->input('data_minutes', env('FLASHLOG_WINDOW_MINUTES', 10080))); // default 1 week
-
- $out = ['error'=>'no_flashlog_found'];
- $out_log = [];
+ $from_cache = boolval($request->input('from_cache', true));
+ $show_log = boolval($request->input('show_log', false));
+ $export_csv = boolval($request->input('csv', false)); // if filled, only save data and return a download link
+ $export_json = boolval($request->input('json', false)); // if filled, only save data and return a download link
+ $block_id = $request->filled('block_id') ? intval($request->input('block_id')) : -1;
+ $block_data_i = intval($request->input('block_data_index', -1));
+ $data_minutes = intval($request->input('data_minutes', env('FLASHLOG_WINDOW_MINUTES', 10080))); // default 1 week
+
+ $out = ['error' => 'no_flashlog_found'];
+ $out_log = [];
$flashlog = $this->getUserFlashlogs($id);
-
- if ($flashlog)
- {
+ if ($flashlog) {
$device = $flashlog->device;
-
- if ($device)
- {
- $device_id = $flashlog->device_id;
+
+ if ($device) {
+ $device_id = $flashlog->device_id;
$device_name = $flashlog->device_name;
$device_intm = $device->measurement_interval_min;
- $hive_id = $flashlog->hive_id;
- $hive_name = $flashlog->hive_name;
- $user_id = $flashlog->user_id;
- $user_name = $flashlog->user_name;
- $measurements= Measurement::getMatchingMeasurements();
- $add_weight = true; //$from_cache === false && isset($flashlog->log_messages) && $flashlog->log_messages > 50000 ? false : true; // prevent server crash
-
- if(isset($flashlog->log_file))
- {
+ $hive_id = $flashlog->hive_id;
+ $hive_name = $flashlog->hive_name;
+ $user_id = $flashlog->user_id;
+ $user_name = $flashlog->user_name;
+ $measurements = Measurement::getMatchingMeasurements();
+ $add_weight = true; // $from_cache === false && isset($flashlog->log_messages) && $flashlog->log_messages > 50000 ? false : true; // prevent server crash
+
+ if (isset($flashlog->log_file)) {
$out = $flashlog->log(null, null, $save_result, true, true, $matches_min, $match_props, $db_records, $save_result, $from_cache, 0, $add_weight); // $data='', $log_bytes=null, $save=true, $fill=false, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null, $save_override=false, $from_cache=true, $match_days_offset=0, $add_sensordefinitions=true
- //die(print_r($out));
+ // die(print_r($out));
$log_blocks = [];
- if (isset($out['log']))
- {
+ if (isset($out['log'])) {
$out_log = $out['log'];
- foreach ($out_log as $out_log_block)
- {
+ foreach ($out_log as $out_log_block) {
$log_blocks[$out_log_block['block']] = $out_log_block;
}
}
@@ -377,75 +360,68 @@ private function parse(Request $request, $id, $persist=false, $delete=false)
// Log::debug($log_blocks);
// get the data from a single Flashlog block
- if ($block_id > -1 && isset($log_blocks[$block_id]))
- {
- $block = $log_blocks[$block_id];
+ if ($block_id > -1 && isset($log_blocks[$block_id])) {
+ $block = $log_blocks[$block_id];
$interval_min = isset($block['interval_min']) ? $block['interval_min'] : $device_intm;
- $block_data = json_decode($flashlog->getFileContent('log_file_parsed'), true);
- $block_start_i= $block['start_i'];
- $block_end_i = $block['end_i'];
+ $block_data = json_decode($flashlog->getFileContent('log_file_parsed'), true);
+ $block_start_i = $block['start_i'];
+ $block_end_i = $block['end_i'];
$block_length = $block_end_i - $block_start_i;
- $has_matches = isset($log_blocks[$block_id]['matches']) ? true : false;
+ $has_matches = isset($log_blocks[$block_id]['matches']) ? true : false;
- $interval_db = 15; // db request minute interval
- $fl_per_db_int= $interval_db / $interval_min; // amount of flashlog items in 1 database interval
+ $interval_db = 15; // db request minute interval
+ $fl_per_db_int = $interval_db / $interval_min; // amount of flashlog items in 1 database interval
// show only portion of the data (for charting in ChartJS)
$interval_multi = 1;
- if ($data_minutes > 43200) // month
+ if ($data_minutes > 43200) { // month
$interval_multi = 12;
- else if ($data_minutes > 10080) // week
+ } elseif ($data_minutes > 10080) { // week
$interval_multi = 8;
- else if ($data_minutes > 1440)
+ } elseif ($data_minutes > 1440) {
$interval_multi = 4;
+ }
$interval_multi = $interval_multi * $fl_per_db_int;
- if ($export_csv || $export_json)
+ if ($export_csv || $export_json) {
return FlashLog::exportData(array_slice($block_data, $block_start_i, $block_length), "user-$user_id-$device_name-log-file-$id-block-$block_id-matches-$has_matches", $export_csv);
+ }
// Check if there are matches (NB: Bug: persisted measurements now can only be deleted in a block with matches)
- if ($has_matches)
- {
- $block_start_t= $block['time_start'];
- $block_end_t = $block['time_end'];
- $block_start_u= strtotime($block_start_t);
- $block_end_u = strtotime($block_end_t);
-
- if ($delete || $persist)
- {
- Log::debug("");
+ if ($has_matches) {
+ $block_start_t = $block['time_start'];
+ $block_end_t = $block['time_end'];
+ $block_start_u = strtotime($block_start_t);
+ $block_end_u = strtotime($block_end_t);
+
+ if ($delete || $persist) {
+ Log::debug('');
$persist_log = $persist ? '1' : '0';
- $delete_log = $delete ? '1' : '0';
+ $delete_log = $delete ? '1' : '0';
Log::debug("FlashLogController parse device=$device_name, persist=$persist_log, del=$delete_log, fl_id=$flashlog_id, bl_id=$block_id, bl_len=$block_length, bl_st_tm=$block_start_t, bl_st_i=$block_start_i, bl_end_tm=$block_end_t, bl_end_i=$block_end_i, bl_data_i=$block_data_i");
}
- if ($delete)
- {
- $data_influx_deleted= false;
+ if ($delete) {
+ $data_influx_deleted = false;
$data_delete_errors = [];
- $data_deleted = 'no_data_to_delete';
+ $data_deleted = 'no_data_to_delete';
$delete_count_query = 'SELECT COUNT("bv") AS "count" FROM "sensors" WHERE "from_flashlog" = \'1\' AND '.$device->influxWhereKeys().' AND time >= \''.$block_start_t.'\' AND time <= \''.$block_end_t.'\'';
- $delete_count = Device::getInfluxQuery($delete_count_query, 'flashlog');
- $delete_count_sum = isset($delete_count[0]['count']) ? $delete_count[0]['count'] : 0;
- $deleted_days = round($delete_count_sum*$interval_min/(60*24), 1);
+ $delete_count = Device::getInfluxQuery($delete_count_query, 'flashlog');
+ $delete_count_sum = isset($delete_count[0]['count']) ? $delete_count[0]['count'] : 0;
+ $deleted_days = round($delete_count_sum * $interval_min / (60 * 24), 1);
Log::debug("delete before: delete_count_sum=$delete_count_sum deleted_days=$deleted_days");
- if ($delete_count_sum > 0 && $deleted_days > 0)
- {
+ if ($delete_count_sum > 0 && $deleted_days > 0) {
// Delete for each key separately since OR statements do not work in DELETE statements
- foreach ($device->allKeys() as $device_key)
- {
+ foreach ($device->allKeys() as $device_key) {
$delete_query = 'DELETE FROM "sensors" WHERE "key" = \''.$device_key.'\' AND "from_flashlog" = \'1\' AND time >= \''.$block_start_t.'\' AND time <= \''.$block_end_t.'\'';
- try
- {
+ try {
$data_deleted = $this->client::query($delete_query);
$data_influx_deleted = true;
Log::debug($delete_query);
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
$data_delete_errors[] = $e->getMessage();
Log::error($e->getMessage());
Log::error($delete_query);
@@ -453,139 +429,130 @@ private function parse(Request $request, $id, $persist=false, $delete=false)
$deleted_days = 0;
}
}
-
- if ($data_influx_deleted)
- {
+
+ if ($data_influx_deleted) {
$persisted_block_ids_array = $flashlog->persisted_block_ids_array;
- if (count($persisted_block_ids_array) == 0 || (count($persisted_block_ids_array) == 1 && $persisted_block_ids_array[0] == $block_id))
+ if (count($persisted_block_ids_array) == 0 || (count($persisted_block_ids_array) == 1 && $persisted_block_ids_array[0] == $block_id)) {
$flashlog->persisted_block_ids = null;
- else
+ } else {
$flashlog->persisted_block_ids_array = array_diff($flashlog->persisted_block_ids_array, [$block_id]);
+ }
$flashlog->persisted_measurements = max(0, $flashlog->persisted_measurements - $delete_count_sum);
$flashlog->save();
}
}
-
- if (count($data_delete_errors) > 0)
- $out = ['data_deleted'=>$data_influx_deleted, 'deleted_measurements'=>$delete_count_sum, 'deleted_days'=>$deleted_days, 'errors'=>$data_delete_errors];
- else
- $out = ['data_deleted'=>$data_influx_deleted, 'deleted_measurements'=>$delete_count_sum, 'deleted_days'=>$deleted_days];
- if ($data_influx_deleted)
- Cache::forget($flashlog->getLogCacheName(true, true, $matches_min, $match_props, $db_records)); // remove cached result, because import has changed it
-
- Log::debug("delete finished: ".json_encode($out));
+ if (count($data_delete_errors) > 0) {
+ $out = ['data_deleted' => $data_influx_deleted, 'deleted_measurements' => $delete_count_sum, 'deleted_days' => $deleted_days, 'errors' => $data_delete_errors];
+ } else {
+ $out = ['data_deleted' => $data_influx_deleted, 'deleted_measurements' => $delete_count_sum, 'deleted_days' => $deleted_days];
+ }
- }
- else if ($persist) // Save missing data to DB
- {
- $persist_count= 0;
- $db_insert_rec= 4999; // chuck size of records to insert at one POST request
- $req_points_db= $block_length / $fl_per_db_int;
- $req_cnt_db = ceil($req_points_db / $this->maxDataPoints);
+ if ($data_influx_deleted) {
+ Cache::forget($flashlog->getLogCacheName(true, true, $matches_min, $match_props, $db_records));
+ } // remove cached result, because import has changed it
+
+ Log::debug('delete finished: '.json_encode($out));
+
+ } elseif ($persist) { // Save missing data to DB
+ $persist_count = 0;
+ $db_insert_rec = 4999; // chuck size of records to insert at one POST request
+ $req_points_db = $block_length / $fl_per_db_int;
+ $req_cnt_db = ceil($req_points_db / $this->maxDataPoints);
$points_p_req = round($req_points_db / $req_cnt_db);
$secs_per_req = $points_p_req * $interval_db * 60;
$count_measurements = [];
- foreach ($measurements as $key => $value)
- $count_measurements['count_'.$value] = $key; // compare keys with 'count_' included, else everything in excluded and sum is always 0
+ foreach ($measurements as $key => $value) {
+ $count_measurements['count_'.$value] = $key;
+ } // compare keys with 'count_' included, else everything in excluded and sum is always 0
- //Log::debug(['count_measurements'=>$count_measurements]);
+ // Log::debug(['count_measurements'=>$count_measurements]);
// split the amount of requests in sensible maximum amount of measurements from DB
- for ($req_ind=0; $req_ind <= $req_cnt_db; $req_ind++)
- {
+ for ($req_ind = 0; $req_ind <= $req_cnt_db; $req_ind++) {
$req_start_unix = $block_start_u + ($secs_per_req * $req_ind);
$req_start_time = date('Y-m-d H:i:s', $req_start_unix);
- $req_end_unix = $block_start_u + ($secs_per_req * ($req_ind+1)) -1;
- $req_end_time = date('Y-m-d H:i:s', $req_end_unix);
-
- // run through the db data array to define which data to add
- $count_query = 'SELECT COUNT(*) FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$req_start_time.'\' AND time <= \''.$req_end_time.'\' GROUP BY time('.$interval_db.'m) ORDER BY time ASC LIMIT '.$points_p_req;
- $data_per_int = Device::getInfluxQuery($count_query, 'flashlog');
- $data_per_int_d = [];
- $data_per_int_max_i = count($data_per_int)-1;
- $missing_data = [];
-
+ $req_end_unix = $block_start_u + ($secs_per_req * ($req_ind + 1)) - 1;
+ $req_end_time = date('Y-m-d H:i:s', $req_end_unix);
+
+ // run through the db data array to define which data to add
+ $count_query = 'SELECT COUNT(*) FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$req_start_time.'\' AND time <= \''.$req_end_time.'\' GROUP BY time('.$interval_db.'m) ORDER BY time ASC LIMIT '.$points_p_req;
+ $data_per_int = Device::getInfluxQuery($count_query, 'flashlog');
+ $data_per_int_d = [];
+ $data_per_int_max_i = count($data_per_int) - 1;
+ $missing_data = [];
+
Log::debug("persist_check chunk $req_ind/$req_cnt_db of $points_p_req interval_db min values: req_start_time=$req_start_time, req_end_time=$req_end_time, query_results=$data_per_int_max_i");
- //die(print_r($data_per_int));
+ // die(print_r($data_per_int));
// Persist all non-existing Flashlog data to InfluxDB
- if ($data_per_int_max_i == -1) // import data where there is NO database data available
- {
- $indexFlogStart = round($block_start_i + ($req_ind * $points_p_req * $fl_per_db_int));
- $indexFlogEnd = round($block_start_i + (($req_ind+1) * $points_p_req * $fl_per_db_int));
-
+ if ($data_per_int_max_i == -1) { // import data where there is NO database data available
+ $indexFlogStart = round($block_start_i + ($req_ind * $points_p_req * $fl_per_db_int));
+ $indexFlogEnd = round($block_start_i + (($req_ind + 1) * $points_p_req * $fl_per_db_int));
+
Log::debug("persist_with_no_db_values: indexFlogStart=$indexFlogStart, indexFlogEnd=$indexFlogEnd");
- for ($i=$indexFlogStart; $i < $indexFlogEnd; $i++)
- {
- if (isset($block_data[$i]))
- {
+ for ($i = $indexFlogStart; $i < $indexFlogEnd; $i++) {
+ if (isset($block_data[$i])) {
$data_item = $block_data[$i];
- if (isset($data_item['time']) && isset($data_item['port']) && $data_item['port'] == 3) // time from flashlog should be between start and end of this interval
+ if (isset($data_item['time']) && isset($data_item['port']) && $data_item['port'] == 3) { // time from flashlog should be between start and end of this interval
$missing_data[] = FlashLog::cleanFlashlogItem($data_item);
+ }
}
// Store batches of data to InfluxDB
$missing_data_count = count($missing_data);
- if ($missing_data_count > $db_insert_rec || ($missing_data_count > 0 && $i == $indexFlogEnd - 1)) // persist at every 100 items, or at last item
- {
+ if ($missing_data_count > $db_insert_rec || ($missing_data_count > 0 && $i == $indexFlogEnd - 1)) { // persist at every 100 items, or at last item
$stored = $this->storeInfluxDataArrays($missing_data, $device);
- if ($stored)
+ if ($stored) {
$persist_count += $missing_data_count;
-
- $logMissingDates = $missing_data[0]['time'].' -> '.$missing_data[$missing_data_count-1]['time'];
- $missing_data = [];
+ }
+
+ $logMissingDates = $missing_data[0]['time'].' -> '.$missing_data[$missing_data_count - 1]['time'];
+ $missing_data = [];
Log::debug("persist_with_no_db_values: stored=$stored, missing_data_count=$missing_data_count, persist_count=$persist_count, dates=$logMissingDates");
}
}
- }
- else // import data where there is database data available
- {
+ } else { // import data where there is database data available
$dbStartDate = $data_per_int[0]['time'];
- $dbEndDate = $data_per_int[$data_per_int_max_i]['time'];
+ $dbEndDate = $data_per_int[$data_per_int_max_i]['time'];
Log::debug("persist_in_between_db_values: dbStartDate=$dbStartDate, dbEndDate=$dbEndDate");
- // Run through DB data per Influx time group (15 min)
- for($db_count_i=0 ; $db_count_i < $data_per_int_max_i; $db_count_i++)
- {
- $db_count = $data_per_int[$db_count_i];
- $db_count_next = $data_per_int[$db_count_i+1];
- $time_start = $db_count['time'];
- $time_end = $db_count_next['time'];
-
- //print_r(['db_count'=>$db_count, 'm'=>$count_measurements]);
-
- $db_count = array_intersect_key($db_count, $count_measurements); // only keep the key counts from valid matching measurements
- $count_sum = array_sum($db_count) / $fl_per_db_int;
+ // Run through DB data per Influx time group (15 min)
+ for ($db_count_i = 0; $db_count_i < $data_per_int_max_i; $db_count_i++) {
+ $db_count = $data_per_int[$db_count_i];
+ $db_count_next = $data_per_int[$db_count_i + 1];
+ $time_start = $db_count['time'];
+ $time_end = $db_count_next['time'];
+
+ // print_r(['db_count'=>$db_count, 'm'=>$count_measurements]);
+
+ $db_count = array_intersect_key($db_count, $count_measurements); // only keep the key counts from valid matching measurements
+ $count_sum = array_sum($db_count) / $fl_per_db_int;
$data_per_int_d[$time_start] = $count_sum;
-
- if ($count_sum < $match_props) // Database data has less data than flashlog
- {
+ if ($count_sum < $match_props) { // Database data has less data than flashlog
// define index start-end of day
$secOfCountStart = strtotime($time_start);
- $secOfCountEnd = strtotime($time_end);
+ $secOfCountEnd = strtotime($time_end);
$minDifWithStart = round(($secOfCountStart - $block_start_u) / 60);
- $indexFlogStart = $block_start_i + ceil($minDifWithStart / $interval_min);
- $indexFlogEnd = min($block_end_i, $indexFlogStart + $fl_per_db_int);
- $indexFlogStart = max(0, $indexFlogStart);
-
- for ($i=$indexFlogStart; $i < $indexFlogEnd; $i++)
- {
- if (isset($block_data[$i]))
- {
+ $indexFlogStart = $block_start_i + ceil($minDifWithStart / $interval_min);
+ $indexFlogEnd = min($block_end_i, $indexFlogStart + $fl_per_db_int);
+ $indexFlogStart = max(0, $indexFlogStart);
+
+ for ($i = $indexFlogStart; $i < $indexFlogEnd; $i++) {
+ if (isset($block_data[$i])) {
$data_item = $block_data[$i];
- if (isset($data_item['time']))
- {
+ if (isset($data_item['time'])) {
$secDataItem = strtotime($data_item['time']);
-
- if (isset($data_item['port']) && $data_item['port'] == 3 && $secDataItem >= $secOfCountStart && $secDataItem < $secOfCountEnd) // time from flashlog should be between start and end of this interval
+
+ if (isset($data_item['port']) && $data_item['port'] == 3 && $secDataItem >= $secOfCountStart && $secDataItem < $secOfCountEnd) { // time from flashlog should be between start and end of this interval
$missing_data[] = FlashLog::cleanFlashlogItem($data_item);
+ }
}
}
@@ -594,14 +561,14 @@ private function parse(Request $request, $id, $persist=false, $delete=false)
// Store batches of data to InfluxDB
$missing_data_count = count($missing_data);
- if ($missing_data_count > $db_insert_rec || ($missing_data_count > 0 && $db_count_i == $data_per_int_max_i - 1)) // persist at every $db_insert_rec items, or at last item
- {
+ if ($missing_data_count > $db_insert_rec || ($missing_data_count > 0 && $db_count_i == $data_per_int_max_i - 1)) { // persist at every $db_insert_rec items, or at last item
$stored = $this->storeInfluxDataArrays($missing_data, $device);
- if ($stored)
+ if ($stored) {
$persist_count += $missing_data_count;
-
- $logMissingDates = $missing_data[0]['time'].' -> '.$missing_data[$missing_data_count-1]['time'];
- $missing_data = [];
+ }
+
+ $logMissingDates = $missing_data[0]['time'].' -> '.$missing_data[$missing_data_count - 1]['time'];
+ $missing_data = [];
Log::debug("persist_in_between_db_values stored=$stored, missing_data_count=$missing_data_count, persist_count=$persist_count, missing_dates=$logMissingDates");
}
@@ -609,139 +576,127 @@ private function parse(Request $request, $id, $persist=false, $delete=false)
}
}
- //die(print_r([$persist_count, $block_start_t, $data_per_int_d, $missing_data]));
-
- if ($persist_count > 0)
- {
+ // die(print_r([$persist_count, $block_start_t, $data_per_int_d, $missing_data]));
+
+ if ($persist_count > 0) {
Cache::forget($flashlog->getLogCacheName(true, true, $matches_min, $match_props, $db_records)); // remove cached result, because import has changed it
-
- $persist_days = round($persist_count*$interval_min/(60*24), 1);
- if (isset($flashlog->persisted_days))
+ $persist_days = round($persist_count * $interval_min / (60 * 24), 1);
+
+ if (isset($flashlog->persisted_days)) {
$flashlog->persisted_days += $persist_days;
- else
+ } else {
$flashlog->persisted_days = $persist_days;
+ }
- if (isset($flashlog->persisted_measurements))
+ if (isset($flashlog->persisted_measurements)) {
$flashlog->persisted_measurements += $persist_count;
- else
+ } else {
$flashlog->persisted_measurements = $persist_count;
+ }
$persisted_block_ids = $flashlog->persisted_block_ids_array;
- if (!in_array($block_id, $persisted_block_ids)) // add persisted block id
- {
+ if (! in_array($block_id, $persisted_block_ids)) { // add persisted block id
$persisted_block_ids[] = $block_id;
$flashlog->persisted_block_ids_array = $persisted_block_ids;
}
- $out = ['data_stored'=>true, 'persisted_measurements'=>$persist_count, 'persisted_days'=>$persist_days];
+ $out = ['data_stored' => true, 'persisted_measurements' => $persist_count, 'persisted_days' => $persist_days];
$flashlog->save();
+ } else {
+ $out = ['data_stored' => false, 'persisted_measurements' => $persist_count, 'persisted_days' => 0, 'error' => 'no_data_stored'];
}
- else
- {
- $out = ['data_stored'=>false, 'persisted_measurements'=>$persist_count, 'persisted_days'=>0, 'error'=>'no_data_stored'];
+ Log::debug('persist finished: '.json_encode($out));
+ } else { // Show data content per $data_minutes
+ $fl_i_modulo = $interval_multi;
+ $match_index = $block['fl_i'];
+ $index_amount = round($data_minutes / $interval_min);
+ $data_i_max = floor(($block_end_i - $block_start_i) / $index_amount);
+
+ if ($block_data_i == -1) {
+ $block_data_i = round($data_i_max * (($match_index - $block_start_i) / $block_length));
}
- Log::debug("persist finished: ".json_encode($out));
- }
- else // Show data content per $data_minutes
- {
- $fl_i_modulo = $interval_multi;
- $match_index = $block['fl_i'];
- $index_amount = round($data_minutes / $interval_min);
- $data_i_max = floor(($block_end_i - $block_start_i) / $index_amount);
-
- if ($block_data_i == -1)
- $block_data_i = round( $data_i_max * (($match_index - $block_start_i) / $block_length) );
-
- if ($block_data_i < 0)
+
+ if ($block_data_i < 0) {
$block_data_i = 0;
+ }
- if ($block_data_i > $data_i_max)
+ if ($block_data_i > $data_i_max) {
$block_data_i = $data_i_max;
+ }
- $start_index = $block_start_i + ($index_amount * $block_data_i);
- $end_index = min($block_end_i, $block_start_i + ($index_amount * ($block_data_i+1)));
-
- $out = ['interval_min'=>$interval_min*$interval_multi, 'data_point_modulo'=>$fl_i_modulo, 'block_start_i'=>$block_start_i, 'block_end_i'=>$block_end_i, 'match_index'=>$match_index, 'block_data_index'=>$block_data_i, 'block_data_index_max'=>$data_i_max, 'block_data_index_amount'=>$index_amount, 'block_data_start'=>$start_index, 'block_data_end'=>$end_index, 'flashlog'=>[], 'database'=>[]];
+ $start_index = $block_start_i + ($index_amount * $block_data_i);
+ $end_index = min($block_end_i, $block_start_i + ($index_amount * ($block_data_i + 1)));
+
+ $out = ['interval_min' => $interval_min * $interval_multi, 'data_point_modulo' => $fl_i_modulo, 'block_start_i' => $block_start_i, 'block_end_i' => $block_end_i, 'match_index' => $match_index, 'block_data_index' => $block_data_i, 'block_data_index_max' => $data_i_max, 'block_data_index_amount' => $index_amount, 'block_data_start' => $start_index, 'block_data_end' => $end_index, 'flashlog' => [], 'database' => []];
// Add flashlog measurement data
- $fl_data_cln = [];
- for ($i=$start_index; $i<$end_index; $i++)
- {
+ $fl_data_cln = [];
+ for ($i = $start_index; $i < $end_index; $i++) {
$block_data_item = FlashLog::cleanFlashlogItem($block_data[$i]);
-
- if (isset($block_data_item['time']))
- {
+
+ if (isset($block_data_item['time'])) {
$block_data_item['time'] .= 'Z'; // display as UTC
$fl_data_cln[] = $block_data_item;
}
}
$data_val_count = count($fl_data_cln);
-
+
// Add Database data
- if ($data_val_count > 0)
- {
- $first_obj = $fl_data_cln[0];
- $last_obj = $fl_data_cln[$data_val_count-1];
- $start_time = substr($first_obj['time'], 0, 19); // cut off Z
- $end_time = substr($last_obj['time'], 0, 19); // cut off Z
- $query = 'SELECT "'.implode('","', $measurements).'" FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$start_time.'\' AND time <= \''.$end_time.'\' ORDER BY time ASC LIMIT '.$index_amount;
+ if ($data_val_count > 0) {
+ $first_obj = $fl_data_cln[0];
+ $last_obj = $fl_data_cln[$data_val_count - 1];
+ $start_time = substr($first_obj['time'], 0, 19); // cut off Z
+ $end_time = substr($last_obj['time'], 0, 19); // cut off Z
+ $query = 'SELECT "'.implode('","', $measurements).'" FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$start_time.'\' AND time <= \''.$end_time.'\' ORDER BY time ASC LIMIT '.$index_amount;
$db_data_block = Device::getInfluxQuery($query, 'flashlog');
- $db_data_len = count($db_data_block);
- $db_data_cln = [];
-
- for ($i=0; $i<$db_data_len; $i++)
+ $db_data_len = count($db_data_block);
+ $db_data_cln = [];
+
+ for ($i = 0; $i < $db_data_len; $i++) {
$db_data_cln[] = array_filter($db_data_block[$i]);
-
+ }
+
// Run through the data to see how many % of the data matches
- if ($device->rtc)
- {
- $out['block_data_match_percentage'] = 100;
+ if ($device->rtc) {
+ $out['block_data_match_percentage'] = 100;
$out['block_data_flashlog_sec_diff'] = 0;
- $out['block_data_match_errors'] = '';
- $out['block_data_diff_percentage'] = 0;
- $out['block_data_match_count'] = $index_amount;
- }
- else
- {
- if ($data_minutes <= 43200)
- {
+ $out['block_data_match_errors'] = '';
+ $out['block_data_diff_percentage'] = 0;
+ $out['block_data_match_count'] = $index_amount;
+ } else {
+ if ($data_minutes <= 43200) {
$match_percentage = $this->matchPercentage($fl_data_cln, $db_data_cln, $match_props);
- $out['block_data_match_percentage'] = $match_percentage['perc_match'];
+ $out['block_data_match_percentage'] = $match_percentage['perc_match'];
$out['block_data_flashlog_sec_diff'] = $match_percentage['sec_diff'];
- $out['block_data_match_errors'] = $match_percentage['errors'];
- $out['block_data_diff_percentage'] = $match_percentage['avg_diff'];
- $out['block_data_match_count'] = $match_percentage['match_count'];
- }
- else
- {
- $out['block_data_match_percentage'] = 0;
+ $out['block_data_match_errors'] = $match_percentage['errors'];
+ $out['block_data_diff_percentage'] = $match_percentage['avg_diff'];
+ $out['block_data_match_count'] = $match_percentage['match_count'];
+ } else {
+ $out['block_data_match_percentage'] = 0;
$out['block_data_flashlog_sec_diff'] = '?';
- $out['block_data_match_errors'] = 'Cannot calculate matches for periods >30 days';
- $out['block_data_diff_percentage'] = 0;
- $out['block_data_match_count'] = 0;
+ $out['block_data_match_errors'] = 'Cannot calculate matches for periods >30 days';
+ $out['block_data_diff_percentage'] = 0;
+ $out['block_data_match_count'] = 0;
}
}
// Add min start / max end time for ChartJS view
$time_start_db = strtotime($first_obj['time']);
- $time_end_db = strtotime($last_obj['time']);
+ $time_end_db = strtotime($last_obj['time']);
$time_start_fl = strtotime($block_data[$start_index]['time']);
- $time_end_fl = strtotime($block_data[$end_index-1]['time']);
+ $time_end_fl = strtotime($block_data[$end_index - 1]['time']);
$out['start_date'] = date($this->timeFormat, min($time_start_db, $time_start_fl)).'Z';
- $out['end_date'] = date($this->timeFormat, max($time_end_db, $time_end_fl)).'Z';
+ $out['end_date'] = date($this->timeFormat, max($time_end_db, $time_end_fl)).'Z';
// Add DB data
- $out['database'] = $db_data_cln;
-
- // Remove values for ease of charting (in frontend) if $interval_multi > 1
- if ($fl_i_modulo > 1)
- {
- for ($i=0; $i < $data_val_count; $i++)
- {
- if ($i % $fl_i_modulo != 0)
- {
+ $out['database'] = $db_data_cln;
+
+ // Remove values for ease of charting (in frontend) if $interval_multi > 1
+ if ($fl_i_modulo > 1) {
+ for ($i = 0; $i < $data_val_count; $i++) {
+ if ($i % $fl_i_modulo != 0) {
unset($fl_data_cln[$i]);
unset($db_data_cln[$i]);
}
@@ -756,109 +711,103 @@ private function parse(Request $request, $id, $persist=false, $delete=false)
}
// Add properties
$out['block_id'] = $block_id;
- }
- else if ($delete) // no matches but delete button pressed
- {
- $out = ['data_deleted'=>false, 'deleted_measurements'=>0, 'deleted_days'=>0, 'error'=>'no_data_deleted_because_no_matches_found'];
- }
- else // Show only flashlog data without matched time
- {
+ } elseif ($delete) { // no matches but delete button pressed
+ $out = ['data_deleted' => false, 'deleted_measurements' => 0, 'deleted_days' => 0, 'error' => 'no_data_deleted_because_no_matches_found'];
+ } else { // Show only flashlog data without matched time
// select portion of the data
- $match_index = $block['fl_i'];
- $index_amount = round($data_minutes / $interval_min);
- $data_i_max = floor(($block_end_i - $block_start_i) / $index_amount);
-
- if ($block_data_i == -1)
- $block_data_i = round( $data_i_max * (($match_index - $block_start_i) / $block_length) );
-
- if ($block_data_i < 0)
+ $match_index = $block['fl_i'];
+ $index_amount = round($data_minutes / $interval_min);
+ $data_i_max = floor(($block_end_i - $block_start_i) / $index_amount);
+
+ if ($block_data_i == -1) {
+ $block_data_i = round($data_i_max * (($match_index - $block_start_i) / $block_length));
+ }
+
+ if ($block_data_i < 0) {
$block_data_i = 0;
+ }
- if ($block_data_i > $data_i_max)
+ if ($block_data_i > $data_i_max) {
$block_data_i = $data_i_max;
+ }
$start_index = $block_start_i + ($index_amount * $block_data_i);
- $end_index = min($block_end_i, $block_start_i + ($index_amount * ($block_data_i+1)));
+ $end_index = min($block_end_i, $block_start_i + ($index_amount * ($block_data_i + 1)));
- $out = ['block_start_i'=>$block_start_i, 'block_end_i'=>$block_end_i, 'match_index'=>$match_index, 'block_data_index'=>$block_data_i, 'block_data_index_max'=>$data_i_max, 'block_data_index_amount'=>$index_amount, 'block_data_start'=>$start_index, 'block_data_end'=>$end_index, 'flashlog'=>[], 'database'=>[]];
+ $out = ['block_start_i' => $block_start_i, 'block_end_i' => $block_end_i, 'match_index' => $match_index, 'block_data_index' => $block_data_i, 'block_data_index_max' => $data_i_max, 'block_data_index_amount' => $index_amount, 'block_data_start' => $start_index, 'block_data_end' => $end_index, 'flashlog' => [], 'database' => []];
// check if time is set
$device_time_set = false;
- if (isset($block_data[$start_index]['time']) && isset($block_data[$end_index-1]['time']))
+ if (isset($block_data[$start_index]['time']) && isset($block_data[$end_index - 1]['time'])) {
$device_time_set = true;
+ }
// Add flashlog measurement data
$out['start_date'] = null;
- $out['end_date'] = null;
- $fl_i_modulo = $interval_multi;
- $modulo_counter = 0; // counter that starts at 0 (like DB $i)
-
- for ($i=$start_index; $i<$end_index; $i++)
- {
- if ($fl_i_modulo < 2 || $modulo_counter % $fl_i_modulo == 0)
- {
+ $out['end_date'] = null;
+ $fl_i_modulo = $interval_multi;
+ $modulo_counter = 0; // counter that starts at 0 (like DB $i)
+
+ for ($i = $start_index; $i < $end_index; $i++) {
+ if ($fl_i_modulo < 2 || $modulo_counter % $fl_i_modulo == 0) {
$data_item = $block_data[$i];
- if (isset($data_item['port']) && $data_item['port'] == 3)
- {
+ if (isset($data_item['port']) && $data_item['port'] == 3) {
$block_data_item = FlashLog::cleanFlashlogItem($data_item, false);
- if ($device_time_set == false && isset($block_data_item['minute']))
- $block_data_item['time'] = date('Y-m-d\TH:i:s\Z', 946681200 + $block_data_item['minute'] * 60); // display as UTC from 2000-01-01 00:00:00
-
+ if ($device_time_set == false && isset($block_data_item['minute'])) {
+ $block_data_item['time'] = date('Y-m-d\TH:i:s\Z', 946681200 + $block_data_item['minute'] * 60);
+ } // display as UTC from 2000-01-01 00:00:00
+
$out['flashlog'][] = $block_data_item;
- if (empty($out['start_date'])) // first item
+ if (empty($out['start_date'])) { // first item
$out['start_date'] = $block_data_item['time'];
+ }
$out['end_date'] = $block_data_item['time']; // last port 3 item
}
}
$modulo_counter++;
-
+
}
- $out['block_data_match_percentage'] = 0;
+ $out['block_data_match_percentage'] = 0;
$out['block_data_flashlog_sec_diff'] = '? ';
- $out['block_data_match_errors'] = '';
+ $out['block_data_match_errors'] = '';
}
- }
- else // no block_id set, so show all blocks, or download all data in the flashlog
- {
- if ($export_csv || $export_json)
- {
+ } else { // no block_id set, so show all blocks, or download all data in the flashlog
+ if ($export_csv || $export_json) {
$all_log_data = json_decode($flashlog->getFileContent('log_file_parsed'), true);
+
return FlashLog::exportData($all_log_data, "user-$user_id-$device_name-log-file-$id-all-data", $export_csv);
}
}
- }
- else
- {
- $out = ['error'=>'no_flashlog_data'];
+ } else {
+ $out = ['error' => 'no_flashlog_data'];
}
// Add properties
- $out['device_id'] = $device_id;
+ $out['device_id'] = $device_id;
$out['device_name'] = $device_name;
- $out['hive_id'] = $hive_id;
- $out['hive_name'] = $hive_name;
- $out['user_id'] = $user_id;
- $out['user_name'] = $user_name;
- }
- else
- {
- $out = ['error'=>'no_device'];
+ $out['hive_id'] = $hive_id;
+ $out['hive_name'] = $hive_name;
+ $out['user_id'] = $user_id;
+ $out['user_name'] = $user_name;
+ } else {
+ $out = ['error' => 'no_device'];
}
}
-
+
// Add properties
$out['matches_min'] = $matches_min;
$out['match_props'] = $match_props;
- $out['db_records'] = $db_records;
+ $out['db_records'] = $db_records;
$out['flashlog_id'] = $flashlog_id;
$out['persisted_block_ids_array'] = $flashlog->persisted_block_ids_array;
-
- if ($show_log)
+
+ if ($show_log) {
$out['log'] = $out_log;
+ }
return $out;
}
@@ -867,5 +816,4 @@ public function destroy(Request $request, $id)
{
return response()->json($request->user()->flashlogs()->findOrFail($id)->delete());
}
-
}
diff --git a/app/Http/Controllers/Api/GroupController.php b/app/Http/Controllers/Api/GroupController.php
index 1f35cd78..6a760cf4 100644
--- a/app/Http/Controllers/Api/GroupController.php
+++ b/app/Http/Controllers/Api/GroupController.php
@@ -2,25 +2,23 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
-use Illuminate\Support\Str;
-use Illuminate\Support\Facades\Log;
-use App\Http\Controllers\Controller;
-use Auth;
-use Mail;
use App\Group;
-use App\Hive;
-use App\User;
-use App\Mail\GroupInvitation;
+use App\Http\Controllers\Controller;
use App\Mail\GroupAcceptation;
+use App\Mail\GroupInvitation;
use App\Mail\GroupRefusal;
-
+use App\User;
+use Auth;
use DB;
+use Illuminate\Http\Request;
+use Illuminate\Support\Str;
+use Mail;
use Validator;
/**
* @group Api\GroupController
* Manage collaboration groups
+ *
* @authenticated
*/
class GroupController extends Controller
@@ -28,198 +26,194 @@ class GroupController extends Controller
/**
* api/groups GET
* List all groups, or by ids
+ *
* @authenticated
+ *
* @urlParam ids string P
*/
- public function index(Request $request, $code=200, $message=null, $error=null)
+ public function index(Request $request, $code = 200, $message = null, $error = null)
{
- if ($request->filled('ids'))
- {
+ if ($request->filled('ids')) {
$group_ids = $request->input('ids');
- if (gettype($group_ids) == 'string')
+ if (gettype($group_ids) == 'string') {
$group_ids = explode(',', $group_ids);
+ }
}
- if (isset($group_ids) && gettype($group_ids) == 'array')
- {
+ if (isset($group_ids) && gettype($group_ids) == 'array') {
$groupsAndInvites = [];
$groupsAndInvites['invitations'] = $request->user()->groupInvitations();
- $groupsAndInvites['groups'] = $request->user()->groups()->whereIn('id', $group_ids)->orderBy('name')->get();
- }
- else
- {
+ $groupsAndInvites['groups'] = $request->user()->groups()->whereIn('id', $group_ids)->orderBy('name')->get();
+ } else {
$groupsAndInvites = $request->user()->groupsAndInvites();
}
-
+
$groupsAndInvites['message'] = $message;
- $groupsAndInvites['error'] = $error;
+ $groupsAndInvites['error'] = $error;
+
return response()->json($groupsAndInvites, $code);
}
/**
* api/groups/checktoken POST
* Check a token for a group id, and accept or decline the invite
+ *
* @authenticated
- * @param \Illuminate\Http\Request $request
+ *
* @return \Illuminate\Http\Response
*/
public function checktoken(Request $request)
{
- $validator = Validator::make($request->only('token','group_id','decline'), [
- 'token' => 'required|exists:group_user,token',
- 'group_id' => 'required|exists:group_user,group_id',
- 'decline' => 'nullable|boolean',
+ $validator = Validator::make($request->only('token', 'group_id', 'decline'), [
+ 'token' => 'required|exists:group_user,token',
+ 'group_id' => 'required|exists:group_user,group_id',
+ 'decline' => 'nullable|boolean',
]);
- if ($validator->fails())
- {
- return response()->json(['errors'=>$validator->errors()]);
- }
- else
- {
- $valid_data = $validator->validated();
- $group_id = $valid_data['group_id'];
- $token = $valid_data['token'];
- $decline = (isset($valid_data['decline']) && boolval($valid_data['decline']) === true) ? true : false;
- $group_user_id = DB::table('group_user')->where('token',$token)->where('group_id',$group_id)->value('user_id');
- $user_name = User::where('id',$group_user_id)->value('name');
-
- if ($decline)
- $res = DB::table('group_user')->where('token',$token)->where('group_id',$group_id)->update(['invited'=>null,'accepted'=>null,'declined'=>now(),'token'=>null]);
- else
- $res = DB::table('group_user')->where('token',$token)->where('group_id',$group_id)->update(['invited'=>null,'accepted'=>now(),'declined'=>null,'token'=>null]);
-
- if ($res)
- {
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ } else {
+ $valid_data = $validator->validated();
+ $group_id = $valid_data['group_id'];
+ $token = $valid_data['token'];
+ $decline = (isset($valid_data['decline']) && boolval($valid_data['decline']) === true) ? true : false;
+ $group_user_id = DB::table('group_user')->where('token', $token)->where('group_id', $group_id)->value('user_id');
+ $user_name = User::where('id', $group_user_id)->value('name');
+
+ if ($decline) {
+ $res = DB::table('group_user')->where('token', $token)->where('group_id', $group_id)->update(['invited' => null, 'accepted' => null, 'declined' => now(), 'token' => null]);
+ } else {
+ $res = DB::table('group_user')->where('token', $token)->where('group_id', $group_id)->update(['invited' => null, 'accepted' => now(), 'declined' => null, 'token' => null]);
+ }
+
+ if ($res) {
$this->sendAcceptMailToGroupAdmins($group_id, $user_name, $group_user_id, $decline);
- $msg = $decline ? 'group_declined' : 'group_activated';
+ $msg = $decline ? 'group_declined' : 'group_activated';
// Empty group cache upon new member
$group = Group::where('id', $group_id)->first();
- if ($group)
+ if ($group) {
$group->empty_cache();
-
- return response()->json(['message'=>$msg]);
- }
+ }
+ return response()->json(['message' => $msg]);
+ }
}
- return response()->json('token_error',500);
+
+ return response()->json('token_error', 500);
}
- private function sendAcceptMailToGroupAdmins($group_id, $user_name, $group_user_id, $decline=false)
+ private function sendAcceptMailToGroupAdmins($group_id, $user_name, $group_user_id, $decline = false)
{
- $group_name = Group::where('id', $group_id)->value('name');
- $group_admin = DB::table('group_user')->where('user_id', '!=', $group_user_id)->where('group_id',$group_id)->where('admin',1)->pluck('user_id')->toArray();
- $admin_mails = User::whereIn('id',$group_admin)->pluck('name','email')->toArray();
-
- foreach ($admin_mails as $email => $name)
- {
- if ($decline)
+ $group_name = Group::where('id', $group_id)->value('name');
+ $group_admin = DB::table('group_user')->where('user_id', '!=', $group_user_id)->where('group_id', $group_id)->where('admin', 1)->pluck('user_id')->toArray();
+ $admin_mails = User::whereIn('id', $group_admin)->pluck('name', 'email')->toArray();
+
+ foreach ($admin_mails as $email => $name) {
+ if ($decline) {
Mail::to($email)->send(new GroupRefusal($name, $group_name, $user_name));
- else
+ } else {
Mail::to($email)->send(new GroupAcceptation($name, $group_name, $user_name));
+ }
}
}
-
public function store(Request $request)
{
$userExist = $this->checkIfUsersExist($request);
- if (gettype($userExist) == 'array')
- {
- if (isset($userExist['error']))
+ if (gettype($userExist) == 'array') {
+ if (isset($userExist['error'])) {
return response()->json($userExist, 422);
+ }
}
- $requestData = $request->only(['name','description','hex_color']);
- $group = Group::create($requestData);
- $request->user()->groups()->attach($group, ['creator'=>true,'admin'=>true,'accepted'=>now()]);
+ $requestData = $request->only(['name', 'description', 'hex_color']);
+ $group = Group::create($requestData);
+ $request->user()->groups()->attach($group, ['creator' => true, 'admin' => true, 'accepted' => now()]);
$this->syncHives($request, $group);
-
+
$msg = $this->syncUsers($request, $group);
- if (gettype($msg) == 'array')
- {
- if (isset($msg['message']))
+ if (gettype($msg) == 'array') {
+ if (isset($msg['message'])) {
return $this->index($request, 201, $msg['message']);
- else if (isset($msg['error']))
+ } elseif (isset($msg['error'])) {
return $this->index($request, 422, null, $msg['error']);
+ }
}
return $this->index($request, 201, __('group.Created').$requestData['name']);
}
-
public function show(Request $request, $id)
{
$group = $request->user()->groups()->find($id);
- if ($group)
- {
- return response()->json($group);
+ if ($group) {
+ return response()->json($group);
}
+
return response()->json(null, 404);
}
-
public function update(Request $request, $id)
{
$userExist = $this->checkIfUsersExist($request);
- if (gettype($userExist) == 'array')
- {
- if (isset($userExist['error']))
+ if (gettype($userExist) == 'array') {
+ if (isset($userExist['error'])) {
return response()->json($userExist, 422);
+ }
}
- $requestData = $request->only(['id','name','description','hex_color']);
+ $requestData = $request->only(['id', 'name', 'description', 'hex_color']);
$group = $request->user()->groups()->find($id);
- if ($group)
- {
+ if ($group) {
$this->syncHives($request, $group);
$group->empty_cache();
-
- if ($group->getAdminAttribute())
- {
+
+ if ($group->getAdminAttribute()) {
$group->update($requestData);
$msg = $this->syncUsers($request, $group);
- if (gettype($msg) == 'array')
- {
- if (isset($msg['message']))
+ if (gettype($msg) == 'array') {
+ if (isset($msg['message'])) {
return $this->index($request, 201, $msg['message']);
- else if (isset($msg['error']))
+ } elseif (isset($msg['error'])) {
return $this->index($request, 422, null, $msg['error']);
+ }
}
}
return $this->index($request, 200, __('group.Updated').$requestData['name']);
}
+
return response()->json('no_group_found', 404);
}
public function detach(Request $request, $id)
{
$group = $request->user()->groups()->findOrFail($id);
- if ($group)
- {
- $res = $this->detachFromGroup($request->user(), $group);
- if ($res)
- return response()->json(['message'=>'group_detached'], 200);
+ if ($group) {
+ $res = $this->detachFromGroup($request->user(), $group);
+ if ($res) {
+ return response()->json(['message' => 'group_detached'], 200);
+ }
}
- return response()->json(['error'=>'no_group_detached'], 404);
+ return response()->json(['error' => 'no_group_detached'], 404);
}
private function detachFromGroup($user, $group)
{
- $user_hive_ids = $user->hives()->pluck('hives.id')->toArray();
- $group_hive_ids = $group->group_hives()->pluck('hives.id')->toArray();
+ $user_hive_ids = $user->hives()->pluck('hives.id')->toArray();
+ $group_hive_ids = $group->group_hives()->pluck('hives.id')->toArray();
$user_group_hive_ids = array_intersect($group_hive_ids, $user_hive_ids);
-
- //die(print_r(['user_hives'=>$user_hive_ids,'hives'=>$group_hive_ids, 'match'=>$user_group_hive_ids]));
-
+
+ // die(print_r(['user_hives'=>$user_hive_ids,'hives'=>$group_hive_ids, 'match'=>$user_group_hive_ids]));
+
$group->group_hives()->detach($user_group_hive_ids);
$user->groups()->detach($group->id);
-
+
$group->empty_cache();
+
// ToDo make next admin in group owner
return true;
}
@@ -227,171 +221,150 @@ private function detachFromGroup($user, $group)
public function destroy(Request $request, $id)
{
$group = $request->user()->groups()->findOrFail($id);
- $name = $group->name;
- $del = false;
+ $name = $group->name;
+ $del = false;
- if ($group && $group->getCreatorAttribute())
- {
+ if ($group && $group->getCreatorAttribute()) {
$del = $group->delete();
+
return $this->index($request, 200, __('group.Deleted').$name);
}
-
+
return $this->index($request, 404, null, 'no_group_creator');
}
-
-
private function syncHives(Request $request, $group)
- {
+ {
// add edit_hive states to group_hive association
$hive_ids = $request->input('hives_selected');
$edit_ids = $request->input('hives_editable');
$sync_ids = [];
- foreach ($hive_ids as $i => $hive_id)
- {
- $sync_ids[$hive_id] = ['edit_hive'=>false];
- if (in_array($hive_id, $edit_ids))
- $sync_ids[$hive_id] = ['edit_hive'=>true];
+ foreach ($hive_ids as $i => $hive_id) {
+ $sync_ids[$hive_id] = ['edit_hive' => false];
+ if (in_array($hive_id, $edit_ids)) {
+ $sync_ids[$hive_id] = ['edit_hive' => true];
+ }
}
+
return $group->group_hives()->sync($sync_ids);
}
-
private function checkIfUsersExist(Request $request)
{
- $users = $request->input('users');
- $error_msg = [];
- foreach ($users as $i => $user)
- {
+ $users = $request->input('users');
+ $error_msg = [];
+ foreach ($users as $i => $user) {
$validUser = null;
- $user_id = '';
-
- if (isset($user['email']))
- {
- $validUser = User::where('email',$user['email'])->first();
- if (!isset($validUser))
+ $user_id = '';
+
+ if (isset($user['email'])) {
+ $validUser = User::where('email', $user['email'])->first();
+ if (! isset($validUser)) {
$error_msg[] = $user['email'];
+ }
}
}
- if (count($error_msg) > 0)
- {
- return ['error'=>__('group.email_na').implode(', ', $error_msg)];
+ if (count($error_msg) > 0) {
+ return ['error' => __('group.email_na').implode(', ', $error_msg)];
}
+
return true;
}
private function syncUsers(Request $request, $group)
- {
+ {
// add edit_hive states to group_hive association
$groupUsers = $group->users;
- $users = $request->input('users');
+ $users = $request->input('users');
$invite_grp = [];
$invite_new = [];
- $updated_msg= [];
- $error_msg = [];
+ $updated_msg = [];
+ $error_msg = [];
- foreach ($users as $i => $user)
- {
+ foreach ($users as $i => $user) {
$validUser = null;
- $user_id = '';
-
- if (isset($user['email']))
- {
- $validUser = User::where('email',$user['email'])->first();
- $user_id = isset($validUser) ? ','.$validUser->id : '';
+ $user_id = '';
+
+ if (isset($user['email'])) {
+ $validUser = User::where('email', $user['email'])->first();
+ $user_id = isset($validUser) ? ','.$validUser->id : '';
}
$validator = Validator::make($user, [
- 'id' => 'nullable|integer|exists:users,id',
- 'name' => 'nullable|string',
- 'email' => 'required|email|unique:users,email'.$user_id,
- 'admin' => 'required|boolean',
+ 'id' => 'nullable|integer|exists:users,id',
+ 'name' => 'nullable|string',
+ 'email' => 'required|email|unique:users,email'.$user_id,
+ 'admin' => 'required|boolean',
'delete' => 'nullable|boolean',
]);
- if ($validator->fails())
- {
+ if ($validator->fails()) {
$error_msg[] = $validator->errors();
+
continue;
}
$validData = $validator->validated();
- $email = $validData['email'];
- $name = isset($validData['name']) ? $validData['name'] : $validUser['name'];
- $admin = (isset($validData['admin']) && $validData['admin']);
- $delete = (isset($validData['delete']) && $validData['delete']);
-
- if (isset($validData['id']))
- $validUser = User::where('id',$validData['id'])->orWhere('email',$email)->first();
- else
- $validUser = User::where('email',$email)->first();
-
- if ($validUser)
- {
- $alreadyIn = ($groupUsers->where('email',$email)->count() > 0);
+ $email = $validData['email'];
+ $name = isset($validData['name']) ? $validData['name'] : $validUser['name'];
+ $admin = (isset($validData['admin']) && $validData['admin']);
+ $delete = (isset($validData['delete']) && $validData['delete']);
+
+ if (isset($validData['id'])) {
+ $validUser = User::where('id', $validData['id'])->orWhere('email', $email)->first();
+ } else {
+ $validUser = User::where('email', $email)->first();
+ }
+
+ if ($validUser) {
+ $alreadyIn = ($groupUsers->where('email', $email)->count() > 0);
// check if we need to invite
- if ($alreadyIn)
- {
- if ($delete) // detach user and it's hives from the group
- {
+ if ($alreadyIn) {
+ if ($delete) { // detach user and it's hives from the group
$this->detachFromGroup($validUser, $group);
- }
- else // update user
- {
- $res = DB::table('group_user')->where('user_id',$validUser->id)->where('group_id',$group->id)->update(['admin'=>$admin]);
- if ($res && $validUser->id != $request->user()->id)
+ } else { // update user
+ $res = DB::table('group_user')->where('user_id', $validUser->id)->where('group_id', $group->id)->update(['admin' => $admin]);
+ if ($res && $validUser->id != $request->user()->id) {
$updated_msg[] = $name;
+ }
// die(print_r(['admin'=>$admin,'del'=>$delete,'invite_new'=>$invite_new, 'invite_grp'=>$invite_grp, 'updated_msg'=>$updated_msg, 'u'=>$validUser->id, 'g'=>$group->group_id]));
}
- }
- else
- {
+ } else {
// invite existing Beep user for group
$token = Str::random(30);
- $validUser->groups()->attach($group->id, ['creator'=>false,'admin'=>$admin,'invited'=>now(),'token'=>$token]);
- $invite_grp[$validUser->email] = ['name'=>$name, 'admin'=>$admin, 'token'=>$token];
+ $validUser->groups()->attach($group->id, ['creator' => false, 'admin' => $admin, 'invited' => now(), 'token' => $token]);
+ $invite_grp[$validUser->email] = ['name' => $name, 'admin' => $admin, 'token' => $token];
}
$validUser->emptyCache('group');
- }
- else
- {
+ } else {
// invite non-existing Beep user for group
- //die(print_r(['invite_new_user'=>$email]));
- if ($delete)
+ // die(print_r(['invite_new_user'=>$email]));
+ if ($delete) {
$invite_grp[$email] = $admin;
- else
+ } else {
$invite_new[$user['email']] = $user['name'];
+ }
}
}
- if (count($invite_grp) > 0)
- {
+ if (count($invite_grp) > 0) {
$emails = [];
- foreach ($invite_grp as $email => $user)
- {
+ foreach ($invite_grp as $email => $user) {
$invited_by = Auth::user()->name.(Auth::user()->name != Auth::user()->email ? ' ('.Auth::user()->email.')' : '');
Mail::to($email)->send(new GroupInvitation($group, $name, $admin, $user['token'], $invited_by));
$emails[] = $email;
}
- return ['message'=>__('group.Invited').implode(', ', $emails)];
- }
- else if (count($invite_new) > 0)
- {
- return ['error'=>__('group.email_na').implode(', ', $invite_new)];
- }
- else if (count($updated_msg) > 0)
- {
- return ['message'=>__('group.Updated').implode(', ', $updated_msg)];
- }
- else if (count($error_msg) > 0)
- {
- return ['error'=>implode(', ', $error_msg)];
+
+ return ['message' => __('group.Invited').implode(', ', $emails)];
+ } elseif (count($invite_new) > 0) {
+ return ['error' => __('group.email_na').implode(', ', $invite_new)];
+ } elseif (count($updated_msg) > 0) {
+ return ['message' => __('group.Updated').implode(', ', $updated_msg)];
+ } elseif (count($error_msg) > 0) {
+ return ['error' => implode(', ', $error_msg)];
}
$group->empty_cache();
+
return $group->group_users();
}
-
-
-
-
}
diff --git a/app/Http/Controllers/Api/HiveController.php b/app/Http/Controllers/Api/HiveController.php
index 2270b792..b16926a3 100644
--- a/app/Http/Controllers/Api/HiveController.php
+++ b/app/Http/Controllers/Api/HiveController.php
@@ -2,25 +2,26 @@
namespace App\Http\Controllers\Api;
-use App\Hive;
-use App\Queen;
use App\Category;
-use App\Location;
+use App\Hive;
use App\HiveFactory;
-use Illuminate\Http\Request;
-use App\Http\Requests\PostHiveRequest;
use App\Http\Controllers\Controller;
+use App\Http\Requests\PostHiveRequest;
+use App\Location;
+use App\Queen;
+use Illuminate\Http\Request;
/**
* @group Api\HiveController
* Manage your hives
+ *
* @authenticated
*/
class HiveController extends Controller
{
/**
* @var HiveFactory
- **/
+ **/
private $hiveFactory;
public function __construct(HiveFactory $hiveFactory)
@@ -30,35 +31,39 @@ public function __construct(HiveFactory $hiveFactory)
private function saveQueen(Request $request, $hive)
{
- if ($request->filled('queen.race_id') || $request->filled('queen.name') || $request->filled('queen.birth_date') || $request->filled('queen.color') || $request->filled('queen.clipped') || $request->filled('queen.fertilized') || $request->filled('queen.description') || $request->filled('queen.line') || $request->filled('queen.tree'))
- {
+ if ($request->filled('queen.race_id') || $request->filled('queen.name') || $request->filled('queen.birth_date') || $request->filled('queen.color') || $request->filled('queen.clipped') || $request->filled('queen.fertilized') || $request->filled('queen.description') || $request->filled('queen.line') || $request->filled('queen.tree')) {
$race_id = Category::findCategoryIdByParentAndName('subspecies', 'other');
- $date = $request->filled('queen.birth_date') ? date('Y-m-d', strtotime($request->input('queen.birth_date'))) : null;
+ $date = $request->filled('queen.birth_date') ? date('Y-m-d', strtotime($request->input('queen.birth_date'))) : null;
$queen = [
- 'name' =>$request->input('queen.name'),
- 'description' =>$request->input('queen.description'),
- 'line' =>$request->input('queen.line'),
- 'tree' =>$request->input('queen.tree'),
- 'race_id' =>$request->input('queen.race_id', $race_id),
- 'birth_date' =>$date,
- 'color' =>$request->input('queen.color'),
- 'clipped' =>boolval($request->input('queen.clipped')),
- 'fertilized' =>boolval($request->input('queen.fertilized')),
- ];
-
- if ($request->filled('queen.id') && empty($queen['race_id'])) // update of queen without race defined, set to default
+ 'name' => $request->input('queen.name'),
+ 'description' => $request->input('queen.description'),
+ 'line' => $request->input('queen.line'),
+ 'tree' => $request->input('queen.tree'),
+ 'race_id' => $request->input('queen.race_id', $race_id),
+ 'birth_date' => $date,
+ 'color' => $request->input('queen.color'),
+ 'clipped' => boolval($request->input('queen.clipped')),
+ 'fertilized' => boolval($request->input('queen.fertilized')),
+ ];
+
+ if ($request->filled('queen.id') && empty($queen['race_id'])) { // update of queen without race defined, set to default
$queen['race_id'] = $race_id;
+ }
- $hive->queen()->updateOrCreate(['id'=>$request->input('queen.id', null)], $queen);
+ $hive->queen()->updateOrCreate(['id' => $request->input('queen.id', null)], $queen);
}
+
return $hive;
}
/**
* api/hives GET
* Display a listing of user hives.
+ *
* @return \Illuminate\Http\Response
+ *
* @authenticated
+ *
* @response{
"hives": [
{
@@ -106,42 +111,44 @@ private function saveQueen(Request $request, $hive)
"queen": null
}
]}
- */
+ */
public function index(Request $request)
{
- if ($request->user()->hives()->count() > 0)
- return response()->json(['hives'=>$request->user()->hives()->with('layers.frames', 'queen')->get()]);
+ if ($request->user()->hives()->count() > 0) {
+ return response()->json(['hives' => $request->user()->hives()->with('layers.frames', 'queen')->get()]);
+ }
- return response()->json(['error'=>'no hives available'],404);
+ return response()->json(['error' => 'no hives available'], 404);
}
-
/**
* api/hives POST
* Store a newly created Hive in storage for the authenticated user.
+ *
* @authenticated
- * @param \App\Requests\PostHiveRequest $request
+ *
+ * @param \App\Requests\PostHiveRequest $request
* @return \App\Hive
*/
public function store(PostHiveRequest $request)
{
-
- $user_id = $request->user()->id;
- $location = $request->user()->locations()->findOrFail($request->input('location_id'));
- $name = $request->input('name');
- $order = $request->input('order', null);
- $bb_width_cm = $request->input('bb_width_cm', null);
- $bb_depth_cm = $request->input('bb_depth_cm', null);
- $bb_height_cm = $request->input('bb_height_cm', null);
- $fr_width_cm = $request->input('fr_width_cm', null);
- $fr_height_cm = $request->input('fr_height_cm', null);
- $hive_type_id = $request->input('hive_type_id', 63);
- $color = $request->input('color', '#FABB13'); // yellow
+
+ $user_id = $request->user()->id;
+ $location = $request->user()->locations()->findOrFail($request->input('location_id'));
+ $name = $request->input('name');
+ $order = $request->input('order', null);
+ $bb_width_cm = $request->input('bb_width_cm', null);
+ $bb_depth_cm = $request->input('bb_depth_cm', null);
+ $bb_height_cm = $request->input('bb_height_cm', null);
+ $fr_width_cm = $request->input('fr_width_cm', null);
+ $fr_height_cm = $request->input('fr_height_cm', null);
+ $hive_type_id = $request->input('hive_type_id', 63);
+ $color = $request->input('color', '#FABB13'); // yellow
$broodLayerAmount = $request->input('brood_layers', 1);
$honeyLayerAmount = $request->input('honey_layers', 1);
- $frameAmount = $request->input('frames', 10);
- $layers = $request->input('layers', null);
- $timeZone = $request->input('timezone', 'Europe/Amsterdam');
+ $frameAmount = $request->input('frames', 10);
+ $layers = $request->input('layers', null);
+ $timeZone = $request->input('timezone', 'Europe/Amsterdam');
$hive = $this->hiveFactory->createHive($user_id, $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $layers);
$hive = $this->saveQueen($request, $hive);
@@ -152,42 +159,43 @@ public function store(PostHiveRequest $request)
/**
* api/hives/{id} GET
* Display the specified resource.
+ *
* @authenticated
- * @param \App\Hive $hive
+ *
* @return \App\Hive
*/
public function show(Request $request, Hive $hive)
{
- return response()->json(['hives'=>[$request->user()->allhives()->orderBy('name')->with('layers.frames', 'queen')->findOrFail($hive->id)]]);
+ return response()->json(['hives' => [$request->user()->allhives()->orderBy('name')->with('layers.frames', 'queen')->findOrFail($hive->id)]]);
}
-
/**
* api/hives/{id} PATCH
* Update the specified user Hive in storage.
+ *
* @authenticated
- * @param \App\Requests\PostHiveRequest $request
- * @param \App\Hive $hive
+ *
+ * @param \App\Requests\PostHiveRequest $request
* @return \App\Hive
*/
public function update(PostHiveRequest $request, Hive $hive)
{
- $hive = $request->user()->allhives(true)->findOrFail($hive->id);
- $location = $request->user()->allLocations(true)->findOrFail($request->input('location_id'));
- $name = $request->input('name');
- $order = $request->input('order', null);
- $bb_width_cm = $request->input('bb_width_cm', null);
- $bb_depth_cm = $request->input('bb_depth_cm', null);
- $bb_height_cm = $request->input('bb_height_cm', null);
- $fr_width_cm = $request->input('fr_width_cm', null);
- $fr_height_cm = $request->input('fr_height_cm', null);
- $hive_type_id = $request->input('hive_type_id');
- $color = $request->input('color', '#FABB13'); // yellow
+ $hive = $request->user()->allhives(true)->findOrFail($hive->id);
+ $location = $request->user()->allLocations(true)->findOrFail($request->input('location_id'));
+ $name = $request->input('name');
+ $order = $request->input('order', null);
+ $bb_width_cm = $request->input('bb_width_cm', null);
+ $bb_depth_cm = $request->input('bb_depth_cm', null);
+ $bb_height_cm = $request->input('bb_height_cm', null);
+ $fr_width_cm = $request->input('fr_width_cm', null);
+ $fr_height_cm = $request->input('fr_height_cm', null);
+ $hive_type_id = $request->input('hive_type_id');
+ $color = $request->input('color', '#FABB13'); // yellow
$broodLayerAmount = $request->input('brood_layers', 1);
$honeyLayerAmount = $request->input('honey_layers', 1);
- $frameAmount = $request->input('frames', 10);
- $layers = $request->input('layers', null);
- $timeZone = $request->input('timezone', 'Europe/Amsterdam');
+ $frameAmount = $request->input('frames', 10);
+ $layers = $request->input('layers', null);
+ $timeZone = $request->input('timezone', 'Europe/Amsterdam');
$hive = $this->hiveFactory->updateHive($hive, $location, $name, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $order, $layers, $timeZone);
$hive = $this->saveQueen($request, $hive);
@@ -198,14 +206,16 @@ public function update(PostHiveRequest $request, Hive $hive)
/**
* api/hives/{id} DELETE
* Remove the specified user Hive from storage.
+ *
* @authenticated
- * @param \App\Hive $hive
+ *
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Hive $hive)
{
$hive = $request->user()->hives()->findOrFail($hive->id);
$hive->delete();
+
return response()->json(null, 204);
}
}
diff --git a/app/Http/Controllers/Api/HiveTagsController.php b/app/Http/Controllers/Api/HiveTagsController.php
index 5f7c1cdb..7d674b21 100644
--- a/app/Http/Controllers/Api/HiveTagsController.php
+++ b/app/Http/Controllers/Api/HiveTagsController.php
@@ -3,11 +3,7 @@
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
-use App\Models\HiveTag;
use Illuminate\Http\Request;
-
use Validator;
class HiveTagsController extends Controller
@@ -27,29 +23,30 @@ public function index(Request $request)
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
- $data = $request->all();
+ $data = $request->all();
$validator = Validator::make($data, [
- 'tag' => 'required|string',
- 'router_link' => 'required',
- 'hive_id' => 'nullable|integer|exists:hives,id',
- 'action_id' => 'nullable|integer',
+ 'tag' => 'required|string',
+ 'router_link' => 'required',
+ 'hive_id' => 'nullable|integer|exists:hives,id',
+ 'action_id' => 'nullable|integer',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
-
- $user = $request->user();
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
+
+ $user = $request->user();
$hive_tags = $user->hive_tags();
- $existing = $hive_tags->where('tag', $request->input('tag'));
+ $existing = $hive_tags->where('tag', $request->input('tag'));
- if ($existing->count() > 0)
+ if ($existing->count() > 0) {
return $this->update($request, $existing->first()->id);
+ }
$hive_tag = $user->hive_tags()->create($data);
@@ -60,7 +57,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function show(Request $request, $tag)
@@ -73,28 +69,28 @@ public function show(Request $request, $tag)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $tag)
{
- $data = $request->all();
+ $data = $request->all();
$validator = Validator::make($data, [
- 'tag' => 'required|string',
- 'router_link' => 'required',
- 'hive_id' => 'nullable|integer|exists:hives,id',
- 'action_id' => 'nullable|integer',
+ 'tag' => 'required|string',
+ 'router_link' => 'required',
+ 'hive_id' => 'nullable|integer|exists:hives,id',
+ 'action_id' => 'nullable|integer',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
$hive_tag = $request->user()->hive_tags()->where('tag', $tag)->first();
-
- if ($hive_tag)
+
+ if ($hive_tag) {
$hive_tag->update($data);
+ }
return response()->json($hive_tag, 200);
}
@@ -103,7 +99,6 @@ public function update(Request $request, $tag)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $tag)
diff --git a/app/Http/Controllers/Api/ImageController.php b/app/Http/Controllers/Api/ImageController.php
index c55381df..098f1f83 100644
--- a/app/Http/Controllers/Api/ImageController.php
+++ b/app/Http/Controllers/Api/ImageController.php
@@ -2,16 +2,15 @@
namespace App\Http\Controllers\Api;
-use App\Http\Requests;
use App\Http\Controllers\Controller;
-
-use Auth;
use App\Image;
+use Auth;
use Illuminate\Http\Request;
/**
* @group Api\ImageController
* Store and retreive image metadata (image_url, thumb_url, width, category_id, etc.)
+ *
* @authenticated
*/
class ImageController extends Controller
@@ -25,8 +24,9 @@ public function index(Request $request)
{
$images = Auth::user()->images()->get();
- if ($images)
+ if ($images) {
return response()->json($images, 200);
+ }
return response()->json(null, 404);
}
@@ -34,18 +34,18 @@ public function index(Request $request)
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
-
- if($request->has('file') && $request->hasFile('file'))
- {
+
+ if ($request->has('file') && $request->hasFile('file')) {
$image = Image::store($request->all());
+
return response()->json($image, 201);
}
+
return response()->json(null, 200);
}
@@ -53,7 +53,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function show($id)
@@ -66,14 +65,12 @@ public function show($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
-
+
$image = Auth::user()->images()->findOrFail($id);
$image->update($request->all());
@@ -84,21 +81,20 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\Response
*/
public function destroyByUrl(Request $request)
{
- if ($request->filled('image_url'))
- {
+ if ($request->filled('image_url')) {
$image_url = $request->input('image_url');
- $image = Auth::user()->images()->where('image_url', $image_url)->orWhere('thumb_url', $image_url)->first();
- if ($image)
- {
+ $image = Auth::user()->images()->where('image_url', $image_url)->orWhere('thumb_url', $image_url)->first();
+ if ($image) {
$image->delete();
+
return response()->json(null, 204);
}
}
+
return response()->json(null, 404);
}
}
diff --git a/app/Http/Controllers/Api/InspectionsController.php b/app/Http/Controllers/Api/InspectionsController.php
index 72b68999..7274ac13 100644
--- a/app/Http/Controllers/Api/InspectionsController.php
+++ b/app/Http/Controllers/Api/InspectionsController.php
@@ -4,21 +4,20 @@
use App\Category;
use App\Hive;
-use App\BeeRace;
+use App\Http\Controllers\Controller;
+use App\Image;
use App\Inspection;
use App\InspectionItem;
-use App\Image;
-use Illuminate\Http\Request;
-use App\Http\Controllers\Controller;
-use App\Http\Resources\InspectionCollection;
-use Moment\Moment;
use Auth;
+use Illuminate\Http\Request;
use LaravelLocalization;
+use Moment\Moment;
use Validator;
/**
* @group Api\InspectionsController
* Manage manual hive inspections
+ *
* @authenticated
*/
class InspectionsController extends Controller
@@ -32,48 +31,47 @@ class InspectionsController extends Controller
@bodyParam start string Date >= (YYYY-MM-DD HH:mm:ss) to filter inspections from. Example: 2024-02-14 00:00:00
@bodyParam end string Date <= (YYYY-MM-DD HH:mm:ss) to filter inspections to. Example: 2024-02-18 00:00:00
@authenticated
- **/
+ **/
public function index(Request $request)
{
$inspections = $request->user()->allInspections()->orderBy('created_at', 'desc');
-
- if ($request->filled('id'))
- {
+
+ if ($request->filled('id')) {
$id = $request->input('id');
$inspections = $inspections->where('id', $id);
- }
- else if ($request->filled('search'))
- {
+ } elseif ($request->filled('search')) {
$search = $request->input('search');
$inspections = $inspections->where('note', 'LIKE', '%'.$search.'%')
- ->orWhere('created_at', 'LIKE', '%'.$search.'%')
- ->orWhere('reminder', 'LIKE', '%'.$search.'%')
- ->orWhere('id', intval($search));
+ ->orWhere('created_at', 'LIKE', '%'.$search.'%')
+ ->orWhere('reminder', 'LIKE', '%'.$search.'%')
+ ->orWhere('id', intval($search));
- if ($request->filled('start'))
+ if ($request->filled('start')) {
$inspections = $inspections->where('created_at', '>=', $request->input('start'));
+ }
- if ($request->filled('end'))
+ if ($request->filled('end')) {
$inspections = $inspections->where('created_at', '<=', $request->input('end'));
+ }
}
-
+
$inspections = $inspections->limit(1000)->get(); // convert query to collection
// Add filters on items with appends
if ($request->filled('hive_ids')) {
$hive_ids_in = $request->input('hive_ids');
- $hive_ids = gettype($hive_ids_in) == 'array' ? $hive_ids_in : explode(',', $hive_ids_in);
- // filter by occurence in hive_ids array
- $inspections = $inspections->reject(function (Inspection $ins, int $key) use ($hive_ids){
+ $hive_ids = gettype($hive_ids_in) == 'array' ? $hive_ids_in : explode(',', $hive_ids_in);
+ // filter by occurence in hive_ids array
+ $inspections = $inspections->reject(function (Inspection $ins, int $key) use ($hive_ids) {
return in_array($ins->hive_id, $hive_ids) === false;
});
}
if ($request->filled('location_ids')) {
$location_ids_in = $request->input('location_ids');
- $location_ids = gettype($location_ids_in) == 'array' ? $location_ids_in : explode(',', $location_ids_in);
- // filter by occurence in location_ids array
- $inspections = $inspections->reject(function (Inspection $ins, int $key) use ($location_ids){
+ $location_ids = gettype($location_ids_in) == 'array' ? $location_ids_in : explode(',', $location_ids_in);
+ // filter by occurence in location_ids array
+ $inspections = $inspections->reject(function (Inspection $ins, int $key) use ($location_ids) {
return in_array($ins->location_id, $location_ids) === false;
});
}
@@ -82,18 +80,18 @@ public function index(Request $request)
return response()->json(null, 404);
}
- if ($inspections->count() == 0)
+ if ($inspections->count() == 0) {
return response()->json(null, 404);
+ }
return response()->json($inspections);
}
-
/**
api/inspections/lists GET
- List checklists and its inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
+ List checklists and its inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
@authenticated
- @bodyParam id integer required The hive to request inspections from.
+ @bodyParam id integer required The hive to request inspections from.
@response {
"checklists": [
{
@@ -121,33 +119,35 @@ public function index(Request $request)
}
]
}
- **/
+ **/
public function lists(Request $request)
{
- $out = [];
- $checklists = $request->user()->allChecklists();
+ $out = [];
+ $checklists = $request->user()->allChecklists();
$out['checklists'] = $checklists->orderBy('name')->get();
-
- $checklist = null;
- if ($checklists->where('id',intval($request->input('id')))->count() > 0)
- $checklist = $checklists->where('id',intval($request->input('id')))->first();
- else
+ $checklist = null;
+
+ if ($checklists->where('id', intval($request->input('id')))->count() > 0) {
+ $checklist = $checklists->where('id', intval($request->input('id')))->first();
+ } else {
$checklist = $request->user()->allChecklists()->orderBy('created_at', 'desc')->first();
-
- if ($checklist && $checklist->categories()->count() > 0)
+ }
+
+ if ($checklist && $checklist->categories()->count() > 0) {
$checklist->categories = $checklist->categories()->get()->toTree();
+ }
- $out['checklist'] = $checklist;
+ $out['checklist'] = $checklist;
return response()->json($out);
}
/**
api/inspections/hive/{hive_id} GET
- List all inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
+ List all inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
@authenticated
- @urlParam hive_id required The hive to request inspections from.
+ @urlParam hive_id required The hive to request inspections from.
@bodyParam search string Filter inspections on text inside notes, reminder, created_at, reminder_date, inspection item names/values. Example: test
bodyParam id integer If provided, select single inspection. Example: 15
@bodyParam impression string Filter by one or more impression values 1-3 (smileys). Default: null. Example: 2,3
@@ -248,11 +248,12 @@ public function lists(Request $request)
}
]
}
- */
+ */
public function hive(Request $request, $hive_id)
{
- $hive = $request->user()->allHives()->findOrFail($hive_id);
+ $hive = $request->user()->allHives()->findOrFail($hive_id);
$locale = $request->filled('locale') ? $request->input('locale') : LaravelLocalization::getCurrentLocale();
+
return response()->json($hive->inspection_items_by_date($request, $locale));
}
@@ -260,17 +261,19 @@ public function hive(Request $request, $hive_id)
api/inspections/{id} GET
Show the 'inspection' object. The object reflects only the general inspection data.
@authenticated
- @urlParam id required The id of the inspection.
- **/
+ @urlParam id required The id of the inspection.
+ **/
public function show(Request $request, $id)
{
$inspection = $request->user()->allInspections()->find($id);
- if (isset($inspection) == false)
+ if (isset($inspection) == false) {
return response()->json(null, 404);
+ }
$inspection->makeVisible('items');
- $inspection_items = InspectionItem::where('inspection_id',$inspection->id)->groupBy('category_id')->get();
+ $inspection_items = InspectionItem::where('inspection_id', $inspection->id)->groupBy('category_id')->get();
$inspection->items = $inspection_items;
+
return response()->json($inspection);
}
@@ -289,77 +292,71 @@ public function show(Request $request, $id)
@bodyParam reminder_date date The (local time) date time for an optional reminder that can be fed to the users calender. Example: 2020-05-27 16:16
@bodyParam notes string Textual value of the notes fields. Example: This is an inspection note
@bodyParam checklist_id integer Id of the user checklist for generating this inspection. Example: 829
- **/
+ **/
public function store(Request $request)
{
$validator = Validator::make($request->input(),
- [
- 'date' => 'required|date',
- 'items' => 'nullable',
- 'hive_ids.*' => 'required_without:hive_id|integer|exists:hives,id',
- 'hive_id' => 'required_without:hive_ids|integer|exists:hives,id',
- ]);
-
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()], 422);
+ [
+ 'date' => 'required|date',
+ 'items' => 'nullable',
+ 'hive_ids.*' => 'required_without:hive_id|integer|exists:hives,id',
+ 'hive_id' => 'required_without:hive_ids|integer|exists:hives,id',
+ ]);
+
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()], 422);
+ }
$user = Auth::user();
- if ($request->filled('date') && ( $request->filled('items') || ($request->filled('item_ids') && $request->filled('item_vals')) ) )
- {
- $moment = new Moment($request->input('date'));
- $date = $moment->format('Y-m-d H:i:s');
- $data = $request->except(['hive_id','items','date']);
- $data['created_at'] = $date;
+ if ($request->filled('date') && ($request->filled('items') || ($request->filled('item_ids') && $request->filled('item_vals')))) {
+ $moment = new Moment($request->input('date'));
+ $date = $moment->format('Y-m-d H:i:s');
+ $data = $request->except(['hive_id', 'items', 'date']);
+ $data['created_at'] = $date;
$data['checklist_id'] = $request->filled('checklist_id') ? $request->input('checklist_id') : null;
- if ($request->filled('reminder_date'))
- {
+ if ($request->filled('reminder_date')) {
$reminder_moment = new Moment($request->input('reminder_date'));
$data['reminder_date'] = $reminder_moment->format('Y-m-d H:i:s');
}
-
+
// filter -1 values for impression and attention
- $data['impression'] = $request->filled('impression') && $request->input('impression') > -1 ? $request->input('impression') : null;
- $data['attention'] = $request->filled('attention') && $request->input('attention') > -1 ? $request->input('attention') : null;
+ $data['impression'] = $request->filled('impression') && $request->input('impression') > -1 ? $request->input('impression') : null;
+ $data['attention'] = $request->filled('attention') && $request->input('attention') > -1 ? $request->input('attention') : null;
// combine item_ids and item_vals to items
- if (!$request->filled('items') && $request->filled('item_ids') && $request->filled('item_vals'))
- {
+ if (! $request->filled('items') && $request->filled('item_ids') && $request->filled('item_vals')) {
$items = [];
- $item_ids = explode(',', $request->input('item_ids'));
+ $item_ids = explode(',', $request->input('item_ids'));
$item_vals = explode(',', $request->input('item_vals'));
- if (count($item_ids) == count($item_vals))
- {
- for ($i=0; $i < count($item_ids); $i++)
- {
+ if (count($item_ids) == count($item_vals)) {
+ for ($i = 0; $i < count($item_ids); $i++) {
$items[$item_ids[$i]] = $item_vals[$i];
}
}
- }
- else
- {
- $items = $request->input('items');
+ } else {
+ $items = $request->input('items');
}
- $location = $user->allLocations(true)->find($request->input('location_id'));
+ $location = $user->allLocations(true)->find($request->input('location_id'));
- $hive_ids = [];
- if ($request->filled('hive_ids'))
+ $hive_ids = [];
+ if ($request->filled('hive_ids')) {
$hive_ids = $request->input('hive_ids');
- else
+ } else {
$hive_ids = [$request->input('hive_id')];
-
+ }
$inspection = $user->inspections()->find($request->input('id'));
- foreach ($hive_ids as $hive_id)
- {
+ foreach ($hive_ids as $hive_id) {
$hive = $user->allHives(true)->find($hive_id);
- if (!isset($hive))
+ if (! isset($hive)) {
continue;
-
- // if (!isset($inspection)) // if no inspection id
+ }
+
+ // if (!isset($inspection)) // if no inspection id
// {
// if ($hive)
// $inspection = $hive->inspections()->orderBy('created_at','desc')->where('created_at', $date)->first();
@@ -370,49 +367,47 @@ public function store(Request $request)
// //$inspection = $user->inspections()->orderBy('created_at','desc')->where('created_at', $date)->first();
// }
- if (isset($inspection) && $inspection->hive_id == $hive_id)
+ if (isset($inspection) && $inspection->hive_id == $hive_id) {
$inspection->update($data);
- else
+ } else {
$inspection = Inspection::create($data);
-
+ }
+
// link inspection
$inspection->users()->syncWithoutDetaching($user->id);
- if (isset($location))
+ if (isset($location)) {
$inspection->locations()->syncWithoutDetaching($location->id);
+ }
- if (isset($hive))
+ if (isset($hive)) {
$inspection->hives()->syncWithoutDetaching($hive->id);
-
+ }
// Set inspection items
// clear to remove items not in input
$inspection->items()->forceDelete();
-
- if (count($items) > 0)
- {
- foreach ($items as $cat_id => $value)
- {
+
+ if (count($items) > 0) {
+ foreach ($items as $cat_id => $value) {
$category = Category::find($cat_id);
- if (isset($category) && isset($value))
- {
- if (is_array($value))
- $value = implode(',',$value); // convert value to string
+ if (isset($category) && isset($value)) {
+ if (is_array($value)) {
+ $value = implode(',', $value);
+ } // convert value to string
- $itemData =
+ $itemData =
[
- 'category_id' => $category->id,
+ 'category_id' => $category->id,
'inspection_id' => $inspection->id,
- 'value' => $value,
+ 'value' => $value,
];
InspectionItem::create($itemData);
// add inspection link to Image
- if ($category->inputTypeType() == 'image')
- {
+ if ($category->inputTypeType() == 'image') {
$image = Image::where('thumb_url', $value)->first();
- if ($image)
- {
+ if ($image) {
$image->inspection_id = $inspection->id;
$image->save();
}
@@ -423,10 +418,10 @@ public function store(Request $request)
}
}
- if (isset($inspection))
- {
- // Empty user cache, because the inspection if synced
+ if (isset($inspection)) {
+ // Empty user cache, because the inspection if synced
$user->emptyCache('inspection');
+
return response()->json($inspection->id, 201);
}
@@ -434,7 +429,6 @@ public function store(Request $request)
}
-
/**
* Remove the specified resource from storage.
*
@@ -445,5 +439,4 @@ public function destroy($id)
{
Auth::user()->inspections()->findOrFail($id)->delete();
}
-
}
diff --git a/app/Http/Controllers/Api/LocationController.php b/app/Http/Controllers/Api/LocationController.php
index 30b6b4ed..85e58434 100644
--- a/app/Http/Controllers/Api/LocationController.php
+++ b/app/Http/Controllers/Api/LocationController.php
@@ -2,28 +2,26 @@
namespace App\Http\Controllers\Api;
-use App\Location;
-use App\Continent;
use App\Category;
+use App\Continent;
use App\HiveFactory;
-use Illuminate\Http\Request;
-use App\Http\Requests\PostLocationRequest;
use App\Http\Controllers\Controller;
-use Illuminate\Support\Facades\Cache;
-
+use App\Http\Requests\PostLocationRequest;
+use App\Location;
+use Illuminate\Http\Request;
use Validator;
/**
* @group Api\LocationController
* Manage Apiaries
+ *
* @authenticated
*/
class LocationController extends Controller
{
-
/**
* @var HiveFactory
- **/
+ **/
private $hiveFactory;
public function __construct(HiveFactory $hiveFactory)
@@ -38,106 +36,106 @@ public function __construct(HiveFactory $hiveFactory)
*/
public function index(Request $request)
{
- if ($request->filled('ids'))
- {
- if (gettype($request->input('ids')) == 'array')
+ if ($request->filled('ids')) {
+ if (gettype($request->input('ids')) == 'array') {
$location_ids = $request->input('ids');
- else
+ } else {
$location_ids = explode(',', $request->input('ids'));
+ }
}
- if ($request->filled('root') && $request->input('root'))
- {
- if (isset($location_ids))
- return response()->json(['locations'=>$request->user()->locations()->whereIn('id', $location_ids)->get()]);
- else
- return response()->json(['locations'=>$request->user()->locations()->get()]);
+ if ($request->filled('root') && $request->input('root')) {
+ if (isset($location_ids)) {
+ return response()->json(['locations' => $request->user()->locations()->whereIn('id', $location_ids)->get()]);
+ } else {
+ return response()->json(['locations' => $request->user()->locations()->get()]);
+ }
}
- if (isset($location_ids) && gettype($location_ids) == 'array')
+ if (isset($location_ids) && gettype($location_ids) == 'array') {
$locations = $request->user()->locations()->whereIn('id', $location_ids)->with(['hives.layers', 'hives.queen'])->get();
- else
+ } else {
$locations = $request->user()->allApiaries();
+ }
- return response()->json(['locations'=>$locations]); // removed with(['hives.layers.frames', 'hives.queen'])
+ return response()->json(['locations' => $locations]); // removed with(['hives.layers.frames', 'hives.queen'])
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
- $validator = Validator::make($request->only('name','hive_type_id'),
- [
- 'name' => 'required|string',
- 'hive_type_id' => 'nullable|integer|exists:categories,id',
- ]);
-
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()], 422);
-
- $name = $request->input('name');
- $prefix = $request->filled('prefix') == false && isset($name)? $name : $request->input('prefix');
- $continent = Continent::where('abbr', $request->input('continent','eu'))->first();
- $category = Category::findCategoryByParentAndName('location_type', $request->input('location_type','fixed'))->first();
- $location = new Location([
- 'name' =>$name,
- 'roofed' =>$request->input('roofed'),
- 'order' =>$request->input('order', null),
- 'continent_id' =>$continent->id,
- 'category_id' =>$category->id,
- 'coordinate_lat'=>$request->filled('lat') ? round($request->input('lat'),3) : null,
- 'coordinate_lon'=>$request->filled('lon') ? round($request->input('lon'),3) : null,
- 'city' =>$request->input('city'),
- 'street' =>$request->input('street'),
- 'street_no' =>$request->input('street_no'),
- 'postal_code' =>$request->input('postal_code'),
- 'country_code' =>$request->input('country_code', 'nl'),
- 'hex_color' =>$request->input('hex_color'),
+ $validator = Validator::make($request->only('name', 'hive_type_id'),
+ [
+ 'name' => 'required|string',
+ 'hive_type_id' => 'nullable|integer|exists:categories,id',
]);
- //die(print_r($location));
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()], 422);
+ }
+
+ $name = $request->input('name');
+ $prefix = $request->filled('prefix') == false && isset($name) ? $name : $request->input('prefix');
+ $continent = Continent::where('abbr', $request->input('continent', 'eu'))->first();
+ $category = Category::findCategoryByParentAndName('location_type', $request->input('location_type', 'fixed'))->first();
+ $location = new Location([
+ 'name' => $name,
+ 'roofed' => $request->input('roofed'),
+ 'order' => $request->input('order', null),
+ 'continent_id' => $continent->id,
+ 'category_id' => $category->id,
+ 'coordinate_lat' => $request->filled('lat') ? round($request->input('lat'), 3) : null,
+ 'coordinate_lon' => $request->filled('lon') ? round($request->input('lon'), 3) : null,
+ 'city' => $request->input('city'),
+ 'street' => $request->input('street'),
+ 'street_no' => $request->input('street_no'),
+ 'postal_code' => $request->input('postal_code'),
+ 'country_code' => $request->input('country_code', 'nl'),
+ 'hex_color' => $request->input('hex_color'),
+ ]);
+
+ // die(print_r($location));
$request->user()->locations()->save($location);
-
- $user_id = $request->user()->id;
- $amount = $request->input('hive_amount', 1);
- $count_start = intval($request->input('offset', 1)); // 1
- $hive_type_id = $request->input('hive_type_id', 63); // custom
- $color = $request->input('color', '#FABB13'); // yellow
+
+ $user_id = $request->user()->id;
+ $amount = $request->input('hive_amount', 1);
+ $count_start = intval($request->input('offset', 1)); // 1
+ $hive_type_id = $request->input('hive_type_id', 63); // custom
+ $color = $request->input('color', '#FABB13'); // yellow
$broodLayerAmount = $request->input('brood_layers', 1);
$honeyLayerAmount = $request->input('honey_layers', 1);
- $frameAmount = $request->input('frames', 10);
- $bb_width_cm = $request->input('bb_width_cm', null);
- $bb_depth_cm = $request->input('bb_depth_cm', null);
- $bb_height_cm = $request->input('bb_height_cm', null);
- $fr_width_cm = $request->input('fr_width_cm', null);
- $fr_height_cm = $request->input('fr_height_cm', null);
- $layers = $request->input('layers', null);
+ $frameAmount = $request->input('frames', 10);
+ $bb_width_cm = $request->input('bb_width_cm', null);
+ $bb_depth_cm = $request->input('bb_depth_cm', null);
+ $bb_height_cm = $request->input('bb_height_cm', null);
+ $fr_width_cm = $request->input('fr_width_cm', null);
+ $fr_height_cm = $request->input('fr_height_cm', null);
+ $layers = $request->input('layers', null);
$hives = $this->hiveFactory->createMultipleHives($user_id, $amount, $location, $prefix, $hive_type_id, $color, $broodLayerAmount, $honeyLayerAmount, $frameAmount, $count_start, $bb_width_cm, $bb_depth_cm, $bb_height_cm, $fr_width_cm, $fr_height_cm, $layers);
-
+
// print_r($location);
// die();
$request->user()->emptyCache();
-
+
return $this->show($request, $location);
}
/**
* Display the specified resource.
*
- * @param \App\Location $location
* @return \Illuminate\Http\Response
*/
public function show(Request $request, Location $location)
{
$location = $request->user()->locations()->with('hives.layers.frames', 'hives.queen')->findOrFail($location->id);
- return response()->json(['locations'=>[$location]]);
- }
+ return response()->json(['locations' => [$location]]);
+ }
/**
* Update the specified resource in storage.
@@ -148,18 +146,18 @@ public function show(Request $request, Location $location)
*/
public function update(PostLocationRequest $request, $id)
{
- $location = $request->user()->locations()->findOrFail($id);
+ $location = $request->user()->locations()->findOrFail($id);
// To do: edit continent and type
- $location->name = $request->input('name');
- $location->roofed = $request->input('roofed');
- $location->coordinate_lat= $request->filled('lat') ? round($request->input('lat'),3) : null;
- $location->coordinate_lon= $request->filled('lon') ? round($request->input('lon'),3) : null;
- $location->city = $request->input('city');
- $location->street = $request->input('street');
- $location->street_no = $request->input('street_no');
- $location->postal_code = $request->input('postal_code');
- $location->country_code = $request->input('country_code', 'nl');
- $location->hex_color = $request->input('hex_color');
+ $location->name = $request->input('name');
+ $location->roofed = $request->input('roofed');
+ $location->coordinate_lat = $request->filled('lat') ? round($request->input('lat'), 3) : null;
+ $location->coordinate_lon = $request->filled('lon') ? round($request->input('lon'), 3) : null;
+ $location->city = $request->input('city');
+ $location->street = $request->input('street');
+ $location->street_no = $request->input('street_no');
+ $location->postal_code = $request->input('postal_code');
+ $location->country_code = $request->input('country_code', 'nl');
+ $location->hex_color = $request->input('hex_color');
$request->user()->locations()->save($location);
$request->user()->emptyCache();
@@ -168,7 +166,6 @@ public function update(PostLocationRequest $request, $id)
/**
* Remove the specified resource from storage.
*
- * @param \App\Location $location
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Location $location)
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index dd80d0c7..be853389 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -1,31 +1,29 @@
valid_sensors = Measurement::getValidMeasurements();
- $this->valid_weather = Measurement::getValidMeasurements(false, true);
+ $this->valid_sensors = Measurement::getValidMeasurements();
+ $this->valid_weather = Measurement::getValidMeasurements(false, true);
$this->output_sensors = Measurement::getValidMeasurements(true);
$this->output_weather = Measurement::getValidMeasurements(true, true);
- $this->client = new \Influx;
- //die(print_r($this->valid_sensors));
+ $this->client = new \Influx;
+ // die(print_r($this->valid_sensors));
}
private function doPostHttpRequest($url, $data)
{
- $guzzle = new Client();
- try
- {
+ $guzzle = new Client;
+ try {
$response = $guzzle->post($url, [\GuzzleHttp\RequestOptions::JSON => $data]);
- }
- catch(ClientException $e)
- {
+ } catch (ClientException $e) {
return $e;
}
@@ -75,69 +77,55 @@ private function doPostHttpRequest($url, $data)
protected function get_user_device(Request $request, $mine = false)
{
-
$devices = $request->user()->allDevices($mine); // inlude user Group hive sensors ($mine == false)
$check_device = [];
- if ($devices->count() > 0)
- {
- if ($request->filled('id') && $request->input('id') != 'null')
- {
+ if ($devices->count() > 0) {
+ if ($request->filled('id') && $request->input('id') != 'null') {
$id = $request->input('id');
$check_device = $devices->findOrFail($id);
- }
- else if ($request->filled('device_id') && $request->input('device_id') != 'null')
- {
+ } elseif ($request->filled('device_id') && $request->input('device_id') != 'null') {
$id = $request->input('device_id');
$check_device = $devices->findOrFail($id);
- }
- else if ($request->filled('key') && $request->input('key') != 'null')
- {
+ } elseif ($request->filled('key') && $request->input('key') != 'null') {
$keys = $request->input('key');
- if(!is_array($keys)){
+ if (! is_array($keys)) {
$check_device = $devices->where('key', $keys)->first();
- }else{
+ } else {
$check_device = $devices->whereIn('key', $keys)->get();
}
- }
- else if ($request->filled('hive_id') && $request->input('hive_id') != 'null')
- {
+ } elseif ($request->filled('hive_id') && $request->input('hive_id') != 'null') {
$hive_ids = $request->input('hive_id');
- if(!is_array($hive_ids)){
+ if (! is_array($hive_ids)) {
$check_device = $devices->where('hive_id', $hive_ids)->first();
- }else{
+ } else {
$check_device = $devices->whereIn('hive_id', $hive_ids)->get();
}
- }
- else
- {
+ } else {
$check_device = $devices->first();
}
- if(isset($check_device))
+ if (isset($check_device)) {
return $check_device;
+ }
}
+
return null;
}
-
-
-
// requires at least ['name'=>value] to be set
private function storeInfluxData($data_array, $device, $unix_timestamp)
{
// store posted data
- $client = $this->client;
- $points = [];
- $unix_time = isset($unix_timestamp) ? $unix_timestamp : time();
+ $client = $this->client;
+ $points = [];
+ $unix_time = isset($unix_timestamp) ? $unix_timestamp : time();
$sensor_tags = ['key' => strtolower($device->key), 'device_name' => $device->name, 'hardware_id' => strtolower($device->hardware_id), 'user_id' => $device->user_id];
$valid_sensor_keys = array_keys($this->valid_sensors);
- foreach ($data_array as $key => $value)
- {
- if (in_array($key, $valid_sensor_keys) )
- {
+ foreach ($data_array as $key => $value) {
+ if (in_array($key, $valid_sensor_keys)) {
array_push($points,
new InfluxDB\Point(
'sensors', // name of the measurement
@@ -151,59 +139,53 @@ private function storeInfluxData($data_array, $device, $unix_timestamp)
}
// die(print_r($points));
$stored = false;
- if (count($points) > 0)
- {
- try
- {
+ if (count($points) > 0) {
+ try {
$this->cacheRequestRate('influx-write');
$stored = $client::writePoints($points, InfluxDB\Database::PRECISION_SECONDS);
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
// enable for DEBUG
// die(print_r($e->getMessage()));
// gracefully do nothing
}
}
+
return $stored;
}
- private function cacheRequestRate($name, $amount=1)
+ private function cacheRequestRate($name, $amount = 1)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
+ Cache::remember($name.'-time', 86400, function () use ($name) {
Cache::forget($name.'-count');
+
return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count', $amount);
- else
+ } else {
Cache::put($name.'-count', $amount);
+ }
}
- private function cacheRequestArray($name, $val=null)
+ private function cacheRequestArray($name, $val = null)
{
- if (isset($val))
- {
- $val = date('H:i:s').' - '.$val;
+ if (isset($val)) {
+ $val = date('H:i:s').' - '.$val;
$array = [];
- if (Cache::has($name.'-array'))
- {
+ if (Cache::has($name.'-array')) {
$array = Cache::get($name.'-array');
- if (gettype($array) == 'array')
- {
+ if (gettype($array) == 'array') {
array_unshift($array, $val); // put at first value
- if (count($array) > 50)
- array_pop($array); // remove last value
+ if (count($array) > 50) {
+ array_pop($array);
+ } // remove last value
}
Cache::forget($name.'-array');
- }
- else
- {
+ } else {
$array[] = $val;
}
Cache::put($name.'-array', $array, 3600);
@@ -212,38 +194,41 @@ private function cacheRequestArray($name, $val=null)
private function storeMeasurements($data_array)
{
- if (!isset($data_array['key']) || $data_array['key'] == '' || $data_array['key'] == null)
- {
+ if (! isset($data_array['key']) || $data_array['key'] == '' || $data_array['key'] == null) {
Storage::disk('local')->put('sensors/sensor_no_key.log', json_encode($data_array));
$this->cacheRequestRate('store-measurements-400');
$this->cacheRequestArray('store-measurements-400', json_encode($data_array));
+
return Response::json('No key provided', 400);
}
// Check if key is valid
$dev_eui = $data_array['key']; // save sensor data under sensor key
- $device = Device::where('key', $dev_eui)->first();
+ $device = Device::where('key', $dev_eui)->first();
- if($device)
- {
+ if ($device) {
// store device metadata
- if (isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data_array['hardware_id'])) // store hardware id
- {
+ if (isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data_array['hardware_id'])) { // store hardware id
$device = $this->addDeviceMeta($device, 'hardware_id', $data_array['hardware_id']);
- if (isset($data_array['measurement_transmission_ratio']))
+ if (isset($data_array['measurement_transmission_ratio'])) {
$device = $this->addDeviceMeta($device, 'measurement_transmission_ratio', $data_array['measurement_transmission_ratio']);
- if (isset($data_array['measurement_interval_min']))
+ }
+ if (isset($data_array['measurement_interval_min'])) {
$device = $this->addDeviceMeta($device, 'measurement_interval_min', $data_array['measurement_interval_min']);
- if (isset($data_array['hardware_version']))
+ }
+ if (isset($data_array['hardware_version'])) {
$device = $this->addDeviceMeta($device, 'hardware_version', $data_array['hardware_version']);
- if (isset($data_array['firmware_version']))
+ }
+ if (isset($data_array['firmware_version'])) {
$device = $this->addDeviceMeta($device, 'firmware_version', $data_array['firmware_version']);
- if (isset($data_array['bootcount']))
+ }
+ if (isset($data_array['bootcount'])) {
$device = $this->addDeviceMeta($device, 'bootcount', $data_array['bootcount']);
- if (isset($data_array['time_device']))
+ }
+ if (isset($data_array['time_device'])) {
$device = $this->addDeviceMeta($device, 'time_device', $data_array['time_device']);
- if (isset($data_array['time_clock']) && $data_array['time_clock'] == 'rtc')
- {
+ }
+ if (isset($data_array['time_clock']) && $data_array['time_clock'] == 'rtc') {
$device = $this->addDeviceMeta($device, 'last_downlink_result', 'RTC detected');
$device = $this->addDeviceMeta($device, 'rtc', true);
}
@@ -251,64 +236,59 @@ private function storeMeasurements($data_array)
// store metadata from sensor
$device->last_message_received = date('Y-m-d H:i:s');
$device->save();
- }
- else
- {
- if (isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data_array['hardware_id'])) // store hardware id
- $device = $this->addDeviceMeta($device, 'hardware_id', $data_array['hardware_id']); // create device if ALLOW_DEVICE_CREATION == 'true'
+ } else {
+ if (isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data_array['hardware_id'])) { // store hardware id
+ $device = $this->addDeviceMeta($device, 'hardware_id', $data_array['hardware_id']);
+ } // create device if ALLOW_DEVICE_CREATION == 'true'
- if ($device) // new device created from hw id?
- {
+ if ($device) { // new device created from hw id?
$device->last_message_received = date('Y-m-d H:i:s');
$device->save();
- }
- else
- {
+ } else {
Storage::disk('local')->put('sensors/sensor_invalid_key.log', json_encode($data_array));
$this->cacheRequestRate('store-measurements-401');
$this->cacheRequestArray('store-measurements-401', $dev_eui);
+
return Response::json('No valid key provided', 401);
}
}
- if(!isset($device))
+ if (! isset($device)) {
return Response::json('no-device-defined');
+ }
// Save data
unset($data_array['key']);
unset($data_array['hardware_id']);
unset($data_array['beep_base']);
- if(count($data_array) == 0)
+ if (count($data_array) == 0) {
return Response::json('no-data-to-write');
-
+ }
$time = time();
- if (isset($data_array['time']))
+ if (isset($data_array['time'])) {
$time = intval($data_array['time']);
-
+ }
// Add senaor data based on available device sensorDefinitions
- $date = date($this->timeFormat, $time);
- $sensor_defs = $device->activeSensorDefinitions();
+ $date = date($this->timeFormat, $time);
+ $sensor_defs = $device->activeSensorDefinitions();
$sensor_defs_all = $device->sensorDefinitions;
- foreach ($sensor_defs as $sd)
- {
- if (isset($sd->output_abbr) && isset($data_array[$sd->input_abbr]))
- {
+ foreach ($sensor_defs as $sd) {
+ if (isset($sd->output_abbr) && isset($data_array[$sd->input_abbr])) {
$data_array = $device->addSensorDefinitionMeasurements($data_array, $data_array[$sd->input_abbr], $sd->input_measurement_id, $date, $sensor_defs_all);
-
+
}
}
- if (isset($data_array['debug']) && $data_array['debug'] == 1)
+ if (isset($data_array['debug']) && $data_array['debug'] == 1) {
return Response::json($data_array);
+ }
// store battery voltage after applying sensor defs
- if (isset($data_array['bv']))
- {
+ if (isset($data_array['bv'])) {
$battery_voltage = floatval($data_array['bv']);
- if ($battery_voltage > 100)
- {
+ if ($battery_voltage > 100) {
$battery_voltage = $battery_voltage / 1000;
$data_array['bv'] = $battery_voltage;
}
@@ -317,30 +297,29 @@ private function storeMeasurements($data_array)
}
// Legacy weight calculation from 2-4 load cells
- if (!isset($data_array['weight_kg']) && (isset($data_array['w_fl']) || isset($data_array['w_fr']) || isset($data_array['w_bl']) || isset($data_array['w_br'])) )
- {
+ if (! isset($data_array['weight_kg']) && (isset($data_array['w_fl']) || isset($data_array['w_fr']) || isset($data_array['w_bl']) || isset($data_array['w_br']))) {
// check if calibration is required
$calibrate = $device->last_sensor_measurement_time_value('calibrating_weight');
- if (floatval($calibrate) > 0)
+ if (floatval($calibrate) > 0) {
$this->calibrate_weight_sensors($device, $calibrate, false, $data_array);
+ }
// take into account offset and multi
$weight_kg = $this->calculateWeightKg($device, $data_array);
- if (!isset($data_array['w_v']) || $data_array['w_v'] != $weight_kg) // do not save too big value
+ if (! isset($data_array['w_v']) || $data_array['w_v'] != $weight_kg) { // do not save too big value
$data_array['weight_kg'] = $weight_kg;
+ }
// check if we need to compensate weight for temp (legacy)
- //$data_array = $this->add_weight_kg_corrected_with_temperature($device, $data_array);
+ // $data_array = $this->add_weight_kg_corrected_with_temperature($device, $data_array);
}
$stored = $this->storeInfluxData($data_array, $device, $time);
-
// Remember the last date/data that this device stored measurements from (and previous to calculate diff)
- $cached_time = Cache::get('set-measurements-device-'.$device->id.'-time');
- $cached_data = Cache::get('set-measurements-device-'.$device->id.'-data');
+ $cached_time = Cache::get('set-measurements-device-'.$device->id.'-time');
+ $cached_data = Cache::get('set-measurements-device-'.$device->id.'-data');
$has_prev_data = false;
- if ($cached_time && $cached_data)
- {
+ if ($cached_time && $cached_data) {
Cache::put('set-measurements-device-'.$device->id.'-time-prev', $cached_time);
Cache::put('set-measurements-device-'.$device->id.'-data-prev', $cached_data);
$has_prev_data = true;
@@ -349,30 +328,29 @@ private function storeMeasurements($data_array)
Cache::put('set-measurements-device-'.$device->id.'-data', $data_array);
// Parse Alert rules if available
- $alert_count = 0;
+ $alert_count = 0;
$device_rule_ids = $device->hiveUserRuleIds();
- if (count($device_rule_ids) > 0)
- {
+ if (count($device_rule_ids) > 0) {
$last_values_array = [$data_array];
- if ($has_prev_data)
+ if ($has_prev_data) {
$last_values_array[] = $cached_data;
+ }
$alert_count = AlertRule::parseUserDeviceDirectAlertRules($device_rule_ids, $device->id, $last_values_array);
$this->cacheRequestRate('alert-direct', $alert_count);
}
- if($stored)
- {
+ if ($stored) {
$this->cacheRequestRate('store-measurements-201');
$alert_comment = $alert_count > 0 ? '-'.$alert_count.'-alerts' : '';
+
return Response::json('saved'.$alert_comment, 201);
- }
- else
- {
- //die(print_r($data_array));
+ } else {
+ // die(print_r($data_array));
Storage::disk('local')->put('sensors/sensor_write_error.log', json_encode($data_array));
$this->cacheRequestRate('store-measurements-500');
$this->cacheRequestArray('store-measurements-500', json_encode($data_array));
+
return Response::json('sensor-write-error', 500);
}
}
@@ -381,48 +359,46 @@ private function storeMeasurements($data_array)
api/sensors/measurement_types GET
Request all currently available sensor measurement types that can be POSTed to
@queryParam locale string Two digit locale to get translated sensor measurement types. Example: en
- */
+ */
public function sensor_measurement_types(Request $request)
{
$locale = null;
- if ($request->filled('locale'))
+ if ($request->filled('locale')) {
$locale = $request->input('locale');
+ }
return Response::json(Measurement::getValidMeasurements(false, false, $locale));
}
-
public function sensor_measurement_types_available(Request $request)
{
- $device_id = $request->input('device_id');
- $device = $this->get_user_device($request);
+ $device_id = $request->input('device_id');
+ $device = $this->get_user_device($request);
- if ($device)
- {
- $start = $request->input('start');
- $end = $request->input('end');
+ if ($device) {
+ $start = $request->input('start');
+ $end = $request->input('end');
- $tz = $request->input('timezone', 'UTC');
+ $tz = $request->input('timezone', 'UTC');
$startMoment = new Moment($start, 'UTC');
$startString = $startMoment->setTimezone($tz)->format($this->timeFormat);
- $endMoment = new Moment($end, 'UTC');
- $endString = $endMoment->setTimezone($tz)->format($this->timeFormat);
+ $endMoment = new Moment($end, 'UTC');
+ $endString = $endMoment->setTimezone($tz)->format($this->timeFormat);
- $sensors = $request->input('sensors', $this->output_sensors);
- $where = $device->influxWhereKeys().' AND time >= \''.$startString.'\' AND time <= \''.$endString.'\'';
+ $sensors = $request->input('sensors', $this->output_sensors);
+ $where = $device->influxWhereKeys().' AND time >= \''.$startString.'\' AND time <= \''.$endString.'\'';
$sensor_measurements = Device::getAvailableSensorNamesNoCache($sensors, $where, 'sensors', false);
- //die(print_r([$device->name, $device->key]));
- if ($sensor_measurements)
- {
- $measurement_types = Measurement::all()->sortBy('pq')->whereIn('abbreviation', $sensor_measurements)->pluck('abbr_named_object','abbreviation')->toArray();
+ // die(print_r([$device->name, $device->key]));
+ if ($sensor_measurements) {
+ $measurement_types = Measurement::all()->sortBy('pq')->whereIn('abbreviation', $sensor_measurements)->pluck('abbr_named_object', 'abbreviation')->toArray();
+
return Response::json($measurement_types, 200);
- }
- else
- {
+ } else {
return Response::json('influx-query-empty', 500);
}
}
+
return Response::json('invalid-user-device', 500);
}
@@ -433,29 +409,28 @@ public function sensor_measurement_types_available(Request $request)
@bodyParam key string DEV EUI to look up the Device.
@bodyParam id integer ID to look up the Device
@bodyParam hive_id integer Hive ID to look up the Device
- */
+ */
public function lastvalues(Request $request)
{
$this->cacheRequestRate('get-measurements-last');
$device = $this->get_user_device($request);
- if ($device)
- {
- $output = $device->last_sensor_values_array(implode('","',$this->output_sensors));
+ if ($device) {
+ $output = $device->last_sensor_values_array(implode('","', $this->output_sensors));
- if ($output === false)
+ if ($output === false) {
return Response::json('sensor-get-error', 500);
- else if ($output !== null)
+ } elseif ($output !== null) {
return Response::json($output);
+ }
}
+
return Response::json('error', 404);
}
-
private function convertOldFirmwareValues($data_array)
{
- if (isset($data_array['w_fl']) || isset($data_array['w_fr']) || isset($data_array['w_bl']) || isset($data_array['w_br'])) // v7 firmware
- {
+ if (isset($data_array['w_fl']) || isset($data_array['w_fr']) || isset($data_array['w_bl']) || isset($data_array['w_br'])) { // v7 firmware
// - H -> *2 (range 0-200)
// - T -> -10 -> +40 range (+10, *5), so 0-250 is /5, -10
// - W_E -> -20 -> +80 range (/2, +10, *5), so 0-250 is /5, -10, *2
@@ -469,6 +444,7 @@ private function convertOldFirmwareValues($data_array)
$data_array = $this->floatify_sensor_val($data_array, 'w_bl');
$data_array = $this->floatify_sensor_val($data_array, 'w_br');
}
+
return $data_array;
}
@@ -492,30 +468,41 @@ private function convertOldFirmwareValues($data_array)
private function parse_kpn_payload($request_data)
{
$data_array = [];
- //die(print_r($request_data));
- if (isset($request_data['LrnDevEui'])) // KPN Simpoint msg
- if (Device::all()->where('key', $request_data['LrnDevEui'])->count() > 0)
+ // die(print_r($request_data));
+ if (isset($request_data['LrnDevEui'])) { // KPN Simpoint msg
+ if (Device::all()->where('key', $request_data['LrnDevEui'])->count() > 0) {
$data_array['key'] = $request_data['LrnDevEui'];
+ }
+ }
- if (isset($request_data['DevEUI_uplink']['DevEUI'])) // KPN Simpoint msg
- if (Device::where('key', $request_data['DevEUI_uplink']['DevEUI'])->count() > 0)
+ if (isset($request_data['DevEUI_uplink']['DevEUI'])) { // KPN Simpoint msg
+ if (Device::where('key', $request_data['DevEUI_uplink']['DevEUI'])->count() > 0) {
$data_array['key'] = $request_data['DevEUI_uplink']['DevEUI'];
+ }
+ }
- if (isset($request_data['DevEUI_location']['DevEUI'])) // KPN Simpoint msg
- if (Device::where('key', $request_data['DevEUI_location']['DevEUI'])->count() > 0)
+ if (isset($request_data['DevEUI_location']['DevEUI'])) { // KPN Simpoint msg
+ if (Device::where('key', $request_data['DevEUI_location']['DevEUI'])->count() > 0) {
$data_array['key'] = $request_data['DevEUI_location']['DevEUI'];
+ }
+ }
- if (isset($request_data['DevEUI_uplink']['LrrRSSI']))
+ if (isset($request_data['DevEUI_uplink']['LrrRSSI'])) {
$data_array['rssi'] = $request_data['DevEUI_uplink']['LrrRSSI'];
- if (isset($request_data['DevEUI_uplink']['LrrSNR']))
- $data_array['snr'] = $request_data['DevEUI_uplink']['LrrSNR'];
- if (isset($request_data['DevEUI_uplink']['LrrLAT']))
- $data_array['lat'] = $request_data['DevEUI_uplink']['LrrLAT'];
- if (isset($request_data['DevEUI_uplink']['LrrLON']))
- $data_array['lon'] = $request_data['DevEUI_uplink']['LrrLON'];
-
- if (isset($request_data['DevEUI_uplink']['payload_hex']))
+ }
+ if (isset($request_data['DevEUI_uplink']['LrrSNR'])) {
+ $data_array['snr'] = $request_data['DevEUI_uplink']['LrrSNR'];
+ }
+ if (isset($request_data['DevEUI_uplink']['LrrLAT'])) {
+ $data_array['lat'] = $request_data['DevEUI_uplink']['LrrLAT'];
+ }
+ if (isset($request_data['DevEUI_uplink']['LrrLON'])) {
+ $data_array['lon'] = $request_data['DevEUI_uplink']['LrrLON'];
+ }
+
+ if (isset($request_data['DevEUI_uplink']['payload_hex'])) {
$data_array = array_merge($data_array, $this->decode_simpoint_payload($request_data['DevEUI_uplink']));
+ }
return $data_array;
}
@@ -527,8 +514,8 @@ private function is_kpn_things_payload($data)
{
$dev_eui = false;
$payload = false;
- $port = false;
- $loc = false;
+ $port = false;
+ $loc = false;
/*
KPN Thing payload (2023-04-13):
[
@@ -537,26 +524,28 @@ private function is_kpn_things_payload($data)
{"n":"timeOrigin","vs":"NETWORK"}
]
*/
- foreach ($data as $item) // KPN things JSON payload is array of 4? items
- {
- if (count((array)$item) > 1) // each object has 2 items
- {
- if (isset($item['bn'])) // get key (DevEUI) from "urn:dev:DEVEUI:DevEUIstring:"
+ foreach ($data as $item) { // KPN things JSON payload is array of 4? items
+ if (count((array) $item) > 1) { // each object has 2 items
+ if (isset($item['bn'])) { // get key (DevEUI) from "urn:dev:DEVEUI:DevEUIstring:"
$dev_eui = array_search('DEVEUI', explode(':', $item['bn'])) !== false ? true : false;
+ }
- if (isset($item['n']))
- {
- if (($item['n'] == 'payload' || $item['n'] == 'payload_hex') && isset($item['vs']))
+ if (isset($item['n'])) {
+ if (($item['n'] == 'payload' || $item['n'] == 'payload_hex') && isset($item['vs'])) {
$payload = true;
+ }
- if ($item['n'] == 'port' && isset($item['v']))
+ if ($item['n'] == 'port' && isset($item['v'])) {
$port = true;
+ }
- if ($item['n'] == 'locOrigin' && isset($item['vs']) && $item['vs'] == 'KPNLORA') // location
+ if ($item['n'] == 'locOrigin' && isset($item['vs']) && $item['vs'] == 'KPNLORA') { // location
$loc = true;
+ }
}
}
}
+
return $dev_eui && ($loc || ($port && $payload)); // only true if all three items are available
}
@@ -570,7 +559,7 @@ private function is_kpn_things_payload($data)
{
"n": "payload" ** or "payload_hex" since 10-06-2025 update to SenML **,
"vs": "1b0c6e0c6a640a01ffcd7304000c0a0946000300020002000200010001000100010001000007000000000000"
- },
+ },
{
"n": "port",
"v": 3.0
@@ -584,43 +573,47 @@ private function parse_kpnthings_payload($request_data)
{
$data_array = [];
- foreach ($request_data as $item) // KPN things JSON payload is array of 4? items
- {
- if (count((array)$item) > 1) // each object has 2 items
- {
- if (isset($item['bn'])) // get key (DevEUI) from "urn:dev:DEVEUI:DevEUIstring:"
- {
+ foreach ($request_data as $item) { // KPN things JSON payload is array of 4? items
+ if (count((array) $item) > 1) { // each object has 2 items
+ if (isset($item['bn'])) { // get key (DevEUI) from "urn:dev:DEVEUI:DevEUIstring:"
$dev_eui_arr = explode(':', $item['bn']);
$dev_eui_ind = array_search('DEVEUI', $dev_eui_arr);
- if (count($dev_eui_arr) > $dev_eui_ind+1)
- $data_array['key'] = $dev_eui_arr[$dev_eui_ind+1];
+ if (count($dev_eui_arr) > $dev_eui_ind + 1) {
+ $data_array['key'] = $dev_eui_arr[$dev_eui_ind + 1];
+ }
}
- if (isset($item['n']))
- {
- if ($item['n'] == 'payload' && isset($item['vs']))
+ if (isset($item['n'])) {
+ if ($item['n'] == 'payload' && isset($item['vs'])) {
$data_array['payload'] = $item['vs'];
+ }
- if ($item['n'] == 'payload_hex' && isset($item['vs']))
+ if ($item['n'] == 'payload_hex' && isset($item['vs'])) {
$data_array['payload'] = $item['vs'];
+ }
- if ($item['n'] == 'port' && isset($item['v']))
+ if ($item['n'] == 'port' && isset($item['v'])) {
$data_array['port'] = intval($item['v']);
+ }
- if ($item['n'] == 'latitude' && isset($item['v']))
+ if ($item['n'] == 'latitude' && isset($item['v'])) {
$data_array['lat'] = floatval($item['v']);
+ }
- if ($item['n'] == 'longitude' && isset($item['v']))
+ if ($item['n'] == 'longitude' && isset($item['v'])) {
$data_array['lon'] = floatval($item['v']);
+ }
- if ($item['n'] == 'locTime' && isset($item['v']))
+ if ($item['n'] == 'locTime' && isset($item['v'])) {
$data_array['time'] = intval($item['v']);
+ }
}
}
}
- if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port']))
+ if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port'])) {
$data_array = array_merge($data_array, $this->decode_kpnthings_payload($data_array));
+ }
return $data_array;
}
@@ -690,27 +683,36 @@ private function parse_helium_payload($request_data)
{
$data_array = [];
- if (isset($request_data['dev_eui']))
- if (Device::where('key', $request_data['dev_eui'])->count() > 0)
+ if (isset($request_data['dev_eui'])) {
+ if (Device::where('key', $request_data['dev_eui'])->count() > 0) {
$data_array['key'] = $request_data['dev_eui'];
+ }
+ }
- if (isset($request_data['hotspots'][0]['rssi']))
+ if (isset($request_data['hotspots'][0]['rssi'])) {
$data_array['rssi'] = $request_data['hotspots'][0]['rssi'];
- if (isset($request_data['hotspots'][0]['snr']))
- $data_array['snr'] = $request_data['hotspots'][0]['snr'];
- if (isset($request_data['hotspots'][0]['lat']))
- $data_array['lat'] = $request_data['hotspots'][0]['lat'];
- if (isset($request_data['hotspots'][0]['long']))
- $data_array['lon'] = $request_data['hotspots'][0]['long'];
-
- if (isset($request_data['port']))
+ }
+ if (isset($request_data['hotspots'][0]['snr'])) {
+ $data_array['snr'] = $request_data['hotspots'][0]['snr'];
+ }
+ if (isset($request_data['hotspots'][0]['lat'])) {
+ $data_array['lat'] = $request_data['hotspots'][0]['lat'];
+ }
+ if (isset($request_data['hotspots'][0]['long'])) {
+ $data_array['lon'] = $request_data['hotspots'][0]['long'];
+ }
+
+ if (isset($request_data['port'])) {
$data_array['port'] = $request_data['port'];
+ }
- if (isset($request_data['payload']))
+ if (isset($request_data['payload'])) {
$data_array['payload'] = $request_data['payload'];
+ }
- if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port']))
+ if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port'])) {
$data_array = array_merge($data_array, $this->decode_helium_payload($data_array));
+ }
return $data_array;
}
@@ -718,71 +720,71 @@ private function parse_helium_payload($request_data)
private function parse_swisscom_payload($request_data)
{
$data_array = [];
-
- if (isset($request_data['data']['DevEUI']))
- {
- $key = $request_data['data']['DevEUI'];
+
+ if (isset($request_data['data']['DevEUI'])) {
+ $key = $request_data['data']['DevEUI'];
$key_lower = strtolower($key);
- if (Device::where('key', $key)->count() > 0)
+ if (Device::where('key', $key)->count() > 0) {
$data_array['key'] = $key;
- else if (Device::where('key', $key_lower)->count() > 0)
+ } elseif (Device::where('key', $key_lower)->count() > 0) {
$data_array['key'] = $key_lower;
+ }
}
- if (isset($request_data['uplinkMetrics']['rssi']))
- $data_array['rssi'] = $request_data['uplinkMetrics']['rssi'];
-
- if (isset($request_data['uplinkMetrics']['snr']))
- $data_array['snr'] = $request_data['uplinkMetrics']['snr'];
+ if (isset($request_data['uplinkMetrics']['rssi'])) {
+ $data_array['rssi'] = $request_data['uplinkMetrics']['rssi'];
+ }
- if (isset($request_data['data']['FPort']))
+ if (isset($request_data['uplinkMetrics']['snr'])) {
+ $data_array['snr'] = $request_data['uplinkMetrics']['snr'];
+ }
+
+ if (isset($request_data['data']['FPort'])) {
$data_array['port'] = $request_data['data']['FPort'];
+ }
- if (isset($request_data['data']['payload_hex']))
+ if (isset($request_data['data']['payload_hex'])) {
$data_array['payload'] = $request_data['data']['payload_hex'];
+ }
- if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port']))
+ if (isset($data_array['key']) && isset($data_array['payload']) && isset($data_array['port'])) {
$data_array = array_merge($data_array, $this->decode_swisscom_payload($data_array));
+ }
return $data_array;
}
- private function addDeviceMeta($device=null, $field=null, $value=null)
+ private function addDeviceMeta($device = null, $field = null, $value = null)
{
- if ($device == null && $field == 'hardware_id' && $value !== null && env('ALLOW_DEVICE_CREATION') == 'true' && Auth::user() && Auth::user()->hasRole('sensor-data')) // no device with this key available, so create new device by hardware id
- {
+ if ($device == null && $field == 'hardware_id' && $value !== null && env('ALLOW_DEVICE_CREATION') == 'true' && Auth::user() && Auth::user()->hasRole('sensor-data')) { // no device with this key available, so create new device by hardware id
$device = Device::where('hardware_id', $value)->first();
- if (!isset($device) && strlen($value) == 18) // TODO: remove if TTN and app fix and DB change have been implemented
+ if (! isset($device) && strlen($value) == 18) { // TODO: remove if TTN and app fix and DB change have been implemented
$device = Device::where('hardware_id', '0e'.$value)->first();
+ }
- if ($device)
- {
+ if ($device) {
$device->key = $key; // update device key of hardware id to prevent double hardware id's
- }
- else
- {
+ } else {
$category_id = Category::findCategoryIdByParentAndName('sensor', 'beep');
$device_name = 'BEEPBASE-'.strtoupper(substr($key, -4, 4));
- $device = Device::create(['name'=> $device_name, 'key'=>$key, 'hardware_id'=>$value, 'user_id'=>1, 'category_id'=>$category_id]);
+ $device = Device::create(['name' => $device_name, 'key' => $key, 'hardware_id' => $value, 'user_id' => 1, 'category_id' => $category_id]);
}
}
- if($device)
- {
- if ($field != null && $value != null)
- {
- switch($field)
- {
+ if ($device) {
+ if ($field != null && $value != null) {
+ switch ($field) {
case 'hardware_id':
- if (isset($device->hardware_id))
+ if (isset($device->hardware_id)) {
return $device;
- else
+ } else {
$device->hardware_id = $value;
+ }
break;
case 'time_device':
- $device->datetime = date("Y-m-d H:i:s", $value);
+ $device->datetime = date('Y-m-d H:i:s', $value);
$time = time();
$device->datetime_offset_sec = round($value - $time, 2);
break;
@@ -793,6 +795,7 @@ private function addDeviceMeta($device=null, $field=null, $value=null)
}
}
}
+
return $device;
}
@@ -800,8 +803,7 @@ private function sendDeviceDownlink($key, $url)
{
$device = Device::where('key', $key)->first();
- if($device && isset($url) && isset($device->next_downlink_message)) // && Auth::user()->hasRole('sensor-data')
- {
+ if ($device && isset($url) && isset($device->next_downlink_message)) { // && Auth::user()->hasRole('sensor-data')
$msg = $device->next_downlink_message;
$downlink_array = [
'dev_id' => $key,
@@ -812,22 +814,16 @@ private function sendDeviceDownlink($key, $url)
$result = $this->doPostHttpRequest($url, $downlink_array);
// store waiting message for sensor
- if ($result instanceof ClientException)
- {
- $device->last_downlink_result = 'Error (no result): last downlink ('.$msg.') tried to sent @ '.date('Y-m-d H:i:s').'. Error message: '.substr($result->getMessage(), 0, 150);
+ if ($result instanceof ClientException) {
+ $device->last_downlink_result = 'Error (no result): last downlink ('.$msg.') tried to sent @ '.date('Y-m-d H:i:s').'. Error message: '.substr($result->getMessage(), 0, 150);
$device->save();
- }
- else if ($result)
- {
- if ($result->getStatusCode() == 200)
- {
+ } elseif ($result) {
+ if ($result->getStatusCode() == 200) {
$device->next_downlink_message = null;
- $device->last_downlink_result = 'Last downlink ('.$msg.') sent @ '.date('Y-m-d H:i:s').', waiting for result...';
+ $device->last_downlink_result = 'Last downlink ('.$msg.') sent @ '.date('Y-m-d H:i:s').', waiting for result...';
$device->save();
- }
- else
- {
- $device->last_downlink_result = 'Error (status '.$result->getStatusCode().'): last downlink ('.$msg.') tried to @ '.date('Y-m-d H:i:s');
+ } else {
+ $device->last_downlink_result = 'Error (status '.$result->getStatusCode().'): last downlink ('.$msg.') tried to @ '.date('Y-m-d H:i:s');
$device->save();
}
}
@@ -839,24 +835,24 @@ private function parse_ttn_payload($request_data)
$data_array = [];
// parse payload
- if (isset($request_data['payload_fields'])) // TTN v2 with decoder installed
+ if (isset($request_data['payload_fields'])) { // TTN v2 with decoder installed
$data_array = $request_data['payload_fields'];
- else if (isset($request_data['payload_raw'])) // TTN v2
+ } elseif (isset($request_data['payload_raw'])) { // TTN v2
$data_array = $this->decode_ttn_payload($request_data);
- else if (isset($request_data['uplink_message']) && isset($request_data['end_device_ids'])) // TTN v3 (Things cloud)
+ } elseif (isset($request_data['uplink_message']) && isset($request_data['end_device_ids'])) { // TTN v3 (Things cloud)
$data_array = $this->decode_ttn_payload($request_data);
- else if (isset($request_data['join_accept']) && isset($request_data['end_device_ids'])) // TTN v3 (Things cloud)
+ } elseif (isset($request_data['join_accept']) && isset($request_data['end_device_ids'])) { // TTN v3 (Things cloud)
$data_array = $this->decode_ttn_payload($request_data);
+ }
// process downlink
- if (isset($data_array['key']) && isset($data['downlink_url']))
+ if (isset($data_array['key']) && isset($data['downlink_url'])) {
$this->sendDeviceDownlink($data_array['key'], $data['downlink_url']);
+ }
- if (isset($data_array['key']) && isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data['port']) && $data['port'] == 6) // downlink response
- {
+ if (isset($data_array['key']) && isset($data_array['beep_base']) && boolval($data_array['beep_base']) && isset($data['port']) && $data['port'] == 6) { // downlink response
$device = Device::where('key', $data_array['key'])->first();
- if($device) // && Auth::user()->hasRole('sensor-data')
- {
+ if ($device) { // && Auth::user()->hasRole('sensor-data')
$device->last_downlink_result = json_encode($data_array);
$device->save();
}
@@ -865,7 +861,6 @@ private function parse_ttn_payload($request_data)
return $data_array;
}
-
/**
api/lora_sensors POST
Store sensor measurement data (see BEEP sensor data API definition) from TTN or KPN (Simpoint)
@@ -876,58 +871,44 @@ private function parse_ttn_payload($request_data)
@bodyParam payload_raw string TTN BEEP Measurement data in Base 64 encoded string
@bodyParam payload_fields json TTN Measurement data array
@bodyParam DevEUI_uplink json KPN Measurement data array
- */
+ */
public function lora_sensors(Request $request)
{
- $data_array = [];
+ $data_array = [];
$request_data = $request->input();
$payload_type = '';
// distinguish type of data
- if (($request->filled('LrnDevEui') || $request->filled('DevEUI_uplink.DevEUI')) && $request->filled('DevEUI_uplink.payload_hex')) // KPN/Simpoint HTTPS POST
- {
+ if (($request->filled('LrnDevEui') || $request->filled('DevEUI_uplink.DevEUI')) && $request->filled('DevEUI_uplink.payload_hex')) { // KPN/Simpoint HTTPS POST
$data_array = $this->parse_kpn_payload($request_data);
$payload_type = 'kpn';
- }
- else if (($request->filled('payload_fields') || $request->filled('payload_raw')) && $request->filled('hardware_serial')) // TTN V2 HTTPS POST
- {
+ } elseif (($request->filled('payload_fields') || $request->filled('payload_raw')) && $request->filled('hardware_serial')) { // TTN V2 HTTPS POST
$data_array = $this->parse_ttn_payload($request_data);
$payload_type = 'ttn-v2';
- }
- else if ($request->filled('rawData') && $request->filled('uplinkMetrics') && $request->filled('deviceId')) // Swisscom HTTPS POST
- {
+ } elseif ($request->filled('rawData') && $request->filled('uplinkMetrics') && $request->filled('deviceId')) { // Swisscom HTTPS POST
$data_array = $this->parse_swisscom_payload($request_data);
$payload_type = 'swisscom';
- }
- else if (($request->filled('end_device_ids') || $request->filled('uplink_message'))) // TTN V3 HTTPS POST
- {
+ } elseif (($request->filled('end_device_ids') || $request->filled('uplink_message'))) { // TTN V3 HTTPS POST
$data_array = $this->parse_ttn_payload($request_data);
$payload_type = 'ttn-v3';
- }
- else if ($request->filled('reported_at') && $request->filled('payload')) // Helium HTTPS POST
- {
+ } elseif ($request->filled('reported_at') && $request->filled('payload')) { // Helium HTTPS POST
$data_array = $this->parse_helium_payload($request_data);
$payload_type = 'helium';
- }
- else if (is_array($request_data) && $this->is_kpn_things_payload($request_data))
- {
+ } elseif (is_array($request_data) && $this->is_kpn_things_payload($request_data)) {
$data_array = $this->parse_kpnthings_payload($request_data);
$payload_type = 'kpn-things';
- }
- else if (($request->filled('data') || $request->filled('identifiers'))) // TTN V3 Packet broker HTTPS POST
- {
+ } elseif (($request->filled('data') || $request->filled('identifiers'))) { // TTN V3 Packet broker HTTPS POST
$data_array = $this->parse_ttn_payload($request_data['data']);
$payload_type = 'ttn-v3-pb';
}
$this->cacheRequestRate('store-lora-sensors-'.$payload_type);
- //die(print_r([$payload_type, $data_array, 'r'=>$request_data]));
+ // die(print_r([$payload_type, $data_array, 'r'=>$request_data]));
- if (env('APP_ENV') == 'test')
- {
- $port = isset($data_array['port']) ? '_port'.$data_array['port'] : '';
- $logFileName = isset($data_array['key']) ? 'lora_sensor_'.$data_array['key'].$port.'.json' : 'lora_sensor_no_key.json';
+ if (env('APP_ENV') == 'test') {
+ $port = isset($data_array['port']) ? '_port'.$data_array['port'] : '';
+ $logFileName = isset($data_array['key']) ? 'lora_sensor_'.$data_array['key'].$port.'.json' : 'lora_sensor_no_key.json';
Storage::disk('local')->put('sensors/'.$logFileName, '[{"payload_type":"'.$payload_type.'"},{"request_input":'.json_encode($request_data).'},{"data_array":'.json_encode($data_array).'}]');
}
@@ -939,68 +920,51 @@ public function lora_sensors(Request $request)
Store sensor measurement data (see BEEP sensor data API definition) from API, or TTN. See /sensors/measurement_types?locale=en which measurement types can be used to POST data to.
@bodyParam key/data json required Measurement data as JSON: {"key":"your_beep_device_key", "t":18.4, t_i":34.5, "weight_kg":57.348, "h":58, "bv":3.54}
@queryParam key/data string required Measurement formatted as URL query: key=your_beep_device_key&t=18.4&t_i=34.5&weight_kg=57.348&h=58&bv=3.54
- */
+ */
public function storeMeasurementData(Request $request)
{
$request_data = $request->input();
// Check for valid data
- if (($request->filled('payload_fields') || $request->filled('payload_raw')) && $request->filled('hardware_serial')) // TTN HTTP POST
- {
+ if (($request->filled('payload_fields') || $request->filled('payload_raw')) && $request->filled('hardware_serial')) { // TTN HTTP POST
$data_array = $this->parse_ttn_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-ttn-v2');
- }
- else if (is_array($request_data) && count($request_data) > 1 && isset($request_data['rawData']['port']) && isset($request_data['deviceId']))
- {
-
+ } elseif (is_array($request_data) && count($request_data) > 1 && isset($request_data['rawData']['port']) && isset($request_data['deviceId'])) {
+
$data_array = $this->parse_swisscom_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-swisscom');
- }
- else if (($request->filled('end_device_ids') || $request->filled('uplink_message'))) // TTN V3 HTTPS POST
- {
+ } elseif (($request->filled('end_device_ids') || $request->filled('uplink_message'))) { // TTN V3 HTTPS POST
$data_array = $this->parse_ttn_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-ttn-v3');
- }
- else if ($request->filled('LrnDevEui') && $request->filled('DevEUI_uplink.payload_hex')) // KPN/Simpoint
- {
+ } elseif ($request->filled('LrnDevEui') && $request->filled('DevEUI_uplink.payload_hex')) { // KPN/Simpoint
$data_array = $this->parse_kpn_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-kpn');
- }
- else if (is_array($request_data) && count($request_data) > 1 && $this->is_kpn_things_payload($request_data)) // KPN things check is now JSON order based, which is bad practice
- {
+ } elseif (is_array($request_data) && count($request_data) > 1 && $this->is_kpn_things_payload($request_data)) { // KPN things check is now JSON order based, which is bad practice
$data_array = $this->parse_kpnthings_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-kpn-things');
- }
- else if (is_array($request_data) && count($request_data) > 1 && isset($request_data['reported_at']) && isset($request_data['payload'])) // KPN things check is now JSON order based, which is bad practice
- {
+ } elseif (is_array($request_data) && count($request_data) > 1 && isset($request_data['reported_at']) && isset($request_data['payload'])) { // KPN things check is now JSON order based, which is bad practice
$data_array = $this->parse_helium_payload($request_data);
$this->cacheRequestRate('store-lora-sensors-helium');
- }
- else if (($request->filled('data') && $request->filled('identifiers'))) // TTN V3 Packet broker HTTPS POST
- {
+ } elseif (($request->filled('data') && $request->filled('identifiers'))) { // TTN V3 Packet broker HTTPS POST
$data_array = $this->parse_ttn_payload($request_data['data']);
$this->cacheRequestRate('store-lora-sensors-ttn-v3-pb');
- }
- else if ($request->filled('data')) // Check for sensor string (colon and pipe devided) fw v1-3
- {
- if (is_array($request_data['data']))
+ } elseif ($request->filled('data')) { // Check for sensor string (colon and pipe devided) fw v1-3
+ if (is_array($request_data['data'])) {
$data_array = $request_data['data'];
- else
+ } else {
$data_array = $this->convertSensorStringToArray($request_data['data']);
+ }
$this->cacheRequestRate('store-sensors');
- }
- else // Assume post data input
- {
+ } else { // Assume post data input
$data_array = $request_data;
$this->cacheRequestRate('store-sensors');
}
- //die(print_r($data_array));
+ // die(print_r($data_array));
return $this->storeMeasurements($data_array);
}
-
/**
api/sensors/flashlog
POST data from BEEP base fw 1.5.0+ FLASH log (with timestamp), interpret data and store in InlfuxDB (overwriting existing data). BEEP base BLE cmd: when the response is 200 OK and erase_mx_flash > -1, provide the ERASE_MX_FLASH BLE command (0x21) to the BEEP base with the last byte being the HEX value of the erase_mx_flash value (0 = 0x00, 1 = 0x01, i.e.0x2100, or 0x2101, i.e. erase_type:"fatfs", or erase_type:"full")
@@ -1024,146 +988,133 @@ public function storeMeasurementData(Request $request)
"erase":false,
"erase_type":"fatfs"
}
- */
+ */
public function flashlog(Request $request)
{
- $user= $request->user();
+ $user = $request->user();
$inp = $request->all();
$sid = isset($inp['id']) ? $inp['id'] : null;
$key = null;
- if (isset($inp['key']) && !isset($inp['hardware_id']) && !isset($inp['id']) )
- {
+ if (isset($inp['key']) && ! isset($inp['hardware_id']) && ! isset($inp['id'])) {
$key = strtolower($inp['key']);
$dev = $user->allDevices()->whereRaw('lower(`key`) = \''.$key.'\'')->first(); // check for case insensitive device key before validation
- if ($dev)
- {
+ if ($dev) {
$inp['id'] = $dev->id;
- $sid = $inp['id'];
+ $sid = $inp['id'];
}
}
$hwi = null;
- if (isset($inp['hardware_id']))
- {
+ if (isset($inp['hardware_id'])) {
$hwi = strtolower($inp['hardware_id']);
$inp['hardware_id'] = $hwi;
}
$validator = Validator::make($inp, [
- 'id' => ['required_without_all:key,hardware_id','integer','exists:sensors,id'],
- 'hardware_id' => ['required_without_all:key,id','string','exists:sensors,hardware_id'],
- 'key' => ['required_without_all:id,hardware_id','string','min:4','exists:sensors,key'],
- 'data' => 'required_without:file',
- 'file' => 'required_without:data|file',
- 'show' => 'nullable|boolean',
- 'save' => 'nullable|boolean',
- 'fill' => 'nullable|boolean',
- 'log_size_bytes' => 'nullable|integer'
+ 'id' => ['required_without_all:key,hardware_id', 'integer', 'exists:sensors,id'],
+ 'hardware_id' => ['required_without_all:key,id', 'string', 'exists:sensors,hardware_id'],
+ 'key' => ['required_without_all:id,hardware_id', 'string', 'min:4', 'exists:sensors,key'],
+ 'data' => 'required_without:file',
+ 'file' => 'required_without:data|file',
+ 'show' => 'nullable|boolean',
+ 'save' => 'nullable|boolean',
+ 'fill' => 'nullable|boolean',
+ 'log_size_bytes' => 'nullable|integer',
]);
- $result = null;
- $parsed = false;
- $saved = false;
- $files = false;
+ $result = null;
+ $parsed = false;
+ $saved = false;
+ $files = false;
$messages = 0;
- if ($validator->fails())
- {
- return Response::json(['errors'=>$validator->errors()], 400);
- }
- else
- {
- $device = null;
+ if ($validator->fails()) {
+ return Response::json(['errors' => $validator->errors()], 400);
+ } else {
+ $device = null;
- if (isset($sid))
- {
- if (Auth::user()->hasRole('superadmin'))
+ if (isset($sid)) {
+ if (Auth::user()->hasRole('superadmin')) {
$device = Device::find($sid);
- else
+ } else {
$device = $user->allDevices()->where('id', $sid)->first();
- }
- else if (isset($key) && !isset($sid) && isset($hwi))
+ }
+ } elseif (isset($key) && ! isset($sid) && isset($hwi)) {
$device = $user->allDevices()->where('hardware_id', $hwi)->where('key', $key)->first();
- else if (isset($hwi))
+ } elseif (isset($hwi)) {
$device = $user->allDevices()->where('hardware_id', $hwi)->first();
- else if (isset($key) && !isset($sid) && !isset($hwi))
+ } elseif (isset($key) && ! isset($sid) && ! isset($hwi)) {
$device = $user->allDevices()->where('key', $key)->first();
+ }
- if ($device == null)
- return Response::json(['errors'=>'device_not_found'], 400);
+ if ($device == null) {
+ return Response::json(['errors' => 'device_not_found'], 400);
+ }
$log_bytes = $request->filled('log_size_bytes') ? intval($inp['log_size_bytes']) : null;
- $fill = $request->filled('fill') ? $inp['fill'] : false;
- $show = $request->filled('show') ? $inp['show'] : false;
- $save = $request->filled('save') ? $inp['save'] : true;
-
- if ($device && ($request->filled('data') || $request->hasFile('file')))
- {
- $sid = $device->id;
- $time = date("YmdHis");
- $disk = env('FLASHLOG_STORAGE', 'public');
+ $fill = $request->filled('fill') ? $inp['fill'] : false;
+ $show = $request->filled('show') ? $inp['show'] : false;
+ $save = $request->filled('save') ? $inp['save'] : true;
+
+ if ($device && ($request->filled('data') || $request->hasFile('file'))) {
+ $sid = $device->id;
+ $time = date('YmdHis');
+ $disk = env('FLASHLOG_STORAGE', 'public');
$f_dir = 'flashlog';
- $data = '';
+ $data = '';
$lines = 0;
$bytes = 0;
$logtm = 0;
$erase = -1;
- $mime = ['mimetype' => 'text/plain'];
+ $mime = ['mimetype' => 'text/plain'];
- if ($request->hasFile('file') && $request->file('file')->isValid())
- {
- $files= true;
+ if ($request->hasFile('file') && $request->file('file')->isValid()) {
+ $files = true;
$file = $request->file('file');
- $name = "sensor_".$sid."_flash_$time.log";
- $f_log= Storage::disk($disk)->putFileAs($f_dir, $file, $name, $mime);
- $saved= $f_log ? true : false;
+ $name = 'sensor_'.$sid."_flash_$time.log";
+ $f_log = Storage::disk($disk)->putFileAs($f_dir, $file, $name, $mime);
+ $saved = $f_log ? true : false;
$data = Storage::disk($disk)->get($f_dir.'/'.$name);
- $f_log= Storage::disk($disk)->url($f_dir.'/'.$name);
- if ($save == false) // check if file needs to be saved
- {
+ $f_log = Storage::disk($disk)->url($f_dir.'/'.$name);
+ if ($save == false) { // check if file needs to be saved
$saved = Storage::disk($disk)->delete($f_dir.'/'.$name) ? false : true;
$f_log = null;
}
- }
- else
- {
+ } else {
$data = $request->input('data');
- if ($save)
- {
- $logFileName = $f_dir."/sensor_".$sid."_flash_$time.log";
+ if ($save) {
+ $logFileName = $f_dir.'/sensor_'.$sid."_flash_$time.log";
$saved = Storage::disk($disk)->put($logFileName, $data, $mime);
$f_log = Storage::disk($disk)->url($logFileName);
}
}
- if ($data)
- {
+ if ($data) {
$f = [
- 'user_id' => $user->id,
- 'device_id' => $device->id,
- 'log_file' => $f_log,
- 'log_size_bytes'=> $log_bytes,
- 'log_saved' => $saved
+ 'user_id' => $user->id,
+ 'device_id' => $device->id,
+ 'log_file' => $f_log,
+ 'log_size_bytes' => $log_bytes,
+ 'log_saved' => $saved,
];
$flashlog = new FlashLog($f);
- $result = $flashlog->log($data, $log_bytes, $save, $fill, $show); // creates result for erasing flashlog in BEEP base apps
+ $result = $flashlog->log($data, $log_bytes, $save, $fill, $show); // creates result for erasing flashlog in BEEP base apps
$messages = $result['log_messages'];
- $lines = $result['lines_received'];
- $bytes = $result['bytes_received'];
- $logtm = $result['log_has_timestamps'];
- $saved = $result['log_saved'];
- $parsed = $result['log_parsed'];
- $erase = $result['erase'];
+ $lines = $result['lines_received'];
+ $bytes = $result['bytes_received'];
+ $logtm = $result['log_has_timestamps'];
+ $saved = $result['log_saved'];
+ $parsed = $result['log_parsed'];
+ $erase = $result['erase'];
}
- Webhook::sendNotification("Flashlog from ".$user->name.", device: ".$device->name.", parsed:".$parsed.", size: ".round($bytes/1024/1024, 2)."MB (".($log_bytes != null && $log_bytes > 0 ? round(100*$bytes/$log_bytes, 1) : '?')."%), messages:".$messages.", saved:".$saved.", erased:".$erase.", to disk:".$disk.'/'.$f_dir);
+ Webhook::sendNotification('Flashlog from '.$user->name.', device: '.$device->name.', parsed:'.$parsed.', size: '.round($bytes / 1024 / 1024, 2).'MB ('.($log_bytes != null && $log_bytes > 0 ? round(100 * $bytes / $log_bytes, 1) : '?').'%), messages:'.$messages.', saved:'.$saved.', erased:'.$erase.', to disk:'.$disk.'/'.$f_dir);
}
- if ($show)
- {
+ if ($show) {
$result['fields'] = array_keys($inp);
- //$result['output'] = $out;
+ // $result['output'] = $out;
}
}
@@ -1175,47 +1126,44 @@ public function decode_beep_lora_payload(Request $request, $port, $payload)
return Response::json($this->decode_beep_payload($payload, $port));
}
-
- private function interval(Request $request, $relative_interval=false, $download=false, $min_interval_min=1)
+ private function interval(Request $request, $relative_interval = false, $download = false, $min_interval_min = 1)
{
- $interval = $request->input('interval','day');
- $index = intval($request->input('index',0));
- $timeGroup = $request->input('timeGroup','day');
- $timeZone = $request->input('timezone','UTC');
+ $interval = $request->input('interval', 'day');
+ $index = intval($request->input('index', 0));
+ $timeGroup = $request->input('timeGroup', 'day');
+ $timeZone = $request->input('timezone', 'UTC');
- $resolution = null;
+ $resolution = null;
$staTimestamp = new Moment(null, $timeZone);
$endTimestamp = new Moment(null, $timeZone);
- if ($request->filled('start') && $request->filled('end'))
- {
- $interval = null;
- $timeGroup = null;
+ if ($request->filled('start') && $request->filled('end')) {
+ $interval = null;
+ $timeGroup = null;
$relative_interval = true;
- $staDate = $request->input('start');
- $endDate = $request->input('end');
- }
- else
- {
+ $staDate = $request->input('start');
+ $endDate = $request->input('end');
+ } else {
$endDate = date('Y-m-d H:i:s');
- $device = $this->get_user_device($request);
- if ($device)
+ $device = $this->get_user_device($request);
+ if ($device) {
$staDate = $device->created_at;
- else
+ } else {
$staDate = $endDate;
+ }
}
// set start/end of interval
$staIndex = $index;
$endIndex = $index;
- if ($relative_interval)
+ if ($relative_interval) {
$staIndex += 1;
+ }
$cache_sensor_names = $index < 7 ? true : false;
- switch($interval)
- {
+ switch ($interval) {
case 'year':
$resolution = '1d'; // 365 values
$staTimestamp->subtractYears($staIndex);
@@ -1250,8 +1198,7 @@ private function interval(Request $request, $relative_interval=false, $download=
$staTimestamp = new Moment($staDate, $timeZone);
$endTimestamp = new Moment($endDate, $timeZone);
$durationDays = abs($staTimestamp->from($endTimestamp)->getDays());
- switch(true)
- {
+ switch (true) {
case $durationDays > 90:
$resolution = $download ? ($min_interval_min > 60 ? $min_interval_min.'m' : '1h') : '1d'; // 90+ values
break;
@@ -1264,7 +1211,7 @@ private function interval(Request $request, $relative_interval=false, $download=
case $durationDays > 2:
$resolution = $download ? null : ($min_interval_min > 30 ? $min_interval_min.'m' : '30m'); // 96-336 values
break;
- case $durationDays > 6/24: // 6 hours
+ case $durationDays > 6 / 24: // 6 hours
$resolution = $download ? null : ($min_interval_min > 10 ? $min_interval_min.'m' : '10m'); // 60-240 values
break;
default:
@@ -1274,76 +1221,68 @@ private function interval(Request $request, $relative_interval=false, $download=
}
// Relative
- if ($relative_interval)
- {
+ if ($relative_interval) {
$start = $staTimestamp->setTimezone('UTC')->format($this->timeFormat);
- $end = $endTimestamp->setTimezone('UTC')->format($this->timeFormat);
- }
- else // absolute time intervals
- {
+ $end = $endTimestamp->setTimezone('UTC')->format($this->timeFormat);
+ } else { // absolute time intervals
$start = $staTimestamp->startOf($interval)->setTimezone('UTC')->format($this->timeFormat);
- $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($this->timeFormat);
+ $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($this->timeFormat);
}
- return ['start'=>$start, 'end'=>$end, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'resolution'=>$resolution, 'timeGroup'=>$timeGroup, 'timeZone'=>$timeZone, 'cacheSensorNames'=>$cache_sensor_names];
+ return ['start' => $start, 'end' => $end, 'interval' => $interval, 'relative_interval' => $relative_interval, 'index' => $index, 'resolution' => $resolution, 'timeGroup' => $timeGroup, 'timeZone' => $timeZone, 'cacheSensorNames' => $cache_sensor_names];
}
-
// just a copy of interal but working for multiple devices
- private function compareinterval(Request $request, $relative_interval=false, $download=false)
+ private function compareinterval(Request $request, $relative_interval = false, $download = false)
{
- $interval = $request->input('interval','day');
- $index = intval($request->input('index',0));
- $timeGroup = $request->input('timeGroup','day');
- $timeZone = $request->input('timezone','UTC');
+ $interval = $request->input('interval', 'day');
+ $index = intval($request->input('index', 0));
+ $timeGroup = $request->input('timeGroup', 'day');
+ $timeZone = $request->input('timezone', 'UTC');
$staTimestamp = new Moment(null, $timeZone);
$endTimestamp = new Moment(null, $timeZone);
$resolution = null;
$resolutions = [];
- $devices = $this->get_user_device($request);
- foreach($devices as $device){
+ $devices = $this->get_user_device($request);
+ foreach ($devices as $device) {
array_push($resolutions, isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1);
}
$maxResolution = max($resolutions);
-
- if ($request->filled('start') && $request->filled('end'))
- {
- $interval = null;
- $timeGroup = null;
+ if ($request->filled('start') && $request->filled('end')) {
+ $interval = null;
+ $timeGroup = null;
$relative_interval = true;
- $staDate = $request->input('start');
- $endDate = $request->input('end');
- }
- else
- {
+ $staDate = $request->input('start');
+ $endDate = $request->input('end');
+ } else {
$endDate = date('Y-m-d H:i:s');
$createds = [];
- foreach($devices as $device){
+ foreach ($devices as $device) {
array_push($createds, $device->created_at);
}
if ($devices) {
- #$createds = array_column($devices, 'created_at');
+ // $createds = array_column($devices, 'created_at');
$staDate = min($createds);
- }
- else
+ } else {
$staDate = $endDate;
+ }
}
// set start/end of interval
$staIndex = $index;
$endIndex = $index;
- if ($relative_interval)
+ if ($relative_interval) {
$staIndex += 1;
+ }
$cache_sensor_names = $index < 7 ? true : false;
- switch($interval)
- {
+ switch ($interval) {
case 'year':
$resolution = '1d'; // 365 values
$staTimestamp->subtractYears($staIndex);
@@ -1378,8 +1317,7 @@ private function compareinterval(Request $request, $relative_interval=false, $do
$staTimestamp = new Moment($staDate, $timeZone);
$endTimestamp = new Moment($endDate, $timeZone);
$durationDays = abs($staTimestamp->from($endTimestamp)->getDays());
- switch(true)
- {
+ switch (true) {
case $durationDays > 90:
$resolution = $download ? ($maxResolution > 60 ? $maxResolution.'m' : '1h') : '1d'; // 90+ values
break;
@@ -1392,7 +1330,7 @@ private function compareinterval(Request $request, $relative_interval=false, $do
case $durationDays > 2:
$resolution = $download ? null : ($maxResolution > 30 ? $maxResolution.'m' : '30m'); // 96-336 values
break;
- case $durationDays > 6/24: // 6 hours
+ case $durationDays > 6 / 24: // 6 hours
$resolution = $download ? null : ($maxResolution > 10 ? $maxResolution.'m' : '10m'); // 60-240 values
break;
default:
@@ -1402,21 +1340,17 @@ private function compareinterval(Request $request, $relative_interval=false, $do
}
// Relative
- if ($relative_interval)
- {
+ if ($relative_interval) {
$start = $staTimestamp->setTimezone('UTC')->format($this->timeFormat);
- $end = $endTimestamp->setTimezone('UTC')->format($this->timeFormat);
- }
- else // absolute time intervals
- {
+ $end = $endTimestamp->setTimezone('UTC')->format($this->timeFormat);
+ } else { // absolute time intervals
$start = $staTimestamp->startOf($interval)->setTimezone('UTC')->format($this->timeFormat);
- $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($this->timeFormat);
+ $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($this->timeFormat);
}
- return ['start'=>$start, 'end'=>$end, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'resolution'=>$resolution, 'timeGroup'=>$timeGroup, 'timeZone'=>$timeZone, 'cacheSensorNames'=>$cache_sensor_names];
+ return ['start' => $start, 'end' => $end, 'interval' => $interval, 'relative_interval' => $relative_interval, 'index' => $index, 'resolution' => $resolution, 'timeGroup' => $timeGroup, 'timeZone' => $timeZone, 'cacheSensorNames' => $cache_sensor_names];
}
-
/**
api/sensors/measurements GET
Request all sensor measurements from a certain interval (hour, day, week, month, year) and index (0=until now, 1=previous interval, etc.)
@@ -1432,113 +1366,115 @@ private function compareinterval(Request $request, $relative_interval=false, $do
@bodyParam end date Date for end of measurements. Required without interval & index. Example: 2020-05-30 00:00
@bodyParam weather integer Load corresponding weather data from the weather database (1) or not (0). Example: 1
@bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
- */
+ */
public function data(Request $request)
{
$this->cacheRequestRate('get-measurements');
$validator = Validator::make($request->all(), [
- 'id' => 'nullable|integer|exists:sensors,id',
- 'key' => 'nullable|string|exists:sensors,key',
- 'hive_id' => 'nullable|integer|exists:hives,id',
- 'start' => 'required_without:index|date',
- 'end' => 'required_without:index|date',
- 'index' => 'required_without:start|required_with:interval|integer',
- 'interval' => 'nullable|string',
- 'timeGroup' => 'nullable|string',
- 'names' => 'nullable|string',
- 'weather' => 'nullable|integer',
- 'clean_weight'=> 'nullable|integer',
- 'timezone' => 'nullable|timezone',
+ 'id' => 'nullable|integer|exists:sensors,id',
+ 'key' => 'nullable|string|exists:sensors,key',
+ 'hive_id' => 'nullable|integer|exists:hives,id',
+ 'start' => 'required_without:index|date',
+ 'end' => 'required_without:index|date',
+ 'index' => 'required_without:start|required_with:interval|integer',
+ 'interval' => 'nullable|string',
+ 'timeGroup' => 'nullable|string',
+ 'names' => 'nullable|string',
+ 'weather' => 'nullable|integer',
+ 'clean_weight' => 'nullable|integer',
+ 'timezone' => 'nullable|timezone',
'relative_interval' => 'nullable|integer',
]);
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
-
-
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
- //Get the sensor
- $device = $this->get_user_device($request);
+ // Get the sensor
+ $device = $this->get_user_device($request);
- if (!isset($device))
+ if (! isset($device)) {
return Response::json('sensor-none-error', 500);
+ }
- $names = $request->input('names', $this->output_sensors);
- $names_w = $this->output_weather;
+ $names = $request->input('names', $this->output_sensors);
+ $names_w = $this->output_weather;
- if (is_string($names))
+ if (is_string($names)) {
$names = explode(',', $names);
+ }
- if (count($names) == 0)
+ if (count($names) == 0) {
return Response::json('sensor-no-measurements-error', 500);
+ }
// add sensorDefinition names
$sensorDefinitions = [];
- foreach ($names as $name)
- {
- $measurement_id = Measurement::getIdByAbbreviation($name);
+ foreach ($names as $name) {
+ $measurement_id = Measurement::getIdByAbbreviation($name);
$sensordefinition = $device->sensorDefinitions->where('output_measurement_id', $measurement_id)->sortByDesc('updated_at')->first();
- if ($sensordefinition)
+ if ($sensordefinition) {
$sensorDefinitions["$name"] = $sensordefinition->toArray();
+ }
}
- //Get the data interval
- $min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
- $relative_interval = boolval($request->input('relative_interval', 0));
- $loadWeather = boolval($request->input('weather', 1));
- $loadCleanWeight = boolval($request->input('clean_weight', 1));
- $intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
+ // Get the data interval
+ $min_interval_min = isset($device->measurement_interval_min) ? $device->measurement_interval_min : 1;
+ $relative_interval = boolval($request->input('relative_interval', 0));
+ $loadWeather = boolval($request->input('weather', 1));
+ $loadCleanWeight = boolval($request->input('clean_weight', 1));
+ $intervalArr = $this->interval($request, $relative_interval, false, $min_interval_min);
- $groupBySelect = null;
+ $groupBySelect = null;
$groupBySelectWeather = null;
- $groupByResolution = '';
- $limit = $this->maxDataPoints;
- $relative_interval = $intervalArr['relative_interval'];
- $resolution = $intervalArr['resolution'];
- $cache_sensor_names = $intervalArr['cacheSensorNames'];
- $start_date = $intervalArr['start'];
- $end_date = $intervalArr['end'];
- $interval = $intervalArr['interval'];
- $index = $intervalArr['index'];
- $timeGroup = $intervalArr['timeGroup'];
- $timeZone = $intervalArr['timeZone'];
- $whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
-
- $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations();
- $add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
-
- if($resolution != null)
- {
- if ($device)
- {
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ $groupByResolution = '';
+ $limit = $this->maxDataPoints;
+ $relative_interval = $intervalArr['relative_interval'];
+ $resolution = $intervalArr['resolution'];
+ $cache_sensor_names = $intervalArr['cacheSensorNames'];
+ $start_date = $intervalArr['start'];
+ $end_date = $intervalArr['end'];
+ $interval = $intervalArr['interval'];
+ $index = $intervalArr['index'];
+ $timeGroup = $intervalArr['timeGroup'];
+ $timeZone = $intervalArr['timeZone'];
+ $whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+
+ $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations();
+ $add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
+
+ if ($resolution != null) {
+ if ($device) {
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
$groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
- $queryList = Device::getAvailableSensorNamesFromData($device->id, $names, $whereKeyAndTime, 'sensors', true, $cache_sensor_names);
+ $queryList = Device::getAvailableSensorNamesFromData($device->id, $names, $whereKeyAndTime, 'sensors', true, $cache_sensor_names);
// Add calibration input measurements for recalculation
- if ($add_calibrations)
- {
+ if ($add_calibrations) {
$m_abbr_calibrations = array_keys($calibration_m_abbr);
- foreach ($m_abbr_calibrations as $m)
- $queryList[] = $m; // 'w_v', etc.
+ foreach ($m_abbr_calibrations as $m) {
+ $queryList[] = $m;
+ } // 'w_v', etc.
}
- foreach ($queryList as $i => $name)
+ foreach ($queryList as $i => $name) {
$queryList[$i] = 'MEAN("'.$name.'") AS "'.$name.'"';
+ }
$groupBySelect = implode(', ', $queryList);
- //$groupBySelect .= ', SUM("weight_delta_noOutlier") AS "mean_weight_intake"';
+ // $groupBySelect .= ', SUM("weight_delta_noOutlier") AS "mean_weight_intake"';
}
// Add weather
- if ($loadWeather){
+ if ($loadWeather) {
$queryListWeather = [];
- foreach ($names_w as $name)
+ foreach ($names_w as $name) {
$queryListWeather[] = 'MEAN("'.$name.'") AS "'.$name.'"';
+ }
$groupBySelectWeather = implode(', ', $queryListWeather);
}
@@ -1547,417 +1483,385 @@ public function data(Request $request)
$sensors_out = [];
$sensorQuery = '';
- if ($groupBySelect != null && $groupBySelect != '')
- {
+ if ($groupBySelect != null && $groupBySelect != '') {
$sensorQuery = 'SELECT '.$groupBySelect.' FROM "sensors" WHERE '.$whereKeyAndTime.' '.$groupByResolution.' LIMIT '.$limit;
$sensors_out = Device::getInfluxQuery($sensorQuery, 'data');
-
+
// Apply SensorDefinitions that have 'recalculate' set to true
- if ($add_calibrations)
- {
- foreach ($sensors_out as $i => $data_array)
+ if ($add_calibrations) {
+ foreach ($sensors_out as $i => $data_array) {
$sensors_out[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr);
+ }
}
}
// Add weather data
- if ($loadWeather && $groupBySelectWeather != null)
- {
+ if ($loadWeather && $groupBySelectWeather != null) {
$location = $device->location();
-
- if (isset($location->coordinate_lat) && isset($location->coordinate_lon))
- {
+
+ if (isset($location->coordinate_lat) && isset($location->coordinate_lon)) {
$weatherQuery = 'SELECT '.$groupBySelectWeather.' FROM "weather" WHERE "lat" = \''.$location->coordinate_lat.'\' AND "lon" = \''.$location->coordinate_lon.'\' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\' '.$groupByResolution.' LIMIT '.$limit;
- $weather_out = Device::getInfluxQuery($weatherQuery, 'weather');
+ $weather_out = Device::getInfluxQuery($weatherQuery, 'weather');
- if (count($sensors_out) == 0)
- {
+ if (count($sensors_out) == 0) {
$sensors_out = $weather_out;
- }
- else if (count($weather_out) > 0)
- {
+ } elseif (count($weather_out) > 0) {
// Add weather data to existing sensor data
$data_time_key_arr = [];
- foreach ($weather_out as $values)
- {
+ foreach ($weather_out as $values) {
$time = $values['time'];
$data_time_key_arr[$time] = $values;
}
// add clean_weight values to sensor time keys where the clean_weight values also exist
- if (count($data_time_key_arr) > 0)
- {
- foreach ($sensors_out as $i => $values)
- {
+ if (count($data_time_key_arr) > 0) {
+ foreach ($sensors_out as $i => $values) {
$time = $values['time'];
- if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
- {
+ if (isset($data_time_key_arr[$time])) { // add clean_weight data to already available datetime
$sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]);
unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
// add missing time values to sensors
- if (count($data_time_key_arr) > 0)
+ if (count($data_time_key_arr) > 0) {
$sensors_out = array_merge($sensors_out, array_values($data_time_key_arr));
+ }
}
}
}
-
// Add cleaned weight
- if($loadCleanWeight){
+ if ($loadCleanWeight) {
$alter_request = $request;
- $alter_request["id"] = [$alter_request["id"]];
- $clean_weight_query = $this -> cleanedWeightQuery($alter_request) ;
+ $alter_request['id'] = [$alter_request['id']];
+ $clean_weight_query = $this->cleanedWeightQuery($alter_request);
$clean_weight_out = Device::getInfluxQuery($clean_weight_query, 'data');
array_shift($clean_weight_out);
- if (count($sensors_out) == 0)
- {
+ if (count($sensors_out) == 0) {
$sensors_out = $clean_weight_out;
- }
- else
- {
+ } else {
// Add weight data to existing sensor data
$data_time_key_arr = [];
- foreach ($clean_weight_out as $values)
- {
+ foreach ($clean_weight_out as $values) {
$time = $values['time'];
$data_time_key_arr[$time] = $values;
}
// add clean_weight values to sensor time keys where the clean_weight values also exist
- if (count($data_time_key_arr) > 0)
- {
- foreach ($sensors_out as $i => $values)
- {
+ if (count($data_time_key_arr) > 0) {
+ foreach ($sensors_out as $i => $values) {
$time = $values['time'];
- if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
- {
+ if (isset($data_time_key_arr[$time])) { // add clean_weight data to already available datetime
$sensors_out[$i] = array_merge($data_time_key_arr[$time], $sensors_out[$i]);
unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
// add missing time values to sensors
- if (count($data_time_key_arr) > 0)
+ if (count($data_time_key_arr) > 0) {
$sensors_out = array_merge(array_values($data_time_key_arr), $sensors_out);
+ }
}
- //return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $clean_weight_query, 'cleanWeight_out'=> $clean_weight_out, 'measurements' => $sensors_out]);
+ // return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $clean_weight_query, 'cleanWeight_out'=> $clean_weight_out, 'measurements' => $sensors_out]);
}
- if (count($sensors_out) == 0)
+ if (count($sensors_out) == 0) {
return Response::json('sensor-no-data-error', 500);
+ }
- return Response::json( ['id'=>$device->id, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'timeGroup'=>$timeGroup, 'resolution'=>$resolution, 'measurements'=>$sensors_out, 'sensorDefinitions'=>$sensorDefinitions, 'cacheSensorNames'=>$cache_sensor_names] );
+ return Response::json(['id' => $device->id, 'interval' => $interval, 'relative_interval' => $relative_interval, 'index' => $index, 'timeGroup' => $timeGroup, 'resolution' => $resolution, 'measurements' => $sensors_out, 'sensorDefinitions' => $sensorDefinitions, 'cacheSensorNames' => $cache_sensor_names]);
}
-
/**
- api/sensors/comparemeasurements GET
- Request mean measurements for multiple hives from a certain interval (hour, day, week, month, year) and index (0=until now, 1=previous interval, etc.)
- @authenticated
- @bodyParam key string DEV EUI to look up the sensor (Device).
- @bodyParam id integer ID to look up the sensor (Device)
- @bodyParam hive_id integer Hive ID to look up the sensor (Device)
- @bodyParam names string comma separated list of Measurement abbreviations to filter request data (weight_kg, t, h, etc.)
- @bodyParam interval string Data interval for interpolation of measurement values: hour (2min), day (10min), week (1 hour), month (3 hours), year (1 day). Default: day.
- @bodyParam relative_interval integer Load data from the selected interval relative to current time (1), or load data in absolute intervals (from start-end of hour/day/week/etc) (0). Default: 0.
- @bodyParam index integer Interval index (>=0; 0=until now, 1=previous interval, etc.). Default: 0.
- @bodyParam start date Date for start of measurements. Required without interval & index. Example: 2020-05-27 16:16
- @bodyParam end date Date for end of measurements. Required without interval & index. Example: 2020-05-30 00:00
- @bodyParam weather integer Load corresponding weather data from the weather database (1) or not (0). Example: 1
- @bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
- */
- public function comparedata(Request $request)
- {
- $this->cacheRequestRate('get-measurements');
-
- $validator = Validator::make($request->all(), [
- 'id' => 'nullable|array|exists:sensors,id',
- 'key' => 'nullable|array|exists:sensors,key',
- 'hive_id' => 'nullable|array|exists:hives,id',
- 'start' => 'required_without:index|date',
- 'end' => 'required_without:index|date',
- 'index' => 'required_without:start|required_with:interval|integer',
- 'interval' => 'nullable|string',
- 'timeGroup' => 'nullable|string',
- 'names' => 'nullable|string',
- 'weather' => 'nullable|integer',
- 'timezone' => 'nullable|timezone',
- 'relative_interval' => 'nullable|integer',
- ]);
-
- #return Response::json( ['status'=>"before validation"] );
-
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
-
- #return Response::json( ['status'=>"validated"] );
-
- //Get the sensors
- $devices = $this->get_user_device($request);
- #return Response::json( ['status'=>"got devices"] );
- #return Response::json( ['devicesLength'=>sizeof($devices)] );
- #return Response::json( ['devices'=>$devices] );
-
-
- if (!isset($devices))
- return Response::json('sensor-none-error', 500);
-
- $names = $request->input('names', $this->output_sensors);
-
- if (count($names) == 0)
- return Response::json('sensor-no-measurements-error', 500);
-
-
- // add sensorDefinition names
- $sensorDefinitions = [];
- foreach ($names as $name)
- {
- $measurement_id = Measurement::getIdByAbbreviation($name);
- foreach($devices as $device){
- $sensordefinition = $device->sensorDefinitions->where('output_measurement_id', $measurement_id)->sortByDesc('updated_at')->first();
- if ($sensordefinition)
- $sensorDefinitions["$name"] = ['name'=>$sensordefinition->name, 'inside'=>$sensordefinition->inside];
-
+ api/sensors/comparemeasurements GET
+ Request mean measurements for multiple hives from a certain interval (hour, day, week, month, year) and index (0=until now, 1=previous interval, etc.)
+ @authenticated
+ @bodyParam key string DEV EUI to look up the sensor (Device).
+ @bodyParam id integer ID to look up the sensor (Device)
+ @bodyParam hive_id integer Hive ID to look up the sensor (Device)
+ @bodyParam names string comma separated list of Measurement abbreviations to filter request data (weight_kg, t, h, etc.)
+ @bodyParam interval string Data interval for interpolation of measurement values: hour (2min), day (10min), week (1 hour), month (3 hours), year (1 day). Default: day.
+ @bodyParam relative_interval integer Load data from the selected interval relative to current time (1), or load data in absolute intervals (from start-end of hour/day/week/etc) (0). Default: 0.
+ @bodyParam index integer Interval index (>=0; 0=until now, 1=previous interval, etc.). Default: 0.
+ @bodyParam start date Date for start of measurements. Required without interval & index. Example: 2020-05-27 16:16
+ @bodyParam end date Date for end of measurements. Required without interval & index. Example: 2020-05-30 00:00
+ @bodyParam weather integer Load corresponding weather data from the weather database (1) or not (0). Example: 1
+ @bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
+ */
+ public function comparedata(Request $request)
+ {
+ $this->cacheRequestRate('get-measurements');
+
+ $validator = Validator::make($request->all(), [
+ 'id' => 'nullable|array|exists:sensors,id',
+ 'key' => 'nullable|array|exists:sensors,key',
+ 'hive_id' => 'nullable|array|exists:hives,id',
+ 'start' => 'required_without:index|date',
+ 'end' => 'required_without:index|date',
+ 'index' => 'required_without:start|required_with:interval|integer',
+ 'interval' => 'nullable|string',
+ 'timeGroup' => 'nullable|string',
+ 'names' => 'nullable|string',
+ 'weather' => 'nullable|integer',
+ 'timezone' => 'nullable|timezone',
+ 'relative_interval' => 'nullable|integer',
+ ]);
+
+ // return Response::json( ['status'=>"before validation"] );
+
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
+
+ // return Response::json( ['status'=>"validated"] );
+
+ // Get the sensors
+ $devices = $this->get_user_device($request);
+ // return Response::json( ['status'=>"got devices"] );
+ // return Response::json( ['devicesLength'=>sizeof($devices)] );
+ // return Response::json( ['devices'=>$devices] );
+
+ if (! isset($devices)) {
+ return Response::json('sensor-none-error', 500);
+ }
+
+ $names = $request->input('names', $this->output_sensors);
+
+ if (count($names) == 0) {
+ return Response::json('sensor-no-measurements-error', 500);
+ }
+
+ // add sensorDefinition names
+ $sensorDefinitions = [];
+ foreach ($names as $name) {
+ $measurement_id = Measurement::getIdByAbbreviation($name);
+ foreach ($devices as $device) {
+ $sensordefinition = $device->sensorDefinitions->where('output_measurement_id', $measurement_id)->sortByDesc('updated_at')->first();
+ if ($sensordefinition) {
+ $sensorDefinitions["$name"] = ['name' => $sensordefinition->name, 'inside' => $sensordefinition->inside];
}
- }
- //Get the data interval
- $relative_interval = boolval($request->input('relative_interval', 0));
- $intervalArr = $this->compareinterval($request, $relative_interval, false);
-
- $groupBySelect = null;
- $groupBySelectWeather = null;
- $groupByResolution = '';
- $limit = 'LIMIT '.$this->maxDataPoints;
- $relative_interval = $intervalArr['relative_interval'];
- $resolution = $intervalArr['resolution'];
- $cache_sensor_names = $intervalArr['cacheSensorNames'];
- $start_date = $intervalArr['start'];
- $end_date = $intervalArr['end'];
- $interval = $intervalArr['interval'];
- $index = $intervalArr['index'];
- $timeGroup = $intervalArr['timeGroup'];
- $timeZone = $intervalArr['timeZone'];
- $wherekeys = '';
- $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
-
- foreach($devices as $device){
- if($wherekeys !== '') $wherekeys .= ' OR ';
-
- $wherekeys.=$device->influxWhereKeys();
}
+ }
- $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+ // Get the data interval
+ $relative_interval = boolval($request->input('relative_interval', 0));
+ $intervalArr = $this->compareinterval($request, $relative_interval, false);
- if($resolution != null)
- {
- if ($devices)
- {
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
- $groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
- #$queryList = Device::getAvailableSensorNamesFromData($device->id, $names, $whereKeyAndTime, 'sensors', true, $cache_sensor_names);
- $queryList = $names;
+ $groupBySelect = null;
+ $groupBySelectWeather = null;
+ $groupByResolution = '';
+ $limit = 'LIMIT '.$this->maxDataPoints;
+ $relative_interval = $intervalArr['relative_interval'];
+ $resolution = $intervalArr['resolution'];
+ $cache_sensor_names = $intervalArr['cacheSensorNames'];
+ $start_date = $intervalArr['start'];
+ $end_date = $intervalArr['end'];
+ $interval = $intervalArr['interval'];
+ $index = $intervalArr['index'];
+ $timeGroup = $intervalArr['timeGroup'];
+ $timeZone = $intervalArr['timeZone'];
+ $wherekeys = '';
+ $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+
+ foreach ($devices as $device) {
+ if ($wherekeys !== '') {
+ $wherekeys .= ' OR ';
+ }
+ $wherekeys .= $device->influxWhereKeys();
+ }
- foreach ($queryList as $i => $name)
- $queryList[$i] = 'MEAN("'.$name.'") AS "mean_'.$name.'", stddev("'.$name.'") AS "sd_'.$name.'"';
-
-
- $groupBySelect = implode(', ', $queryList);
+ $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+
+ if ($resolution != null) {
+ if ($devices) {
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ $groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
+ // $queryList = Device::getAvailableSensorNamesFromData($device->id, $names, $whereKeyAndTime, 'sensors', true, $cache_sensor_names);
+ $queryList = $names;
- #$groupBySelect .= ', SUM("weight_delta_noOutlier") AS "weight_intake"';
+ foreach ($queryList as $i => $name) {
+ $queryList[$i] = 'MEAN("'.$name.'") AS "mean_'.$name.'", stddev("'.$name.'") AS "sd_'.$name.'"';
}
-
+ $groupBySelect = implode(', ', $queryList);
+
+ // $groupBySelect .= ', SUM("weight_delta_noOutlier") AS "weight_intake"';
+ }
+
$sensors_out = [];
-
- if ($groupBySelect != null && $groupBySelect != '')
- {
+ if ($groupBySelect != null && $groupBySelect != '') {
$sensorQuery = 'SELECT '.$groupBySelect.' FROM "sensors" WHERE '.$whereKeyAndTime.' '.$groupByResolution.' '.$limit;
$sensors_out = Device::getInfluxQuery($sensorQuery, 'data');
}
// Add cleaned weight
-
+ $cleanWeight_query = $this->cleanedWeightQuery($request);
+ // if(count($queries)>1){
+ $cleanWeight_query = 'SELECT mean(net_weight_kg) as mean_net_weight_kg, stddev(net_weight_kg) as sd_net_weight_kg FROM ('.$cleanWeight_query.') where '.$whereTime.' '.$groupByResolution.' '.$limit;
+ // }
- $cleanWeight_query = $this -> cleanedWeightQuery($request) ;
- #if(count($queries)>1){
- $cleanWeight_query = 'SELECT mean(net_weight_kg) as mean_net_weight_kg, stddev(net_weight_kg) as sd_net_weight_kg FROM ('.$cleanWeight_query.') where '.$whereTime.' '.$groupByResolution.' '.$limit;
- #}
-
$cleanWeight_out = Device::getInfluxQuery($cleanWeight_query, 'data');
- #return Response::json( ['ccw' => count($cleanWeight_out), 'so' => count($sensors_out)] );
- if (count($cleanWeight_out) == (count($sensors_out)+1)){
+ // return Response::json( ['ccw' => count($cleanWeight_out), 'so' => count($sensors_out)] );
+ if (count($cleanWeight_out) == (count($sensors_out) + 1)) {
array_shift($cleanWeight_out);
}
-
- if (count($cleanWeight_out) == count($sensors_out))
- {
- foreach ($sensors_out as $key => $value)
- {
- foreach ($cleanWeight_out[$key] as $name => $value)
- {
- if ($name != 'time')
- $sensors_out[$key][$name] = $value;
+
+ if (count($cleanWeight_out) == count($sensors_out)) {
+ foreach ($sensors_out as $key => $value) {
+ foreach ($cleanWeight_out[$key] as $name => $value) {
+ if ($name != 'time') {
+ $sensors_out[$key][$name] = $value;
+ }
}
}
}
-
- #return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $cleanWeight_query, 'cleanWeight_out'=> count($cleanWeight_out), 'sensors_out' => count($sensors_out), 'measurements'=>$cleanWeight_out, 'measurements2'=>$sensors_out]);
-
- if (count($sensors_out) == 0)
+
+ // return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $cleanWeight_query, 'cleanWeight_out'=> count($cleanWeight_out), 'sensors_out' => count($sensors_out), 'measurements'=>$cleanWeight_out, 'measurements2'=>$sensors_out]);
+
+ if (count($sensors_out) == 0) {
return Response::json('sensor-no-data-error', 500);
+ }
+
+ // return Response::json( ['cleanquery' => $cleanWeight_query, 'id'=>$device->id, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'timeGroup'=>$timeGroup, 'resolution'=>$resolution, 'measurements'=>$sensors_out, 'sensorDefinitions'=>$sensorDefinitions, 'cacheSensorNames'=>$cache_sensor_names] );
- #return Response::json( ['cleanquery' => $cleanWeight_query, 'id'=>$device->id, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'timeGroup'=>$timeGroup, 'resolution'=>$resolution, 'measurements'=>$sensors_out, 'sensorDefinitions'=>$sensorDefinitions, 'cacheSensorNames'=>$cache_sensor_names] );
-
- return Response::json( ['id'=>$device->id, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'timeGroup'=>$timeGroup, 'resolution'=>$resolution, 'measurements'=>$sensors_out, 'sensorDefinitions'=>$sensorDefinitions, 'cacheSensorNames'=>$cache_sensor_names] );
+ return Response::json(['id' => $device->id, 'interval' => $interval, 'relative_interval' => $relative_interval, 'index' => $index, 'timeGroup' => $timeGroup, 'resolution' => $resolution, 'measurements' => $sensors_out, 'sensorDefinitions' => $sensorDefinitions, 'cacheSensorNames' => $cache_sensor_names]);
}
}
-
- private function mapToSmallerResolution($resolution){
- $index = strlen($resolution) -1;
+ private function mapToSmallerResolution($resolution)
+ {
+ $index = strlen($resolution) - 1;
$unit = substr($resolution, $index);
- if($unit=="m"){
- $resolution = "1m";
- }
- elseif($unit=="h"){
- $resolution = "15m";
- }
- elseif($unit=="d"){
- $resolution = "1h";
+ if ($unit == 'm') {
+ $resolution = '1m';
+ } elseif ($unit == 'h') {
+ $resolution = '15m';
+ } elseif ($unit == 'd') {
+ $resolution = '1h';
}
+
return $resolution;
}
+ private function getDeviations(Device $device, $resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone)
+ {
- private function getDeviations(Device $device, $resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone){
+ $wherekeys = $device->influxWhereKeys();
- $wherekeys = $device->influxWhereKeys();
+ $whereTreshold = 'weight_delta > '.$threshold.' OR weight_delta <'.-1 * $threshold;
+ $inspections = [];
- $whereTreshold = 'weight_delta > '.$threshold.' OR weight_delta <'.-1*$threshold;
- $inspections = [];
+ if (isset($device->hive)) {
+ $inspections = $device->hive->getAllInspectionDates();
+ sort($inspections);
- if (isset($device -> hive))
- {
- $inspections = $device -> hive -> getAllInspectionDates();
- sort($inspections);
-
- // choose inspections in time frame only and convert to utc
- $filteredInspections = [];
- foreach($inspections as $inspection){
- $inspection_stamp = new Moment($inspection, $timeZone);
- $inspection_utc = $inspection_stamp->setTimezone('UTC')->format($this->timeFormat);
- if($inspection_utc >= $start_date & $inspection_utc <= $end_date){
- array_push($filteredInspections, $inspection_utc);
- }
- }
- $inspections = $filteredInspections;
- #return Response::json( ['status'=>$inspections] );
+ // choose inspections in time frame only and convert to utc
+ $filteredInspections = [];
+ foreach ($inspections as $inspection) {
+ $inspection_stamp = new Moment($inspection, $timeZone);
+ $inspection_utc = $inspection_stamp->setTimezone('UTC')->format($this->timeFormat);
+ if ($inspection_utc >= $start_date & $inspection_utc <= $end_date) {
+ array_push($filteredInspections, $inspection_utc);
+ }
}
-
- // array for time frames shortly before and after inspections
- $inspectionTuples = [];
- // array for other time frames
- $periodTuples = [];
-
- $inspectionFrame = $frame;
-
- // create first tuple / or the only tuple needed
- $length = count($inspections);
-
- if($length > 0){
- $periodTuples[0] = ['\''.$start_date.'\'', '\''.$inspections[0].'\''.' - '.$inspectionFrame.'h', $resolution];
- }else{
- $periodTuples[0] = ['\''.$start_date.'\'', '\''.$end_date.'\'', $resolution];
+ $inspections = $filteredInspections;
+ // return Response::json( ['status'=>$inspections] );
+ }
+
+ // array for time frames shortly before and after inspections
+ $inspectionTuples = [];
+ // array for other time frames
+ $periodTuples = [];
+
+ $inspectionFrame = $frame;
+
+ // create first tuple / or the only tuple needed
+ $length = count($inspections);
+
+ if ($length > 0) {
+ $periodTuples[0] = ['\''.$start_date.'\'', '\''.$inspections[0].'\''.' - '.$inspectionFrame.'h', $resolution];
+ } else {
+ $periodTuples[0] = ['\''.$start_date.'\'', '\''.$end_date.'\'', $resolution];
+ }
+
+ // create all tuples
+ $i = 0;
+ while ($i <= $length - 1) {
+ $cur = current($inspections);
+ if (($i != $length - 1)) {
+ $nex = next($inspections);
+ } else {
+ $nex = $end_date;
}
+ $i++;
- // create all tuples
- $i = 0;
- while($i <= $length-1){
- $cur = current($inspections);
- if(($i != $length-1)){
+ // check if two or more inspection time frames should be merged into one. update $nex in that case
+ $inter = $cur;
+ while (($i <= $length - 1) && ((strtotime($nex) - strtotime($inter)) / (60 * 60) <= 2 * $inspectionFrame)) {
+ $inter = $nex;
+ if (($i != $length - 1)) {
$nex = next($inspections);
- }else{
+ } else {
$nex = $end_date;
}
$i++;
-
- // check if two or more inspection time frames should be merged into one. update $nex in that case
- $inter = $cur;
- while(($i <= $length-1) && ((strtotime($nex) - strtotime($inter))/(60*60)<= 2*$inspectionFrame )){
- $inter = $nex;
- if(($i != $length-1)){
- $nex = next($inspections);
- } else{
- $nex = $end_date;
- }
- $i++;
- }
- // add inspection tuple
- $inspectionTuples[$i] = ['\''.$cur.'\' - '.$inspectionFrame.'h', '\''.$inter.'\' + '.$inspectionFrame.'h'];
- // calculate resolution/ offset needed for period tuple
- // therefore check if period time frame would be smaller than the resolution
- // in that case, the resolution should be smaller than the one used for the outer query
- // $difference = round(abs(strtotime($nex) - strtotime($inter)) / 60);
- // $transRes = $this->translateResolutionToMinutes($resolution);
- // $useRes = $resolution;
- // if(!is_null($transRes) & (($difference - 2*60*$inspectionFrame)< $transRes)){
- // $useRes = $this -> mapToSmallerResolution($resolution);
- // }
- // // add period tuple
- // if($i <= $length-1){
- // $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$nex.'\' - '.$inspectionFrame.'h', $useRes];
- // }else{
- // $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$end_date.'\'', $useRes];
- // }
}
+ // add inspection tuple
+ $inspectionTuples[$i] = ['\''.$cur.'\' - '.$inspectionFrame.'h', '\''.$inter.'\' + '.$inspectionFrame.'h'];
+ // calculate resolution/ offset needed for period tuple
+ // therefore check if period time frame would be smaller than the resolution
+ // in that case, the resolution should be smaller than the one used for the outer query
+ // $difference = round(abs(strtotime($nex) - strtotime($inter)) / 60);
+ // $transRes = $this->translateResolutionToMinutes($resolution);
+ // $useRes = $resolution;
+ // if(!is_null($transRes) & (($difference - 2*60*$inspectionFrame)< $transRes)){
+ // $useRes = $this -> mapToSmallerResolution($resolution);
+ // }
+ // // add period tuple
+ // if($i <= $length-1){
+ // $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$nex.'\' - '.$inspectionFrame.'h', $useRes];
+ // }else{
+ // $periodTuples[$i+1] = ['\''.$inter.'\' + '.$inspectionFrame.'h + '.$useRes, '\''.$end_date.'\'', $useRes];
+ // }
+ }
+
+ $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+
+ if ($resolution != null) {
+ if ($device) {
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ $groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
+ $groupInspection = 'GROUP BY time(15m)';
-
- $whereKeyAndTime = $wherekeys.' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
-
-
-
-
- if($resolution != null)
- {
- if ($device)
- {
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
- $groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
- $groupInspection = 'GROUP BY time(15m)';
-
- #$groupBySelectOuter = 'cumulative_sum(sum(weight_delta)) as weight_kg_noOutlier';
- $groupBySelectInnerInspection = 'derivative(mean(weight_kg), 15m) as weight_delta';
- #$groupBySelectInnerPeriod = 'derivative(mean(weight_kg), '.$resolution.') as weight_delta';
- }
+ // $groupBySelectOuter = 'cumulative_sum(sum(weight_delta)) as weight_kg_noOutlier';
+ $groupBySelectInnerInspection = 'derivative(mean(weight_kg), 15m) as weight_delta';
+ // $groupBySelectInnerPeriod = 'derivative(mean(weight_kg), '.$resolution.') as weight_delta';
+ }
-
$sensors_out = [];
-
-
- $inspectionQueries = [];
- foreach($inspectionTuples as $i => $tuple){
- $inspectionQueries[$i] = '(SELECT * FROM ( SELECT '.$groupBySelectInnerInspection.' FROM "sensors" WHERE '.$wherekeys.
- ' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' '.$groupInspection.' fill(linear)) WHERE '.$whereTreshold.')';
- }
- // $periodQueries = [];
- // foreach($periodTuples as $i => $tuple){
- // $periodQueries[$i] = '(SELECT derivative(mean(weight_kg), '.$tuple[2].') as weight_delta FROM "sensors" WHERE '.$wherekeys.
- // ' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' group by time('.$tuple[2].') '.$limit.')';
- // }
- // $allQueries = array_merge($periodQueries, $inspectionQueries);
- $innerQuery = implode(', ', $inspectionQueries);
-
+ $inspectionQueries = [];
+ foreach ($inspectionTuples as $i => $tuple) {
+ $inspectionQueries[$i] = '(SELECT * FROM ( SELECT '.$groupBySelectInnerInspection.' FROM "sensors" WHERE '.$wherekeys.
+ ' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' '.$groupInspection.' fill(linear)) WHERE '.$whereTreshold.')';
+ }
+ // $periodQueries = [];
+ // foreach($periodTuples as $i => $tuple){
+ // $periodQueries[$i] = '(SELECT derivative(mean(weight_kg), '.$tuple[2].') as weight_delta FROM "sensors" WHERE '.$wherekeys.
+ // ' AND time >= '.$tuple[0].' AND time <= '.$tuple[1].' group by time('.$tuple[2].') '.$limit.')';
+ // }
+ // $allQueries = array_merge($periodQueries, $inspectionQueries);
+ $innerQuery = implode(', ', $inspectionQueries);
+
}
- return $innerQuery;
+
+ return $innerQuery;
}
@@ -1965,141 +1869,130 @@ private function getDeviations(Device $device, $resolution, $start_date, $end_da
public function cleanedWeightQuery(Request $request)
{
$validator = Validator::make($request->all(), [
- 'id' => 'nullable|array|exists:sensors,id',
- 'key' => 'nullable|array|exists:sensors,key',
- 'hive_id' => 'nullable|array|exists:hives,id',
- 'start' => 'required_without:index|date',
- 'end' => 'required_without:index|date',
- 'index' => 'required_without:start|required_with:interval|integer',
- 'interval' => 'nullable|string',
- 'timeGroup' => 'nullable|string',
- 'names' => 'nullable|string',
- 'weather' => 'nullable|integer',
- 'timezone' => 'nullable|timezone',
+ 'id' => 'nullable|array|exists:sensors,id',
+ 'key' => 'nullable|array|exists:sensors,key',
+ 'hive_id' => 'nullable|array|exists:hives,id',
+ 'start' => 'required_without:index|date',
+ 'end' => 'required_without:index|date',
+ 'index' => 'required_without:start|required_with:interval|integer',
+ 'interval' => 'nullable|string',
+ 'timeGroup' => 'nullable|string',
+ 'names' => 'nullable|string',
+ 'weather' => 'nullable|integer',
+ 'timezone' => 'nullable|timezone',
'relative_interval' => 'nullable|integer',
'threshold' => 'nullable|integer',
- 'frame' => 'nullable|integer',
+ 'frame' => 'nullable|integer',
]);
- #return Response::json( ['status'=>"before validation"] );
+ // return Response::json( ['status'=>"before validation"] );
- if ($validator->fails())
- return response()->json(['errors'=>$validator->errors()]);
+ if ($validator->fails()) {
+ return response()->json(['errors' => $validator->errors()]);
+ }
- if ($request->filled('threshold') && $request->input('threshold') != 'null'){
+ if ($request->filled('threshold') && $request->input('threshold') != 'null') {
$threshold = floatval($request->input('threshold'));
- }
- else{
+ } else {
$threshold = 0.75;
}
- if ($request->filled('frame') && $request->input('frame') != 'null'){
+ if ($request->filled('frame') && $request->input('frame') != 'null') {
$frame = intval($request->input('frame'));
- }
- else{
+ } else {
$frame = 2;
}
- //Get the sensors
- $devices = $this->get_user_device($request);
+ // Get the sensors
+ $devices = $this->get_user_device($request);
-
- if (!isset($devices))
+ if (! isset($devices)) {
return Response::json('sensor-none-error', 500);
+ }
+ $names = $request->input('names', $this->output_sensors);
- $names = $request->input('names', $this->output_sensors);
-
- if (count($names) == 0)
+ if (count($names) == 0) {
return Response::json('sensor-no-measurements-error', 500);
-
+ }
// add sensorDefinition names
$sensorDefinitions = [];
- foreach ($names as $name)
- {
+ foreach ($names as $name) {
$measurement_id = Measurement::getIdByAbbreviation($name);
- foreach($devices as $device){
+ foreach ($devices as $device) {
$sensordefinition = $device->sensorDefinitions->where('output_measurement_id', $measurement_id)->sortByDesc('updated_at')->first();
- if ($sensordefinition)
- $sensorDefinitions["$name"] = ['name'=>$sensordefinition->name, 'inside'=>$sensordefinition->inside];
+ if ($sensordefinition) {
+ $sensorDefinitions["$name"] = ['name' => $sensordefinition->name, 'inside' => $sensordefinition->inside];
+ }
}
}
- //Get the data interval
- $relative_interval = boolval($request->input('relative_interval', 0));
- $intervalArr = $this->compareinterval($request, $relative_interval, false);
+ // Get the data interval
+ $relative_interval = boolval($request->input('relative_interval', 0));
+ $intervalArr = $this->compareinterval($request, $relative_interval, false);
- $groupBySelect = null;
+ $groupBySelect = null;
$groupBySelectWeather = null;
- $groupByResolution = '';
- $limit = $this->maxDataPoints;
- $relative_interval = $intervalArr['relative_interval'];
- $resolution = $intervalArr['resolution'];
- $smallerResolution = $this -> mapToSmallerResolution($resolution);
- $cache_sensor_names = $intervalArr['cacheSensorNames'];
- $start_date = $intervalArr['start'];
- $end_date = $intervalArr['end'];
- $interval = $intervalArr['interval'];
- $index = $intervalArr['index'];
- $timeGroup = $intervalArr['timeGroup'];
- $timeZone = $intervalArr['timeZone'];
- $wherekeys = '';
- $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ $groupByResolution = '';
+ $limit = $this->maxDataPoints;
+ $relative_interval = $intervalArr['relative_interval'];
+ $resolution = $intervalArr['resolution'];
+ $smallerResolution = $this->mapToSmallerResolution($resolution);
+ $cache_sensor_names = $intervalArr['cacheSensorNames'];
+ $start_date = $intervalArr['start'];
+ $end_date = $intervalArr['end'];
+ $interval = $intervalArr['interval'];
+ $index = $intervalArr['index'];
+ $timeGroup = $intervalArr['timeGroup'];
+ $timeZone = $intervalArr['timeZone'];
+ $wherekeys = '';
+ $whereTime = 'time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
$groupByResolution = 'GROUP BY time('.$resolution.') fill('.$fill.')';
$groupByKeyResolutionPrev = 'GROUP BY "key",time('.$resolution.') fill(previous)';
$groupByKeyResolutionPrevSmall = 'GROUP BY "key",time('.$smallerResolution.') fill(previous)';
$groupByKeyResolutionNullSmall = 'GROUP BY "key",time('.$smallerResolution.') fill(null)';
$groupByKeyResolution0Small = 'GROUP BY "key",time('.$smallerResolution.') fill(0)';
- $groupBySelectOuter = 'cumulative_sum(sum(weight_delta)) as jump';
-
+ $groupBySelectOuter = 'cumulative_sum(sum(weight_delta)) as jump';
$innerQueries = [];
- foreach($devices as $i => $device)
- {
+ foreach ($devices as $i => $device) {
$innerQuery = $this->getDeviations($device, $resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone);
-// foreach($devices as $i => $device)
-// {
-// $innerCleanQuery = $device->getInnerCleanQuery($resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone);
-// if ($innerCleanQuery !== null)
-// $innerQueries[$i] = $innerCleanQuery;
-// }
-// $innerQuery = implode(', ', $innerQueries);
-
-
- if($resolution != null)
- {
- $wherekeys=$device->influxWhereKeys();
- # get raw weight
+ // foreach($devices as $i => $device)
+ // {
+ // $innerCleanQuery = $device->getInnerCleanQuery($resolution, $start_date, $end_date, $limit, $threshold, $frame, $timeZone);
+ // if ($innerCleanQuery !== null)
+ // $innerQueries[$i] = $innerCleanQuery;
+ // }
+ // $innerQuery = implode(', ', $innerQueries);
+
+ if ($resolution != null) {
+ $wherekeys = $device->influxWhereKeys();
+ // get raw weight
$weightQuery = 'SELECT mean(weight_kg) AS "weight_kg" FROM "sensors" WHERE '.$wherekeys.' AND '.$whereTime.' '.$groupByKeyResolutionNullSmall;
- # get first value to transform ylim to 0
- $firstQuery = 'SELECT mean(first_weight) as first_weight FROM ( SELECT first(weight_kg) as first_weight FROM "sensors" WHERE '.$wherekeys. ' AND '.$whereTime.' GROUP BY time(1000d)) WHERE '.$whereTime.' '.$groupByKeyResolutionPrev;
-
- if(strlen($innerQuery)>1){
+ // get first value to transform ylim to 0
+ $firstQuery = 'SELECT mean(first_weight) as first_weight FROM ( SELECT first(weight_kg) as first_weight FROM "sensors" WHERE '.$wherekeys.' AND '.$whereTime.' GROUP BY time(1000d)) WHERE '.$whereTime.' '.$groupByKeyResolutionPrev;
+
+ if (strlen($innerQuery) > 1) {
$sensorQuery = $innerQuery;
- # collect all information
- $sensorQuery = 'SELECT mean(weight_kg) - mean(jump) as net_weight_kg FROM ('.$weightQuery.'),(SELECT mean(jump) AS jump FROM (SELECT mean(jump) AS jump FROM ( SELECT '.$groupBySelectOuter.' FROM '.$innerQuery.' WHERE '.$whereTime.' '.$groupByKeyResolutionNullSmall.') WHERE '.$whereTime.' '.$groupByKeyResolutionPrevSmall.') WHERE '.$whereTime.' '.$groupByKeyResolution0Small.' ) WHERE '.$whereTime.' '.$groupByKeyResolutionNullSmall.' ';
- # this is with the correct resolution
+ // collect all information
+ $sensorQuery = 'SELECT mean(weight_kg) - mean(jump) as net_weight_kg FROM ('.$weightQuery.'),(SELECT mean(jump) AS jump FROM (SELECT mean(jump) AS jump FROM ( SELECT '.$groupBySelectOuter.' FROM '.$innerQuery.' WHERE '.$whereTime.' '.$groupByKeyResolutionNullSmall.') WHERE '.$whereTime.' '.$groupByKeyResolutionPrevSmall.') WHERE '.$whereTime.' '.$groupByKeyResolution0Small.' ) WHERE '.$whereTime.' '.$groupByKeyResolutionNullSmall.' ';
+ // this is with the correct resolution
$sensorQuery = 'SELECT mean(net_weight_kg) as net_weight_kg FROM ('.$sensorQuery.') WHERE '.$whereTime.' '.$groupByResolution.' LIMIT '.$limit;
- }else{
- # no cleaning necessary
+ } else {
+ // no cleaning necessary
$sensorQuery = 'SELECT mean(weight_kg) as net_weight_kg FROM "sensors" WHERE '.$wherekeys.' and '.$whereTime.' '.$groupByResolution.' LIMIT '.$limit; // this is necessary to fill with null values when data is missing
}
- # substract first value
+ // substract first value
$sensorQuery = 'SELECT mean(net_weight_kg) - mean(first_weight) as net_weight_kg FROM ('.$firstQuery.'), ('.$sensorQuery.') WHERE '.$whereTime.' '.$groupByResolution.' LIMIT '.$limit;
-
+
$queries[$i] = $sensorQuery;
}
$query = implode('), (', array_filter($queries));
}
-
-
-
-
return $sensorQuery;
}
-
}
diff --git a/app/Http/Controllers/Api/QueenController.php b/app/Http/Controllers/Api/QueenController.php
index a917c0e9..20876cec 100644
--- a/app/Http/Controllers/Api/QueenController.php
+++ b/app/Http/Controllers/Api/QueenController.php
@@ -2,13 +2,14 @@
namespace App\Http\Controllers\Api;
+use App\Http\Controllers\Controller;
use App\Queen;
use Illuminate\Http\Request;
-use App\Http\Controllers\Controller;
/**
* @group Api\QueenController
* Not used
+ *
* @authenticated
*/
class QueenController extends Controller
@@ -20,42 +21,41 @@ class QueenController extends Controller
*/
public function index(Request $request)
{
- if ($request->user()->queens()->count() > 0)
- return response()->json(['queens'=>$request->user()->queens()->get()]);
+ if ($request->user()->queens()->count() > 0) {
+ return response()->json(['queens' => $request->user()->queens()->get()]);
+ }
- return response()->json(['error'=>'no queens available'],404);
+ return response()->json(['error' => 'no queens available'], 404);
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$race_id = $request->filled('race_id') ? $request->input('race_id') : Category::findCategoryIdByParentAndName('subspecies', 'other');
- $date = $request->filled('birth_date') ? date('Y-m-d', strtotime($request->input('birth_date'))) : null;
- $queen = [
- 'name' =>$request->input('name'),
- 'description' =>$request->input('description'),
- 'line' =>$request->input('line'),
- 'tree' =>$request->input('tree'),
- 'hive_id' =>$request->input('hive_id'),
- 'race_id' =>$race_id,
- 'birth_date' =>$date,
- 'color' =>$request->input('color'),
- 'clipped' =>boolval($request->input('clipped')),
- 'fertilized' =>boolval($request->input('fertilized')),
+ $date = $request->filled('birth_date') ? date('Y-m-d', strtotime($request->input('birth_date'))) : null;
+ $queen = [
+ 'name' => $request->input('name'),
+ 'description' => $request->input('description'),
+ 'line' => $request->input('line'),
+ 'tree' => $request->input('tree'),
+ 'hive_id' => $request->input('hive_id'),
+ 'race_id' => $race_id,
+ 'birth_date' => $date,
+ 'color' => $request->input('color'),
+ 'clipped' => boolval($request->input('clipped')),
+ 'fertilized' => boolval($request->input('fertilized')),
];
- return response()->json($request->user()->queens()->updateOrCreate(['queens.id'=>$request->input('id', null)], $queen));
+ return response()->json($request->user()->queens()->updateOrCreate(['queens.id' => $request->input('id', null)], $queen));
}
/**
* Display the specified resource.
*
- * @param \App\Queen $queen
* @return \Illuminate\Http\Response
*/
public function show(Request $request, Queen $queen)
@@ -66,8 +66,6 @@ public function show(Request $request, Queen $queen)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
- * @param \App\Queen $queen
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Queen $queen)
@@ -78,13 +76,13 @@ public function update(Request $request, Queen $queen)
/**
* Remove the specified resource from storage.
*
- * @param \App\Queen $queen
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Queen $queen)
{
$queen = $request->user()->queens()->findorFail($queen->id);
$queen->delete();
+
return response()->json(null, 204);
}
}
diff --git a/app/Http/Controllers/Api/ResearchController.php b/app/Http/Controllers/Api/ResearchController.php
index ed5430d0..82e8d0ca 100644
--- a/app/Http/Controllers/Api/ResearchController.php
+++ b/app/Http/Controllers/Api/ResearchController.php
@@ -2,16 +2,16 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
-
use App\Research;
-use Moment\Moment;
use DB;
+use Illuminate\Http\Request;
+use Moment\Moment;
/**
* @group Api\ResearchController
* Manage your research consent
+ *
* @authenticated
*/
class ResearchController extends Controller
@@ -24,23 +24,27 @@ class ResearchController extends Controller
public function index(Request $request)
{
$researches = Research::where('visible', true)->get();
- $out = [];
- $user_id = $request->user()->id;
+ $out = [];
+ $user_id = $request->user()->id;
- foreach ($researches as $r)
- if ($user_id == $r->user_id || $r->on_invite_only == false || (isset($r->default_user_ids) && in_array($user_id, $r->default_user_ids))) // owners, open researches and researches where user has been invited to
+ foreach ($researches as $r) {
+ if ($user_id == $r->user_id || $r->on_invite_only == false || (isset($r->default_user_ids) && in_array($user_id, $r->default_user_ids))) { // owners, open researches and researches where user has been invited to
$out[] = $r;
+ }
+ }
return $out;
}
/**
* research/{id}/add_consent POST
- *
+ *
* @urlParam id integer required Research ID
+ *
* @bodyParam location_ids array Only share data from these location IDs
* @bodyParam hive_ids array Only share data from these hive IDs
* @bodyParam device_ids array Only share data from these device IDs
+ *
* @return \Illuminate\Http\Response
*/
public function add_consent(Request $request, $id)
@@ -56,14 +60,14 @@ public function remove_consent(Request $request, $id)
public function edit_consent(Request $request, $id, $consent_id)
{
$consent = DB::table('research_user')->where('user_id', $request->user()->id)->where('research_id', $id)->find($consent_id);
-
+
$saved = false;
- if ($consent && $request->filled('updated_at'))
- {
+ if ($consent && $request->filled('updated_at')) {
$timestamp = $request->input('updated_at');
- DB::table('research_user')->where('id', $consent_id)->update(['updated_at'=>$timestamp]);
+ DB::table('research_user')->where('id', $consent_id)->update(['updated_at' => $timestamp]);
$saved = true;
}
+
return response()->json($saved, $saved ? 200 : 500);
}
@@ -72,8 +76,7 @@ public function delete_no_consent(Request $request, $id, $consent_id)
$consent = DB::table('research_user')->where('user_id', $request->user()->id)->where('research_id', $id)->find($consent_id);
$deleted = false;
- if ($consent && $consent->consent == false)
- {
+ if ($consent && $consent->consent == false) {
DB::table('research_user')->where('id', $consent_id)->delete();
$deleted = true;
}
@@ -83,37 +86,34 @@ public function delete_no_consent(Request $request, $id, $consent_id)
private function save_consent(Request $request, $id, $consent)
{
- $research = Research::findOrFail($id);
+ $research = Research::findOrFail($id);
$timestamp = date('Y-m-d H:i:s');
- $history = $research->getConsentHistoryAttribute();
- $updated = false;
+ $history = $research->getConsentHistoryAttribute();
+ $updated = false;
// Provide consent on specific parts
- $loc_ids = $request->filled('location_ids') && is_array($request->input('location_ids')) ? implode(',', $request->input('location_ids')) : null;
- $hive_ids = $request->filled('hive_ids') && is_array($request->input('hive_ids')) ? implode(',', $request->input('hive_ids')) : null;
- $device_ids= $request->filled('device_ids') && is_array($request->input('device_ids')) ? implode(',', $request->input('device_ids')) : null;
+ $loc_ids = $request->filled('location_ids') && is_array($request->input('location_ids')) ? implode(',', $request->input('location_ids')) : null;
+ $hive_ids = $request->filled('hive_ids') && is_array($request->input('hive_ids')) ? implode(',', $request->input('hive_ids')) : null;
+ $device_ids = $request->filled('device_ids') && is_array($request->input('device_ids')) ? implode(',', $request->input('device_ids')) : null;
- if ($history->count() > 0)
- {
- $last = $history->first()->updated_at;
+ if ($history->count() > 0) {
+ $last = $history->first()->updated_at;
$lastMoment = new Moment($last);
$fromMoment = $lastMoment->from($timestamp);
+ // die(print_r([$timestamp, $last, $fromMoment]));
- //die(print_r([$timestamp, $last, $fromMoment]));
-
- if ($fromMoment->getSeconds() < 3600)
- {
- DB::table('research_user')->where('research_id', $id)->where('user_id', $request->user()->id)->where('updated_at', $last)->update(['consent'=>$consent, 'updated_at'=>$timestamp, 'consent_location_ids'=>$loc_ids, 'consent_hive_ids'=>$hive_ids, 'consent_sensor_ids'=>$device_ids]);
+ if ($fromMoment->getSeconds() < 3600) {
+ DB::table('research_user')->where('research_id', $id)->where('user_id', $request->user()->id)->where('updated_at', $last)->update(['consent' => $consent, 'updated_at' => $timestamp, 'consent_location_ids' => $loc_ids, 'consent_hive_ids' => $hive_ids, 'consent_sensor_ids' => $device_ids]);
$updated = true;
}
}
- if ($updated === false)
- $request->user()->researches()->attach($id, ['consent'=>$consent, 'created_at'=>$timestamp, 'updated_at'=>$timestamp, 'consent_location_ids'=>$loc_ids, 'consent_hive_ids'=>$hive_ids, 'consent_sensor_ids'=>$device_ids]);
+ if ($updated === false) {
+ $request->user()->researches()->attach($id, ['consent' => $consent, 'created_at' => $timestamp, 'updated_at' => $timestamp, 'consent_location_ids' => $loc_ids, 'consent_hive_ids' => $hive_ids, 'consent_sensor_ids' => $device_ids]);
+ }
return $research;
}
-
}
diff --git a/app/Http/Controllers/Api/ResearchDataController.php b/app/Http/Controllers/Api/ResearchDataController.php
index ce285b10..392f0e49 100644
--- a/app/Http/Controllers/Api/ResearchDataController.php
+++ b/app/Http/Controllers/Api/ResearchDataController.php
@@ -2,76 +2,81 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
-use Illuminate\Validation\Rule;
-use Illuminate\Support\Facades\Log;
-use App\Http\Controllers\Controller;
-
-use App\Research;
-use App\User;
-use App\Location;
-use App\Hive;
use App\Device;
+use App\Hive;
+use App\Http\Controllers\Controller;
use App\Inspection;
use App\Measurement;
use App\Models\FlashLog;
-use App\Models\AlertRule;
-use Moment\Moment;
-use Response;
-use DB;
+use App\Research;
+use App\User;
use Cache;
+use DB;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Validation\Rule;
use InfluxDB;
+use Moment\Moment;
+use Response;
use Storage;
/**
* @group Api\ResearchDataController
* Retreive owned or viewable Research data
+ *
* @authenticated
*/
class ResearchDataController extends Controller
{
-
- protected $valid_sensors = [];
+ protected $valid_sensors = [];
+
protected $output_sensors = [];
+
protected $output_weather = [];
- protected $influx_limit = 5000;
- protected $timeFormat = 'Y-m-d H:i:s';
+
+ protected $influx_limit = 5000;
+
+ protected $timeFormat = 'Y-m-d H:i:s';
public function __construct()
{
- $this->valid_sensors = Measurement::getValidMeasurements();
+ $this->valid_sensors = Measurement::getValidMeasurements();
$this->output_sensors = Measurement::getValidMeasurements(true);
$this->output_weather = Measurement::getValidMeasurements(true, true);
- $this->client = new \Influx;
- //die(print_r($this->valid_sensors));
+ $this->client = new \Influx;
+ // die(print_r($this->valid_sensors));
}
// Research API for researchers
- private function checkAuthorization(Request $request, $id=null)
+ private function checkAuthorization(Request $request, $id = null)
{
-
- if ($request->user()->researchMenuOption() == false)
+
+ if ($request->user()->researchMenuOption() == false) {
return false;
+ }
- if ($id)
- if (Research::findOrFail($id)->viewers()->where('users.id', $request->user()->id)->count() == 0)
+ if ($id) {
+ if (Research::findOrFail($id)->viewers()->where('users.id', $request->user()->id)->count() == 0) {
return false;
-
+ }
+ }
+
return true;
}
private function cacheRequestRate($name)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count');
- else
+ } else {
Cache::put($name.'-count', 1);
+ }
}
@@ -156,17 +161,19 @@ private function cacheRequestRate($name)
}
}
]
- */
+ */
public function index(Request $request)
{
$auth = $this->checkAuthorization($request);
- if ($auth == false)
+ if ($auth == false) {
return Response::json('unauthorized', 405);
+ }
- if ($request->user()->hasRole('superadmin'))
+ if ($request->user()->hasRole('superadmin')) {
$researches = Research::all();
- else
+ } else {
$researches = $request->user()->allResearches()->get();
+ }
return Response::json($researches);
}
@@ -175,7 +182,7 @@ public function index(Request $request)
api/researchdata/{id} GET
List one Research by id with list of consent_users
@authenticated
- @urlParam id required The research ID to request data from.
+ @urlParam id required The research ID to request data from.
@response {
"research": {
"id": 1,
@@ -285,27 +292,28 @@ public function index(Request $request)
}
]
}
- */
+ */
public function show(Request $request, $id)
{
$auth = $this->checkAuthorization($request, $id);
- if ($auth == false)
+ if ($auth == false) {
return Response::json('unauthorized-for-research', 405);
+ }
- $research = $request->user()->allResearches()->findOrFail($id);
+ $research = $request->user()->allResearches()->findOrFail($id);
$consent_users = DB::table('research_user')
- ->join('users', 'users.id', '=', 'research_user.user_id')
- ->select('users.id','users.name','users.email','users.created_at','users.updated_at','users.last_login','users.locale','research_user.updated_at','research_user.consent')
- ->where('research_user.research_id', $id)
- ->whereDate('research_user.updated_at', '<', $research->end_date)
- ->get();
+ ->join('users', 'users.id', '=', 'research_user.user_id')
+ ->select('users.id', 'users.name', 'users.email', 'users.created_at', 'users.updated_at', 'users.last_login', 'users.locale', 'research_user.updated_at', 'research_user.consent')
+ ->where('research_user.research_id', $id)
+ ->whereDate('research_user.updated_at', '<', $research->end_date)
+ ->get();
- return Response::json(['research'=>$research, 'consent_users'=>$consent_users]);
+ return Response::json(['research' => $research, 'consent_users' => $consent_users]);
}
/**
api/researchdata/{id}/user/{user_id}/{item} GET
- List all user 'item' data within the consent=1 periods of a specific user within a Research. The 'item' field indicates the type of user data (apiaries/locations/hives/devices/flashlogs/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/user/1/inspections.
+ List all user 'item' data within the consent=1 periods of a specific user within a Research. The 'item' field indicates the type of user data (apiaries/locations/hives/devices/flashlogs/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/user/1/inspections.
@authenticated
@authenticated
@urlParam id required The research ID to request data from. Example: 1
@@ -313,11 +321,11 @@ public function show(Request $request, $id)
@urlParam item required The type of user data (locations/devices/inspections/measurements) to request within the research (which the user gave consent for to use). Example: inspections
@bodyParam date_start datetime The date in 'YYYY-MM-DD HH:mm:ss' format (2020-01-01 00:00:00) to request data from (default is beginning of research, or earlier (except inspections and measurements). Example: 2020-01-01 00:00:00
@bodyParam date_until datetime The date in 'YYYY-MM-DD HH:mm:ss' format (2020-09-29 23:59:59) to request data until (default is until the end of the user consent, or research end). Example: 2020-09-29 23:59:59
- @bodyParam interval string Specifies the optional (InfluxDB GROUPBY) time interval to interpolate measurements (*(all values)/1m/5m/30m/1h/1d/1w/30d/365d) m (minutes), h (hours), d (days), w (weeks). Default: 1d. Example: 5m
- @bodyParam limit integer Specifies the maximum number of measurements per location_research (InfluxDB LIMIT), Max: 5000. Default: 5000. Example: 10
- @bodyParam calculation string Specifies the optional (InfluxDB) calculation (NONE/FIRST/LAST/MEAN/MEDIAN/MIN/MAX/SUM/COUNT/SPREAD/STDDEV/DERIVATIVE/PERCENTILE/BOXPLOT/PEAKS/WEEKMAP/NETWEIGHT) for use with time interval. Default: NONE. Example: MEAN
+ @bodyParam interval string Specifies the optional (InfluxDB GROUPBY) time interval to interpolate measurements (*(all values)/1m/5m/30m/1h/1d/1w/30d/365d) m (minutes), h (hours), d (days), w (weeks). Default: 1d. Example: 5m
+ @bodyParam limit integer Specifies the maximum number of measurements per location_research (InfluxDB LIMIT), Max: 5000. Default: 5000. Example: 10
+ @bodyParam calculation string Specifies the optional (InfluxDB) calculation (NONE/FIRST/LAST/MEAN/MEDIAN/MIN/MAX/SUM/COUNT/SPREAD/STDDEV/DERIVATIVE/PERCENTILE/BOXPLOT/PEAKS/WEEKMAP/NETWEIGHT) for use with time interval. Default: NONE. Example: MEAN
@bodyParam calculation_prop string Specifies the optional (InfluxDB) calculation property for i.e. PERCENTILE/DERIVATIVE/etc). Default: null. Example: DERIVATIVE
- @bodyParam decimals integer Specifies the optional maximum amount of decimals that the (InfluxDB) calculation returns. Default: 2. Example: 1
+ @bodyParam decimals integer Specifies the optional maximum amount of decimals that the (InfluxDB) calculation returns. Default: 2. Example: 1
@bodyParam device_id integer The device_id to filter the measurements on (next to date_start and date_until). Example: 1
@bodyParam location_id integer The location_id to filter the hives, and measurements on (next to date_start and date_until). Example: 2
@bodyParam precision string Specifies the optional InfluxDB format/precision (rfc3339/h/m/s/ms/u) of the timestamp of the measurements and weather data: rfc3339 (YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ), h (hours), m (minutes), s (seconds), ms (milliseconds), u (microseconds). Precision defaults to rfc3339. Example: rfc3339
@@ -474,182 +482,172 @@ public function show(Request $request, $id)
]
}
]
- */
+ */
public function user_data(Request $request, $id, $user_id, $item)
{
$auth = $this->checkAuthorization($request, $id);
- if ($auth == false)
+ if ($auth == false) {
return Response::json('unauthorized-for-research', 405);
+ }
$this->validate($request, [
- 'date_start' => 'nullable|date',
- 'date_until' => 'nullable|date',
- 'device_id' => 'nullable|integer|exists:sensors,id',
- 'location_id' => 'nullable|integer|exists:locations,id',
- 'measurements' => 'nullable|string',
- 'decimals' => 'nullable|integer',
- 'interval' => ['nullable', Rule::in(['*','1m','5m','15m','30m','1h','3h','6h','12h','1d','1w','30d','365d','hour','day','week','month','year','research','live'])],
- 'calculation' => ['nullable', Rule::in(['NONE','FIRST','LAST','MEAN','MEDIAN','MIN','MAX','SUM','COUNT','SPREAD','STDDEV','DERIVATIVE','PERCENTILE','BOXPLOT','PEAKS','WEEKMAP','NETWEIGHT'])],
- 'calculation_prop' => 'nullable|string',
- 'limit' => 'nullable|integer|min:1|max:'.$this->influx_limit,
- 'precision' => ['nullable', Rule::in(['rfc3339','h','m','s','ms','u'])],
- 'index' => 'nullable|integer|min:0', // only in case of 1 device requested, to provide 'normal' data view
- 'timezone' => 'nullable|timezone',
+ 'date_start' => 'nullable|date',
+ 'date_until' => 'nullable|date',
+ 'device_id' => 'nullable|integer|exists:sensors,id',
+ 'location_id' => 'nullable|integer|exists:locations,id',
+ 'measurements' => 'nullable|string',
+ 'decimals' => 'nullable|integer',
+ 'interval' => ['nullable', Rule::in(['*', '1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1d', '1w', '30d', '365d', 'hour', 'day', 'week', 'month', 'year', 'research', 'live'])],
+ 'calculation' => ['nullable', Rule::in(['NONE', 'FIRST', 'LAST', 'MEAN', 'MEDIAN', 'MIN', 'MAX', 'SUM', 'COUNT', 'SPREAD', 'STDDEV', 'DERIVATIVE', 'PERCENTILE', 'BOXPLOT', 'PEAKS', 'WEEKMAP', 'NETWEIGHT'])],
+ 'calculation_prop' => 'nullable|string',
+ 'limit' => 'nullable|integer|min:1|max:'.$this->influx_limit,
+ 'precision' => ['nullable', Rule::in(['rfc3339', 'h', 'm', 's', 'ms', 'u'])],
+ 'index' => 'nullable|integer|min:0', // only in case of 1 device requested, to provide 'normal' data view
+ 'timezone' => 'nullable|timezone',
]);
- // Check if user is present on
- if (DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->where('consent', 1)->count() == 0)
+ // Check if user is present on
+ if (DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->where('consent', 1)->count() == 0) {
return Response::json('user-not-connected-to-research', 400);
+ }
- if (!in_array($item, ['apiaries','locations','devices','inspections','measurements','weather']))
+ if (! in_array($item, ['apiaries', 'locations', 'devices', 'inspections', 'measurements', 'weather'])) {
return Response::json('invalid-item-requested', 400);
+ }
// Make dates
- $research = Research::findOrFail($id);
- $user = User::findOrFail($user_id);
- $location_id= $request->input('location_id');
+ $research = Research::findOrFail($id);
+ $user = User::findOrFail($user_id);
+ $location_id = $request->input('location_id');
$date_start = $request->input('date_start', $research->start_date);
$date_until = $request->input('date_until', $research->end_date);
- $calculation= $request->input('calculation', 'NONE');
- $calc_prop = $request->input('calculation_prop');
- $interval = $request->input('interval', '1h');
- $decimals = $request->input('decimals', 2);
- $limit = $request->input('limit', $this->influx_limit);
- $precision = $request->input('precision', 'rfc3339');
- $measurements=$request->filled('measurements') ? explode(',', $request->input('measurements')) : '*';
- $index = $request->filled('index') ? intval($request->input('index',0)) : null;
- $timeZone = $request->input('timezone','UTC');
-
- $date_format='Y-m-d H:i:s'; // RFC3339 == 'Y-m-d\TH:i:sP'
-
- if ($request->filled('date_start'))
- {
- if ($this->validateDate($date_start, $date_format) == false)
- return Response::json(['date_start_invalid'=>$date_start, 'format'=>$date_format], 400);
- else if ($date_start < $research->start_date)
- $date_start = $research->start_date; // return Response::json('date_start_before_research_start', 400);
+ $calculation = $request->input('calculation', 'NONE');
+ $calc_prop = $request->input('calculation_prop');
+ $interval = $request->input('interval', '1h');
+ $decimals = $request->input('decimals', 2);
+ $limit = $request->input('limit', $this->influx_limit);
+ $precision = $request->input('precision', 'rfc3339');
+ $measurements = $request->filled('measurements') ? explode(',', $request->input('measurements')) : '*';
+ $index = $request->filled('index') ? intval($request->input('index', 0)) : null;
+ $timeZone = $request->input('timezone', 'UTC');
+
+ $date_format = 'Y-m-d H:i:s'; // RFC3339 == 'Y-m-d\TH:i:sP'
+
+ if ($request->filled('date_start')) {
+ if ($this->validateDate($date_start, $date_format) == false) {
+ return Response::json(['date_start_invalid' => $date_start, 'format' => $date_format], 400);
+ } elseif ($date_start < $research->start_date) {
+ $date_start = $research->start_date;
+ } // return Response::json('date_start_before_research_start', 400);
}
- if ($request->filled('date_until'))
- {
- if ($this->validateDate($date_until, $date_format) == false)
- return Response::json(['date_until_invalid'=>$date_until, 'format'=>$date_format], 400);
- else if ($date_until > $research->end_date)
- $date_until = $research->end_date; // return Response::json('date_until_after_research_end', 400);
- else if ($date_until < $date_start)
+ if ($request->filled('date_until')) {
+ if ($this->validateDate($date_until, $date_format) == false) {
+ return Response::json(['date_until_invalid' => $date_until, 'format' => $date_format], 400);
+ } elseif ($date_until > $research->end_date) {
+ $date_until = $research->end_date;
+ } // return Response::json('date_until_after_research_end', 400);
+ elseif ($date_until < $date_start) {
return Response::json('date_until_before_start_date', 400);
- else if ($date_start > $date_until)
+ } elseif ($date_start > $date_until) {
return Response::json('date_start_after_until_date', 400);
+ }
}
// User specific data
- $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at','asc')->get()->toArray();
+ $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at', 'asc')->get()->toArray();
- if (count($user_consents) == 0) // if only 1 and consent is false, stop
+ if (count($user_consents) == 0) { // if only 1 and consent is false, stop
return Response::json('user-gave-no-consent', 400);
+ }
- $user_consent_obj = $user_consents[0];
- $user_consent = $user_consent_obj->consent;
+ $user_consent_obj = $user_consents[0];
+ $user_consent = $user_consent_obj->consent;
- if(count($user_consents) == 1 && $user_consent === 0) // if only 1 and consent is false, stop
+ if (count($user_consents) == 1 && $user_consent === 0) { // if only 1 and consent is false, stop
return Response::json('user-gave-no-consent', 400);
-
+ }
+
$date_curr_consent = $user_consent_obj->updated_at;
- $date_consent_start= $date_curr_consent < $date_start ? $date_start : $date_curr_consent; // take latest of two dates
+ $date_consent_start = $date_curr_consent < $date_start ? $date_start : $date_curr_consent; // take latest of two dates
$date_next_consent = $date_until;
- //die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
+ // die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
- if ($item == 'measurements' || $item == 'weather')
+ if ($item == 'measurements' || $item == 'weather') {
$this->cacheRequestRate('get-measurements-research');
-
+ }
+
// Get all user data
- if (isset($user_consent_obj->consent_location_ids)) // Set consent based on specific items
- {
- $loc_array = explode(',', $user_consent_obj->consent_location_ids);
+ if (isset($user_consent_obj->consent_location_ids)) { // Set consent based on specific items
+ $loc_array = explode(',', $user_consent_obj->consent_location_ids);
$user_apiaries = $user->locations()->withTrashed()->whereIn('id', $loc_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
+ } else {
$user_apiaries = $user->locations()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_hive_ids)) // Set consent based on specific items
- {
- $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
- $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
- $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ if (isset($user_consent_obj->consent_hive_ids)) { // Set consent based on specific items
+ $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
+ $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ } else {
+ $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_sensor_ids)) // Set consent based on specific items
- {
- $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
- $user_devices = $user->devices()->withTrashed()->whereIn('id', $device_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
- $user_devices = $user->devices()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ if (isset($user_consent_obj->consent_sensor_ids)) { // Set consent based on specific items
+ $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
+ $user_devices = $user->devices()->withTrashed()->whereIn('id', $device_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ } else {
+ $user_devices = $user->devices()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
-
- $user_flashlogs = FlashLog::where('user_id', $user_id)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $user_flashlogs = FlashLog::where('user_id', $user_id)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
$user_measurements = [];
// add hive inspections (also from collaborators)
$hive_inspection_ids = [];
- foreach ($user_hives as $hive)
- {
+ foreach ($user_hives as $hive) {
$hive_inspections = $hive->inspections()->where('created_at', '>=', $date_consent_start)->where('created_at', '<', $date_until)->get();
- foreach ($hive_inspections as $ins)
+ foreach ($hive_inspections as $ins) {
$hive_inspection_ids[] = $ins->id;
-
+ }
+
}
$hive_inspections = Inspection::whereIn('id', $hive_inspection_ids)->with('items')->where('created_at', '>=', $date_consent_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
-
$data = [];
- foreach ($user_consents as $i => $consent)
- {
- $user_consent = $consent->consent;
- $date_curr_consent = $consent->updated_at;
-
- if ($i < count($user_consents)-1)
- {
- $date_next_consent = $user_consents[$i+1]->updated_at;
- $next_consent = $user_consents[$i+1]->consent;
- }
- else // until end of research no other consent filled
- {
+ foreach ($user_consents as $i => $consent) {
+ $user_consent = $consent->consent;
+ $date_curr_consent = $consent->updated_at;
+
+ if ($i < count($user_consents) - 1) {
+ $date_next_consent = $user_consents[$i + 1]->updated_at;
+ $next_consent = $user_consents[$i + 1]->consent;
+ } else { // until end of research no other consent filled
$date_next_consent = $date_until;
- $next_consent = $user_consent;
+ $next_consent = $user_consent;
}
// Minimize data to requested dates
- if ($request->filled('date_start') && $date_start > $date_curr_consent)
- {
- if ($date_start < $date_next_consent)
+ if ($request->filled('date_start') && $date_start > $date_curr_consent) {
+ if ($date_start < $date_next_consent) {
$date_curr_consent = $date_start;
- else
- continue; // start >= next_consent, so hide this data from dataset, because earlier than requested
+ } else {
+ continue;
+ } // start >= next_consent, so hide this data from dataset, because earlier than requested
}
-
- if ($request->filled('date_until') && $date_until < $date_next_consent)
- {
- if ($date_until > $date_curr_consent)
+
+ if ($request->filled('date_until') && $date_until < $date_next_consent) {
+ if ($date_until > $date_curr_consent) {
$date_next_consent = $date_until;
- else
- continue; // until <= curr_consent, so hide this data from dataset, because later than requested
+ } else {
+ continue;
+ } // until <= curr_consent, so hide this data from dataset, because later than requested
}
// Fill objects for consent period
- if ($user_consent && ($next_consent || $i == 0))
- {
- // add
- switch($item)
- {
+ if ($user_consent && ($next_consent || $i == 0)) {
+ // add
+ switch ($item) {
case 'locations':
case 'apiaries':
$data = array_merge($data, $user_apiaries->where('created_at', '<=', $date_next_consent)->toArray());
@@ -667,16 +665,12 @@ public function user_data(Request $request, $id, $user_id, $item)
$data = array_merge($data, $user_flashlogs->where('created_at', '<=', $date_next_consent)->toArray());
break;
case 'measurements':
- if ($user_devices->count() > 0)
- {
- foreach ($user_devices as $device)
- {
- if (($request->filled('device_id') && $request->input('device_id') == $device->id) || !$request->filled('device_id'))
- {
- if ($device->created_at < $date_next_consent)
- {
- $where= $device->influxWhereKeys().' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
- $adds = ['device_id'=>$device->id];
+ if ($user_devices->count() > 0) {
+ foreach ($user_devices as $device) {
+ if (($request->filled('device_id') && $request->input('device_id') == $device->id) || ! $request->filled('device_id')) {
+ if ($device->created_at < $date_next_consent) {
+ $where = $device->influxWhereKeys().' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
+ $adds = ['device_id' => $device->id];
$data = array_merge($data, $this->getArrayFromInflux($where, $measurements, 'sensors', $interval, $calculation, $calc_prop, $decimals, $precision, $adds, $limit, $device, $timeZone, $date_curr_consent, $date_next_consent)); // $where, $measurements='*', $database='sensors', $interval='1h', $calculation='MEAN', $calc_prop=null, $decimals=2, $precision='rfc3339', $adds=[], $limit=5000
}
}
@@ -684,14 +678,11 @@ public function user_data(Request $request, $id, $user_id, $item)
}
break;
case 'weather':
- if ($user_apiaries->count() > 0)
- {
- foreach ($user_apiaries as $apiary)
- {
- if ($apiary->created_at < $date_next_consent)
- {
- $where= '"lat" = \''.$apiary->coordinate_lat.'\' AND "lon" = \''.$apiary->coordinate_lon.'\' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
- $adds = ['device_id'=>$device->id];
+ if ($user_apiaries->count() > 0) {
+ foreach ($user_apiaries as $apiary) {
+ if ($apiary->created_at < $date_next_consent) {
+ $where = '"lat" = \''.$apiary->coordinate_lat.'\' AND "lon" = \''.$apiary->coordinate_lon.'\' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
+ $adds = ['device_id' => $device->id];
$data = array_merge($data, $this->getArrayFromInflux($where, $measurements, 'weather', $interval, $calculation, $calc_prop, $decimals, $precision, $adds, $limit));
}
}
@@ -702,22 +693,24 @@ public function user_data(Request $request, $id, $user_id, $item)
}
}
}
+
return Response::json($data);
}
-/**
+
+ /**
api/researchdata/{id}/data/{item} GET
- List all research 'item' data within the consent=1 periods within a Research. The 'item' field indicates the type of data (apiaries/locations/devices/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/inspections.
+ List all research 'item' data within the consent=1 periods within a Research. The 'item' field indicates the type of data (apiaries/locations/devices/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/inspections.
@authenticated
@urlParam id required The research ID to request data from. Example: 1
@urlParam item required The type of user data (locations/devices/inspections/measurements) to request within the research (which the user gave consent for to use). Example: inspections
@bodyParam date_start datetime The date in 'YYYY-MM-DD HH:mm:ss' format (2020-01-01 00:00:00) to request data from (default is beginning of research, or earlier (except inspections and measurements). Example: 2020-01-01 00:00:00
@bodyParam date_until datetime The date in 'YYYY-MM-DD HH:mm:ss' format (2020-09-29 23:59:59) to request data until (default is until the end of the user consent, or research end). Example: 2020-09-29 23:59:59
@bodyParam year_months string Comma separated string of YYYY-MM strings to filter ONLY measurment data. Example: 2020-01,2021-02
- @bodyParam interval string Specifies the optional (InfluxDB GROUPBY) time interval to interpolate measurements (*(all values)/1m/5m/30m/1h/1d/1w/30d/365d) m (minutes), h (hours), d (days), w (weeks). Default: 1d. Example: 5m
- @bodyParam limit integer Specifies the maximum number of measurements per location_research (InfluxDB LIMIT), Max: 5000. Default: 5000. Example: 500
- @bodyParam calculation string Specifies the optional (InfluxDB) calculation (NONE/FIRST/LAST/MEAN/MEDIAN/MIN/MAX/SUM/COUNT/SPREAD/STDDEV/DERIVATIVE/PERCENTILE/BOXPLOT/PEAKS/WEEKMAP/NETWEIGHT) for use with time interval. Default: MEAN. Example: MAX
- @bodyParam calculation_prop string Specifies the optional (InfluxDB) calculation property for i.e. PERCENTILE/DERIVATIVE/etc). Default: null. Example: 5
- @bodyParam decimals integer Specifies the optional maximum amount of decimals that the (InfluxDB) calculation returns. Default: 2. Example: 1
+ @bodyParam interval string Specifies the optional (InfluxDB GROUPBY) time interval to interpolate measurements (*(all values)/1m/5m/30m/1h/1d/1w/30d/365d) m (minutes), h (hours), d (days), w (weeks). Default: 1d. Example: 5m
+ @bodyParam limit integer Specifies the maximum number of measurements per location_research (InfluxDB LIMIT), Max: 5000. Default: 5000. Example: 500
+ @bodyParam calculation string Specifies the optional (InfluxDB) calculation (NONE/FIRST/LAST/MEAN/MEDIAN/MIN/MAX/SUM/COUNT/SPREAD/STDDEV/DERIVATIVE/PERCENTILE/BOXPLOT/PEAKS/WEEKMAP/NETWEIGHT) for use with time interval. Default: MEAN. Example: MAX
+ @bodyParam calculation_prop string Specifies the optional (InfluxDB) calculation property for i.e. PERCENTILE/DERIVATIVE/etc). Default: null. Example: 5
+ @bodyParam decimals integer Specifies the optional maximum amount of decimals that the (InfluxDB) calculation returns. Default: 2. Example: 1
@bodyParam device_id integer The device_id to filter measurements on (next to date_start and date_until). Example: 1
@bodyParam device_ids string Comma separated string of device_ids to filter the measurements on (next to date_start and date_until). Example: 1,3,6
@bodyParam location_id integer The location_id to filter and measurements (next to date_start and date_until). Example: 2
@@ -727,85 +720,89 @@ public function user_data(Request $request, $id, $user_id, $item)
@bodyParam index integer Historic index of the interval from now. 0=period with current time included. 1=previous interval. Required without end. Example: 0
@bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
@bodyParam output_csv_links boolean Optionally provide true if you want the data to be returned as an array of CSV files in stead of JSON data.
- */
+ */
public function research_data(Request $request, $id, $item)
{
$auth = $this->checkAuthorization($request, $id);
- if ($auth == false)
+ if ($auth == false) {
return Response::json('unauthorized-for-research', 405);
+ }
$this->validate($request, [
- 'date_start' => 'nullable|date',
- 'date_until' => 'nullable|date',
- 'year_months' => 'nullable|string',
- 'device_ids' => 'nullable|string',
- 'device_id' => 'nullable|integer|exists:sensors,id',
- 'location_ids' => 'nullable|string',
- 'location_id' => 'nullable|integer|exists:locations,id',
- 'measurements' => 'nullable|string',
- 'decimals' => 'nullable|integer',
- 'interval' => ['nullable', Rule::in(['*','1m','5m','15m','30m','1h','3h','6h','12h','1d','1w','30d','365d','hour','day','week','month','year','research','live'])],
- 'calculation' => ['nullable', Rule::in(['NONE','FIRST','LAST','MEAN','MEDIAN','MIN','MAX','SUM','COUNT','SPREAD','STDDEV','DERIVATIVE','PERCENTILE','BOXPLOT','PEAKS','WEEKMAP','NETWEIGHT'])],
- 'calculation_prop' => 'nullable|string',
- 'limit' => 'nullable|integer|min:1|max:'.$this->influx_limit,
- 'precision' => ['nullable', Rule::in(['rfc3339','h','m','s','ms','u'])],
- 'index' => 'nullable|integer|min:0', // only in case of 1 device requested, to provide 'normal' data view
- 'timezone' => 'nullable|timezone',
- 'output_csv_links' => 'nullable|boolean',
+ 'date_start' => 'nullable|date',
+ 'date_until' => 'nullable|date',
+ 'year_months' => 'nullable|string',
+ 'device_ids' => 'nullable|string',
+ 'device_id' => 'nullable|integer|exists:sensors,id',
+ 'location_ids' => 'nullable|string',
+ 'location_id' => 'nullable|integer|exists:locations,id',
+ 'measurements' => 'nullable|string',
+ 'decimals' => 'nullable|integer',
+ 'interval' => ['nullable', Rule::in(['*', '1m', '5m', '15m', '30m', '1h', '3h', '6h', '12h', '1d', '1w', '30d', '365d', 'hour', 'day', 'week', 'month', 'year', 'research', 'live'])],
+ 'calculation' => ['nullable', Rule::in(['NONE', 'FIRST', 'LAST', 'MEAN', 'MEDIAN', 'MIN', 'MAX', 'SUM', 'COUNT', 'SPREAD', 'STDDEV', 'DERIVATIVE', 'PERCENTILE', 'BOXPLOT', 'PEAKS', 'WEEKMAP', 'NETWEIGHT'])],
+ 'calculation_prop' => 'nullable|string',
+ 'limit' => 'nullable|integer|min:1|max:'.$this->influx_limit,
+ 'precision' => ['nullable', Rule::in(['rfc3339', 'h', 'm', 's', 'ms', 'u'])],
+ 'index' => 'nullable|integer|min:0', // only in case of 1 device requested, to provide 'normal' data view
+ 'timezone' => 'nullable|timezone',
+ 'output_csv_links' => 'nullable|boolean',
]);
- // Check if user is present on
- if (DB::table('research_user')->where('research_id', $id)->where('consent', 1)->count() == 0)
+ // Check if user is present on
+ if (DB::table('research_user')->where('research_id', $id)->where('consent', 1)->count() == 0) {
return Response::json('no-user-consents-for-research', 400);
+ }
- if (!in_array($item, ['apiaries','locations','devices','inspections','measurements','weather']))
+ if (! in_array($item, ['apiaries', 'locations', 'devices', 'inspections', 'measurements', 'weather'])) {
return Response::json('invalid-item-requested', 400);
+ }
// Make dates
- $research = Research::findOrFail($id);
-
- $location_id= $request->input('location_id');
- $device_id = $request->input('device_id');
-
- $date_format='Y-m-d H:i:s'; // RFC3339 == 'Y-m-d\TH:i:sP'
+ $research = Research::findOrFail($id);
+
+ $location_id = $request->input('location_id');
+ $device_id = $request->input('device_id');
+
+ $date_format = 'Y-m-d H:i:s'; // RFC3339 == 'Y-m-d\TH:i:sP'
$date_start = $request->input('date_start', $research->start_date);
$date_until = $request->input('date_until', $research->end_date);
- $calculation= $request->input('calculation', 'MEAN');
- $calc_prop = $request->input('calculation_prop');
- $interval = $request->input('interval', '1d');
- $decimals = $request->input('decimals', 2);
- $limit = $request->input('limit', $this->influx_limit);
- $precision = $request->input('precision', 'rfc3339');
-
- $measurements=$request->filled('measurements') ? explode(',', $request->input('measurements')) : '*';
- $location_ids=$request->filled('location_ids') ? explode(',', $request->input('location_ids')) : (isset($location_id) ? [$location_id] : null);
- $device_ids = $request->filled('device_ids') ? explode(',', $request->input('device_ids')) : (isset($device_id) ? [$device_id] : null);
- $year_months= $request->filled('year_months') ? explode(',', $request->input('year_months')) : null; // ['2021-03',2022-03'];
- $index = $request->filled('index') ? intval($request->input('index',0)) : null;
- $timeZone = $request->input('timezone','UTC');
- $data_call = in_array($interval, ['hour','day','week','month','year','research','live']);
- $m_start = $date_start;
- $m_until = $date_until;
+ $calculation = $request->input('calculation', 'MEAN');
+ $calc_prop = $request->input('calculation_prop');
+ $interval = $request->input('interval', '1d');
+ $decimals = $request->input('decimals', 2);
+ $limit = $request->input('limit', $this->influx_limit);
+ $precision = $request->input('precision', 'rfc3339');
+
+ $measurements = $request->filled('measurements') ? explode(',', $request->input('measurements')) : '*';
+ $location_ids = $request->filled('location_ids') ? explode(',', $request->input('location_ids')) : (isset($location_id) ? [$location_id] : null);
+ $device_ids = $request->filled('device_ids') ? explode(',', $request->input('device_ids')) : (isset($device_id) ? [$device_id] : null);
+ $year_months = $request->filled('year_months') ? explode(',', $request->input('year_months')) : null; // ['2021-03',2022-03'];
+ $index = $request->filled('index') ? intval($request->input('index', 0)) : null;
+ $timeZone = $request->input('timezone', 'UTC');
+ $data_call = in_array($interval, ['hour', 'day', 'week', 'month', 'year', 'research', 'live']);
+ $m_start = $date_start;
+ $m_until = $date_until;
$csv_output = $request->filled('output_csv_links') ? boolval($request->input('output_csv_links')) : false;
-
- if ($request->filled('date_start'))
- {
- if ($this->validateDate($date_start, $date_format) == false)
- return Response::json(['date_start_invalid'=>$date_start, 'format'=>$date_format], 400);
- else if ($date_start < $research->start_date)
- $date_start = $research->start_date; // return Response::json('date_start_before_research_start', 400);
+
+ if ($request->filled('date_start')) {
+ if ($this->validateDate($date_start, $date_format) == false) {
+ return Response::json(['date_start_invalid' => $date_start, 'format' => $date_format], 400);
+ } elseif ($date_start < $research->start_date) {
+ $date_start = $research->start_date;
+ } // return Response::json('date_start_before_research_start', 400);
}
- if ($request->filled('date_until'))
- {
- if ($this->validateDate($date_until, $date_format) == false)
- return Response::json(['date_until_invalid'=>$date_until, 'format'=>$date_format], 400);
- else if ($date_until > $research->end_date)
- $date_until = $research->end_date; // return Response::json('date_until_after_research_end', 400);
- else if ($date_until < $date_start)
+ if ($request->filled('date_until')) {
+ if ($this->validateDate($date_until, $date_format) == false) {
+ return Response::json(['date_until_invalid' => $date_until, 'format' => $date_format], 400);
+ } elseif ($date_until > $research->end_date) {
+ $date_until = $research->end_date;
+ } // return Response::json('date_until_after_research_end', 400);
+ elseif ($date_until < $date_start) {
return Response::json('date_until_before_start_date', 400);
- else if ($date_start > $date_until)
+ } elseif ($date_start > $date_until) {
return Response::json('date_start_after_until_date', 400);
+ }
}
// $years = [];
@@ -831,229 +828,210 @@ public function research_data(Request $request, $id, $item)
// User specific data
$research_consents = DB::table('research_user')
- ->where('research_id', $id)
- ->whereDate('updated_at', '<=', $date_until)
- ->orderBy('user_id')
- ->orderBy('updated_at','asc')
- ->get();
-
+ ->where('research_id', $id)
+ ->whereDate('updated_at', '<=', $date_until)
+ ->orderBy('user_id')
+ ->orderBy('updated_at', 'asc')
+ ->get();
$consented_users = DB::table('research_user')
- ->where('research_id', $id)
- ->where('consent', 1)
- ->whereDate('updated_at', '<=', $date_until)
- ->groupBy('user_id')
- ->get();
+ ->where('research_id', $id)
+ ->where('consent', 1)
+ ->whereDate('updated_at', '<=', $date_until)
+ ->groupBy('user_id')
+ ->get();
- $data = [];
+ $data = [];
// keep track of doubles
$loc_ids = [];
$dev_ids = [];
- $ins_ids = [];
+ $ins_ids = [];
- foreach ($consented_users as $user_c)
- {
- $user_id = $user_c->user_id;
- $user = User::find($user_id);
- $user_consents = $research_consents->where('user_id', $user_id);
- $user_consent_obj = $user_consents->first();
- $user_consent = $user_consent_obj->consent;
+ foreach ($consented_users as $user_c) {
+ $user_id = $user_c->user_id;
+ $user = User::find($user_id);
+ $user_consents = $research_consents->where('user_id', $user_id);
+ $user_consent_obj = $user_consents->first();
+ $user_consent = $user_consent_obj->consent;
- if ($user_consents->count() == 0 || ($user_consents->count() == 1 && $user_consent === 0)) // if only 1 and consent is false, stop
+ if ($user_consents->count() == 0 || ($user_consents->count() == 1 && $user_consent === 0)) { // if only 1 and consent is false, stop
continue;
+ }
$date_curr_consent = $user_consent_obj->updated_at;
- $date_consent_start= $date_curr_consent < $date_start ? $date_start : $date_curr_consent; // take latest of two dates
+ $date_consent_start = $date_curr_consent < $date_start ? $date_start : $date_curr_consent; // take latest of two dates
$date_next_consent = $date_until;
- //die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
+ // die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
- if ($item == 'measurements' || $item == 'weather')
+ if ($item == 'measurements' || $item == 'weather') {
$this->cacheRequestRate('get-measurements-research');
-
+ }
+
// Get all user locations
$loc_array = [];
- if (isset($user_consent_obj->consent_location_ids) || isset($location_id) || filled($location_ids)) // Set consent based on specific items
- {
- if (isset($user_consent_obj->consent_location_ids))
- {
+ if (isset($user_consent_obj->consent_location_ids) || isset($location_id) || filled($location_ids)) { // Set consent based on specific items
+ if (isset($user_consent_obj->consent_location_ids)) {
$loc_array = explode(',', $user_consent_obj->consent_location_ids);
- if (filled($location_ids))
+ if (filled($location_ids)) {
$loc_array = array_intersect($loc_array, $location_ids);
- }
- else if (filled($location_ids))
- {
+ }
+ } elseif (filled($location_ids)) {
$loc_array = $location_ids;
}
$user_locations = $user->allLocations()->whereIn('id', $loc_array)
- ->where('created_at', '<', $date_until)
- ->orderBy('created_at')
- ->get();
- }
- else
- {
+ ->where('created_at', '<', $date_until)
+ ->orderBy('created_at')
+ ->get();
+ } else {
$user_locations = $user->allLocations()->where('created_at', '<', $date_until)
- ->orderBy('created_at')
- ->get();
+ ->orderBy('created_at')
+ ->get();
}
-
+
// Get all user devices
- if (isset($user_consent_obj->consent_sensor_ids) || filled($device_ids)) // Set consent based on specific items
- {
+ if (isset($user_consent_obj->consent_sensor_ids) || filled($device_ids)) { // Set consent based on specific items
$device_array = [];
- if (isset($user_consent_obj->consent_sensor_ids))
- {
+ if (isset($user_consent_obj->consent_sensor_ids)) {
$device_array = explode(',', $user_consent_obj->consent_sensor_ids);
- if (filled($device_ids))
+ if (filled($device_ids)) {
$device_array = array_intersect($device_array, $device_ids);
- }
- else if (filled($device_ids))
- {
+ }
+ } elseif (filled($device_ids)) {
$device_array = $device_ids;
}
- $user_devices = $user->devices()->whereIn('id', $device_array)
- ->where('created_at', '<', $date_until)
- ->orderBy('created_at')
- ->get();
- }
- else
- {
- $user_devices = $user->devices()->where('created_at', '<', $date_until)
- ->orderBy('created_at')
- ->get();
+ $user_devices = $user->devices()->whereIn('id', $device_array)
+ ->where('created_at', '<', $date_until)
+ ->orderBy('created_at')
+ ->get();
+ } else {
+ $user_devices = $user->devices()->where('created_at', '<', $date_until)
+ ->orderBy('created_at')
+ ->get();
}
-
$user_measurements = [];
// add inspections (also from collaborators)
$loc_inspection_ids = [];
- foreach ($user_locations as $loc)
- {
+ foreach ($user_locations as $loc) {
$loc_inspections = $loc->inspections()
- ->where('created_at', '>=', $date_consent_start)
- ->where('created_at', '<', $date_until)
- ->get();
- foreach ($loc_inspections as $ins)
+ ->where('created_at', '>=', $date_consent_start)
+ ->where('created_at', '<', $date_until)
+ ->get();
+ foreach ($loc_inspections as $ins) {
$loc_inspection_ids[] = $ins->id;
-
+ }
+
}
$loc_inspections = Inspection::whereIn('id', $loc_inspection_ids)
- ->with('items')
- ->where('created_at', '>=', $date_consent_start)
- ->where('created_at', '<', $date_until)
- ->orderBy('created_at')
- ->get();
-
-
- foreach ($user_consents as $i => $consent)
- {
- $user_consent = $consent->consent;
- $date_curr_consent = $consent->updated_at;
-
- if ($i < count($user_consents)-1)
- {
- $date_next_consent = $user_consents[$i+1]->updated_at;
- $next_consent = $user_consents[$i+1]->consent;
- }
- else // until end of research no other consent filled
- {
+ ->with('items')
+ ->where('created_at', '>=', $date_consent_start)
+ ->where('created_at', '<', $date_until)
+ ->orderBy('created_at')
+ ->get();
+
+ foreach ($user_consents as $i => $consent) {
+ $user_consent = $consent->consent;
+ $date_curr_consent = $consent->updated_at;
+
+ if ($i < count($user_consents) - 1) {
+ $date_next_consent = $user_consents[$i + 1]->updated_at;
+ $next_consent = $user_consents[$i + 1]->consent;
+ } else { // until end of research no other consent filled
$date_next_consent = $date_until;
- $next_consent = $user_consent;
+ $next_consent = $user_consent;
}
// Minimize data to requested dates
- if ($request->filled('date_start') && $date_start > $date_curr_consent)
- {
- if ($date_start < $date_next_consent)
+ if ($request->filled('date_start') && $date_start > $date_curr_consent) {
+ if ($date_start < $date_next_consent) {
$date_curr_consent = $date_start;
- else
- continue; // start >= next_consent, so hide this data from dataset, because earlier than requested
+ } else {
+ continue;
+ } // start >= next_consent, so hide this data from dataset, because earlier than requested
}
-
- if ($request->filled('date_until') && $date_until < $date_next_consent)
- {
- if ($date_until > $date_curr_consent)
+
+ if ($request->filled('date_until') && $date_until < $date_next_consent) {
+ if ($date_until > $date_curr_consent) {
$date_next_consent = $date_until;
- else
- continue; // until <= curr_consent, so hide this data from dataset, because later than requested
+ } else {
+ continue;
+ } // until <= curr_consent, so hide this data from dataset, because later than requested
}
// Fill objects for consent period
- if ($user_consent && ($next_consent || $i == 0))
- {
- // add
- switch($item)
- {
+ if ($user_consent && ($next_consent || $i == 0)) {
+ // add
+ switch ($item) {
case 'apiaries':
case 'locations':
$locs = $user_locations
- ->whereNotIn('id', $loc_ids)
- ->where('created_at', '<=', $date_next_consent)
- ->toArray();
- // exclude these items from future addition to output
- foreach ($locs as $l)
+ ->whereNotIn('id', $loc_ids)
+ ->where('created_at', '<=', $date_next_consent)
+ ->toArray();
+ // exclude these items from future addition to output
+ foreach ($locs as $l) {
$loc_ids[] = $l['id'];
+ }
$data = array_merge($data, $locs);
break;
case 'devices':
$devs = $user_devices
- ->whereNotIn('id', $dev_ids)
- ->where('created_at', '<=', $date_next_consent)
- ->toArray();
- // exclude these items from future addition to output
- foreach ($devs as $d)
+ ->whereNotIn('id', $dev_ids)
+ ->where('created_at', '<=', $date_next_consent)
+ ->toArray();
+ // exclude these items from future addition to output
+ foreach ($devs as $d) {
$dev_ids[] = $d['id'];
+ }
$data = array_merge($data, $devs);
break;
case 'inspections':
$insp = $loc_inspections
- ->whereNotIn('id', $ins_ids)
- ->where('created_at', '>=', $date_curr_consent)
- ->where('created_at', '<=', $date_next_consent)
- ->toArray();
- // exclude these items from future addition to output
- foreach ($insp as $i)
+ ->whereNotIn('id', $ins_ids)
+ ->where('created_at', '>=', $date_curr_consent)
+ ->where('created_at', '<=', $date_next_consent)
+ ->toArray();
+ // exclude these items from future addition to output
+ foreach ($insp as $i) {
$ins_ids[] = $i['id'];
+ }
$data = array_merge($data, $insp);
break;
case 'measurements':
// Add measurement data
- if ($user_devices->count() > 0)
- {
- $m_start = $date_curr_consent;
- $m_until = $date_next_consent;
- $m_interval = $interval;
+ if ($user_devices->count() > 0) {
+ $m_start = $date_curr_consent;
+ $m_until = $date_next_consent;
+ $m_interval = $interval;
$filter_year_months = filled($year_months);
- foreach ($user_devices as $device)
- {
- if ($device)
- {
- if (($request->filled('device_id') && $request->input('device_id') == $device->id) || !$request->filled('device_id'))
- {
- // Allow 'normal' data view by 1 device and interval/index combination as in DeviceController
- if (isset($index) && $data_call)
- {
- // limit start/end of interval by start of consent
+ foreach ($user_devices as $device) {
+ if ($device) {
+ if (($request->filled('device_id') && $request->input('device_id') == $device->id) || ! $request->filled('device_id')) {
+ // Allow 'normal' data view by 1 device and interval/index combination as in DeviceController
+ if (isset($index) && $data_call) {
+ // limit start/end of interval by start of consent
$staTimestamp = new Moment(null, $timeZone);
$endTimestamp = new Moment(null, $timeZone);
- $startOfInt = $staTimestamp->startOf($m_interval);
- $endOfInt = $endTimestamp->endOf($m_interval);
+ $startOfInt = $staTimestamp->startOf($m_interval);
+ $endOfInt = $endTimestamp->endOf($m_interval);
$now_tst = date($this->timeFormat);
- if ($now_tst < $m_until)
+ if ($now_tst < $m_until) {
$m_until = $now_tst;
+ }
$staMom = new Moment($m_start, $timeZone);
$endMom = new Moment($m_until, $timeZone);
@@ -1061,15 +1039,17 @@ public function research_data(Request $request, $id, $item)
$staSecDiff = $staMom->from($startOfInt)->getSeconds();
$endSecDiff = $endMom->from($endOfInt)->getSeconds();
- if ($staSecDiff < 0)
+ if ($staSecDiff < 0) {
$startOfInt = $staMom;
+ }
- if ($endSecDiff < 0)
+ if ($endSecDiff < 0) {
$endOfInt = $endMom;
+ }
- //die(print_r([$m_interval, $m_start, $m_until, $staSecDiff, $endSecDiff]));
+ // die(print_r([$m_interval, $m_start, $m_until, $staSecDiff, $endSecDiff]));
// Convert interval to the Influx grouping interval
- switch($m_interval){
+ switch ($m_interval) {
case 'year':
$startOfInt->subtractYears($index);
$endOfInt->subtractYears($index);
@@ -1102,82 +1082,72 @@ public function research_data(Request $request, $id, $item)
$m_interval = '1d';
break;
}
-
+
// set index based time
$m_start = $startOfInt->setTimezone('UTC')->format($this->timeFormat);
$m_until = $endOfInt->setTimezone('UTC')->format($this->timeFormat);
- //die(print_r([$m_interval, $m_start, $m_until]));
+ // die(print_r([$m_interval, $m_start, $m_until]));
}
- $adds = $calculation == 'WEEKMAP' ? [] : ['device_id'=>$device->id];
- $where= $device->influxWhereKeys().' AND time >= \''.$m_start.'\' AND time <= \''.$m_until.'\'';
-
- if ($csv_output)
- {
+ $adds = $calculation == 'WEEKMAP' ? [] : ['device_id' => $device->id];
+ $where = $device->influxWhereKeys().' AND time >= \''.$m_start.'\' AND time <= \''.$m_until.'\'';
+
+ if ($csv_output) {
// 2021-03-30_T1UK_HPP 8a.csv
$file_name = $research->name.'/'.substr($m_start, 0, 10).'/'.$device->location_name.$device->hive_name.'.csv';
$file_path = $this->exportCsvFromInflux($where, $file_name, $measurements, 'sensors');
- $data[] = $file_path;
- }
- else
- {
+ $data[] = $file_path;
+ } else {
$meas = $this->getArrayFromInflux($where, $measurements, 'sensors', $m_interval, $calculation, $calc_prop, $decimals, $precision, $adds, $limit, $device, $timeZone, $m_start, $m_until); // $where, $measurements='*', $database='sensors', $interval='1h', $calculation='MEAN', $calc_prop=null, $decimals=2, $precision='rfc3339', $adds=[], $limit=5000)
// filter out all non month-year data
- if ($filter_year_months)
- {
+ if ($filter_year_months) {
$meas_filtered = [];
- foreach ($meas as $m)
- {
- $time = $m['time'];
+ foreach ($meas as $m) {
+ $time = $m['time'];
$year_month = substr($time, 0, 7); // TODO: Make local time, now UTC
- if (in_array($year_month, $year_months))
+ if (in_array($year_month, $year_months)) {
$meas_filtered[] = $m;
+ }
}
$meas = $meas_filtered;
}
// merge data with already available
- if ($calculation == 'WEEKMAP' && count($data) > 0) // only merge weekmaps if data is already filled
- {
+ if ($calculation == 'WEEKMAP' && count($data) > 0) { // only merge weekmaps if data is already filled
// weekmap data: [measurement][day][hour] = value
$wm_add = false;
- foreach ($meas as $wd_m => $wd_array)
- {
- foreach ($wd_array as $wd => $wd_val)
- {
- if (gettype($wd_val) == 'array' && count($wd_val) > 0) // weekday array, $wd = weekday name
- {
- foreach ($wd_val as $wd_h => $wd_h_ave)
- {
- if (isset($data[$wd_m][$wd][$wd_h]))
- $data[$wd_m][$wd][$wd_h] = ($data[$wd_m][$wd][$wd_h] + $wd_h_ave) / 2; // TODO: solve wrong average calculation for >2 values
- else
- $data[$wd_m][$wd][$wd_h] = $wd_h_ave; // add unexisting weekhour value
+ foreach ($meas as $wd_m => $wd_array) {
+ foreach ($wd_array as $wd => $wd_val) {
+ if (gettype($wd_val) == 'array' && count($wd_val) > 0) { // weekday array, $wd = weekday name
+ foreach ($wd_val as $wd_h => $wd_h_ave) {
+ if (isset($data[$wd_m][$wd][$wd_h])) {
+ $data[$wd_m][$wd][$wd_h] = ($data[$wd_m][$wd][$wd_h] + $wd_h_ave) / 2;
+ } // TODO: solve wrong average calculation for >2 values
+ else {
+ $data[$wd_m][$wd][$wd_h] = $wd_h_ave;
+ } // add unexisting weekhour value
$wm_add = true;
}
}
}
}
- if ($wm_add)
- {
+ if ($wm_add) {
$wm_device_ids = [$device->id];
-
- if (isset($data['device_ids']))
+
+ if (isset($data['device_ids'])) {
$wm_device_ids = array_merge($wm_device_ids, explode(',', $data['device_ids']));
+ }
sort($wm_device_ids);
$data['device_ids'] = implode(',', $wm_device_ids);
}
- }
- else // no WEEKMAP, or first data of WEEKMAP
- {
+ } else { // no WEEKMAP, or first data of WEEKMAP
$data = array_merge($data, $meas);
- if ($calculation == 'WEEKMAP' && count($data) > 0) // set the first id's of the WEEKMAP data
- {
+ if ($calculation == 'WEEKMAP' && count($data) > 0) { // set the first id's of the WEEKMAP data
$data['device_ids'] = $device->id;
}
}
@@ -1187,70 +1157,56 @@ public function research_data(Request $request, $id, $item)
// Add weather data
$loc = $device->location();
- if ($loc && isset($loc->created_at) && $loc->created_at <= $m_until && $loc->lat != '' && $loc->lon != '')
- {
- $where = '"lat" = \''.$loc->lat.'\' AND "lon" = \''.$loc->lon.'\' AND time >= \''.$m_start.'\' AND time <= \''.$m_until.'\'';
-
- if ($csv_output)
- {
+ if ($loc && isset($loc->created_at) && $loc->created_at <= $m_until && $loc->lat != '' && $loc->lon != '') {
+ $where = '"lat" = \''.$loc->lat.'\' AND "lon" = \''.$loc->lon.'\' AND time >= \''.$m_start.'\' AND time <= \''.$m_until.'\'';
+
+ if ($csv_output) {
// 2021-03-30_T1UK_HPP 8a.csv
$file_name = substr($m_start, 0, 10).'_'.$research->name.'_'.$device->location_name.$device->hive_name;
$file_path = $this->exportCsvFromInflux($where, $file_name, $measurements, 'weather');
- $data[] = $file_path;
- }
- else
- {
- $adds = ['device_id'=>$device->id]; // provide anonimized (10-15km diameter) for end result
+ $data[] = $file_path;
+ } else {
+ $adds = ['device_id' => $device->id]; // provide anonimized (10-15km diameter) for end result
$data_w = $this->getArrayFromInflux($where, $measurements, 'weather', $m_interval, $calculation, $calc_prop, $decimals, $precision, $adds, $limit);
- // Merge measurements with weather data
- if (count($data_w) > 0)
- {
- if ($m_interval == '*' || count($data) == 0 || $m_interval == 'research')
- {
-
- if ($filter_year_months) // filter out all non month-year data
- {
+ // Merge measurements with weather data
+ if (count($data_w) > 0) {
+ if ($m_interval == '*' || count($data) == 0 || $m_interval == 'research') {
+
+ if ($filter_year_months) { // filter out all non month-year data
$meas_filtered = [];
- foreach ($data_w as $m)
- {
- $time = $m['time'];
+ foreach ($data_w as $m) {
+ $time = $m['time'];
$year_month = substr($time, 0, 7); // TODO: Make local time, now UTC
- if (in_array($year_month, $year_months))
+ if (in_array($year_month, $year_months)) {
$meas_filtered[] = $m;
+ }
}
$data_w = $meas_filtered;
}
$data = array_merge($data, $data_w);
- }
- else // merge neatly in same time objects
- {
+ } else { // merge neatly in same time objects
$weather_time_key = [];
- foreach ($data_w as $values)
- {
+ foreach ($data_w as $values) {
$time = $values['time'];
- if ($filter_year_months) // filter out all non month-year data
- {
- $year_month = substr($time, 0, 7); // TODO: Make local time, now UTC
- if (in_array($year_month, $year_months))
+ if ($filter_year_months) { // filter out all non month-year data
+ $year_month = substr($time, 0, 7); // TODO: Make local time, now UTC
+ if (in_array($year_month, $year_months)) {
$weather_time_key[$time] = $values;
- }
- else
- {
+ }
+ } else {
$weather_time_key[$time] = $values;
}
- }
+ }
// add weather values to sensor time keys where the weather values also exist
- if (filled($weather_time_key))
- {
- foreach ($data as $i => $values)
- {
+ if (filled($weather_time_key)) {
+ foreach ($data as $i => $values) {
$time = $values['time'];
- if (isset($weather_time_key[$time])) // add weather data to already available datetime
- {
- foreach ($weather_time_key[$time] as $m => $v)
+ if (isset($weather_time_key[$time])) { // add weather data to already available datetime
+ foreach ($weather_time_key[$time] as $m => $v) {
$data[$i][$m] = $v;
+ }
}
}
}
@@ -1268,51 +1224,45 @@ public function research_data(Request $request, $id, $item)
}
}
- // Check if the mean values need to be added
- if ($data_call && $csv_output == false)
- {
+ // Check if the mean values need to be added
+ if ($data_call && $csv_output == false) {
$data_count = count($data);
-
- if ($data_count > 0)
- {
- $measurements = $data;
+ if ($data_count > 0) {
- $data = [];
- $data['start'] = $m_start;
- $data['end'] = $m_until;
- $data['measurements']= $measurements;
- $data['interval'] = $interval;
- $data['index'] = $index;
- $data['timeZone'] = $timeZone;
+ $measurements = $data;
- $mean_values = [];
+ $data = [];
+ $data['start'] = $m_start;
+ $data['end'] = $m_until;
+ $data['measurements'] = $measurements;
+ $data['interval'] = $interval;
+ $data['index'] = $index;
+ $data['timeZone'] = $timeZone;
+
+ $mean_values = [];
// set mean values time to last timestamp
- $mean_values['time'] = isset($measurements[$data_count-1]['time']) ? $measurements[$data_count-1]['time'] : null;
-
- for ($i=0; $i < $data_count; $i++)
- {
+ $mean_values['time'] = isset($measurements[$data_count - 1]['time']) ? $measurements[$data_count - 1]['time'] : null;
+
+ for ($i = 0; $i < $data_count; $i++) {
// Fill mean values
- $data_array = $measurements[$i];
- foreach ($data_array as $name => $value)
- {
- if (isset($value) && $name != 'time')
- {
- if (!isset($mean_values[$name]))
+ $data_array = $measurements[$i];
+ foreach ($data_array as $name => $value) {
+ if (isset($value) && $name != 'time') {
+ if (! isset($mean_values[$name])) {
$mean_values[$name] = [$value];
- else
+ } else {
$mean_values[$name][] = $value;
+ }
}
}
}
// Calculate mean values
- foreach ($mean_values as $name => $values)
- {
- if ($name != 'time' && count($values) > 0)
- {
+ foreach ($mean_values as $name => $values) {
+ if ($name != 'time' && count($values) > 0) {
$mean_values[$name.'_min'] = min($values);
$mean_values[$name.'_max'] = max($values);
- $mean_values[$name] = array_sum($values) / count($values);
+ $mean_values[$name] = array_sum($values) / count($values);
}
}
$data['mean_values'] = $this->round_values_in_array($mean_values);
@@ -1325,48 +1275,43 @@ public function research_data(Request $request, $id, $item)
private function round_values_in_array($value_array)
{
$names_not_round = ['time', 'start', 'end', 'from_cache', 'file_type', 'bv'];
-
- foreach ($value_array as $name => $value)
- {
- if (!in_array($name, $names_not_round) && is_numeric($value))
- {
- $float_value = floatval($value);
- $decimals = $float_value > 100 ? 0 : 1;
+
+ foreach ($value_array as $name => $value) {
+ if (! in_array($name, $names_not_round) && is_numeric($value)) {
+ $float_value = floatval($value);
+ $decimals = $float_value > 100 ? 0 : 1;
$value_array[$name] = round($float_value, $decimals);
}
}
+
return $value_array;
}
-
- private function validateDate($date, $format='Y-m-d H:i:s') // RFC3339 == 'Y-m-d\TH:i:sP'
+ private function validateDate($date, $format = 'Y-m-d H:i:s') // RFC3339 == 'Y-m-d\TH:i:sP'
{
- $unix = strtotime($date);
+ $unix = strtotime($date);
+
return date($format, $unix) === $date ? true : false;
}
- private function influx_fields_to_query_string($fields, $calculation='NONE', $calc_prop=null, $decimals=2)
+ private function influx_fields_to_query_string($fields, $calculation = 'NONE', $calc_prop = null, $decimals = 2)
{
$round_factor = $decimals === null ? 0 : pow(10, $decimals);
- foreach ($fields as $i => $name)
- {
- if ($calculation == 'NONE' || empty($calculation)) // no calculations
- {
- if ($round_factor === 0)
+ foreach ($fields as $i => $name) {
+ if ($calculation == 'NONE' || empty($calculation)) { // no calculations
+ if ($round_factor === 0) {
$fields[$i] = '"'.$name.'"';
- else
+ } else {
$fields[$i] = 'ROUND(("'.$name.'")*'.$round_factor.')/'.$round_factor.' AS "'.$name.'"';
- }
- else
- {
- $calculation = strtoupper($calculation);
- $calc_prop_add = '';
+ }
+ } else {
+ $calculation = strtoupper($calculation);
+ $calc_prop_add = '';
// BOXPLOT: Min, Max, Mean, Percentile 25, Percentile 75
- if ($calculation == 'BOXPLOT')
- {
- $fields_sub = [];
+ if ($calculation == 'BOXPLOT') {
+ $fields_sub = [];
$fields_sub[] = 'MIN("'.$name.'") AS "'.$name.'_min"';
$fields_sub[] = 'MAX("'.$name.'") AS "'.$name.'_max"';
$fields_sub[] = 'MEDIAN("'.$name.'") AS "'.$name.'_med"';
@@ -1376,240 +1321,208 @@ private function influx_fields_to_query_string($fields, $calculation='NONE', $ca
$fields_sub[] = 'PERCENTILE("'.$name.'", 25) AS "'.$name.'_p25"';
$fields_sub[] = 'PERCENTILE("'.$name.'", 75) AS "'.$name.'_p75"';
$fields_sub[] = 'PERCENTILE("'.$name.'", 99) AS "'.$name.'_p99"';
- $fields[$i] = implode(', ', $fields_sub);
- }
- else if ($calculation == 'PEAKS')
- {
- //SELECT ((SPREAD("pmsp053_pm10") / MODE("pmsp053_pm10")) + ABS(SPREAD("pmsp053_pm10") / MODE("pmsp053_pm10"))) / 2 AS "Peak PM10" FROM "sensors" WHERE ("key" =~ /^$sensor_key$/) AND $timeFilter GROUP BY time(6h) fill(null)
+ $fields[$i] = implode(', ', $fields_sub);
+ } elseif ($calculation == 'PEAKS') {
+ // SELECT ((SPREAD("pmsp053_pm10") / MODE("pmsp053_pm10")) + ABS(SPREAD("pmsp053_pm10") / MODE("pmsp053_pm10"))) / 2 AS "Peak PM10" FROM "sensors" WHERE ("key" =~ /^$sensor_key$/) AND $timeFilter GROUP BY time(6h) fill(null)
$fields[$i] = '(((SPREAD("'.$name.'") / MODE("'.$name.'"))) + ABS((SPREAD("'.$name.'") / MODE("'.$name.'")))) / 2 AS "'.$name.'"';
- }
- else
- {
+ } else {
// DERIVATIVE no property exception
- if (isset($calc_prop))
- {
+ if (isset($calc_prop)) {
$calc_prop_add = ", $calc_prop";
- }
- else if ($calculation == 'DERIVATIVE') // no calc_prop set (time of derivative)
- {
- $calculation = 'DERIVATIVE(MEAN';
+ } elseif ($calculation == 'DERIVATIVE') { // no calc_prop set (time of derivative)
+ $calculation = 'DERIVATIVE(MEAN';
$calc_prop_add = ')'; // add extra bracket for MEAN
}
// Make query
- if ($round_factor === 0)
+ if ($round_factor === 0) {
$fields[$i] = $calculation.'("'.$name.'"'.$calc_prop_add.') AS "'.$name.'"';
- else
+ } else {
$fields[$i] = 'ROUND('.$calculation.'("'.$name.'"'.$calc_prop_add.')*'.$round_factor.')/'.$round_factor.' AS "'.$name.'"';
+ }
}
}
}
+
return implode(', ', $fields);
}
// NB: keys should be filled with keys array for database 'sensors', or with coords ['lat'=>$loc->lat, 'lon'=>$loc->lon] for database 'weather'
- private function getArrayFromInflux($where, $measurements='*', $database='sensors', $interval='1h', $calculation='MEAN', $calc_prop=null, $decimals=2, $precision='rfc3339', $adds=[], $limit=5000, $device=null, $timeZone='UTC', $start_date=null, $end_date=null)
+ private function getArrayFromInflux($where, $measurements = '*', $database = 'sensors', $interval = '1h', $calculation = 'MEAN', $calc_prop = null, $decimals = 2, $precision = 'rfc3339', $adds = [], $limit = 5000, $device = null, $timeZone = 'UTC', $start_date = null, $end_date = null)
{
- $options = ['precision'=>$precision];
-
+ $options = ['precision' => $precision];
+
// Create query
$names = null;
- $replace_names = [];
+ $replace_names = [];
$replace_results = [];
- if (isset($measurements) && $measurements !== '*')
- {
- if (gettype($measurements) == 'array' && count($measurements) > 0)
- {
- foreach($replace_names as $m_source => $m_target)
- {
- if (in_array($m_target, $measurements) || in_array($m_target, $measurements)) // change pmsp053_pm1.0 to pmsp053_pm1_0
- {
+ if (isset($measurements) && $measurements !== '*') {
+ if (gettype($measurements) == 'array' && count($measurements) > 0) {
+ foreach ($replace_names as $m_source => $m_target) {
+ if (in_array($m_target, $measurements) || in_array($m_target, $measurements)) { // change pmsp053_pm1.0 to pmsp053_pm1_0
$replace_results[$m_source] = $m_target;
- if (!in_array($m_source, $measurements))
- $measurements[] = $m_source; // also query measurements that should be replaced
+ if (! in_array($m_source, $measurements)) {
+ $measurements[] = $m_source;
+ } // also query measurements that should be replaced
}
}
$names = $measurements;
- }
- else if (gettype($measurements) == 'string')
- {
+ } elseif (gettype($measurements) == 'string') {
$names = explode(',', $measurements);
}
- }
- else
- {
+ } else {
$replace_results = $replace_names;
}
// add extra measurements to replace
- if (count($replace_results) > 0 && $calculation == 'BOXPLOT')
- {
- $add_suffix = ['_min','_max','_med','_cnt','_p01','_p25','_p75','_p99'];
- foreach($replace_results as $m_source => $m_target)
- {
- foreach($add_suffix as $s)
+ if (count($replace_results) > 0 && $calculation == 'BOXPLOT') {
+ $add_suffix = ['_min', '_max', '_med', '_cnt', '_p01', '_p25', '_p75', '_p99'];
+ foreach ($replace_results as $m_source => $m_target) {
+ foreach ($add_suffix as $s) {
$replace_results[$m_source.$s] = $m_target.$s;
+ }
}
}
// Initialize names if not available
- if (!isset($names))
- {
- if ($database == 'weather')
+ if (! isset($names)) {
+ if ($database == 'weather') {
$names = $this->output_weather;
- else
+ } else {
$names = $this->output_sensors;
+ }
}
-
+
// Create query
$queryList = [];
- if ($database != 'weather' && $calculation != 'NETWEIGHT')
- {
+ if ($database != 'weather' && $calculation != 'NETWEIGHT') {
$queryList = Device::getAvailableSensorNamesNoCache($names, $where, $database); // ($names, $where, $table='sensors', $output_sensors_only=true, $cache_name='names-nocache')
}
-
- if (!isset($queryList) || gettype($queryList) != 'array' || count($queryList) == 0)
+
+ if (! isset($queryList) || gettype($queryList) != 'array' || count($queryList) == 0) {
$queryList = $names;
+ }
- if (isset($interval) && $calculation == 'WEEKMAP') // create hourly weekmap
- {
- $groupBySelect = $this->influx_fields_to_query_string($queryList, 'MEAN', $calc_prop, $decimals);
+ if (isset($interval) && $calculation == 'WEEKMAP') { // create hourly weekmap
+ $groupBySelect = $this->influx_fields_to_query_string($queryList, 'MEAN', $calc_prop, $decimals);
$groupByResolution = 'GROUP BY time(1h) fill(none) ORDER BY time ASC';
- }
- else if (isset($interval) && $interval == '*' && $calculation != 'NONE') // Set full consent interval and possible calculation (MEAN/MIN/MAX/etc), but do not group by time
- {
- $groupBySelect = $this->influx_fields_to_query_string($queryList, $calculation, $calc_prop, $decimals);
+ } elseif (isset($interval) && $interval == '*' && $calculation != 'NONE') { // Set full consent interval and possible calculation (MEAN/MIN/MAX/etc), but do not group by time
+ $groupBySelect = $this->influx_fields_to_query_string($queryList, $calculation, $calc_prop, $decimals);
$groupByResolution = 'ORDER BY time ASC';
- }
- else if (isset($interval) && $interval !== '*' && $calculation != 'NONE') // Set interval and possible calculation (MEAN/MIN/MAX/etc),
- {
- $groupBySelect = $this->influx_fields_to_query_string($queryList, $calculation, $calc_prop, $decimals);
+ } elseif (isset($interval) && $interval !== '*' && $calculation != 'NONE') { // Set interval and possible calculation (MEAN/MIN/MAX/etc),
+ $groupBySelect = $this->influx_fields_to_query_string($queryList, $calculation, $calc_prop, $decimals);
$groupByResolution = 'GROUP BY time('.$interval.') fill(none) ORDER BY time ASC';
- }
- else // $interval == '*' or unset || $calculation == 'NONE'
- {
- $groupBySelect = $this->influx_fields_to_query_string($queryList);
+ } else { // $interval == '*' or unset || $calculation == 'NONE'
+ $groupBySelect = $this->influx_fields_to_query_string($queryList);
$groupByResolution = 'ORDER BY time ASC';
}
-
- if ($calculation == 'NETWEIGHT' && $device && $start_date && $end_date && $timeZone)
- {
+
+ if ($calculation == 'NETWEIGHT' && $device && $start_date && $end_date && $timeZone) {
$query = $device->getCleanedWeightQuery($interval, $start_date, $end_date, $limit, 0.75, 2, $timeZone);
- //dd($query);
- }
- else
- {
+ // dd($query);
+ } else {
$query = 'SELECT '.$groupBySelect.' FROM "'.$database.'" WHERE '.$where.' '.$groupByResolution.' LIMIT '.$limit;
}
-
- //dd($query);
- if ($query === null)
+ // dd($query);
+
+ if ($query === null) {
return [];
+ }
// Load data
$cache_timeout_sec = 84600; // 24 hours, was env('CACHE_TIMEOUT_LONG')
- $out = Cache::remember('research-query-'.$query, $cache_timeout_sec, function () use ($query, $queryList, $options, $adds, $replace_results, $calculation)
- {
- $data = [];
+ $out = Cache::remember('research-query-'.$query, $cache_timeout_sec, function () use ($query, $queryList, $options, $adds, $replace_results, $calculation) {
+ $data = [];
$adds_set = count($adds) > 0 ? true : false;
- try{
+ try {
$this->cacheRequestRate('influx-get');
$this->cacheRequestRate('influx-research-api');
- //die(print_r($query));
+ // die(print_r($query));
$data = $this->client::query($query, $options)->getPoints();
} catch (InfluxDB\Exception $e) {
Log::error($query);
Log::error($e);
+
return [];
}
-
- if (count($data) == 0)
- {
+ if (count($data) == 0) {
return [];
- }
- else
- {
+ } else {
// Prepare WEEKMAP measurement data
- if ($calculation == 'WEEKMAP')
- {
- // fill week
- $weekmap = [];
+ if ($calculation == 'WEEKMAP') {
+ // fill week
+ $weekmap = [];
$data_week = [];
- for ($day_i=0; $day_i < 7; $day_i++)
- {
+ for ($day_i = 0; $day_i < 7; $day_i++) {
$data_week[$day_i] = [];
- for ($hour_i=0; $hour_i < 24; $hour_i++)
- {
+ for ($hour_i = 0; $hour_i < 24; $hour_i++) {
$data_week[$day_i][$hour_i] = [];
}
}
// fill names with week arrays
- foreach ($queryList as $m_abbr)
- {
- if (in_array($m_abbr, array_keys($replace_results)))
+ foreach ($queryList as $m_abbr) {
+ if (in_array($m_abbr, array_keys($replace_results))) {
$m_abbr = $replace_results[$m_abbr];
+ }
$weekmap[$m_abbr] = $data_week;
}
}
// Process measurement data
- foreach ($data as $i => $d)
- {
+ foreach ($data as $i => $d) {
// Replace measurement names
// Empty null results
- $data[$i] = array_filter($d, function($value) { return !is_null($value) && $value !== ''; });
-
+ $data[$i] = array_filter($d, function ($value) {
+ return ! is_null($value) && $value !== '';
+ });
+
// Convert to WEEKMAP (heatmap of all hours in a week)
- if ($calculation == 'WEEKMAP')
- {
- if (isset($data[$i]['time']) && count($data[$i]) > 1)
- {
- $time = strtotime($data[$i]['time']);
- $weekday = date('N', $time)-1; // 1-7 -> 0-6
+ if ($calculation == 'WEEKMAP') {
+ if (isset($data[$i]['time']) && count($data[$i]) > 1) {
+ $time = strtotime($data[$i]['time']);
+ $weekday = date('N', $time) - 1; // 1-7 -> 0-6
$dayhour = date('G', $time); // 0-23
- foreach ($data[$i] as $m_abbr => $value)
- {
- if ($m_abbr != 'time')
+ foreach ($data[$i] as $m_abbr => $value) {
+ if ($m_abbr != 'time') {
$weekmap[$m_abbr][$weekday][$dayhour][] = $value;
+ }
}
}
- }
- else
- {
+ } else {
// Add items in adds
- if ($adds_set)
- foreach ($adds as $add_key => $add_value)
+ if ($adds_set) {
+ foreach ($adds as $add_key => $add_value) {
$data[$i][$add_key] = $add_value;
+ }
+ }
}
-
}
// Post process WEEKMAP
- if ($calculation == 'WEEKMAP')
- {
+ if ($calculation == 'WEEKMAP') {
$weekmap_out = [];
- $weekdays = ['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];
- foreach ($weekmap as $m_abbr => $week_array)
- {
- foreach($week_array as $day_i => $day_array)
- {
- foreach($day_array as $hour_i => $hour_array)
- {
- if (count($hour_array) > 0)
+ $weekdays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
+ foreach ($weekmap as $m_abbr => $week_array) {
+ foreach ($week_array as $day_i => $day_array) {
+ foreach ($day_array as $hour_i => $hour_array) {
+ if (count($hour_array) > 0) {
$weekmap_out[$m_abbr][$weekdays[$day_i]][$hour_i] = array_sum($hour_array) / count($hour_array);
+ }
}
}
// Add items in adds
- if ($adds_set)
- foreach ($adds as $add_key => $add_value)
+ if ($adds_set) {
+ foreach ($adds as $add_key => $add_value) {
$weekmap_out[$m_abbr][$add_key] = $add_value;
+ }
+ }
}
$data = $weekmap_out;
}
@@ -1621,80 +1534,71 @@ private function getArrayFromInflux($where, $measurements='*', $database='sensor
return $out;
}
-
- private function exportCsvFromInflux($where, $fileName='research-export-', $measurements='*', $database='sensors', $separator=',', $translate=false)
+ private function exportCsvFromInflux($where, $fileName = 'research-export-', $measurements = '*', $database = 'sensors', $separator = ',', $translate = false)
{
- $options= ['precision'=>'rfc3339', 'format'=>'csv'];
-
- if ($database == 'sensors')
- {
- if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0)
+ $options = ['precision' => 'rfc3339', 'format' => 'csv'];
+
+ if ($database == 'sensors') {
+ if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0) {
$names = $measurements;
- else
+ } else {
$names = $this->output_sensors;
+ }
$queryList = Device::getAvailableSensorNamesNoCache($names, $where, $database);
-
- if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0)
+
+ if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0) {
$groupBySelect = implode(', ', $queryList);
- else
- $groupBySelect = '"'.implode('","',$names).'"';
+ } else {
+ $groupBySelect = '"'.implode('","', $names).'"';
+ }
$query = 'SELECT '.$groupBySelect.',"from_flashlog" FROM "'.$database.'" WHERE '.$where;
- }
- else // i.e. weather data
- {
- if ($measurements == null || $measurements == '' || $measurements === '*')
+ } else { // i.e. weather data
+ if ($measurements == null || $measurements == '' || $measurements === '*') {
$sensor_measurements = '*';
- else
+ } else {
$sensor_measurements = $measurements;
+ }
$query = 'SELECT '.$sensor_measurements.' FROM "'.$database.'" WHERE '.$where;
}
-
- try{
- $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
+
+ try {
+ $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
} catch (InfluxDB\Exception $e) {
return null;
}
- if (count($data) == 0)
+ if (count($data) == 0) {
return null;
+ }
$csv_file = $data;
- //format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
- $csv_file = "";
+ // format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
+ $csv_file = '';
$csv_sens = array_keys($data[0]);
$csv_head = [];
- if ($translate)
- {
- foreach ($csv_sens as $sensor_name)
- {
- if ($sensor_name == 'from_flashlog')
- {
+ if ($translate) {
+ foreach ($csv_sens as $sensor_name) {
+ if ($sensor_name == 'from_flashlog') {
$csv_head[] = 'Imported from device flash log';
- }
- else
- {
- $meas = Measurement::where('abbreviation', $sensor_name)->first();
+ } else {
+ $meas = Measurement::where('abbreviation', $sensor_name)->first();
$csv_head[] = $meas ? $meas->pq_name_unit().' ('.$sensor_name.')' : $sensor_name;
}
}
- }
- else
- {
+ } else {
$csv_head = $csv_sens;
- }
+ }
$csv_head = '"'.implode('"'.$separator.'"', $csv_head).'"'."\r\n";
// format CSV file body
$csv_body = [];
- foreach ($data as $sensor_array)
- {
- if (isset($sensor_array['time']))
- {
+ foreach ($data as $sensor_array) {
+ if (isset($sensor_array['time'])) {
$time_str = $sensor_array['time'];
$sensor_array['time'] = substr($time_str, 0, 10).' '.substr($time_str, 11, 8); // Format from 2024-10-16T03:17:14Z => YYYY-MM-DD HH:mm:ss
}
@@ -1705,12 +1609,12 @@ private function exportCsvFromInflux($where, $fileName='research-export-', $meas
// return the CSV file content in a file on disk
$filePath = 'exports/'.$fileName;
- $disk = env('EXPORT_STORAGE', 'public');
+ $disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv']))
+ if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv'])) {
return Storage::disk($disk)->url($filePath);
+ }
return null;
}
-
}
diff --git a/app/Http/Controllers/Api/SampleCodeController.php b/app/Http/Controllers/Api/SampleCodeController.php
index 2420c37d..3b847310 100644
--- a/app/Http/Controllers/Api/SampleCodeController.php
+++ b/app/Http/Controllers/Api/SampleCodeController.php
@@ -2,13 +2,14 @@
namespace App\Http\Controllers\Api;
-use Auth;
use App\SampleCode;
+use Auth;
use Illuminate\Http\Request;
/**
* @group Api\SampleCodeController
* Research lab result sample code controller
+ *
* @authenticated
*/
class SampleCodeController extends Controller
@@ -22,8 +23,9 @@ public function index()
{
$code = Auth::user()->samplecodes()->get();
- if ($code)
+ if ($code) {
return response()->json($code, 200);
+ }
return response()->json(null, 404);
}
@@ -32,23 +34,24 @@ public function index()
api/samplecode POST
Create a sample code for lab results
@authenticated
- **/
+ **/
public function store(Request $request)
{
- if($request->filled('hive_id') && $request->user()->allHives()->find($request->input('hive_id')))
- {
- try{
- $code = $request->only('hive_id', 'queen_id');
- $sample_time = $request->filled('sample_date') ? strtotime($request->input('sample_date')) : time();
+ if ($request->filled('hive_id') && $request->user()->allHives()->find($request->input('hive_id'))) {
+ try {
+ $code = $request->only('hive_id', 'queen_id');
+ $sample_time = $request->filled('sample_date') ? strtotime($request->input('sample_date')) : time();
$code['sample_date'] = date('Y-m-d H:i:s', $sample_time);
$code['sample_code'] = SampleCode::generate_code();
- $code['user_id'] = $request->user()->id;
- $samplecode = SampleCode::create($code);
+ $code['user_id'] = $request->user()->id;
+ $samplecode = SampleCode::create($code);
} catch (Exception $e) {
- Log::error("Api/SampleCodeController.store error: ".$e->getMessage());
+ Log::error('Api/SampleCodeController.store error: '.$e->getMessage());
}
+
return response()->json($samplecode, 201);
}
+
return response()->json(null, 400);
}
@@ -76,15 +79,15 @@ public function update(Request $request, SampleCode $sampleCode)
*/
public function destroy(Request $request)
{
- if($request->filled('sample_code'))
- {
+ if ($request->filled('sample_code')) {
$code = $request->user()->samplecodes()->where('sample_code', $request->input('sample_code'))->first();
- if ($code)
- {
+ if ($code) {
$code->delete();
+
return response()->json('code_deleted', 200);
}
}
+
return response()->json(null, 400);
}
}
diff --git a/app/Http/Controllers/Api/SensorDefinitionController.php b/app/Http/Controllers/Api/SensorDefinitionController.php
index dc2d1931..d9aaadd0 100644
--- a/app/Http/Controllers/Api/SensorDefinitionController.php
+++ b/app/Http/Controllers/Api/SensorDefinitionController.php
@@ -2,80 +2,69 @@
namespace App\Http\Controllers\Api;
-use App\Http\Requests;
use App\Http\Controllers\Controller;
-use Illuminate\Support\Facades\Storage;
-
-use App\SensorDefinition;
use App\Measurement;
+use App\SensorDefinition;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
/**
* @group Api\SensorDefinitionController
* Manage your sensor definitions
+ *
* @authenticated
*/
class SensorDefinitionController extends Controller
{
private function getDeviceFromRequest(Request $request)
{
-
- if ($request->filled('device_id'))
- {
+
+ if ($request->filled('device_id')) {
return $request->user()->devices()->findOrFail($request->input('device_id'));
- }
- else if ($request->filled('hardware_id'))
- {
+ } elseif ($request->filled('hardware_id')) {
return $request->user()->devices()->where('hardware_id', strtolower($request->input('hardware_id')))->first();
- }
- else if ($request->filled('device_hardware_id'))
- {
+ } elseif ($request->filled('device_hardware_id')) {
return $request->user()->devices()->where('hardware_id', strtolower($request->input('device_hardware_id')))->first();
}
+
return null;
}
- private function getMeasurementFromRequestKey(Request $request, $output=true)
+ private function getMeasurementFromRequestKey(Request $request, $output = true)
{
- $request_id = $output ? 'output_measurement_id' : 'input_measurement_id';
+ $request_id = $output ? 'output_measurement_id' : 'input_measurement_id';
$request_key = $output ? 'output_measurement_abbreviation' : 'input_measurement_abbreviation';
- if ($request->filled($request_id))
- {
+ if ($request->filled($request_id)) {
return Measurement::findOrFail($request->input($request_id));
- }
- else if ($request->filled($request_key))
- {
+ } elseif ($request->filled($request_key)) {
return Measurement::where('abbreviation', $request->input($request_key))->first();
}
+
return null;
}
private function makeRequestDataArray(Request $request)
{
- $measurement_in = $this->getMeasurementFromRequestKey($request, false);
- $measurement_out = $this->getMeasurementFromRequestKey($request, true);
+ $measurement_in = $this->getMeasurementFromRequestKey($request, false);
+ $measurement_out = $this->getMeasurementFromRequestKey($request, true);
// Change output weight measurement for React native app
- if ($request->hasHeader('X-ClientId') && ($request->header('X-ClientId') == 'android' || $request->header('X-ClientId') == 'ios'))
- {
- if (isset($measurement_in) && $measurement_in->abbreviation == 'w_v')
- {
- if (isset($measurement_out) == false || $measurement_out->abbreviation == 'w_v')
+ if ($request->hasHeader('X-ClientId') && ($request->header('X-ClientId') == 'android' || $request->header('X-ClientId') == 'ios')) {
+ if (isset($measurement_in) && $measurement_in->abbreviation == 'w_v') {
+ if (isset($measurement_out) == false || $measurement_out->abbreviation == 'w_v') {
$measurement_out = Measurement::where('abbreviation', 'weight_kg')->first();
+ }
}
}
-
$request_data = $request->only('name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id');
- $request_data['input_measurement_id'] = isset($measurement_in) ? $measurement_in->id : null;
+ $request_data['input_measurement_id'] = isset($measurement_in) ? $measurement_in->id : null;
$request_data['output_measurement_id'] = isset($measurement_out) ? $measurement_out->id : (isset($measurement_in) ? $measurement_in->id : null);
- if (isset($measurement_in) && $measurement_in->abbreviation == 'w_v' && isset($request_data['offset']) && isset($request_data['multiplier']) && $request_data['offset'] == 0 && $request_data['multiplier'] == 0)
- {
- $in_abbr = $measurement_in->abbreviation;
+ if (isset($measurement_in) && $measurement_in->abbreviation == 'w_v' && isset($request_data['offset']) && isset($request_data['multiplier']) && $request_data['offset'] == 0 && $request_data['multiplier'] == 0) {
+ $in_abbr = $measurement_in->abbreviation;
$out_abbr = isset($measurement_out) ? $measurement_out->abbreviation : 'null';
Log::error("SensorDefinition request in: $in_abbr, out: $out_abbr, weight has empty multiplier and offset:");
Log::error(json_encode($request_data));
@@ -83,27 +72,27 @@ private function makeRequestDataArray(Request $request)
$request_data['multiplier'] = 1;
}
- if ($request->filled('inside'))
- {
- if ($request_data['inside'] === -1)
+ if ($request->filled('inside')) {
+ if ($request_data['inside'] === -1) {
$request_data['inside'] = null;
- else
- $request_data['inside'] = $request_data['inside'] === "true" || $request_data['inside'] === true || $request_data['inside'] == 1 ? 1 : 0;
+ } else {
+ $request_data['inside'] = $request_data['inside'] === 'true' || $request_data['inside'] === true || $request_data['inside'] == 1 ? 1 : 0;
+ }
}
- if ( (!isset($request_data['name']) || empty($request_data['name'])) )
- {
- if (isset($measurement_out))
+ if ((! isset($request_data['name']) || empty($request_data['name']))) {
+ if (isset($measurement_out)) {
$request_data['name'] = $measurement_out->pq_name().' '.__('beep.calibrated');
- else if (isset($measurement_in))
+ } elseif (isset($measurement_in)) {
$request_data['name'] = $measurement_in->pq_name().' '.__('beep.calibrated');
+ }
}
if ($request->filled('updated_at')) {
$updated_date_utc = $request->input('updated_at');
- $updated_date_db = substr($updated_date_utc, 0, 10).' '.substr($updated_date_utc, 11, 8); // strip timezone
+ $updated_date_db = substr($updated_date_utc, 0, 10).' '.substr($updated_date_utc, 11, 8); // strip timezone
$request_data['updated_at'] = date('Y-m-d H:i:s', strtotime($updated_date_db));
- //Log::debug("CalibrationController makeRequestDataArray updated_date_utc: $updated_date_utc, updated_date_db: $updated_date_db");
+ // Log::debug("CalibrationController makeRequestDataArray updated_date_utc: $updated_date_utc, updated_date_db: $updated_date_db");
} elseif (isset($calibration['updated_at'])) {
$request_data['updated_at'] = $calibration->updated_at; // do NOT update the calibration date, by setting the 'updated_at' to the available date
}
@@ -111,11 +100,12 @@ private function makeRequestDataArray(Request $request)
return $request_data;
}
-
/**
* api/sensordefinition GET
* Display a listing of all sensordefinitions that belong to a device
+ *
* @authenticated
+ *
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
@@ -128,29 +118,25 @@ public function index(Request $request)
{
$device = $this->getDeviceFromRequest($request);
- if ($device)
- {
-
- if ($request->filled('input_measurement_abbreviation'))
- {
- $measurement_in = $this->getMeasurementFromRequestKey($request, false);
- $limit = $request->filled('limit') ? intVal($request->input('limit')) : 1;
+ if ($device) {
- if (isset($measurement_in))
+ if ($request->filled('input_measurement_abbreviation')) {
+ $measurement_in = $this->getMeasurementFromRequestKey($request, false);
+ $limit = $request->filled('limit') ? intval($request->input('limit')) : 1;
+
+ if (isset($measurement_in)) {
$sensordefinitions = $device->sensorDefinitions->where('input_measurement_id', $measurement_in->id)->sortByDesc('updated_at')->take($limit)->values();
- else
+ } else {
$sensordefinitions = $device->sensorDefinitions->sortByDesc('updated_at')->take($limit)->values();
- }
- else
- {
- $sensordefinitions = $device->sensorDefinitions->sortBy('updated_at')->values(); // Bugfix iOS app: sort by Asc to get last in iOS app.
+ }
+ } else {
+ $sensordefinitions = $device->sensorDefinitions->sortBy('updated_at')->values(); // Bugfix iOS app: sort by Asc to get last in iOS app.
}
- if ($sensordefinitions)
+ if ($sensordefinitions) {
return response()->json($sensordefinitions);
- }
- else
- {
+ }
+ } else {
return response()->json('no_device_found', 404);
}
@@ -162,6 +148,7 @@ public function index(Request $request)
* Store a newly created sensordefinition
*
* @authenticated
+ *
* @bodyParam name string Name of the sensorinstance (e.g. temperature frame 1)
* @bodyParam inside boolean True is measured inside, false if measured outside
* @bodyParam offset float Measurement value that defines 0
@@ -173,19 +160,20 @@ public function index(Request $request)
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
+ *
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
- //Log::debug('sensordefinition_post');
- //Log::debug($request->input());
-
+ // Log::debug('sensordefinition_post');
+ // Log::debug($request->input());
+
$device = $this->getDeviceFromRequest($request);
- if ($device)
- {
- $request_data = new SensorDefinition($this->makeRequestDataArray($request));
+ if ($device) {
+ $request_data = new SensorDefinition($this->makeRequestDataArray($request));
$sensordefinition = $device->sensorDefinitions()->save($request_data);
+
return response()->json($sensordefinition, 201);
}
@@ -197,8 +185,11 @@ public function store(Request $request)
/**
* api/sensordefinition/{id} GET
* Display the specified sensordefinition
+ *
* @authenticated
+ *
* @urlParam id required Sensordefinition ID
+ *
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
@@ -206,8 +197,7 @@ public function store(Request $request)
public function show(Request $request, $id)
{
$device = $this->getDeviceFromRequest($request);
- if ($device)
- {
+ if ($device) {
return response()->json($this->getDeviceFromRequest($request)->sensorDefinitions()->findOrFail($id), 200);
}
@@ -217,8 +207,11 @@ public function show(Request $request, $id)
/**
* api/sensordefinition/{id} PATCH
* Update the specified sensordefinition
+ *
* @authenticated
+ *
* @urlParam id required Sensordefinition ID
+ *
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
@@ -226,12 +219,11 @@ public function show(Request $request, $id)
public function update(Request $request, $id)
{
$device = $this->getDeviceFromRequest($request);
- if ($device)
- {
+ if ($device) {
$sensordefinition = $device->sensorDefinitions()->findOrFail($id);
- $request_data = $this->makeRequestDataArray($request);
- // $request_data = $request->only('name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id');
-
+ $request_data = $this->makeRequestDataArray($request);
+ // $request_data = $request->only('name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id');
+
// if ($request->filled('inside'))
// {
// if ($request_data['inside'] === -1)
@@ -239,27 +231,31 @@ public function update(Request $request, $id)
// else
// $request_data['inside'] = $request_data['inside'] === "true" || $request_data['inside'] === true || $request_data['inside'] == 1 ? 1 : 0;
// }
- if (isset($request_data['updated_at']))
+ if (isset($request_data['updated_at'])) {
$updated_at = $request_data['updated_at'];
+ }
$sensordefinition->update($request_data);
-
- if (isset($request_data['updated_at']))
- {
+
+ if (isset($request_data['updated_at'])) {
$sensordefinition->updated_at = $updated_at;
$sensordefinition->save(['timestamps' => false]);
}
return response()->json($sensordefinition, 200);
}
+
return response()->json('no_device_found', 404);
}
/**
* api/sensordefinition/{id} DELETE
* Remove the specified sensordefinition
+ *
* @authenticated
+ *
* @urlParam id required Sensordefinition ID
+ *
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
@@ -267,12 +263,13 @@ public function update(Request $request, $id)
public function destroy(Request $request, $id)
{
$device = $this->getDeviceFromRequest($request);
- if ($device)
- {
+ if ($device) {
$sensordefinition = $device->sensorDefinitions()->findOrFail($id);
$sensordefinition->delete();
+
return response()->json('sensor_definition_deleted', 204);
}
+
return response()->json('no_device_found', 404);
}
}
diff --git a/app/Http/Controllers/Api/SettingController.php b/app/Http/Controllers/Api/SettingController.php
index 04ceb047..75b6daa6 100644
--- a/app/Http/Controllers/Api/SettingController.php
+++ b/app/Http/Controllers/Api/SettingController.php
@@ -2,74 +2,70 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
+use App\Category;
use App\Http\Controllers\Controller;
-use Response;
use App\Setting;
-use App\Hive;
-use App\Category;
+use Illuminate\Http\Request;
+use Response;
/**
* @group Api\SettingController
+ *
* @authenticated
*/
class SettingController extends Controller
{
public function store(Request $request)
{
- $user_id = $request->user()->id;
- $type = $request->input('type');
- $number = $request->input('id');
+ $user_id = $request->user()->id;
+ $type = $request->input('type');
+ $number = $request->input('id');
- $input = $request->input();
- if ($request->filled('id'))
+ $input = $request->input();
+ if ($request->filled('id')) {
unset($input['id']);
+ }
- //die(print_r($input));
+ // die(print_r($input));
// $cat_id = Category::name($type);
// if (isset($cat_id))
// {
- $save_cnt = 0;
- foreach($input as $name => $value)
- {
- if ($name == "")
- continue;
+ $save_cnt = 0;
+ foreach ($input as $name => $value) {
+ if ($name == '') {
+ continue;
+ }
- if ($request->filled('id'))
- {
- $request->user()->settings()->where('name',$name)->where('number',$number)->delete();
- }
- else
- {
- $request->user()->settings()->where('name',$name)->delete();
- }
+ if ($request->filled('id')) {
+ $request->user()->settings()->where('name', $name)->where('number', $number)->delete();
+ } else {
+ $request->user()->settings()->where('name', $name)->delete();
+ }
- $setting = new Setting;
- $setting->category_id = 0;
- $setting->name = $name;
- $setting->value = $value;
- $setting->number = $number;
- $saved = $request->user()->settings()->save($setting);
-
- if ($saved)
- $save_cnt++;
+ $setting = new Setting;
+ $setting->category_id = 0;
+ $setting->name = $name;
+ $setting->value = $value;
+ $setting->number = $number;
+ $saved = $request->user()->settings()->save($setting);
+ if ($saved) {
+ $save_cnt++;
}
- if ($save_cnt > 0)
- {
- return $this->index($request);
- }
- //}
+ }
+
+ if ($save_cnt > 0) {
+ return $this->index($request);
+ }
+ // }
return Response::json('no named settings to save', 400);
}
-
+
public function index(Request $request)
{
- //die(print_r($request->user()->settings()->get()));
- return Response::json($request->user()->settings()->groupBy('name','number')->get());
+ // die(print_r($request->user()->settings()->get()));
+ return Response::json($request->user()->settings()->groupBy('name', 'number')->get());
}
-
-
}
diff --git a/app/Http/Controllers/Api/TaxonomyController.php b/app/Http/Controllers/Api/TaxonomyController.php
index 4082262c..2979a108 100644
--- a/app/Http/Controllers/Api/TaxonomyController.php
+++ b/app/Http/Controllers/Api/TaxonomyController.php
@@ -3,53 +3,50 @@
namespace App\Http\Controllers\Api;
use App\Category;
-use App\Taxonomy;
+use App\Http\Controllers\Controller;
use App\Measurement;
use App\Models\AlertRule;
+use App\Taxonomy;
+use Cache;
use Illuminate\Http\Request;
-use App\Http\Controllers\Controller;
use LaravelLocalization;
-use Cache;
/**
* @group Api\TaxonomyController
+ *
* @authenticated
*/
class TaxonomyController extends Controller
{
-
/**
- api/taxonomy/lists
+ api/taxonomy/lists
List of current state of the standard categories.
@authenticated
- */
+ */
public function lists(Request $request)
{
- $lists = Cache::remember('taxonomy-lists', env('CACHE_TIMEOUT_LONG'), function ()
- {
- $out = [];
- $out['hivetypes'] = [];
+ $lists = Cache::remember('taxonomy-lists', env('CACHE_TIMEOUT_LONG'), function () {
+ $out = [];
+ $out['hivetypes'] = [];
$hiveTypes = Category::descendentsByRootParentAndName('hive', 'hive', 'type');
- foreach ($hiveTypes as $cat)
- {
+ foreach ($hiveTypes as $cat) {
$parent = Category::find($cat->parent_id);
- if ($cat->input == 'list_item')
- {
+ if ($cat->input == 'list_item') {
$cat->group = $parent->trans();
$out['hivetypes'][] = $cat;
}
}
- $out['beeraces'] = Category::descendentsByRootParentAndName('bee_colony', 'characteristics', 'subspecies');
- $out['sensortypes'] = Category::descendentsByRootParentAndName('hive', 'app', 'sensor');
- $out['hivedimensions'] = Taxonomy::$hive_type_sizes;
- $out['sensormeasurements'] = Measurement::all();
- $out['alert_rules'] = [];
+ $out['beeraces'] = Category::descendentsByRootParentAndName('bee_colony', 'characteristics', 'subspecies');
+ $out['sensortypes'] = Category::descendentsByRootParentAndName('hive', 'app', 'sensor');
+ $out['hivedimensions'] = Taxonomy::$hive_type_sizes;
+ $out['sensormeasurements'] = Measurement::all();
+ $out['alert_rules'] = [];
$out['alert_rules']['calculations'] = AlertRule::$calculations;
- $out['alert_rules']['comparators'] = AlertRule::$comparators;
- $out['alert_rules']['comparisons'] = AlertRule::$comparisons;
- $out['alert_rules']['exclude_hours']= AlertRule::$exclude_hours;
+ $out['alert_rules']['comparators'] = AlertRule::$comparators;
+ $out['alert_rules']['comparisons'] = AlertRule::$comparisons;
+ $out['alert_rules']['exclude_hours'] = AlertRule::$exclude_hours;
$out['alert_rules']['calc_minutes'] = AlertRule::$calc_minutes;
return $out;
@@ -59,48 +56,48 @@ public function lists(Request $request)
}
/**
- api/taxonomy/taxonomy
+ api/taxonomy/taxonomy
List of current state of the standard categories, translated, unordered/ordered in hierachy/flat.
@queryParam locale string Two character language code to translate taxonomy
@queryParam flat boolean In hierachy (default: true)
@queryParam order boolean Ordered (default: false)
@authenticated
- */
+ */
public function taxonomy(Request $request)
{
- $locale = $request->filled('locale') ? $request->input('locale') : LaravelLocalization::getCurrentLocale();
- $order = ($request->filled('order') && $request->input('order'));
- $flat = ($request->filled('flat') && $request->input('flat'));
-
- $taxonomy = Cache::remember('taxonomy-'.$locale.'-order-'.$order.'-flat-'.$flat, env('CACHE_TIMEOUT_LONG'), function () use ($locale, $order, $flat)
- {
- $out = [];
+ $locale = $request->filled('locale') ? $request->input('locale') : LaravelLocalization::getCurrentLocale();
+ $order = ($request->filled('order') && $request->input('order'));
+ $flat = ($request->filled('flat') && $request->input('flat'));
+
+ $taxonomy = Cache::remember('taxonomy-'.$locale.'-order-'.$order.'-flat-'.$flat, env('CACHE_TIMEOUT_LONG'), function () use ($locale, $order, $flat) {
+ $out = [];
$out['taxonomy'] = $this->getLanguageOrderedTaxonomy($locale, $order, $flat);
+
return $out;
});
return response()->json($taxonomy);
}
- private function getLanguageOrderedTaxonomy($locale='en', $order=false, $flat=false)
+ private function getLanguageOrderedTaxonomy($locale = 'en', $order = false, $flat = false)
{
- if ($order)
- $cheklistRootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->pluck('id');
- else
+ if ($order) {
+ $cheklistRootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->pluck('id');
+ } else {
$cheklistRootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->pluck('id');
-
- $taxonomy = collect();
- foreach ($cheklistRootNodes as $node)
- {
- if ($flat == true && $order == false)
- $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node) );
- else if ($flat == false && $order == false)
- $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node)->toTree() );
- else if ($flat == false && $order == true)
- $taxonomy = $taxonomy->merge(Taxonomy::descendantsAndSelf($node)->whereNotIn('type', ['system'])->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->toTree());
+ }
+
+ $taxonomy = collect();
+ foreach ($cheklistRootNodes as $node) {
+ if ($flat == true && $order == false) {
+ $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node));
+ } elseif ($flat == false && $order == false) {
+ $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node)->toTree());
+ } elseif ($flat == false && $order == true) {
+ $taxonomy = $taxonomy->merge(Taxonomy::descendantsAndSelf($node)->whereNotIn('type', ['system'])->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->toTree());
+ }
}
return $taxonomy;
}
-
}
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index 1b979846..4f8f02f1 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -2,20 +2,20 @@
namespace App\Http\Controllers\Api;
+use App\ChecklistFactory;
+use App\User;
+use Auth;
+use Hash;
+use Illuminate\Auth\Events\Login as ApiTokenLogin;
use Illuminate\Http\Request;
+use Illuminate\Support\Facades\App;
use Illuminate\Support\Str;
-use Illuminate\Auth\Events\Login as ApiTokenLogin;
use Illuminate\Validation\Rule;
-use App\User;
-use App\ChecklistFactory;
-use Response;
-use Validator;
-use Hash;
-use Auth;
-use Password;
use Login;
+use Password;
+use Response;
use Storage;
-use Illuminate\Support\Facades\App;
+use Validator;
/**
* @group Api\UserController
@@ -24,9 +24,8 @@
*/
class UserController extends Controller
{
-
/**
- api/authenticate
+ api/authenticate
Authorize a user and login with an api_token. Used for persistent login in webapp.
Header parameter with Bearer [api_token] from the user object. Example: Bearer 1snu2aRRiwQNl2Tul5F0XpKuZO8hqkgXU4GvjzZ3f3pOCiDPFbBDea7W
@authenticated
@@ -42,18 +41,19 @@ class UserController extends Controller
"policy_accepted": "beep_terms_2018_05_25_avg_v1",
"email_verified_at": "2018-05-25 00:00:00"
}
- */
- public function authenticate(Request $request)
+ */
+ public function authenticate(Request $request)
{
- if ($request->user())
- {
- event( new ApiTokenLogin('api', $request->user(), false) );
-
- if (isset($request->user()->locale))
+ if ($request->user()) {
+ event(new ApiTokenLogin('api', $request->user(), false));
+
+ if (isset($request->user()->locale)) {
App::setlocale($request->user()->locale);
-
+ }
+
return $this->returnToken($request);
}
+
return $this->notAuthenticated($request);
}
@@ -74,45 +74,40 @@ public function authenticate(Request $request)
"policy_accepted": "beep_terms_2018_05_25_avg_v1",
"email_verified_at": "2018-05-25 00:00:00"
}
- */
- public function login(Request $request)
+ */
+ public function login(Request $request)
{
- $credentials = array
- (
+ $credentials =
+ [
'email' => $request->get('email'),
- 'password' => $request->get('password')
- );
+ 'password' => $request->get('password'),
+ ];
- if(Auth::attempt($credentials))
- {
- if ($request->user()->hasVerifiedEmail())
- {
- if (isset($request->user()->locale))
+ if (Auth::attempt($credentials)) {
+ if ($request->user()->hasVerifiedEmail()) {
+ if (isset($request->user()->locale)) {
App::setlocale($request->user()->locale);
-
+ }
+
return $this->returnToken($request);
- }
- else
- {
+ } else {
return $this->notVerified($request);
}
- }
- else
- {
+ } else {
return $this->notAuthenticated($request);
}
}
- public function notVerified(Request $request)
+ public function notVerified(Request $request)
{
return Response::json('email_not_verified', 400);
}
- public function notAuthenticated(Request $request)
+ public function notAuthenticated(Request $request)
{
- return Response::json(["message" => "invalid_user"], 400);
+ return Response::json(['message' => 'invalid_user'], 400);
}
-
+
private function returnToken($request)
{
return Response::json($request->user());
@@ -125,72 +120,64 @@ private function returnToken($request)
@bodyParam password string required Password of the user. Example: testtest
@bodyParam password_confirmation string required Password confirmation of the user. Example: testtest
@bodyParam policy_accepted string required Name of the privacy policy that has been accepted by the user by ticking the accept terms box. Example: beep_terms_2018_05_25_avg_v1
- */
+ */
public function register(Request $request)
{
- $validator = Validator::make
- (
+ $validator = Validator::make(
$request->all(),
- array
- (
- 'email' => 'bail|required|email|unique:users',
- 'name' => 'nullable|string|max:100',
- 'password' => 'required|min:8|confirmed',
- 'policy_accepted'=>'required'
- ),
- array
- (
- 'required' => ':attribute_is_required',
- 'unique' => ':attribute_already_exists',
- 'email' => 'no_valid_email',
- )
- );
+ [
+ 'email' => 'bail|required|email|unique:users',
+ 'name' => 'nullable|string|max:100',
+ 'password' => 'required|min:8|confirmed',
+ 'policy_accepted' => 'required',
+ ],
+
+ [
+ 'required' => ':attribute_is_required',
+ 'unique' => ':attribute_already_exists',
+ 'email' => 'no_valid_email',
+ ]
+ );
// check if the data is validated
- if($validator->fails())
- {
- return Response::json(["message" => $validator->errors()->first()], 400);
- }
- else // save 'm
- {
+ if ($validator->fails()) {
+ return Response::json(['message' => $validator->errors()->first()], 400);
+ } else { // save 'm
$storage = env('IMAGE_STORAGE', 's3');
- $avatar = Storage::disk($storage)->url('avatars/default.jpg');
+ $avatar = Storage::disk($storage)->url('avatars/default.jpg');
$user_data = [
- 'name' => $request->input('name', $request->input('email')),
- 'password' => Hash::make($request->input('password')),
- 'email' => $request->input('email'),
+ 'name' => $request->input('name', $request->input('email')),
+ 'password' => Hash::make($request->input('password')),
+ 'email' => $request->input('email'),
'api_token' => Str::random(60),
'remember_token' => Str::random(10),
- 'policy_accepted'=> $request->input('policy_accepted'),
- 'locale' => $request->input('locale'),
- 'avatar' => $avatar
+ 'policy_accepted' => $request->input('policy_accepted'),
+ 'locale' => $request->input('locale'),
+ 'avatar' => $avatar,
];
// save the user
- $user = User::create($user_data);
+ $user = User::create($user_data);
- // add the standard checklist
+ // add the standard checklist
$checklistFactory = new ChecklistFactory;
- $check = $checklistFactory->getStandardChecklist();
+ $check = $checklistFactory->getStandardChecklist();
$checklistFactory->createUserChecklist($user, $check);
// set the response data
- if($user)
- {
+ if ($user) {
$user->sendApiEmailVerificationNotification();
+
return Response::json(['email_verification_sent'], 201);
- }
- else
- {
+ } else {
return Response::json('could_not_create_user', 500);
}
}
}
-
/**
api/user/reminder
Send password reset link
@@ -199,30 +186,28 @@ public function register(Request $request)
@response{
"message": "reminder_sent"
}
- */
+ */
public function reminder(Request $request)
{
$remind = Password::sendResetLink(['email' => $request->input('email')]);
- switch($remind)
- {
+ switch ($remind) {
case Password::INVALID_USER:
- $code = 400;
- $response = array('message' => 'invalid_user');
- break;
+ $code = 400;
+ $response = ['message' => 'invalid_user'];
+ break;
case Password::RESET_LINK_SENT:
$code = 200;
- $response = array('message' => 'reminder_sent');
- break;
+ $response = ['message' => 'reminder_sent'];
+ break;
}
// return the response
return Response::json($response, $code);
}
-
/**
api/user/reset
Reset the user passowrd with a reset link
@@ -231,59 +216,57 @@ public function reminder(Request $request)
@bodyParam password string required Password of the user. Example: testtest
@bodyParam password_confirmation string required Password confirmation of the user. Example: testtest
@bodyParam token string required Token sent in the reminder e-mail to the email address of the user. Example: z8iQafmgP1
- */
+ */
public function reset(Request $request)
{
// get the input
- $email = $request->input('email');
- $password = $request->input('password');
+ $email = $request->input('email');
+ $password = $request->input('password');
$password_confirm = $request->input('password_confirmation');
- $token = $request->input('token');
+ $token = $request->input('token');
- $credentials = array
- (
- 'email' => $email,
- 'password' => $password,
+ $credentials =
+ [
+ 'email' => $email,
+ 'password' => $password,
'password_confirmation' => $password_confirm,
- 'token' => $token,
- );
+ 'token' => $token,
+ ];
// generate the reset
- $reset = Password::reset($credentials, function($user, $password)
- {
+ $reset = Password::reset($credentials, function ($user, $password) {
$user->password = Hash::make($password);
$user->save();
});
// get the response
- switch ($reset)
- {
+ switch ($reset) {
case Password::INVALID_TOKEN:
- $code = 400;
- $response = array('message' => 'invalid_token');
- break;
+ $code = 400;
+ $response = ['message' => 'invalid_token'];
+ break;
case Password::INVALID_USER:
- $code = 400;
- $response = array('message' => 'invalid_user');
- break;
+ $code = 400;
+ $response = ['message' => 'invalid_user'];
+ break;
case Password::RESET_LINK_SENT:
- $code = 200;
- $response = array('message' => 'reminder_sent');
- break;
+ $code = 200;
+ $response = ['message' => 'reminder_sent'];
+ break;
case Password::PASSWORD_RESET:
- $code = 200;
- $user = User::where('email', $email)->first();
- $response = array
- (
- 'data' => array('api_token' => $user->api_token),
- 'offset' => 0,
- 'count' => 1,
- 'total' => 1,
- );
- break;
+ $code = 200;
+ $user = User::where('email', $email)->first();
+ $response =
+ [
+ 'data' => ['api_token' => $user->api_token],
+ 'offset' => 0,
+ 'count' => 1,
+ 'total' => 1,
+ ];
+ break;
}
// return the response
@@ -294,7 +277,7 @@ public function reset(Request $request)
api/user DELETE
Destroy the logged in user and all its data in the database
@authenticated
- */
+ */
public function destroy(Request $request)
{
$user = $request->user();
@@ -302,14 +285,16 @@ public function destroy(Request $request)
$request->all(), ['password' => 'required|string|min:8']
);
- if($validator->fails())
+ if ($validator->fails()) {
return Response::json(['message' => $validator->errors()->first()], 500);
- else if (Hash::check($request->input('password'), $user->password) == false)
+ } elseif (Hash::check($request->input('password'), $user->password) == false) {
return Response::json(['message' => 'invalid_password'], 500);
-
+ }
+
$del = $request->user()->delete();
- if ($del)
+ if ($del) {
return Response::json(['message' => 'user_deleted'], 200);
+ }
return Response::json(['message' => 'user_not_deleted'], 400);
}
@@ -325,152 +310,137 @@ public function destroy(Request $request)
@bodyParam password_confirmation string Password confirmation of the user, required if password_new is filled. Example: testtest1
@bodyParam policy_accepted string Name of the privacy policy that has been accepted by the user by ticking the accept terms box. Example: beep_terms_2018_05_25_avg_v1
@bodyParam locale string Locale string to define locale. Example: en
- */
+ */
public function edit(Request $request)
{
$user = $request->user();
$save = false;
$newk = true;
- $validator = Validator::make
- (
+ $validator = Validator::make(
$request->all(),
- array
- (
- 'email' => [
- 'bail',
- 'required',
- 'email',
- Rule::unique('users')->ignore($user->id),
- ],
- 'name' => 'nullable|string|max:100',
- 'password' => 'nullable|required_with:password_new|string|min:8', # only let locale be editable without password
- 'password_new' => 'nullable|required_with:password_confirmation|string|min:8',
+
+ [
+ 'email' => [
+ 'bail',
+ 'required',
+ 'email',
+ Rule::unique('users')->ignore($user->id),
+ ],
+ 'name' => 'nullable|string|max:100',
+ 'password' => 'nullable|required_with:password_new|string|min:8', // only let locale be editable without password
+ 'password_new' => 'nullable|required_with:password_confirmation|string|min:8',
'password_confirmation' => 'nullable|required_with:password_new|same:password_new',
- 'locale' => 'nullable|string|min:2',
- 'policy_accepted' => 'nullable',
- ),
- array
- (
- 'required' => ':attribute_is_required',
- 'unique' => ':attribute_already_exists',
- 'email' => 'no_valid_email',
- 'confirmed' => 'no_password_match',
- 'same' => 'no_password_match',
- )
+ 'locale' => 'nullable|string|min:2',
+ 'policy_accepted' => 'nullable',
+ ],
+
+ [
+ 'required' => ':attribute_is_required',
+ 'unique' => ':attribute_already_exists',
+ 'email' => 'no_valid_email',
+ 'confirmed' => 'no_password_match',
+ 'same' => 'no_password_match',
+ ]
);
- if($validator->fails())
- {
+ if ($validator->fails()) {
return Response::json(['message' => $validator->errors()->first()], 400);
- }
- else if (($request->filled('password_new') || ($request->filled('email') && $request->input('email') != $user->email) || ($request->filled('name') && $request->input('name') != $user->name) || ($request->filled('policy_accepted') && $request->input('policy_accepted') != $user->policy_accepted)) && Hash::check($request->input('password'), $user->password) == false)
- {
+ } elseif (($request->filled('password_new') || ($request->filled('email') && $request->input('email') != $user->email) || ($request->filled('name') && $request->input('name') != $user->name) || ($request->filled('policy_accepted') && $request->input('policy_accepted') != $user->policy_accepted)) && Hash::check($request->input('password'), $user->password) == false) {
return Response::json(['message' => 'invalid_password'], 400);
- }
- else // save 'm
- {
- if($request->filled('locale') && $request->input('locale') != $user->locale)
- {
+ } else { // save 'm
+ if ($request->filled('locale') && $request->input('locale') != $user->locale) {
$user->locale = $request->input('locale');
$save = true;
$newk = false;
}
-
- if($request->filled('name') && $request->input('name') != $user->name)
- {
+
+ if ($request->filled('name') && $request->input('name') != $user->name) {
$user->name = $request->input('name');
$save = true;
}
$email_changed = false;
- if($request->filled('email') && $request->input('email') != $user->email)
- {
+ if ($request->filled('email') && $request->input('email') != $user->email) {
$user->email = $request->input('email');
$user->email_verified_at = null;
$email_changed = true;
$save = true;
}
- if($request->filled('policy_accepted') && $request->input('policy_accepted') != $user->policy_accepted && $request->input('policy_accepted') != false)
- {
+ if ($request->filled('policy_accepted') && $request->input('policy_accepted') != $user->policy_accepted && $request->input('policy_accepted') != false) {
$user->policy_accepted = $request->input('policy_accepted');
$save = true;
- }
- else if ($request->filled('policy_accepted') == false || $request->input('policy_accepted') == false)
- {
+ } elseif ($request->filled('policy_accepted') == false || $request->input('policy_accepted') == false) {
$user->policy_accepted = null;
$save = true;
}
- if($request->filled('password_new') && $request->filled('password_confirmation') && $request->input('password_new') == $request->input('password_confirmation'))
- {
+ if ($request->filled('password_new') && $request->filled('password_confirmation') && $request->input('password_new') == $request->input('password_confirmation')) {
$user->password = Hash::make($request->input('password_new'));
$save = true;
}
- if ($save)
- {
- if ($newk)
+ if ($save) {
+ if ($newk) {
$user->api_token = Str::random(60);
-
+ }
+
$saved = $user->save();
- if ($email_changed)
+ if ($email_changed) {
$user->sendApiEmailVerificationNotification();
+ }
- if ($saved)
+ if ($saved) {
return Response::json($user, 200);
+ }
}
}
+
return Response::json(['message' => 'user_not_edited'], 400);
}
-
+
/**
api/userlocale PATCH
Edit the user locale only, do not update api_key
@authenticated
@bodyParam locale string Two digit country string to define locale
- */
+ */
public function userlocale(Request $request)
{
$user = $request->user();
$save = false;
-
- $validator = Validator::make
- (
+
+ $validator = Validator::make(
$request->all(),
- array
- (
- 'locale' => 'required|string|min:2|max:2',
- ),
- array
- (
+
+ [
+ 'locale' => 'required|string|min:2|max:2',
+ ],
+
+ [
'required' => ':attribute_is_required',
- )
+ ]
);
- if($validator->fails())
- {
+ if ($validator->fails()) {
return Response::json(['message' => $validator->errors()->first()], 500);
- }
- else // save 'm
- {
- if($request->filled('locale') && $request->input('locale') != $user->locale)
- {
+ } else { // save 'm
+ if ($request->filled('locale') && $request->input('locale') != $user->locale) {
$user->locale = $request->input('locale');
$save = true;
}
-
- if ($save)
- {
+
+ if ($save) {
$saved = $user->save();
- if ($saved)
+ if ($saved) {
return Response::json($user, 200);
+ }
}
}
+
return Response::json(['message' => 'user_not_edited'], 500);
}
-
}
diff --git a/app/Http/Controllers/Api/WeatherController.php b/app/Http/Controllers/Api/WeatherController.php
index 84d817cc..12bc2794 100644
--- a/app/Http/Controllers/Api/WeatherController.php
+++ b/app/Http/Controllers/Api/WeatherController.php
@@ -2,9 +2,7 @@
namespace App\Http\Controllers\Api;
-use App\Http\Requests;
use App\Http\Controllers\Controller;
-
use App\Weather;
use Illuminate\Http\Request;
@@ -22,19 +20,20 @@ class WeatherController extends Controller
*/
public function index(Request $request)
{
- $lat = $request->filled('lat') ? $request->input('lat') : null;
- $lon = $request->filled('lon') ? $request->input('lon') : null;
+ $lat = $request->filled('lat') ? $request->input('lat') : null;
+ $lon = $request->filled('lon') ? $request->input('lon') : null;
$location = $request->filled('location_id') ? $request->user()->locations()->where('coordinate_lat', '!=', null)->where('coordinate_lon', '!=', null)->find($request->input('location_id')) : null;
-
- $result = Weather::callApi($location, $lat, $lon);
- if (gettype($result) == 'string')
- return response($result)->header('Content-Type','application/json'); // header required for $result has to be read from disk also
+ $result = Weather::callApi($location, $lat, $lon);
+
+ if (gettype($result) == 'string') {
+ return response($result)->header('Content-Type', 'application/json');
+ } // header required for $result has to be read from disk also
- if (gettype($result) == 'array' && isset($result['error']))
+ if (gettype($result) == 'array' && isset($result['error'])) {
return response()->json($result['error']['msg'], $result['error']['code']);
+ }
return response()->json('error_type_is_'.gettype($result), 500);
}
}
-
diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php
index 23f4c4c1..967e465a 100644
--- a/app/Http/Controllers/AppController.php
+++ b/app/Http/Controllers/AppController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-
class AppController extends Controller
{
//
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 1f5b6947..87e997ff 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 Auth;
+use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
@@ -38,9 +38,10 @@ public function __construct()
$this->middleware('guest')->except('logout');
}
- public function logout()
+ public function logout()
{
Auth::logout();
+
return redirect('/login');
}
}
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 6c8b049d..e72d4467 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers\Auth;
-use App\User;
use App\Http\Controllers\Controller;
-use Illuminate\Support\Str;
+use App\User;
+use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
-use Illuminate\Foundation\Auth\RegistersUsers;
+use Illuminate\Support\Str;
class RegisterController extends Controller
{
@@ -44,7 +44,6 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
*
- * @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
@@ -60,7 +59,6 @@ protected function validator(array $data)
/**
* Create a new user instance after a valid registration.
*
- * @param array $data
* @return \App\User
*/
protected function create(array $data)
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index fa4906b4..cf726eec 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -26,7 +26,7 @@ class ResetPasswordController extends Controller
* @var string
*/
protected $redirectTo = '/home';
-
+
/**
* Create a new controller instance.
*
diff --git a/app/Http/Controllers/CalculationModelController.php b/app/Http/Controllers/CalculationModelController.php
index ddcf2e39..ba77fc52 100644
--- a/app/Http/Controllers/CalculationModelController.php
+++ b/app/Http/Controllers/CalculationModelController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
use App\Models\CalculationModel;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 25;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$calculationmodel = CalculationModel::where('name', 'LIKE', "%$keyword%")
->orWhere('measurement_id', 'LIKE', "%$keyword%")
->orWhere('data_measurement_id', 'LIKE', "%$keyword%")
@@ -47,22 +44,22 @@ public function index(Request $request)
*/
public function create()
{
- $calculationmodel = new CalculationModel();
+ $calculationmodel = new CalculationModel;
+
return view('calculation-model.create');
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
CalculationModel::create($requestData);
return redirect('calculation-model')->with('flash_message', 'CalculationModel added!');
@@ -72,7 +69,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -82,20 +78,18 @@ public function show($id)
return view('calculation-model.show', compact('calculationmodel'));
}
-
public function run(Request $request, $id)
{
$calculationmodel = CalculationModel::findOrFail($id);
- $model_result = $calculationmodel->run_model($request->user());
+ $model_result = $calculationmodel->run_model($request->user());
- return view('calculation-model.show', compact('calculationmodel','model_result'));
+ return view('calculation-model.show', compact('calculationmodel', 'model_result'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -108,16 +102,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$calculationmodel = CalculationModel::findOrFail($id);
$calculationmodel->update($requestData);
@@ -128,7 +120,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.php
index 1be03428..03a8d219 100755
--- a/app/Http/Controllers/CategoriesController.php
+++ b/app/Http/Controllers/CategoriesController.php
@@ -1,83 +1,78 @@
categoryFactory = $categoryFactory;
}
- public function index()
- {
- // $tax = $this->categoryFactory->parse_taxonomy();
- // die(print_r($tax));
+ public function index()
+ {
+ // $tax = $this->categoryFactory->parse_taxonomy();
+ // die(print_r($tax));
$cats = Category::all();
- $count= $cats->count();
+ $count = $cats->count();
$tree = $cats->toTree();
- return view('categories.index', compact('tree', 'count'));
- }
+ return view('categories.index', compact('tree', 'count'));
+ }
- /**
- * Show the form for creating a new resource.
- *
- * @return Response
- */
- public function create(Request $input)
- {
+ /**
+ * Show the form for creating a new resource.
+ *
+ * @return Response
+ */
+ public function create(Request $input)
+ {
$data = $input->only('parent_id');
$tree = Category::all()->toTree();
$categories = $this->getCategoryOptions();
- return view('categories.create', compact('data', 'categories', 'tree'));
- }
+ return view('categories.create', compact('data', 'categories', 'tree'));
+ }
/**
* Store a newly created resource in storage.
*
- * @param PostCategoryRequest $input
*
* @return Response
*/
- public function store(PostCategoryRequest $input)
+ public function store(PostCategoryRequest $input)
{
$category = null;
- if ($input->filled('name'))
- {
+ if ($input->filled('name')) {
$category = $this->storeOne($input->all());
- if ($category)
- return redirect()->route('categories.show', [ $category->getKey() ])->with('success', 'Category successfully created!');
- }
- elseif ($input->filled('names'))
- {
+ if ($category) {
+ return redirect()->route('categories.show', [$category->getKey()])->with('success', 'Category successfully created!');
+ }
+ } elseif ($input->filled('names')) {
$categories = $this->storeMultiple($input->all());
- if ($categories)
+ if ($categories) {
return redirect()->route('categories.index')->with('success', 'Categories successfully created!');
+ }
}
return redirect()->route('categories.index')->with('error', 'Category has no name');
@@ -85,70 +80,62 @@ public function store(PostCategoryRequest $input)
private function storeOne($new)
{
- if (isset($new['name']) && $new['name'] != null)
- {
- $parent = isset($inputArray['parent_id']) ? Category::find($inputArray['parent_id']) : null;
- $name = trim(str_replace(' ', '_', strtolower($new['name'])));
+ if (isset($new['name']) && $new['name'] != null) {
+ $parent = isset($inputArray['parent_id']) ? Category::find($inputArray['parent_id']) : null;
+ $name = trim(str_replace(' ', '_', strtolower($new['name'])));
$new['name'] = $name;
Translation::createTranslations($name, 'category');
-
+
return Category::create($new, $parent);
}
+
return null;
}
- static function makeCatArray(&$item, $key)
+ public static function makeCatArray(&$item, $key)
{
$item['name'] = $key;
- if ($item->hasChildren())
+ if ($item->hasChildren()) {
$item['children'] = $item->children();
+ }
}
-
private function storeMultiple($inputArray)
{
// assume text area with lines that are indented by one or multiple spaces in front
- $parent = isset($inputArray['parent_id']) ? Category::find($inputArray['parent_id']) : null;
- $category_input_id = isset($inputArray['category_input_id']) ? $inputArray['category_input_id'] : null;
+ $parent = isset($inputArray['parent_id']) ? Category::find($inputArray['parent_id']) : null;
+ $category_input_id = isset($inputArray['category_input_id']) ? $inputArray['category_input_id'] : null;
$physical_quantity_id = isset($inputArray['physical_quantity_id']) ? $inputArray['physical_quantity_id'] : null;
- $assoc_array = $this->parseLinesToArray($inputArray['names']);
+ $assoc_array = $this->parseLinesToArray($inputArray['names']);
- if (count($assoc_array) > 0)
- {
- foreach ($assoc_array as $name => $children)
- {
- $cat_array = $this->splitLineIntoCategoryArray($name, $category_input_id, $physical_quantity_id);
+ if (count($assoc_array) > 0) {
+ foreach ($assoc_array as $name => $children) {
+ $cat_array = $this->splitLineIntoCategoryArray($name, $category_input_id, $physical_quantity_id);
$base_cat_input_id = $cat_array['category_input_id'];
- $temp_parent = Category::create($cat_array, $parent);
+ $temp_parent = Category::create($cat_array, $parent);
Translation::createTranslations($cat_array['name'], 'category');
- if(count($children) > 0) // holds children
- {
- foreach ($children as $child_name => $sub_children)
- {
- $sub_cat_input_id= $this->getChildInputTypeId($base_cat_input_id);
- $cat_array = $this->splitLineIntoCategoryArray($child_name, $sub_cat_input_id, $physical_quantity_id);
- $sub_cat_input_id= $cat_array['category_input_id'];
+ if (count($children) > 0) { // holds children
+ foreach ($children as $child_name => $sub_children) {
+ $sub_cat_input_id = $this->getChildInputTypeId($base_cat_input_id);
+ $cat_array = $this->splitLineIntoCategoryArray($child_name, $sub_cat_input_id, $physical_quantity_id);
+ $sub_cat_input_id = $cat_array['category_input_id'];
$sub_temp_parent = Category::create($cat_array, $temp_parent);
Translation::createTranslations($cat_array['name'], 'category');
- if(count($sub_children) > 0) // holds children
- {
- foreach ($sub_children as $sub_child_name => $sub_sub_children)
- {
- $sub_sub_cat_input_id = $this->getChildInputTypeId($sub_cat_input_id);
- $cat_array = $this->splitLineIntoCategoryArray($sub_child_name, $sub_sub_cat_input_id);
+ if (count($sub_children) > 0) { // holds children
+ foreach ($sub_children as $sub_child_name => $sub_sub_children) {
+ $sub_sub_cat_input_id = $this->getChildInputTypeId($sub_cat_input_id);
+ $cat_array = $this->splitLineIntoCategoryArray($sub_child_name, $sub_sub_cat_input_id);
$sub_sub_cat_input_id = $cat_array['category_input_id'];
- $sub_sub_temp_parent = Category::create($cat_array, $sub_temp_parent);
+ $sub_sub_temp_parent = Category::create($cat_array, $sub_temp_parent);
Translation::createTranslations($cat_array['name'], 'category');
- if(count($sub_sub_children) > 0) // holds children
- {
- foreach ($sub_sub_children as $sub_sub_child_name => $sub_sub_sub_children)
- {
- $sub_sub_sub_cat_input_id = $this->getChildInputTypeId($sub_sub_cat_input_id);
- $cat_array = $this->splitLineIntoCategoryArray($sub_sub_child_name, $sub_sub_sub_cat_input_id);
+ if (count($sub_sub_children) > 0) { // holds children
+ foreach ($sub_sub_children as $sub_sub_child_name => $sub_sub_sub_children) {
+ $sub_sub_sub_cat_input_id = $this->getChildInputTypeId($sub_sub_cat_input_id);
+ $cat_array = $this->splitLineIntoCategoryArray($sub_sub_child_name, $sub_sub_sub_cat_input_id);
Category::create($cat_array, $sub_sub_temp_parent);
Translation::createTranslations($cat_array['name'], 'category');
}
@@ -158,28 +145,27 @@ private function storeMultiple($inputArray)
}
}
}
+
return $parent;
}
+
return null;
}
-
private function getChildInputTypeId($category_input_id)
{
- $category_input = CategoryInput::find($category_input_id);
+ $category_input = CategoryInput::find($category_input_id);
$child_category_input_id = CategoryInput::getTypeId('label');
- if ($category_input)
- {
- switch($category_input->type)
- {
- case "label":
- case "boolean":
- case "boolean_yes_red":
+ if ($category_input) {
+ switch ($category_input->type) {
+ case 'label':
+ case 'boolean':
+ case 'boolean_yes_red':
$child_category_input_id = CategoryInput::getTypeId('number_positive');
break;
- case "list":
- case "select":
+ case 'list':
+ case 'select':
$child_category_input_id = CategoryInput::getTypeId('list_item');
break;
default:
@@ -191,206 +177,197 @@ private function getChildInputTypeId($category_input_id)
return $child_category_input_id;
}
-
- private function splitLineIntoCategoryArray($line, $ci_id=null, $pq_id=null)
+ private function splitLineIntoCategoryArray($line, $ci_id = null, $pq_id = null)
{
- $out = ['name'=>'', 'category_input_id'=>$ci_id, 'physical_quantity_id'=>$pq_id, 'description'=>null, 'source'=>null];
+ $out = ['name' => '', 'category_input_id' => $ci_id, 'physical_quantity_id' => $pq_id, 'description' => null, 'source' => null];
// check for category input type, physical quantity (pq), and description (d)
- $line_arr = explode('|', $line);
+ $line_arr = explode('|', $line);
$out['name'] = str_replace(' ', '_', $line_arr[0]);
$var_num = count($line_arr);
- if ($var_num > 0)
- {
- for ($i=1; $i < $var_num; $i++)
- {
+ if ($var_num > 0) {
+ for ($i = 1; $i < $var_num; $i++) {
$var_arr = explode('=', $line_arr[$i]);
- if (count($var_arr) == 2)
- {
+ if (count($var_arr) == 2) {
switch ($var_arr[0]) {
case 't':
- $out['category_input_id'] = CategoryInput::getTypeId($var_arr[1]);
- break;
+ $out['category_input_id'] = CategoryInput::getTypeId($var_arr[1]);
+ break;
case 'pq':
- $out['physical_quantity_id'] = PhysicalQuantity::getAbbreviationId($var_arr[1]);
- break;
+ $out['physical_quantity_id'] = PhysicalQuantity::getAbbreviationId($var_arr[1]);
+ break;
case 'pq_id':
- $out['physical_quantity_id'] = $var_arr[1];
- break;
+ $out['physical_quantity_id'] = $var_arr[1];
+ break;
case 'd':
- $out['description'] = $var_arr[1];
- break;
+ $out['description'] = $var_arr[1];
+ break;
case 's':
- $out['source'] = $var_arr[1];
- break;
+ $out['source'] = $var_arr[1];
+ break;
default:
- # code...
- break;
+ // code...
+ break;
}
}
}
}
+
return $out;
}
- private function parseLinesToArray($list, $indentation = "\t") {
- $result = array();
- $path = array();
-
- foreach (explode("\r\n", $list) as $line) {
- // get depth and label
- $depth = 0;
- while (substr($line, 0, strlen($indentation)) === $indentation) {
- $depth += 1;
- $line = substr($line, strlen($indentation));
- }
+ private function parseLinesToArray($list, $indentation = "\t")
+ {
+ $result = [];
+ $path = [];
+
+ foreach (explode("\r\n", $list) as $line) {
+ // get depth and label
+ $depth = 0;
+ while (substr($line, 0, strlen($indentation)) === $indentation) {
+ $depth += 1;
+ $line = substr($line, strlen($indentation));
+ }
- // truncate path if needed
- while ($depth < sizeof($path)) {
- array_pop($path);
- }
+ // truncate path if needed
+ while ($depth < count($path)) {
+ array_pop($path);
+ }
- // keep label (at depth)
- $path[$depth] = $line;
+ // keep label (at depth)
+ $path[$depth] = $line;
- // traverse path and add label to result
- $parent =& $result;
- foreach ($path as $depth => $key)
- {
- if (!isset($parent[$key]))
- {
- $parent[$line] = array();
- break;
- }
+ // traverse path and add label to result
+ $parent = &$result;
+ foreach ($path as $depth => $key) {
+ if (! isset($parent[$key])) {
+ $parent[$line] = [];
+ break;
+ }
- $parent =& $parent[$key];
+ $parent = &$parent[$key];
+ }
}
- }
- // return
- return $result;
+ // return
+ return $result;
}
- /**
- * Display the specified resource.
- *
- * @param int $id
- * @return Response
- */
- public function show($id)
- {
- $cats = Category::all();
- $count= $cats->count();
+ /**
+ * Display the specified resource.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function show($id)
+ {
+ $cats = Category::all();
+ $count = $cats->count();
$tree = $cats->toTree();
$category = Category::findOrFail($id);
- $categories = $this->getCategoryOptions();
+ $categories = $this->getCategoryOptions();
return view('categories.show', compact('category', 'categories', 'tree', 'count'));
- }
-
-
- /**
- * Show the form for editing the specified resource.
- *
- * @param int $id
- * @return Response
- */
- public function edit($id)
- {
- $cats = Category::all();
- $count= $cats->count();
+ }
+
+ /**
+ * Show the form for editing the specified resource.
+ *
+ * @param int $id
+ * @return Response
+ */
+ public function edit($id)
+ {
+ $cats = Category::all();
+ $count = $cats->count();
$tree = $cats->toTree();
- $category = Category::findOrFail($id);
+ $category = Category::findOrFail($id);
- $categories = $this->getCategoryOptions($category);
+ $categories = $this->getCategoryOptions($category);
- return view('categories.edit', compact('category', 'categories', 'tree', 'count'));
- }
+ return view('categories.edit', compact('category', 'categories', 'tree', 'count'));
+ }
- /**
- * Update the specified resource in storage.
- *
- * @param int $id
- * @return Response
- */
+ /**
+ * Update the specified resource in storage.
+ *
+ * @param int $id
+ * @return Response
+ */
public function update(PostCategoryRequest $input, $id)
{
$category = Category::findOrFail($id);
- if ($input->filled('name'))
- {
+ if ($input->filled('name')) {
$name = strtolower(trim($input->input('name')));
-
- $cat_input =
+
+ $cat_input =
[
- 'name' => $name,
- 'source' => $input->input('source'),
- 'type' => $input->input('type'),
- 'description' => $input->input('description'),
- 'parent_id' => $input->input('parent_id', null),
- 'category_input_id' => null,
- 'physical_quantity_id' => null,
- 'old_id' => null,
- 'required' => false,
+ 'name' => $name,
+ 'source' => $input->input('source'),
+ 'type' => $input->input('type'),
+ 'description' => $input->input('description'),
+ 'parent_id' => $input->input('parent_id', null),
+ 'category_input_id' => null,
+ 'physical_quantity_id' => null,
+ 'old_id' => null,
+ 'required' => false,
];
-
+
// Handle the upload of an icon
- if($input->hasFile('icon'))
- {
+ if ($input->hasFile('icon')) {
$icon = $input->file('icon');
- $ext = $icon->getClientOriginalExtension();
- $img = $icon;
- if ($ext != 'svg')
- {
+ $ext = $icon->getClientOriginalExtension();
+ $img = $icon;
+ if ($ext != 'svg') {
$file = Str::random(40).'.'.$ext;
Image::make($icon)->resize(100, 100)->save(public_path('/storage/icons/'.$file));
$cat_input['icon'] = $file;
- }
- else
- {
+ } else {
$cat_input['icon'] = $img->store('/', 'icons');
}
}
// Handle input_type
- if ($input->has('category_input_id'))
+ if ($input->has('category_input_id')) {
$cat_input['category_input_id'] = $input->input('category_input_id');
+ }
// Handle physical_quantity
- if ($input->has('physical_quantity_id'))
+ if ($input->has('physical_quantity_id')) {
$cat_input['physical_quantity_id'] = $input->input('physical_quantity_id');
+ }
// Handle old_id
- if ($input->has('old_id'))
+ if ($input->has('old_id')) {
$cat_input['old_id'] = $input->input('old_id');
+ }
$category->update($cat_input);
// Handle language
$createTranslationsForEmptyLanguages = false;
- if ($input->has('language'))
- {
- foreach($input->input('language') as $abbr => $text)
- {
- if ($text == '')
+ if ($input->has('language')) {
+ foreach ($input->input('language') as $abbr => $text) {
+ if ($text == '') {
$createTranslationsForEmptyLanguages = true;
- else
+ } else {
Translation::saveText($abbr, $input->input('name'), 'category', $text);
+ }
}
- }
- else
- {
+ } else {
$createTranslationsForEmptyLanguages = true;
}
- if ($createTranslationsForEmptyLanguages)
+ if ($createTranslationsForEmptyLanguages) {
Translation::createTranslations($name, 'category');
+ }
- return redirect()->route('categories.show', [ $id ])->with('success', 'Category successfully updated!');
+ return redirect()->route('categories.show', [$id])->with('success', 'Category successfully updated!');
}
- return redirect()->route('categories.show', [ $id ])->with('error', 'Category name is required!');
+ return redirect()->route('categories.show', [$id])->with('error', 'Category name is required!');
}
public function duplicate($id)
@@ -404,10 +381,9 @@ public function duplicate($id)
$copy['physical_quantity_id'] = $category->physical_quantity_id;
$copy_cat = Category::create($copy);
- if ($category && $category->hasChildren())
+ if ($category && $category->hasChildren()) {
$category->children()->each(
- function($c) use ($copy_cat)
- {
+ function ($c) use ($copy_cat) {
$copy = $c->toArray();
unset($copy['id']);
$copy['parent_id'] = $copy_cat->id;
@@ -416,116 +392,99 @@ function($c) use ($copy_cat)
Category::create($copy);
}
);
-
-
+ }
return redirect()->route('categories.index')->with('success', 'Category duplicated');
}
-
- public function fix($id)
+ public function fix($id)
{
- $inputTypeListId = CategoryInput::where('type','list')->value('id');
- $inputTypeLisItemtId = CategoryInput::where('type','list_item')->value('id');
- $inputLabelItemId = CategoryInput::where('type','label')->value('id');
- $inputSelectItemId = CategoryInput::where('type','select')->value('id');
- $inputOptionsItemId = CategoryInput::where('type','options')->value('id');
- $inputBooleanItemId = CategoryInput::where('type','boolean')->value('id');
-
+ $inputTypeListId = CategoryInput::where('type', 'list')->value('id');
+ $inputTypeLisItemtId = CategoryInput::where('type', 'list_item')->value('id');
+ $inputLabelItemId = CategoryInput::where('type', 'label')->value('id');
+ $inputSelectItemId = CategoryInput::where('type', 'select')->value('id');
+ $inputOptionsItemId = CategoryInput::where('type', 'options')->value('id');
+ $inputBooleanItemId = CategoryInput::where('type', 'boolean')->value('id');
+
// Change lists with not only list_items for labels
- $listCategories = Category::whereNotIn('type', ['system'])->where('category_input_id',$inputTypeListId)->get();
-
- //die(print_r($listCategories->toArray()));
- $itemsUnListed = 0;
+ $listCategories = Category::whereNotIn('type', ['system'])->where('category_input_id', $inputTypeListId)->get();
+
+ // die(print_r($listCategories->toArray()));
+ $itemsUnListed = 0;
$itemsOptionized = 0;
- $itemsBooleanized= 0;
- foreach ($listCategories as $cat)
- {
- //die(print_r($cat->children()->get()->toArray()));
- $childCount = $cat->children()->count();
- if ($childCount > 0)
- {
- $onlyListItems = true;
- foreach ($cat->children()->get() as $child)
- {
- if ($child->category_input_id != $inputTypeLisItemtId)
- $onlyListItems = false;
-
- }
- if ($onlyListItems) // make options (select ONE option)
- {
- // $cat->category_input_id = $inputOptionsItemId;
- // $itemsOptionized += $cat->save();
- }
- else // make label (category holder)
- {
- $cat->category_input_id = $inputLabelItemId;
- $itemsUnListed += $cat->save();
- }
- }
- else // make Boolean (checkbox)
- {
- // $cat->category_input_id = $inputBooleanItemId;
- // $itemsBooleanized += $cat->save();
- }
+ $itemsBooleanized = 0;
+ foreach ($listCategories as $cat) {
+ // die(print_r($cat->children()->get()->toArray()));
+ $childCount = $cat->children()->count();
+ if ($childCount > 0) {
+ $onlyListItems = true;
+ foreach ($cat->children()->get() as $child) {
+ if ($child->category_input_id != $inputTypeLisItemtId) {
+ $onlyListItems = false;
+ }
+
+ }
+ if ($onlyListItems) { // make options (select ONE option)
+ // $cat->category_input_id = $inputOptionsItemId;
+ // $itemsOptionized += $cat->save();
+ } else { // make label (category holder)
+ $cat->category_input_id = $inputLabelItemId;
+ $itemsUnListed += $cat->save();
+ }
+ } else { // make Boolean (checkbox)
+ // $cat->category_input_id = $inputBooleanItemId;
+ // $itemsBooleanized += $cat->save();
+ }
}
// Change options items with explicit 4 categories to score
- $optionsCategories = Category::whereNotIn('type', ['system'])->whereIn('category_input_id',[$inputOptionsItemId,$inputSelectItemId])->hasChildren()->get();
- //die(print_r($listCategories->toArray()));
+ $optionsCategories = Category::whereNotIn('type', ['system'])->whereIn('category_input_id', [$inputOptionsItemId, $inputSelectItemId])->hasChildren()->get();
+ // die(print_r($listCategories->toArray()));
$itemsScoreized = 0;
- foreach ($optionsCategories as $cat)
- {
- $testArray = [
- 'score_quality'=>['poor','fair','good','excellent'],
- 'score_amount'=>['low','medium','high','extreme']
- ];
-
- $childCount = $cat->children()->count();
- if ($childCount == 4)
- {
- $optionsString = implode($cat->children()->pluck('name')->toArray());
- foreach ($testArray as $replaceBy => $checkValues)
- {
- $replaceCategoryInputId = CategoryInput::where('type',$replaceBy)->value('id');
-
- if ($replaceCategoryInputId && implode($checkValues) == $optionsString)
- {
- //die(print_r( [$optionsString, implode($checkValues)] ));
- $cat->category_input_id = $replaceCategoryInputId;
- if ($cat->save())
- {
- $itemsScoreized++;
- foreach ($cat->children()->get() as $opt)
- {
- $opt->delete();
- }
- }
- }
- }
- }
+ foreach ($optionsCategories as $cat) {
+ $testArray = [
+ 'score_quality' => ['poor', 'fair', 'good', 'excellent'],
+ 'score_amount' => ['low', 'medium', 'high', 'extreme'],
+ ];
+
+ $childCount = $cat->children()->count();
+ if ($childCount == 4) {
+ $optionsString = implode($cat->children()->pluck('name')->toArray());
+ foreach ($testArray as $replaceBy => $checkValues) {
+ $replaceCategoryInputId = CategoryInput::where('type', $replaceBy)->value('id');
+
+ if ($replaceCategoryInputId && implode($checkValues) == $optionsString) {
+ // die(print_r( [$optionsString, implode($checkValues)] ));
+ $cat->category_input_id = $replaceCategoryInputId;
+ if ($cat->save()) {
+ $itemsScoreized++;
+ foreach ($cat->children()->get() as $opt) {
+ $opt->delete();
+ }
+ }
+ }
+ }
+ }
}
// Change label items with only list_items for select items
- $labelCategories = Category::whereNotIn('type', ['system'])->where('category_input_id',$inputLabelItemId)->hasChildren()->get();
- //die(print_r($listCategories->toArray()));
+ $labelCategories = Category::whereNotIn('type', ['system'])->where('category_input_id', $inputLabelItemId)->hasChildren()->get();
+ // die(print_r($listCategories->toArray()));
$itemsUnLabeled = 0;
- foreach ($labelCategories as $cat)
- {
- $onlyListItems = true;
- //die(print_r($cat->children()->get()->toArray()));
- foreach ($cat->children()->get() as $child)
- {
- if ($child->category_input_id != $inputTypeLisItemtId)
- $onlyListItems = false;
-
- }
- if ($onlyListItems == true)
- {
- //die(print_r(['id'=>$inputLabelItemId, 'cat'=>$cat->toArray()]));
- $cat->category_input_id = $inputSelectItemId;
- $itemsUnLabeled += $cat->save();
- }
+ foreach ($labelCategories as $cat) {
+ $onlyListItems = true;
+ // die(print_r($cat->children()->get()->toArray()));
+ foreach ($cat->children()->get() as $child) {
+ if ($child->category_input_id != $inputTypeLisItemtId) {
+ $onlyListItems = false;
+ }
+
+ }
+ if ($onlyListItems == true) {
+ // die(print_r(['id'=>$inputLabelItemId, 'cat'=>$cat->toArray()]));
+ $cat->category_input_id = $inputSelectItemId;
+ $itemsUnLabeled += $cat->save();
+ }
}
Category::fixTree(); // kalnoy/nestedset: to fix the tree to fill _lft and _rgt columns
@@ -533,27 +492,24 @@ public function fix($id)
return redirect()->route('categories.index')->with('success', "Taxonomy successfully fixed! Changed $itemsUnListed list items to label. Changed $itemsUnLabeled label items to select. Changed $itemsOptionized items from list to options. Changed $itemsBooleanized empty lists to boolean. Converted $itemsScoreized options lists with score to score (5 stars) item.");
}
- public function pop($id)
+ public function pop($id)
{
$category = Category::findOrFail($id);
- if ($category && $category->useAmount() == 0 && $category->hasChildren())
- {
-
- if ($category->isRoot())
- {
- $category->children()->each(function($c){$c->saveAsRoot();});
- }
- else
- {
- $p_id = $category->parent()->value('id');
-
- foreach ($category->children()->get() as $c)
- {
- $c->parent_id = $p_id;
- $c->save();
- };
- }
+ if ($category && $category->useAmount() == 0 && $category->hasChildren()) {
+
+ if ($category->isRoot()) {
+ $category->children()->each(function ($c) {
+ $c->saveAsRoot();
+ });
+ } else {
+ $p_id = $category->parent()->value('id');
+
+ foreach ($category->children()->get() as $c) {
+ $c->parent_id = $p_id;
+ $c->save();
+ }
+ }
}
return $this->destroy($id);
@@ -563,53 +519,49 @@ public function destroy($id)
{
$category = Category::findOrFail($id);
- if ($category)
- {
- if ($category->useAmount() > 0)
- return redirect()->route('categories.index')->with('error','Category is used '.$category->useAmount().'x, so cannot be deleted');
+ if ($category) {
+ if ($category->useAmount() > 0) {
+ return redirect()->route('categories.index')->with('error', 'Category is used '.$category->useAmount().'x, so cannot be deleted');
+ }
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
- //$category->children()->each(function($c){$c->delete();});
+ // $category->children()->each(function($c){$c->delete();});
$category->delete();
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
- return redirect()->route('categories.index')->with('success','Category deleted successfully');
+
+ return redirect()->route('categories.index')->with('success', 'Category deleted successfully');
}
- return redirect()->route('categories.index')->with('error','Category not found');
+ return redirect()->route('categories.index')->with('error', 'Category not found');
}
/**
- * @param Collection $items
- *
* @return static
*/
protected function makeOptions(Collection $items)
{
- $options = [ '' => 'Root' ];
+ $options = ['' => 'Root'];
- foreach ($items as $i => $item)
- {
+ foreach ($items as $i => $item) {
$options[$item->getKey()] = $i.' (depth: '.$item->depth.')'.str_repeat('‒', $item->depth + 1).' '.$item->name;
}
return $options;
}
- /**
- * @param Category $except
- *
- * @return CategoriesController
- */
- protected function getCategoryOptions($except = null)
- {
- /** @var \Kalnoy\Nestedset\QueryBuilder $query */
- $query = Category::select('id', 'name')->withDepth();
-
- if ($except)
- {
- $query->whereNotDescendantOf($except)->where('id', '<>', $except->id);
- }
-
- return $this->makeOptions($query->get());
- }
+ /**
+ * @param Category $except
+ * @return CategoriesController
+ */
+ protected function getCategoryOptions($except = null)
+ {
+ /** @var \Kalnoy\Nestedset\QueryBuilder $query */
+ $query = Category::select('id', 'name')->withDepth();
+
+ if ($except) {
+ $query->whereNotDescendantOf($except)->where('id', '<>', $except->id);
+ }
+
+ return $this->makeOptions($query->get());
+ }
}
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index 145e5261..fa99bdfb 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\CategoryInput;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
@@ -21,7 +18,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 1000;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$categoryinputs = CategoryInput::paginate($perPage);
} else {
$categoryinputs = CategoryInput::paginate($perPage);
@@ -37,30 +34,30 @@ public function index(Request $request)
*/
public function create()
{
- $categoryinput = new CategoryInput();
+ $categoryinput = new CategoryInput;
+
return view('categoryinputs.create', compact('categoryinput'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request,
- [
- 'name' => 'required|string',
- 'type' => 'required|string|unique:category_inputs',
- 'min' => 'nullable|integer',
- 'max' => 'nullable|integer',
- 'decimals' => 'nullable|integer',
- ]);
+ [
+ 'name' => 'required|string',
+ 'type' => 'required|string|unique:category_inputs',
+ 'min' => 'nullable|integer',
+ 'max' => 'nullable|integer',
+ 'decimals' => 'nullable|integer',
+ ]);
$requestData = $request->all();
-
+
CategoryInput::create($requestData);
return redirect('categoryinputs')->with('flash_message', 'CategoryInput added!');
@@ -70,7 +67,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -84,7 +80,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -97,25 +92,23 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request,
- [
- 'name' => 'required|string',
- 'type' => Rule::unique('category_inputs')->ignore($id),
- 'min' => 'nullable|integer',
- 'max' => 'nullable|integer',
- 'decimals' => 'nullable|integer',
- ]);
-
+ [
+ 'name' => 'required|string',
+ 'type' => Rule::unique('category_inputs')->ignore($id),
+ 'min' => 'nullable|integer',
+ 'max' => 'nullable|integer',
+ 'decimals' => 'nullable|integer',
+ ]);
+
$categoryinput = CategoryInput::findOrFail($id);
$requestData = $request->all();
-
+
$categoryinput->update($requestData);
return redirect('categoryinputs')->with('flash_message', 'CategoryInput updated!');
@@ -125,7 +118,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/ChecklistController.php b/app/Http/Controllers/ChecklistController.php
index 360fbfbc..b1ac81ec 100644
--- a/app/Http/Controllers/ChecklistController.php
+++ b/app/Http/Controllers/ChecklistController.php
@@ -2,20 +2,14 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
-use Auth;
-use App\User;
-use App\Checklist;
-use App\Language;
use App\Category;
use App\CategoryFactory;
-use App\CategoryInput;
+use App\Checklist;
+use App\User;
+use Auth;
use Illuminate\Http\Request;
-use LaravelLocalization;
-
use Illuminate\Support\Facades\DB;
+use LaravelLocalization;
class ChecklistController extends Controller
{
@@ -31,12 +25,13 @@ public function __construct(CategoryFactory $categoryFactory)
*/
public function index(Request $request)
{
-
- if (Auth::user()->hasRole('superadmin'))
+
+ if (Auth::user()->hasRole('superadmin')) {
$checklists = CheckList::with('users')->get();
- else
+ } else {
$checklists = $this->getUserChecklists()->get();
-
+ }
+
return view('checklists.index', compact('checklists'));
}
@@ -47,33 +42,30 @@ public function index(Request $request)
*/
public function create()
{
- $taxonomy = Category::getTaxonomy();
- $selected = $this->categoryFactory->get_old_ids_array();
- $users = User::all()->pluck('name','id');
- $selectedUserIds= [Auth::user()->id];
- $checklist = Checklist::create([]);
+ $taxonomy = Category::getTaxonomy();
+ $selected = $this->categoryFactory->get_old_ids_array();
+ $users = User::all()->pluck('name', 'id');
+ $selectedUserIds = [Auth::user()->id];
+ $checklist = Checklist::create([]);
return view('checklists.create', compact('taxonomy', 'selected', 'users', 'selectedUserIds', 'checklist'));
}
-
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->except(['user_id']);
- $checklist = Checklist::create($requestData);
+ $checklist = Checklist::create($requestData);
$this->addChecklistToUsers($request, $checklist);
- if ($request->filled('categories'))
- {
+ if ($request->filled('categories')) {
$categories = explode(',', $request->input('categories'));
$checklist->syncCategories($categories);
}
@@ -85,14 +77,13 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
{
$checklist = $this->getUserChecklists()->find($id);
- $items = $checklist->categories()->get()->toTree();
- $selected = $items->pluck('id')->toArray();
+ $items = $checklist->categories()->get()->toTree();
+ $selected = $items->pluck('id')->toArray();
return view('checklists.show', compact('checklist', 'items', 'selected'));
}
@@ -101,49 +92,46 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
{
- $locale = LaravelLocalization::getCurrentLocale();
+ $locale = LaravelLocalization::getCurrentLocale();
$checklist = $this->getUserChecklists()->find($id);
- $selected = $checklist->categoryIdArray();
- $taxonomy = $checklist->getOrderedChecklist($selected);
-
- $users = User::all()->pluck('name','id');
+ $selected = $checklist->categoryIdArray();
+ $taxonomy = $checklist->getOrderedChecklist($selected);
+
+ $users = User::all()->pluck('name', 'id');
$selectedUserIds = $checklist->users()->pluck('id');
- //die(print_r(['id'=>$selectedUserIds, 'cl'=>$checklist->toArray()]));
+ // die(print_r(['id'=>$selectedUserIds, 'cl'=>$checklist->toArray()]));
return view('checklists.edit', compact('checklist', 'taxonomy', 'selected', 'users', 'selectedUserIds'));
}
private function addChecklistToUsers(Request $request, $checklist)
{
- if ($checklist)
+ if ($checklist) {
$checklist->users()->sync($request->input('user_id'));
+ }
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->except(['user_id']);
-
+
$checklist = $this->getUserChecklists()->find($id);
$checklist->update($requestData);
$this->addChecklistToUsers($request, $checklist);
- if ($request->filled('categories'))
- {
+ if ($request->filled('categories')) {
$categories = explode(',', $request->input('categories'));
$checklist->syncCategories($categories);
}
@@ -155,7 +143,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
@@ -167,7 +154,7 @@ public function destroy($id)
public function destroyCopies()
{
- Checklist::where('type','like','%_copy%')->forceDelete();
+ Checklist::where('type', 'like', '%_copy%')->forceDelete();
$checklist_ids = Checklist::pluck('id')->toArray();
DB::table('checklist_category')->whereNotIn('checklist_id', $checklist_ids)->delete();
@@ -179,10 +166,10 @@ public function destroyCopies()
private function getUserChecklists()
{
- if (Auth::user()->hasRole('superadmin'))
- {
+ if (Auth::user()->hasRole('superadmin')) {
return Checklist::all();
}
+
return Auth::user()->checklists();
}
}
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index 7b5f9891..55c6f035 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
use App\Models\ChecklistSvg;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 25;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$checklistsvg = ChecklistSvg::where('user_id', 'LIKE', "%$keyword%")
->orWhere('checklist_id', 'LIKE', "%$keyword%")
->orWhere('name', 'LIKE', "%$keyword%")
@@ -42,25 +39,25 @@ public function index(Request $request)
*/
public function create()
{
- $checklistsvg = new ChecklistSvg();
+ $checklistsvg = new ChecklistSvg;
+
return view('checklist-svg.create');
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'user_id' => 'required',
- 'checklist_id' => 'required'
- ]);
+ 'user_id' => 'required',
+ 'checklist_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
ChecklistSvg::create($requestData);
return redirect('checklist-svg')->with('flash_message', 'ChecklistSvg added!');
@@ -70,7 +67,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -84,7 +80,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -97,19 +92,17 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'user_id' => 'required',
- 'checklist_id' => 'required'
- ]);
+ 'user_id' => 'required',
+ 'checklist_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
$checklistsvg = ChecklistSvg::findOrFail($id);
$checklistsvg->update($requestData);
@@ -120,7 +113,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 03e02a23..a0a2a8a3 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
+use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
+use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php
index e10c1ce5..b5b47e33 100644
--- a/app/Http/Controllers/DashboardController.php
+++ b/app/Http/Controllers/DashboardController.php
@@ -2,63 +2,55 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-use App\User;
-use App\Location;
use App\Category;
+use App\Checklist;
+use App\Device;
use App\Hive;
+use App\HiveLayerFrame;
use App\Inspection;
use App\InspectionItem;
-use App\Queen;
-use App\Checklist;
-use App\ChecklistCategory;
-use App\HiveLayerFrame;
-use App\Device;
+use App\Location;
use App\Measurement;
-use App\Research;
use App\Models\Alert;
use App\Models\AlertRule;
+use App\Queen;
+use App\Research;
+use App\User;
use DB;
-
+use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
-
use Moment\Moment;
class DashboardController extends Controller
{
- public function __construct()
- {
-
- }
+ public function __construct() {}
- private function cacheRequestGetRate($name, $average_sec=60, $decimals=0)
+ private function cacheRequestGetRate($name, $average_sec = 60, $decimals = 0)
{
- if (Cache::has($name.'-time') && Cache::has($name.'-count'))
- {
- $sec_ago = time() - Cache::get($name.'-time');
+ if (Cache::has($name.'-time') && Cache::has($name.'-count')) {
+ $sec_ago = time() - Cache::get($name.'-time');
$req_per_min = round(Cache::get($name.'-count') * $average_sec / $sec_ago, $decimals);
+
return $req_per_min;
- }
- else
- {
+ } else {
return 0;
}
}
private function cacheRequestGetArray($name)
{
- if (Cache::has($name))
- {
+ if (Cache::has($name)) {
$array = Cache::get($name);
- if (gettype($array) == 'array')
+ if (gettype($array) == 'array') {
return implode("\x0A", $array);
- else
+ } else {
return $array;
+ }
}
+
return '';
}
-
/**
* Display a listing of the resource.
*
@@ -66,109 +58,107 @@ private function cacheRequestGetArray($name)
*/
public function index(Request $request)
{
- $moment = new Moment();
- $last_hour = $moment->subtractHours(1)->format('Y-m-d H:i:s');
- $last_day = $moment->subtractDays(1)->format('Y-m-d H:i:s');
- $last_week = $moment->subtractDays(7)->format('Y-m-d H:i:s');
- $last_month = $moment->subtractMonths(1)->format('Y-m-d');
- $last_qrt = $moment->subtractMonths(3)->format('Y-m-d');
- $last_year = $moment->subtractMonths(12)->format('Y-m-d');
- //die(print_r($last_day));
-
- $data = [];
- $data['users'] = User::count();
- $data['users-locale'] = User::where('locale', '!=', null)->count();
- $data['newusers'] = User::where('created_at', '>', $last_week)->count();
- $data['hourusers'] = User::where('last_login', '>', $last_hour)->count();
- $data['dayusers'] = User::where('last_login', '>', $last_day)->count();
- $data['activeusers'] = User::whereDate('last_login', '>', $last_month)->count();
-
- $users_last_qrt = User::whereDate('last_login', '>', $last_qrt);
- $data['qrtusers'] = $users_last_qrt->count();
+ $moment = new Moment;
+ $last_hour = $moment->subtractHours(1)->format('Y-m-d H:i:s');
+ $last_day = $moment->subtractDays(1)->format('Y-m-d H:i:s');
+ $last_week = $moment->subtractDays(7)->format('Y-m-d H:i:s');
+ $last_month = $moment->subtractMonths(1)->format('Y-m-d');
+ $last_qrt = $moment->subtractMonths(3)->format('Y-m-d');
+ $last_year = $moment->subtractMonths(12)->format('Y-m-d');
+ // die(print_r($last_day));
+
+ $data = [];
+ $data['users'] = User::count();
+ $data['users-locale'] = User::where('locale', '!=', null)->count();
+ $data['newusers'] = User::where('created_at', '>', $last_week)->count();
+ $data['hourusers'] = User::where('last_login', '>', $last_hour)->count();
+ $data['dayusers'] = User::where('last_login', '>', $last_day)->count();
+ $data['activeusers'] = User::whereDate('last_login', '>', $last_month)->count();
+
+ $users_last_qrt = User::whereDate('last_login', '>', $last_qrt);
+ $data['qrtusers'] = $users_last_qrt->count();
// Active users query:
- $data['qrtusers_more_5_hives'] = count(DB::select(DB::raw('SELECT hives.`user_id`, COUNT(hives.`id`) as hive_cnt, users.`created_at`, users.`last_login` FROM hives
+ $data['qrtusers_more_5_hives'] = count(DB::select(DB::raw('SELECT hives.`user_id`, COUNT(hives.`id`) as hive_cnt, users.`created_at`, users.`last_login` FROM hives
INNER JOIN users ON hives.`user_id` = users.`id`
WHERE hives.`deleted_at` IS NULL AND users.`created_at` != users.`updated_at` AND users.`last_login` > \''.$last_qrt.'\'
GROUP BY hives.`user_id` HAVING hive_cnt > 5')));
-
- $data['yearusers'] = User::whereDate('last_login', '>', $last_year)->count();
- $data['locations'] = Location::count();
- $data['hives'] = Hive::count();
- $data['frames'] = HiveLayerFrame::count();
- $data['inspections'] = Inspection::count();
- $data['inspectionitems'] = InspectionItem::count();
- $data['itemsperinspection'] = $data['inspections'] == 0 ? 0 : round($data['inspectionitems'] / $data['inspections'], 1);
- $data['queens'] = Queen::count();
- $data['checklists'] = Checklist::count();
- $data['checklists_edited'] = Checklist::whereRaw('updated_at - created_at > 60')->count();
- $data['sensors'] = Device::count();
- $data['sensors-online'] = Device::all()->where('online', true)->count();
- $data['researches'] = [];
-
- $data['store-measurements-201'] = $this->cacheRequestGetRate('store-measurements-201');
- $data['store-measurements-400'] = $this->cacheRequestGetRate('store-measurements-400', 3600);
+
+ $data['yearusers'] = User::whereDate('last_login', '>', $last_year)->count();
+ $data['locations'] = Location::count();
+ $data['hives'] = Hive::count();
+ $data['frames'] = HiveLayerFrame::count();
+ $data['inspections'] = Inspection::count();
+ $data['inspectionitems'] = InspectionItem::count();
+ $data['itemsperinspection'] = $data['inspections'] == 0 ? 0 : round($data['inspectionitems'] / $data['inspections'], 1);
+ $data['queens'] = Queen::count();
+ $data['checklists'] = Checklist::count();
+ $data['checklists_edited'] = Checklist::whereRaw('updated_at - created_at > 60')->count();
+ $data['sensors'] = Device::count();
+ $data['sensors-online'] = Device::all()->where('online', true)->count();
+ $data['researches'] = [];
+
+ $data['store-measurements-201'] = $this->cacheRequestGetRate('store-measurements-201');
+ $data['store-measurements-400'] = $this->cacheRequestGetRate('store-measurements-400', 3600);
$data['store-measurements-400-array'] = $this->cacheRequestGetArray('store-measurements-400-array');
- $data['store-measurements-401'] = $this->cacheRequestGetRate('store-measurements-401', 3600);
+ $data['store-measurements-401'] = $this->cacheRequestGetRate('store-measurements-401', 3600);
$data['store-measurements-401-array'] = $this->cacheRequestGetArray('store-measurements-401-array');
- $data['store-measurements-500'] = $this->cacheRequestGetRate('store-measurements-500', 3600);
+ $data['store-measurements-500'] = $this->cacheRequestGetRate('store-measurements-500', 3600);
$data['store-measurements-500-array'] = $this->cacheRequestGetArray('store-measurements-500-array');
- $data['store-sensors'] = $this->cacheRequestGetRate('store-sensors');
- $data['store-lora-sensors-'] = $this->cacheRequestGetRate('store-lora-sensors-');
- $data['store-lora-sensors-kpn'] = $this->cacheRequestGetRate('store-lora-sensors-kpn');
- $data['store-lora-sensors-kpn-things']= $this->cacheRequestGetRate('store-lora-sensors-kpn-things');
- $data['store-lora-sensors-helium'] = $this->cacheRequestGetRate('store-lora-sensors-helium');
- $data['store-lora-sensors-swisscom'] = $this->cacheRequestGetRate('store-lora-sensors-swisscom');
- $data['store-lora-sensors-ttn-v2'] = $this->cacheRequestGetRate('store-lora-sensors-ttn-v2');
+ $data['store-sensors'] = $this->cacheRequestGetRate('store-sensors');
+ $data['store-lora-sensors-'] = $this->cacheRequestGetRate('store-lora-sensors-');
+ $data['store-lora-sensors-kpn'] = $this->cacheRequestGetRate('store-lora-sensors-kpn');
+ $data['store-lora-sensors-kpn-things'] = $this->cacheRequestGetRate('store-lora-sensors-kpn-things');
+ $data['store-lora-sensors-helium'] = $this->cacheRequestGetRate('store-lora-sensors-helium');
+ $data['store-lora-sensors-swisscom'] = $this->cacheRequestGetRate('store-lora-sensors-swisscom');
+ $data['store-lora-sensors-ttn-v2'] = $this->cacheRequestGetRate('store-lora-sensors-ttn-v2');
$data['store-lora-sensors-ttn-v3-pb'] = $this->cacheRequestGetRate('store-lora-sensors-ttn-v3-pb');
- $data['store-lora-sensors-ttn-v3'] = $this->cacheRequestGetRate('store-lora-sensors-ttn-v3');
- $data['store-measurements-total'] = $data['store-sensors'] + $data['store-lora-sensors-'] + $data['store-lora-sensors-kpn'] + $data['store-lora-sensors-kpn-things'] + $data['store-lora-sensors-helium'] + $data['store-lora-sensors-ttn-v2'] + $data['store-lora-sensors-ttn-v3-pb'] + $data['store-lora-sensors-ttn-v3'];
- $data['get-measurements'] = $this->cacheRequestGetRate('get-measurements', 3600);
- $data['get-measurements-last'] = $this->cacheRequestGetRate('get-measurements-last', 3600);
- $data['get-measurements-research'] = $this->cacheRequestGetRate('get-measurements-research', 3600);
-
- $data['influx-write'] = $this->cacheRequestGetRate('influx-write', 3600);
- $data['influx-get'] = $this->cacheRequestGetRate('influx-get', 3600);
- $data['influx-data'] = $this->cacheRequestGetRate('influx-data', 3600);
- $data['influx-last'] = $this->cacheRequestGetRate('influx-last', 3600);
- $data['influx-device'] = $this->cacheRequestGetRate('influx-device', 3600);
- $data['influx-names'] = $this->cacheRequestGetRate('influx-names', 3600);
- $data['influx-names-nocache'] = $this->cacheRequestGetRate('influx-names-nocache', 3600);
- $data['influx-alert'] = $this->cacheRequestGetRate('influx-alert', 3600);
- $data['influx-flashlog'] = $this->cacheRequestGetRate('influx-flashlog', 3600);
- $data['influx-weather'] = $this->cacheRequestGetRate('influx-weather', 3600);
- $data['influx-research'] = $this->cacheRequestGetRate('influx-research', 3600);
- $data['influx-research-api'] = $this->cacheRequestGetRate('influx-research-api', 3600);
- $data['influx-weight'] = $this->cacheRequestGetRate('influx-weight', 3600);
- $data['influx-csv'] = $this->cacheRequestGetRate('influx-csv', 3600);
-
- $data['alert-rules'] = AlertRule::count();
- $data['alerts'] = Alert::count();
- $data['alert-direct'] = $this->cacheRequestGetRate('alert-direct', 3600);
- $data['alert-timed'] = $this->cacheRequestGetRate('alert-timed', 3600);
-
- foreach (Research::all() as $key => $r)
- {
+ $data['store-lora-sensors-ttn-v3'] = $this->cacheRequestGetRate('store-lora-sensors-ttn-v3');
+ $data['store-measurements-total'] = $data['store-sensors'] + $data['store-lora-sensors-'] + $data['store-lora-sensors-kpn'] + $data['store-lora-sensors-kpn-things'] + $data['store-lora-sensors-helium'] + $data['store-lora-sensors-ttn-v2'] + $data['store-lora-sensors-ttn-v3-pb'] + $data['store-lora-sensors-ttn-v3'];
+ $data['get-measurements'] = $this->cacheRequestGetRate('get-measurements', 3600);
+ $data['get-measurements-last'] = $this->cacheRequestGetRate('get-measurements-last', 3600);
+ $data['get-measurements-research'] = $this->cacheRequestGetRate('get-measurements-research', 3600);
+
+ $data['influx-write'] = $this->cacheRequestGetRate('influx-write', 3600);
+ $data['influx-get'] = $this->cacheRequestGetRate('influx-get', 3600);
+ $data['influx-data'] = $this->cacheRequestGetRate('influx-data', 3600);
+ $data['influx-last'] = $this->cacheRequestGetRate('influx-last', 3600);
+ $data['influx-device'] = $this->cacheRequestGetRate('influx-device', 3600);
+ $data['influx-names'] = $this->cacheRequestGetRate('influx-names', 3600);
+ $data['influx-names-nocache'] = $this->cacheRequestGetRate('influx-names-nocache', 3600);
+ $data['influx-alert'] = $this->cacheRequestGetRate('influx-alert', 3600);
+ $data['influx-flashlog'] = $this->cacheRequestGetRate('influx-flashlog', 3600);
+ $data['influx-weather'] = $this->cacheRequestGetRate('influx-weather', 3600);
+ $data['influx-research'] = $this->cacheRequestGetRate('influx-research', 3600);
+ $data['influx-research-api'] = $this->cacheRequestGetRate('influx-research-api', 3600);
+ $data['influx-weight'] = $this->cacheRequestGetRate('influx-weight', 3600);
+ $data['influx-csv'] = $this->cacheRequestGetRate('influx-csv', 3600);
+
+ $data['alert-rules'] = AlertRule::count();
+ $data['alerts'] = Alert::count();
+ $data['alert-direct'] = $this->cacheRequestGetRate('alert-direct', 3600);
+ $data['alert-timed'] = $this->cacheRequestGetRate('alert-timed', 3600);
+
+ foreach (Research::all() as $key => $r) {
$data['researches'][$key] = [];
$data['researches'][$key]['name'] = $r->name;
- $data['researches'][$key]['yes'] = DB::table('research_user')->where('research_id', $r->id)->where('consent', 1)->count();
- $data['researches'][$key]['no'] = DB::table('research_user')->where('research_id', $r->id)->where('consent', 0)->count();
+ $data['researches'][$key]['yes'] = DB::table('research_user')->where('research_id', $r->id)->where('consent', 1)->count();
+ $data['researches'][$key]['no'] = DB::table('research_user')->where('research_id', $r->id)->where('consent', 0)->count();
}
$checklist_details = false;
- $connection = true;
-
- if ($request->has('checklist_details') && $request->input('checklist_details') == '1')
- {
+ $connection = true;
+
+ if ($request->has('checklist_details') && $request->input('checklist_details') == '1') {
$checklist_details = true;
$data['checklist_categories_max'] = DB::table('checklist_category')
- ->selectRaw('checklist_id, COUNT(*) as count')
- ->groupBy('checklist_id')
- ->having('count', '>', 0)
- ->orderBy('count', 'desc')
- ->limit(5)
- ->get()
- ->toArray();
+ ->selectRaw('checklist_id, COUNT(*) as count')
+ ->groupBy('checklist_id')
+ ->having('count', '>', 0)
+ ->orderBy('count', 'desc')
+ ->limit(5)
+ ->get()
+ ->toArray();
// $data['checklist_categories_min'] = DB::table('checklist_category')
// ->selectRaw('checklist_id, COUNT(*) as count')
@@ -179,28 +169,26 @@ public function index(Request $request)
// ->get()
// ->toArray();
-
- //die(print_r($data['checklist_categories_max']));
+ // die(print_r($data['checklist_categories_max']));
// Only take into account the amount of users with > 10 inspections
- $inspectionUserCount = DB::table('inspection_user')
- ->selectRaw('user_id, COUNT(*) as count')
- ->groupBy('user_id')
- ->having('count', '>', 10)
- ->get()
- ->toArray();
+ $inspectionUserCount = DB::table('inspection_user')
+ ->selectRaw('user_id, COUNT(*) as count')
+ ->groupBy('user_id')
+ ->having('count', '>', 10)
+ ->get()
+ ->toArray();
$data['inspection_valid_user_count'] = count($inspectionUserCount);
$validInspections = collect();
- foreach ($inspectionUserCount as $key => $val)
- {
+ foreach ($inspectionUserCount as $key => $val) {
$user_id = $val->user_id;
$inspections = User::find($user_id)->inspections()->get();
$validInspections = $validInspections->merge($inspections);
}
-
- //die(print_r($validInspections->where('impression', '>', -1)->toArray()));
+
+ // die(print_r($validInspections->where('impression', '>', -1)->toArray()));
$countImp = $validInspections->where('impression', '>', -1)->count();
$countAtt = $validInspections->where('attention', '>', -1)->count();
$countNts = $validInspections->where('notes', '!=', null)->where('notes', '!=', '')->count();
@@ -208,39 +196,37 @@ public function index(Request $request)
$countRmn = $validInspections->where('reminder', '!=', null)->where('reminder', '!=', '')->count();
$data['ins_vars'] = [];
- $data['ins_vars'][__('export.impression')] = ['count'=>$countImp, 'glyphicon'=>'star'];
- $data['ins_vars'][__('export.attention')] = ['count'=>$countAtt, 'glyphicon'=>'remove-sign'];
- $data['ins_vars'][__('export.notes')] = ['count'=>$countNts, 'glyphicon'=>'align-left'];
- $data['ins_vars'][__('export.reminder_date')] = ['count'=>$countRmd, 'glyphicon'=>'calendar'];
- $data['ins_vars'][__('export.reminder')] = ['count'=>$countRmn, 'glyphicon'=>'align-left'];
+ $data['ins_vars'][__('export.impression')] = ['count' => $countImp, 'glyphicon' => 'star'];
+ $data['ins_vars'][__('export.attention')] = ['count' => $countAtt, 'glyphicon' => 'remove-sign'];
+ $data['ins_vars'][__('export.notes')] = ['count' => $countNts, 'glyphicon' => 'align-left'];
+ $data['ins_vars'][__('export.reminder_date')] = ['count' => $countRmd, 'glyphicon' => 'calendar'];
+ $data['ins_vars'][__('export.reminder')] = ['count' => $countRmn, 'glyphicon' => 'align-left'];
$inspection_terms = DB::table('inspection_items')
- ->selectRaw('category_id, COUNT(*) as count')
- ->groupBy('category_id')
- ->having('count', '>', 10)
- ->orderBy('count', 'desc')
- ->limit(100)
- ->get()
- ->toArray();
-
- $transscription = [];
- $transscription['smileys_3'] = __('taxonomy.smileys_3');
- $transscription['boolean'] = __('taxonomy.boolean');
+ ->selectRaw('category_id, COUNT(*) as count')
+ ->groupBy('category_id')
+ ->having('count', '>', 10)
+ ->orderBy('count', 'desc')
+ ->limit(100)
+ ->get()
+ ->toArray();
+
+ $transscription = [];
+ $transscription['smileys_3'] = __('taxonomy.smileys_3');
+ $transscription['boolean'] = __('taxonomy.boolean');
$transscription['boolean_yes_red'] = __('taxonomy.boolean_yes_red');
- $transscription['score_quality'] = __('taxonomy.score_quality');
- $transscription['score_amount'] = __('taxonomy.score_amount');
+ $transscription['score_quality'] = __('taxonomy.score_quality');
+ $transscription['score_amount'] = __('taxonomy.score_amount');
$data['terms'] = [];
- foreach ($inspection_terms as $value)
- {
- $cat = Category::find($value->category_id);
+ foreach ($inspection_terms as $value) {
+ $cat = Category::find($value->category_id);
$type = $cat->inputTypeType();
$term = $cat->ancName().$cat->transName();
- $data['terms'][$term] = ['count'=>$value->count, 'glyphicon'=>$cat->inputTypeIcon(), 'type'=>$type];
+ $data['terms'][$term] = ['count' => $value->count, 'glyphicon' => $cat->inputTypeIcon(), 'type' => $type];
}
-
- //die(print_r($inspection_terms));
+ // die(print_r($inspection_terms));
$sensor_counts = [];
$sensor_total = 0;
$sensor_count = [];
@@ -261,7 +247,7 @@ public function index(Request $request)
// if (count($sensor_counts) > 0 && count(reset($sensor_counts)) > 1)
// {
// $arr = reset($sensor_counts);
- // foreach ($arr as $key => $val)
+ // foreach ($arr as $key => $val)
// {
// $sensor_abbr = substr($key, 6);
// $sensor_name = in_array($sensor_abbr, array_keys($measurements)) ? $measurements[$sensor_abbr].' ('.$sensor_abbr.')' : null;
@@ -277,10 +263,10 @@ public function index(Request $request)
// ksort($sensor_count);
// }
- $data['measurements']= $sensor_total;
- $data['measurement_details']= $sensor_count;
+ $data['measurements'] = $sensor_total;
+ $data['measurement_details'] = $sensor_count;
}
-
+
return view('dashboard.index', compact('data', 'connection', 'checklist_details'));
}
}
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index 7ba88e78..4c689aff 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -2,15 +2,12 @@
namespace App\Http\Controllers;
-use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
use App\Models\DashboardGroup;
+use Auth;
+use Cache;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
-use Auth;
use Str;
-use Cache;
class DashboardGroupController extends Controller
{
@@ -24,7 +21,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 100;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$dashboardgroup = DashboardGroup::where('user_id', 'LIKE', "%$keyword%")
->orWhere('code', 'LIKE', "%$keyword%")
->orWhere('name', 'LIKE', "%$keyword%")
@@ -51,26 +48,26 @@ public function index(Request $request)
*/
public function create()
{
- $dashboardgroup = new DashboardGroup();
+ $dashboardgroup = new DashboardGroup;
$dashboardgroup->user_id = Auth::user()->id;
$dashboardgroup->code = strtoupper(Str::random(6));
- $hive_ids = Auth::user()->hives()->pluck('name','id')->toArray();
- return view('dashboard-group.create', compact('hive_ids','dashboardgroup'));
+ $hive_ids = Auth::user()->hives()->pluck('name', 'id')->toArray();
+
+ return view('dashboard-group.create', compact('hive_ids', 'dashboardgroup'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'code' => 'required|string|min:6',
+ 'code' => 'required|string|min:6',
'hive_ids.*' => 'required|exists:hives,id',
- 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
+ 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
'speed' => 'required|integer|min:1|max:84600',
'name' => 'nullable|string',
'description' => 'nullable|string',
@@ -78,9 +75,9 @@ public function store(Request $request)
'show_inspections' => 'boolean',
'show_all' => 'boolean',
'hide_measurements' => 'boolean',
- ]);
+ ]);
$requestData = $request->all();
-
+
DashboardGroup::create($requestData);
return redirect('dashboard-group')->with('flash_message', 'DashboardGroup added!');
@@ -90,7 +87,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -104,30 +100,28 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
{
$dashboardgroup = DashboardGroup::findOrFail($id);
- $hive_ids = Auth::user()->hives()->pluck('name','id')->toArray();
- return view('dashboard-group.edit', compact('hive_ids','dashboardgroup'));
+ $hive_ids = Auth::user()->hives()->pluck('name', 'id')->toArray();
+
+ return view('dashboard-group.edit', compact('hive_ids', 'dashboardgroup'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'code' => 'required|string|min:6',
+ 'code' => 'required|string|min:6',
'hive_ids.*' => 'required|exists:hives,id',
- 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
+ 'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
'speed' => 'required|integer|min:1|max:84600',
'name' => 'nullable|string',
'description' => 'nullable|string',
@@ -135,16 +129,17 @@ public function update(Request $request, $id)
'show_inspections' => 'boolean',
'show_all' => 'boolean',
'hide_measurements' => 'boolean',
- ]);
+ ]);
$requestData = $request->all();
-
+
$dashboardgroup = DashboardGroup::findOrFail($id);
-
+
// Empty cache
$code = $dashboardgroup->code;
Cache::forget('dashboard-code'.$code.'-hive-null-data');
- foreach ($dashboardgroup->hive_ids as $hive_id)
+ foreach ($dashboardgroup->hive_ids as $hive_id) {
Cache::forget('dashboard-code'.$code.'-hive-'.$hive_id.'-data');
+ }
$dashboardgroup->update($requestData);
@@ -155,7 +150,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index ff9134c4..dfef19f9 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -2,23 +2,20 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Log;
-use App\Http\Controllers\Controller;
use App\Category;
use App\Device;
-use App\User;
-use App\Research;
use App\Hive;
use App\Location;
use App\Models\FlashLog;
+use App\Research;
+use App\User;
use GuzzleHttp\Client;
-use GuzzleHttp\Psr7;
use GuzzleHttp\Exception\RequestException;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
class DeviceController extends Controller
{
-
/**
* Display a listing of the resource.
*
@@ -26,68 +23,64 @@ class DeviceController extends Controller
*/
public function index(Request $request)
{
- $keyword = $request->get('search');
+ $keyword = $request->get('search');
$search_user = $request->get('user');
- $search_res = $request->get('research');
- $perPage = 50;
- $devices = Device::withTrashed()->where('id', '!=', null);
+ $search_res = $request->get('research');
+ $perPage = 50;
+ $devices = Device::withTrashed()->where('id', '!=', null);
$research_id = null;
- if (!empty($search_res))
- {
+ if (! empty($search_res)) {
$researches = Research::where('name', 'LIKE', "%$search_res%")
- ->orWhere('id', 'LIKE', "%$search_res%")
- ->orWhere('institution', 'LIKE', "%$search_res%")
- ->orWhere('description', 'LIKE', "%$search_res%")
- ->orWhere('type', 'LIKE', "%$search_res%")
- ->get();
-
- if (count($researches) > 0)
- {
+ ->orWhere('id', 'LIKE', "%$search_res%")
+ ->orWhere('institution', 'LIKE', "%$search_res%")
+ ->orWhere('description', 'LIKE', "%$search_res%")
+ ->orWhere('type', 'LIKE', "%$search_res%")
+ ->get();
+
+ if (count($researches) > 0) {
$device_ids = [];
- foreach ($researches as $res)
- {
- foreach ($res->users as $user)
+ foreach ($researches as $res) {
+ foreach ($res->users as $user) {
$device_ids = array_merge($device_ids, $user->devices->pluck('id')->toArray());
+ }
}
$devices = $devices->whereIn('id', $device_ids);
}
}
- if (!empty($search_user))
- {
+ if (! empty($search_user)) {
$user_ids = User::where('name', 'LIKE', "%$search_user%")
- ->orWhere('email', 'LIKE', "%$search_user%")
- ->orWhere('locale', 'LIKE', "%$search_user%")
- ->orWhere('id', 'LIKE', "%$search_user%")
- ->pluck('id');
-
- if (count($user_ids) > 0)
+ ->orWhere('email', 'LIKE', "%$search_user%")
+ ->orWhere('locale', 'LIKE', "%$search_user%")
+ ->orWhere('id', 'LIKE', "%$search_user%")
+ ->pluck('id');
+
+ if (count($user_ids) > 0) {
$devices = $devices->whereIn('user_id', $user_ids);
+ }
}
- if (!empty($keyword))
- {
+ if (! empty($keyword)) {
$devices = $devices->where('hive_id', 'LIKE', "%$keyword%")
- ->orWhere('id', 'LIKE', "%$keyword%")
- ->orWhere('name', 'LIKE', "%$keyword%")
- ->orWhere('key', 'LIKE', "%$keyword%")
- ->orWhere('former_key_list', 'LIKE', "%$keyword%")
- ->orWhere('last_message_received', 'LIKE', "%$keyword%")
- ->orWhere('hardware_id', 'LIKE', "%$keyword%")
- ->orWhere('firmware_version', 'LIKE', "%$keyword%")
- ->orWhere('hardware_version', 'LIKE', "%$keyword%")
- ->orWhere('measurement_interval_min', 'LIKE', "%$keyword%")
- ->orWhere('battery_voltage', 'LIKE', "%$keyword%")
- ->orWhere('datetime', 'LIKE', "%$keyword%")
- ->orWhere('datetime_offset_sec', 'LIKE', "%$keyword%");
+ ->orWhere('id', 'LIKE', "%$keyword%")
+ ->orWhere('name', 'LIKE', "%$keyword%")
+ ->orWhere('key', 'LIKE', "%$keyword%")
+ ->orWhere('former_key_list', 'LIKE', "%$keyword%")
+ ->orWhere('last_message_received', 'LIKE', "%$keyword%")
+ ->orWhere('hardware_id', 'LIKE', "%$keyword%")
+ ->orWhere('firmware_version', 'LIKE', "%$keyword%")
+ ->orWhere('hardware_version', 'LIKE', "%$keyword%")
+ ->orWhere('measurement_interval_min', 'LIKE', "%$keyword%")
+ ->orWhere('battery_voltage', 'LIKE', "%$keyword%")
+ ->orWhere('datetime', 'LIKE', "%$keyword%")
+ ->orWhere('datetime_offset_sec', 'LIKE', "%$keyword%");
}
-
$sensors = $devices->orderByDesc('last_message_received')->paginate($perPage);
- return view('devices.index',compact('sensors'));
+ return view('devices.index', compact('sensors'));
}
/**
@@ -97,128 +90,119 @@ public function index(Request $request)
*/
public function data(Request $request)
{
- $keyword = $request->get('search');
+ $keyword = $request->get('search');
$search_user = $request->get('user');
- $search_res = $request->get('research');
+ $search_res = $request->get('research');
$high_weight = boolval($request->get('high_weight', false));
- $perPage = 10;
- $devices = Device::withTrashed()->where('id', '!=', null);
+ $perPage = 10;
+ $devices = Device::withTrashed()->where('id', '!=', null);
$search_active = false;
$research_id = null;
- if (!empty($search_res))
- {
+ if (! empty($search_res)) {
$search_active = true;
$researches = Research::where('name', 'LIKE', "%$search_res%")
- ->orWhere('id', 'LIKE', "%$search_res%")
- ->orWhere('institution', 'LIKE', "%$search_res%")
- ->orWhere('description', 'LIKE', "%$search_res%")
- ->orWhere('type', 'LIKE', "%$search_res%")
- ->get();
-
- if (count($researches) > 0)
- {
+ ->orWhere('id', 'LIKE', "%$search_res%")
+ ->orWhere('institution', 'LIKE', "%$search_res%")
+ ->orWhere('description', 'LIKE', "%$search_res%")
+ ->orWhere('type', 'LIKE', "%$search_res%")
+ ->get();
+
+ if (count($researches) > 0) {
$device_ids = [];
- foreach ($researches as $res)
- {
- foreach ($res->users as $user)
+ foreach ($researches as $res) {
+ foreach ($res->users as $user) {
$device_ids = array_merge($device_ids, $user->devices->pluck('id')->toArray());
+ }
}
$devices = $devices->whereIn('id', $device_ids);
}
}
- if (!empty($search_user))
- {
+ if (! empty($search_user)) {
$search_active = true;
$user_ids = User::where('name', 'LIKE', "%$search_user%")
- ->orWhere('email', 'LIKE', "%$search_user%")
- ->orWhere('locale', 'LIKE', "%$search_user%")
- ->orWhere('id', 'LIKE', "%$search_user%")
- ->pluck('id');
-
- if (count($user_ids) > 0)
+ ->orWhere('email', 'LIKE', "%$search_user%")
+ ->orWhere('locale', 'LIKE', "%$search_user%")
+ ->orWhere('id', 'LIKE', "%$search_user%")
+ ->pluck('id');
+
+ if (count($user_ids) > 0) {
$devices = $devices->whereIn('user_id', $user_ids);
+ }
}
- if (!empty($keyword))
- {
+ if (! empty($keyword)) {
$search_active = true;
$devices = $devices->where('hive_id', 'LIKE', "%$keyword%")
- ->orWhere('id', 'LIKE', "%$keyword%")
- ->orWhere('name', 'LIKE', "%$keyword%")
- ->orWhere('key', 'LIKE', "%$keyword%")
- ->orWhere('former_key_list', 'LIKE', "%$keyword%")
- ->orWhere('last_message_received', 'LIKE', "%$keyword%")
- ->orWhere('hardware_id', 'LIKE', "%$keyword%")
- ->orWhere('firmware_version', 'LIKE', "%$keyword%")
- ->orWhere('hardware_version', 'LIKE', "%$keyword%")
- ->orWhere('measurement_interval_min', 'LIKE', "%$keyword%")
- ->orWhere('battery_voltage', 'LIKE', "%$keyword%")
- ->orWhere('datetime', 'LIKE', "%$keyword%")
- ->orWhere('datetime_offset_sec', 'LIKE', "%$keyword%");
+ ->orWhere('id', 'LIKE', "%$keyword%")
+ ->orWhere('name', 'LIKE', "%$keyword%")
+ ->orWhere('key', 'LIKE', "%$keyword%")
+ ->orWhere('former_key_list', 'LIKE', "%$keyword%")
+ ->orWhere('last_message_received', 'LIKE', "%$keyword%")
+ ->orWhere('hardware_id', 'LIKE', "%$keyword%")
+ ->orWhere('firmware_version', 'LIKE', "%$keyword%")
+ ->orWhere('hardware_version', 'LIKE', "%$keyword%")
+ ->orWhere('measurement_interval_min', 'LIKE', "%$keyword%")
+ ->orWhere('battery_voltage', 'LIKE', "%$keyword%")
+ ->orWhere('datetime', 'LIKE', "%$keyword%")
+ ->orWhere('datetime_offset_sec', 'LIKE', "%$keyword%");
}
-
$devices = $devices->orderBy('name')->paginate($perPage);
-
- if ($search_active)
- {
- $thisyear= date('Y');
- $year = intval($request->input('year', $thisyear));
- if ($year < 2019)
+
+ if ($search_active) {
+ $thisyear = date('Y');
+ $year = intval($request->input('year', $thisyear));
+ if ($year < 2019) {
$year = $thisyear;
-
- $start = $year.'-01-01 00:00:00';
- $end = $year == $thisyear ? date('Y-m-d H:i:s') : $year.'-12-31 23:59:59';
- $interval= $request->filled('interval_min') ? $request->input('interval_min') : null;
-
- foreach($devices as $di => $device)
- {
- $int_min = isset($interval) ? $interval : $device->measurement_interval_min;
+ }
+
+ $start = $year.'-01-01 00:00:00';
+ $end = $year == $thisyear ? date('Y-m-d H:i:s') : $year.'-12-31 23:59:59';
+ $interval = $request->filled('interval_min') ? $request->input('interval_min') : null;
+
+ foreach ($devices as $di => $device) {
+ $int_min = isset($interval) ? $interval : $device->measurement_interval_min;
$devices[$di]['data_interval_min'] = $int_min;
- $devices[$di]['data_points'] = 0;
- $devices[$di]['data_imported'] = 0;
+ $devices[$di]['data_points'] = 0;
+ $devices[$di]['data_imported'] = 0;
$first_data_this_yr = substr($device->created_at, 0, 4) == $year ? true : false;
- if ($first_data_this_yr)
- {
+ if ($first_data_this_yr) {
$first_battery_date = Device::getInfluxQuery('SELECT "bv" FROM "sensors" WHERE '.$device->influxWhereKeys().' ORDER BY time ASC LIMIT 1', 'device'); // get first sensor date
- $first_data_date = isset($first_battery_date[0]['time']) ? str_replace('T', ' ', substr($first_battery_date[0]['time'], 0, 19)) : null;
- }
- else
- {
- $first_data_date = $start < $device->created_at ? $device->created_at : $start;
+ $first_data_date = isset($first_battery_date[0]['time']) ? str_replace('T', ' ', substr($first_battery_date[0]['time'], 0, 19)) : null;
+ } else {
+ $first_data_date = $start < $device->created_at ? $device->created_at : $start;
}
- if ($first_data_date)
- {
- $count_query = 'SELECT COUNT("bv") as "count" FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$first_data_date.'\' AND time <= \''.$end.'\' GROUP BY time(365d),from_flashlog LIMIT 100';
- $count_result = Device::getInfluxQuery($count_query, 'device');
- foreach ($count_result as $count_obj)
- {
- if ($count_obj['from_flashlog'] === '1')
+ if ($first_data_date) {
+ $count_query = 'SELECT COUNT("bv") as "count" FROM "sensors" WHERE '.$device->influxWhereKeys().' AND time >= \''.$first_data_date.'\' AND time <= \''.$end.'\' GROUP BY time(365d),from_flashlog LIMIT 100';
+ $count_result = Device::getInfluxQuery($count_query, 'device');
+ foreach ($count_result as $count_obj) {
+ if ($count_obj['from_flashlog'] === '1') {
$devices[$di]['data_imported'] += $count_obj['count'];
- else
+ } else {
$devices[$di]['data_points'] += $count_obj['count'];
+ }
}
$sec_year = max(0, strtotime($end) - strtotime($first_data_date));
$sec_data = ($devices[$di]['data_points'] + $devices[$di]['data_imported']) * $int_min * 60;
- $devices[$di]['date_data_start'] = $first_data_date;
- $devices[$di]['date_data_end'] = $end;
- $devices[$di]['total_days'] = round($sec_year / 86400);
- $devices[$di]['data_days'] = round($sec_data / 86400);
- $devices[$di]['completeness'] = $sec_year > 0 ? 100 * min(1, max(0, round($sec_data / $sec_year, 2))) : 0;
+ $devices[$di]['date_data_start'] = $first_data_date;
+ $devices[$di]['date_data_end'] = $end;
+ $devices[$di]['total_days'] = round($sec_year / 86400);
+ $devices[$di]['data_days'] = round($sec_data / 86400);
+ $devices[$di]['completeness'] = $sec_year > 0 ? 100 * min(1, max(0, round($sec_data / $sec_year, 2))) : 0;
}
}
- //die(print_r([$start, $end, $devices->toArray()]));
+ // die(print_r([$start, $end, $devices->toArray()]));
}
- return view('devices.data',compact('devices'));
+ return view('devices.data', compact('devices'));
}
/**
@@ -228,16 +212,15 @@ public function data(Request $request)
*/
public function create()
{
- $types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name','id');
+ $types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name', 'id');
$users = User::all()->sortBy('name')->pluck('name', 'id');
- return view('devices.create',compact('types','users'));
+ return view('devices.create', compact('types', 'users'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
@@ -254,15 +237,15 @@ public function store(Request $request)
$firstUserHive = Hive::where('user_id', $request->input('user_id'))->first();
- if (isset($firstUserHive))
+ if (isset($firstUserHive)) {
$data['hive_id'] = $firstUserHive->id;
- else
- return redirect()->route('devices.index')->with('error','Device not created; because user has no hive to add it to');
+ } else {
+ return redirect()->route('devices.index')->with('error', 'Device not created; because user has no hive to add it to');
+ }
// Make sure that re-registering key for deleted device is possible
$deleted_device_by_key = Device::onlyTrashed()->where('key', $data['key'])->first();
- if ($deleted_device_by_key !== null)
- {
+ if ($deleted_device_by_key !== null) {
$deleted_device_by_key->addFormerKey($data['key']);
$deleted_device_by_key->key = null;
$deleted_device_by_key->save();
@@ -271,7 +254,7 @@ public function store(Request $request)
Device::create($data);
return redirect()->route('devices.index')
- ->with('success','Device created successfully');
+ ->with('success', 'Device created successfully');
}
/**
@@ -283,7 +266,8 @@ public function store(Request $request)
public function show($id)
{
$item = Device::find($id);
- return view('devices.show',compact('item'));
+
+ return view('devices.show', compact('item'));
}
public function sync($id)
@@ -291,19 +275,19 @@ public function sync($id)
$device = Device::findOrFail($id);
// Check if device has hardware_id (required for TTN)
- if (!$device->hardware_id) {
+ if (! $device->hardware_id) {
return Response::json(['error' => 'Device has no hardware_id configured for TTN'], 422);
}
// Calculate the next scheduled transmission time
$now = time();
$timezone = 'Europe/Amsterdam'; // CET timezone as specified
-
+
// Get device timing information
$last_message_received = $device->last_message_received ? strtotime($device->last_message_received) : null;
$measurement_interval_min = $device->measurement_interval_min ?: 15; // Default to 15 minutes if not set
-
- if (!$last_message_received) {
+
+ if (! $last_message_received) {
return Response::json(['error' => 'Device has no last_message_received timestamp'], 422);
}
@@ -311,22 +295,22 @@ public function sync($id)
$interval_seconds = $measurement_interval_min * 60;
$time_since_last = $now - $last_message_received;
$messages_missed = floor($time_since_last / $interval_seconds);
-
+
// Next message time is the last message time plus the next interval
$next_message_time = $last_message_received + (($messages_missed + 1) * $interval_seconds);
-
+
// Add a small buffer (30 seconds) to ensure the device is listening
$scheduled_downlink_time = $next_message_time + 30;
-
+
// Convert to CET timezone
- $cet_time = new \DateTime();
+ $cet_time = new \DateTime;
$cet_time->setTimezone(new \DateTimeZone($timezone));
$cet_time->setTimestamp($scheduled_downlink_time);
$cet_timestamp = $cet_time->getTimestamp();
// Create the payload: A5 + hex timestamp
$hex_timestamp = dechex($cet_timestamp);
- $payload_hex = 'A5' . $hex_timestamp;
+ $payload_hex = 'A5'.$hex_timestamp;
$payload_base64 = base64_encode(hex2bin($payload_hex));
// Prepare the downlink data
@@ -334,30 +318,30 @@ public function sync($id)
'downlinks' => [
[
'frm_payload' => $payload_base64,
- 'f_port' => 6
- ]
- ]
+ 'f_port' => 6,
+ ],
+ ],
];
// Send the downlink via TTN
- $msg = "";
+ $msg = '';
$err = true;
try {
- $guzzle = new Client();
- $url = env('TTN_API_URL') . '/as/applications/' . env('TTN_APP_NAME') . '/webhooks/' . env('TTN_APP_WEBHOOK') . '/devices/' . $device->hardware_id . '/down/push';
-
+ $guzzle = new Client;
+ $url = env('TTN_API_URL').'/as/applications/'.env('TTN_APP_NAME').'/webhooks/'.env('TTN_APP_WEBHOOK').'/devices/'.$device->hardware_id.'/down/push';
+
Log::info("Sync device_id=$id url=$url");
Log::info("Sync device_id=$id downlink_data:");
Log::info($downlink_data);
$response = $guzzle->request('POST', $url, [
'headers' => [
- 'Authorization' => 'Bearer ' . env('TTN_API_KEY'),
+ 'Authorization' => 'Bearer '.env('TTN_API_KEY'),
'Content-Type' => 'application/json',
- 'User-Agent' => env('TTN_APP_NAME')
+ 'User-Agent' => env('TTN_APP_NAME'),
],
- 'json' => $downlink_data
+ 'json' => $downlink_data,
]);
if ($response->getStatusCode() == 202 || $response->getStatusCode() == 200) {
@@ -373,43 +357,41 @@ public function sync($id)
}
} catch (RequestException $e) {
$error_response = $e->hasResponse() ? json_decode($e->getResponse()->getBody(), true) : null;
- $msg = "TTN downlink failed: ".json_encode($error_response) ?: $e->getMessage();
+ $msg = 'TTN downlink failed: '.json_encode($error_response) ?: $e->getMessage();
Log::error("Sync device_id=$id error=$msg");
}
- return redirect()->route('devices.index')->with($err?'error':'success', $msg);
+ return redirect()->route('devices.index')->with($err ? 'error' : 'success', $msg);
}
public function flashlog(Request $request, $id, $fl_id)
{
- $matches_min = $request->input('matches_min', env('FLASHLOG_MIN_MATCHES', 2)); // minimum amount of inline measurements that should be matched
- $match_props = $request->input('match_props', env('FLASHLOG_MATCH_PROPS', 7)); // minimum amount of measurement properties that should match
- $db_records = $request->input('db_records', env('FLASHLOG_DB_RECORDS', 15));// amount of DB records to fetch to match each block
+ $matches_min = $request->input('matches_min', env('FLASHLOG_MIN_MATCHES', 2)); // minimum amount of inline measurements that should be matched
+ $match_props = $request->input('match_props', env('FLASHLOG_MATCH_PROPS', 7)); // minimum amount of measurement properties that should match
+ $db_records = $request->input('db_records', env('FLASHLOG_DB_RECORDS', 15)); // amount of DB records to fetch to match each block
$save_result = boolval($request->input('save_result', false));
- $dont_use_rtc= boolval($request->input('dont_use_rtc', false));
- $use_rtc = !$dont_use_rtc;
+ $dont_use_rtc = boolval($request->input('dont_use_rtc', false));
+ $use_rtc = ! $dont_use_rtc;
- $item = Device::find($id);
+ $item = Device::find($id);
$flashlog = FlashLog::find($fl_id);
- $log = null;
+ $log = null;
- if ($flashlog)
- {
- if(isset($flashlog->log_file))
- {
+ if ($flashlog) {
+ if (isset($flashlog->log_file)) {
$data = $flashlog->getFileContent('log_file');
- if (isset($data))
- $log = $flashlog->log($data, null, $save_result, true, true, $matches_min, $match_props, $db_records, $save_result, false, 3, true, $use_rtc); // $data, $log_bytes=null, $save=true, $fill=false, $show=false
- else
+ if (isset($data)) {
+ $log = $flashlog->log($data, null, $save_result, true, true, $matches_min, $match_props, $db_records, $save_result, false, 3, true, $use_rtc);
+ } // $data, $log_bytes=null, $save=true, $fill=false, $show=false
+ else {
return redirect()->route('devices.show', $id)->with('error', 'Flashlog file \''.$flashlog->log_file.'\' not found');
- }
- else
- {
+ }
+ } else {
return redirect()->route('devices.show', $id)->with('error', 'No flashlog file present, nothing to parse');
}
}
- return view('devices.show',compact('item','flashlog','log', 'matches_min', 'match_props', 'db_records', 'save_result', 'dont_use_rtc'));
+ return view('devices.show', compact('item', 'flashlog', 'log', 'matches_min', 'match_props', 'db_records', 'save_result', 'dont_use_rtc'));
}
/**
@@ -421,25 +403,23 @@ public function flashlog(Request $request, $id, $fl_id)
public function edit($id)
{
$item = Device::find($id);
- $types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name','id');
+ $types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name', 'id');
$users = User::all()->sortBy('name')->pluck('name', 'id');
- $all_hives = Hive::where('user_id',$item->user_id)->where('name','!=','')->orderBy('name')->get();
+ $all_hives = Hive::where('user_id', $item->user_id)->where('name', '!=', '')->orderBy('name')->get();
$hives = [];
- foreach ($all_hives as $val)
- {
- $loc = Location::where('id',$val->location_id)->limit(1)->value('name');
+ foreach ($all_hives as $val) {
+ $loc = Location::where('id', $val->location_id)->limit(1)->value('name');
$hives[$val->id] = $loc != '' ? $loc.' - '.$val->name : $val->name;
}
asort($hives, SORT_NATURAL);
- //die(print_r($types));
+ // die(print_r($types));
- return view('devices.edit',compact('item','types','users','hives'));
+ return view('devices.edit', compact('item', 'types', 'users', 'hives'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
@@ -454,22 +434,21 @@ public function update(Request $request, $id)
'rtc' => 'nullable|boolean',
]);
- $data = $request->all();
+ $data = $request->all();
$sensor = Device::findOrFail($id);
- if ($sensor->user_id != $request->input('user_id'))
- {
+ if ($sensor->user_id != $request->input('user_id')) {
$firstUserHive = Hive::where('user_id', $request->input('user_id'))->first();
- if (isset($firstUserHive))
+ if (isset($firstUserHive)) {
$data['hive_id'] = $firstUserHive->id;
- else
- return redirect()->route('devices.index')->with('error','Device not edited; because new user has no hive to add it to');
+ } else {
+ return redirect()->route('devices.index')->with('error', 'Device not edited; because new user has no hive to add it to');
+ }
}
// Make sure that re-registering key for deleted device is possible
$deleted_device_by_key = Device::onlyTrashed()->where('key', $data['key'])->first();
- if ($deleted_device_by_key !== null)
- {
+ if ($deleted_device_by_key !== null) {
$deleted_device_by_key->addFormerKey($data['key']);
$deleted_device_by_key->key = null;
$deleted_device_by_key->save();
@@ -478,15 +457,16 @@ public function update(Request $request, $id)
$sensor->update($data);
return redirect()->route('devices.index')
- ->with('success','Device updated successfully');
+ ->with('success', 'Device updated successfully');
}
// /devices/{id}/undelete
public function undelete($id)
{
Device::withTrashed()->findOrFail($id)->restore();
+
return redirect()->route('devices.index')
- ->with('success','Device restored successfully');
+ ->with('success', 'Device restored successfully');
}
/**
@@ -498,7 +478,8 @@ public function undelete($id)
public function destroy($id)
{
Device::find($id)->delete();
+
return redirect()->route('devices.index')
- ->with('success','Device deleted successfully');
+ ->with('success','Device deleted successfully');
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/FlashLogController.php b/app/Http/Controllers/FlashLogController.php
index 186acb2a..e401235a 100644
--- a/app/Http/Controllers/FlashLogController.php
+++ b/app/Http/Controllers/FlashLogController.php
@@ -2,17 +2,14 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-use Illuminate\Http\Request;
-
-use App\Models\FlashLog;
-use App\Models\CalculationModel;
-use App\User;
use App\Device;
+use App\Models\CalculationModel;
+use App\Models\FlashLog;
use App\SensorDefinition;
-use Storage;
+use App\User;
use Carbon\Carbon;
+use Illuminate\Http\Request;
+use Storage;
class FlashLogController extends Controller
{
@@ -23,64 +20,64 @@ class FlashLogController extends Controller
*/
public function index(Request $request)
{
- $bytes = $request->filled('mb') ? intval($request->get('mb')*1024*1024) : null;
- $log_parsed = $request->filled('log_parsed') ? boolval($request->get('log_parsed')) : null;
- $log_has_ts = $request->filled('log_has_timestamps') ? boolval($request->get('log_has_timestamps')) : null;
+ $bytes = $request->filled('mb') ? intval($request->get('mb') * 1024 * 1024) : null;
+ $log_parsed = $request->filled('log_parsed') ? boolval($request->get('log_parsed')) : null;
+ $log_has_ts = $request->filled('log_has_timestamps') ? boolval($request->get('log_has_timestamps')) : null;
$log_csv_url = $request->filled('csv_url') ? (boolval($request->get('csv_url')) ? '!=' : '=') : null; // != null / = null
$search_user = $request->get('user');
- $search_dev = $request->get('device');
- $device_id = $request->get('device_id');
- $perPage = 50;
+ $search_dev = $request->get('device');
+ $device_id = $request->get('device_id');
+ $perPage = 50;
- $flashlogs = FlashLog::where('id', '!=', null);
+ $flashlogs = FlashLog::where('id', '!=', null);
- if (!empty($device_id))
- {
+ if (! empty($device_id)) {
$flashlogs = $flashlogs->where('device_id', $device_id);
}
- if (!empty($search_dev))
- {
+ if (! empty($search_dev)) {
$device_ids = Device::where('id', 'LIKE', "%$search_dev%")
- ->orWhere('name', 'LIKE', "%$search_dev%")
- ->orWhere('key', 'LIKE', "%$search_dev%")
- ->orWhere('hardware_id', 'LIKE', "%$search_dev%")
- ->pluck('id');
+ ->orWhere('name', 'LIKE', "%$search_dev%")
+ ->orWhere('key', 'LIKE', "%$search_dev%")
+ ->orWhere('hardware_id', 'LIKE', "%$search_dev%")
+ ->pluck('id');
- if (count($device_ids) > 0)
- {
+ if (count($device_ids) > 0) {
$flashlogs = $flashlogs->whereIn('device_id', $device_ids);
}
}
- if (!empty($search_user))
- {
+ if (! empty($search_user)) {
$user_ids = User::where('name', 'LIKE', "%$search_user%")
- ->orWhere('email', 'LIKE', "%$search_user%")
- ->orWhere('id', 'LIKE', "%$search_user%")
- ->pluck('id');
-
- if (count($user_ids) > 0)
+ ->orWhere('email', 'LIKE', "%$search_user%")
+ ->orWhere('id', 'LIKE', "%$search_user%")
+ ->pluck('id');
+
+ if (count($user_ids) > 0) {
$flashlogs = $flashlogs->whereIn('user_id', $user_ids);
+ }
}
- if (isset($bytes))
+ if (isset($bytes)) {
$flashlogs = $flashlogs->where('bytes_received', '>', $bytes);
+ }
- if (isset($log_parsed))
+ if (isset($log_parsed)) {
$flashlogs = $flashlogs->where('log_parsed', '=', $log_parsed);
+ }
- if (isset($log_has_ts))
+ if (isset($log_has_ts)) {
$flashlogs = $flashlogs->where('log_has_timestamps', '=', $log_has_ts);
+ }
- if (isset($log_csv_url))
+ if (isset($log_csv_url)) {
$flashlogs = $flashlogs->where('csv_url', $log_csv_url, null);
+ }
- //dd($bytes, $log_parsed);
+ // dd($bytes, $log_parsed);
$flashlog = $flashlogs->orderByDesc('id')->paginate($perPage);
-
return view('flash-log.index', compact('flashlog'));
}
@@ -91,22 +88,22 @@ public function index(Request $request)
*/
public function create()
{
- $flashlog = new FlashLog();
+ $flashlog = new FlashLog;
+
return view('flash-log.create', compact('flashlog'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
FlashLog::create($requestData);
return redirect('flash-log')->with('flash_message', 'FlashLog added!');
@@ -116,7 +113,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show(Request $request, $id)
@@ -124,55 +120,62 @@ public function show(Request $request, $id)
$flashlog = FlashLog::findOrFail($id);
// Analyse one day
- $date = $request->filled('date') ? $request->input('date') : null;
- $correct_data = $request->filled('correct_data') && $request->input('correct_data') === '0' ? false : true;
- $show_payload = $request->filled('show_payload') && $request->input('show_payload') === '1' ? true : false;
+ $date = $request->filled('date') ? $request->input('date') : null;
+ $correct_data = $request->filled('correct_data') && $request->input('correct_data') === '0' ? false : true;
+ $show_payload = $request->filled('show_payload') && $request->input('show_payload') === '1' ? true : false;
$date_analysis = null;
- if (isset($date))
- {
+ if (isset($date)) {
$date_analysis = [];
$data = json_decode($flashlog->getFileContent('log_file_parsed'), true);
- foreach ($data as $i => $line)
- {
- if (isset($line['time']))
- {
- if (substr($line['time'], 0, 10) == $date)
- {
-
- if (substr($line['time'], 11, 4) == '00:0')
+ foreach ($data as $i => $line) {
+ if (isset($line['time'])) {
+ if (substr($line['time'], 0, 10) == $date) {
+
+ if (substr($line['time'], 11, 4) == '00:0') {
$date_analysis[] = '------------------------------- NEW DAY ------------------------------------';
+ }
- if ($line['port'] == 2)
+ if ($line['port'] == 2) {
$date_analysis[] = '------------------------------ NEW BLOCK -----------------------------------';
+ }
$data_line = 'P='.$line['port'].' | i='.$line['i'].' | time='.$line['time'].' | t_clock='.$line['time_clock'].' | t_device='.$line['time_device'];
- if (isset($line['time_error']))
+ if (isset($line['time_error'])) {
$data_line .= ' | t_error='.$line['time_error'];
+ }
- if (isset($line['time_corr']))
+ if (isset($line['time_corr'])) {
$data_line .= ' | t_corr='.$line['time_corr'];
+ }
- if (isset($line['time_offset']))
+ if (isset($line['time_offset'])) {
$data_line .= ' | t_offset='.$line['time_offset'];
+ }
- if (isset($line['w_v']))
+ if (isset($line['w_v'])) {
$data_line .= ' | w_v='.$line['w_v'];
+ }
- if (isset($line['weight_kg']))
+ if (isset($line['weight_kg'])) {
$data_line .= ' | weight_kg='.$line['weight_kg'];
-
- if (isset($line['t_i']))
+ }
+
+ if (isset($line['t_i'])) {
$data_line .= ' | t='.$line['t_i'];
+ }
- if (isset($line['bv']))
+ if (isset($line['bv'])) {
$data_line .= ' | bv='.$line['bv'];
+ }
- if (isset($line['firmware_version']))
+ if (isset($line['firmware_version'])) {
$data_line .= ' | fw='.$line['firmware_version'];
+ }
- if ($show_payload && isset($line['payload_hex']))
+ if ($show_payload && isset($line['payload_hex'])) {
$data_line .= ' | pl='.$line['payload_hex'];
+ }
$date_analysis[] = $data_line;
}
@@ -180,106 +183,97 @@ public function show(Request $request, $id)
}
}
- return view('flash-log.show', compact('flashlog','date','date_analysis','correct_data'));
+ return view('flash-log.show', compact('flashlog', 'date', 'date_analysis', 'correct_data'));
}
/**
* Re-parse the specified flashlog.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function parse(Request $request, $id)
{
- $fill_time = $request->filled('no_fill') && $request->input('no_fill') == 1 ? false : true;
- $fill_sdef = $request->filled('no_sensor_def') && $request->input('no_sensor_def') == 1 ? false : true;
- $fill_csv = $request->filled('csv') && $request->input('csv') == 1 ? true : false;
- $fill_meta = $request->filled('add_meta') && $request->input('add_meta') == 1 ? true : false;
- $load_show = $request->filled('load_show') && $request->input('load_show') == 1 ? true : false;
+ $fill_time = $request->filled('no_fill') && $request->input('no_fill') == 1 ? false : true;
+ $fill_sdef = $request->filled('no_sensor_def') && $request->input('no_sensor_def') == 1 ? false : true;
+ $fill_csv = $request->filled('csv') && $request->input('csv') == 1 ? true : false;
+ $fill_meta = $request->filled('add_meta') && $request->input('add_meta') == 1 ? true : false;
+ $load_show = $request->filled('load_show') && $request->input('load_show') == 1 ? true : false;
$correct_data = $request->filled('correct_data') && $request->input('correct_data') === '0' ? false : true;
- $flashlog = FlashLog::findOrFail($id);
- $out = [];
-
- $query_par= array_diff_key($request->query(), ['no_fill'=>0,'no_sensor_def'=>0,'csv'=>0, 'add_meta'=>0,'load_show'=>0]); // do not copy the command to the url params to prevent pressing wrong button
- if ($load_show)
+ $flashlog = FlashLog::findOrFail($id);
+ $out = [];
+
+ $query_par = array_diff_key($request->query(), ['no_fill' => 0, 'no_sensor_def' => 0, 'csv' => 0, 'add_meta' => 0, 'load_show' => 0]); // do not copy the command to the url params to prevent pressing wrong button
+ if ($load_show) {
$query_par = $id;
+ }
+
+ $route = $load_show ? 'flash-log.show' : 'flash-log.index';
- $route = $load_show ? 'flash-log.show' : 'flash-log.index';
-
// Update bytes received if 0
- if (isset($flashlog->log_file) && $flashlog->bytes_received == 0 && $flashlog->log_messages > 0)
- {
+ if (isset($flashlog->log_file) && $flashlog->bytes_received == 0 && $flashlog->log_messages > 0) {
$flashlog->bytes_received = $flashlog->getFileSizeBytes('log_file');
$flashlog->save();
}
- if (($correct_data == false || $flashlog->valid_override) && ($fill_csv || $fill_meta || $flashlog->valid_override) && isset($flashlog->log_parsed)) // use parsed log file to generate CSV, if valid_override == 1 'protect' the generated log_file_parsed.json by not overwriting with raw log
- {
+ if (($correct_data == false || $flashlog->valid_override) && ($fill_csv || $fill_meta || $flashlog->valid_override) && isset($flashlog->log_parsed)) { // use parsed log file to generate CSV, if valid_override == 1 'protect' the generated log_file_parsed.json by not overwriting with raw log
$flashlog_parsed_text = $flashlog->getFileContent('log_file_parsed');
- if (empty($flashlog_parsed_text))
+ if (empty($flashlog_parsed_text)) {
return redirect()->route($route, $query_par)->with('error', "FlashLog $id log_file_parsed is empty");
-
+ }
$flashlog_parsed_json = json_decode($flashlog_parsed_text, true);
-
+
// add sensor definitions
- if (is_array($flashlog_parsed_json) && $correct_data)
- {
- foreach ($flashlog_parsed_json as $i => $data_array){
+ if (is_array($flashlog_parsed_json) && $correct_data) {
+ foreach ($flashlog_parsed_json as $i => $data_array) {
- if (isset($data_array['w_v']) && (!isset($data_array['weight_kg']) || $data_array['w_v'] == $data_array['weight_kg']))
+ if (isset($data_array['w_v']) && (! isset($data_array['weight_kg']) || $data_array['w_v'] == $data_array['weight_kg'])) {
$flashlog_parsed_json[$i] = SensorDefinition::addDeviceMeasurementCalibrations($flashlog->device, $data_array);
+ }
}
}
- if ($fill_meta)
+ if ($fill_meta) {
$fl_saved = $flashlog->addMetaToFlashlog($flashlog_parsed_json);
- else
+ } else {
$fl_saved = $flashlog->addCsvToFlashlog($flashlog_parsed_json);
+ }
$type = $fill_meta ? 'Meta' : 'CSV';
-
- if ($fl_saved)
- {
- $meta_str = CalculationModel::arrayToString($flashlog->meta_data, ', ', '', ['valid_data_points','port2_times_device','firmwares','lowest_bv']);
+
+ if ($fl_saved) {
+ $meta_str = CalculationModel::arrayToString($flashlog->meta_data, ', ', '', ['valid_data_points', 'port2_times_device', 'firmwares', 'lowest_bv']);
+
return redirect()->route($route, $query_par)->with('success', "FlashLog $id $type set, Meta data: ".$meta_str);
}
return redirect()->route($route, $query_par)->with('error', "FlashLog $id $type save error");
- }
- else if (isset($flashlog->log_file))
- {
+ } elseif (isset($flashlog->log_file)) {
$data = $flashlog->getFileContent('log_file');
- if (isset($data))
- {
+ if (isset($data)) {
// log($data='', $log_bytes=null, $save=true, $fill=?, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null, $save_override=false, $from_cache=false, $match_days_offset=0, $add_sensordefinitions=true, $use_rtc=true, $correct_data=false)
- $res = $flashlog->log($data, null, true, $fill_time, false, null, null, null, false, false, 0, $fill_sdef, true, $correct_data);
+ $res = $flashlog->log($data, null, true, $fill_time, false, null, null, null, false, false, 0, $fill_sdef, true, $correct_data);
foreach ($res as $key => $value) {
- $out[] = "$key=$value";
+ $out[] = "$key=$value";
}
- }
- else
- {
+ } else {
return redirect()->route($route, $query_par)->with('error', "FlashLog $id file '$flashlog->log_file' not found");
}
- }
- else
- {
+ } else {
return redirect()->route($route, $query_par)->with('error', "FlashLog $id No flashlog file present, nothing to parse");
}
- return redirect()->route($route, $query_par)->with('success', "FlashLog $id parsed again: ".implode(', ',$out));
+ return redirect()->route($route, $query_par)->with('success', "FlashLog $id parsed again: ".implode(', ', $out));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -292,9 +286,7 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
@@ -305,30 +297,28 @@ public function update(Request $request, $id)
]);
$flashlog = FlashLog::findOrFail($id);
-
- if ($request->hasFile('file')) // Store file in S3 inside "uploads" folder
- {
+ if ($request->hasFile('file')) { // Store file in S3 inside "uploads" folder
$disk = env('FLASHLOG_STORAGE', 'public');
$file = $request->file('file');
$name = $file->getClientOriginalName();
$path = $file->storeAs('flashlog/validated', $name, $disk);
- $url = Storage::disk($disk)->url($path);
+ $url = Storage::disk($disk)->url($path);
$flashlog->log_file_parsed = $url;
- $flashlog->valid_override = 1;
+ $flashlog->valid_override = 1;
$flashlog->save();
return self::parse($request, $id); // reparse flashlog
}
$requestData = $request->except('file');
-
+
if ($request->filled('time_corrections')) {
$time_corrections = json_decode($request->input('time_corrections'));
$requestData['time_corrections'] = $time_corrections;
}
-
+
$flashlog->update($requestData);
$flashlog->created_at = Carbon::parse($request->created_at);
$flashlog->save();
@@ -340,7 +330,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php
index 9a242a3e..34233f1b 100644
--- a/app/Http/Controllers/GroupController.php
+++ b/app/Http/Controllers/GroupController.php
@@ -2,9 +2,8 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-use App\Http\Controllers\Controller;
use App\Group;
+use Illuminate\Http\Request;
class GroupController extends Controller
{
@@ -15,8 +14,9 @@ class GroupController extends Controller
*/
public function index(Request $request)
{
- $groups = Group::orderBy('id','DESC')->paginate(10);
- return view('groups.index',compact('groups'))
+ $groups = Group::orderBy('id', 'DESC')->paginate(10);
+
+ return view('groups.index', compact('groups'))
->with('i', ($request->input('page', 1) - 1) * 10);
}
@@ -33,7 +33,6 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
@@ -46,7 +45,7 @@ public function store(Request $request)
Group::create($request->all());
return redirect()->route('groups.index')
- ->with('success','Group created successfully');
+ ->with('success', 'Group created successfully');
}
/**
@@ -58,7 +57,8 @@ public function store(Request $request)
public function show($id)
{
$item = Group::find($id);
- return view('groups.show',compact('item'));
+
+ return view('groups.show', compact('item'));
}
/**
@@ -70,13 +70,13 @@ public function show($id)
public function edit($id)
{
$item = Group::find($id);
- return view('groups.edit',compact('item'));
+
+ return view('groups.edit', compact('item'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
@@ -90,7 +90,7 @@ public function update(Request $request, $id)
Group::find($id)->update($request->all());
return redirect()->route('groups.index')
- ->with('success','Group updated successfully');
+ ->with('success', 'Group updated successfully');
}
/**
@@ -102,7 +102,8 @@ public function update(Request $request, $id)
public function destroy($id)
{
Group::find($id)->delete();
+
return redirect()->route('groups.index')
- ->with('success','Group deleted successfully');
+ ->with('success', 'Group deleted successfully');
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index 4952adf3..65581816 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Controllers\Controller;
-use App\Http\Requests;
-
use App\Models\HiveTag;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 25;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$hivetags = HiveTag::where('user_id', 'LIKE', "%$keyword%")
->orWhere('tag', 'LIKE', "%$keyword%")
->orWhere('hive_id', 'LIKE', "%$keyword%")
@@ -42,25 +39,25 @@ public function index(Request $request)
*/
public function create()
{
- $hivetag = new HiveTag();
+ $hivetag = new HiveTag;
+
return view('hive-tags.create');
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'tag' => 'required',
- 'user_id' => 'required'
- ]);
+ 'tag' => 'required',
+ 'user_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
HiveTag::create($requestData);
return redirect('hive-tags')->with('flash_message', 'HiveTag added!');
@@ -70,7 +67,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -84,7 +80,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -97,19 +92,17 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'tag' => 'required',
- 'user_id' => 'required'
- ]);
+ 'tag' => 'required',
+ 'user_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
$hivetag = HiveTag::findOrFail($id);
$hivetag->update($requestData);
@@ -120,7 +113,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 7cbc2c3f..6c50be36 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-
class HomeController extends Controller
{
/**
diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php
index 97beb1c6..9643ad88 100644
--- a/app/Http/Controllers/ImageController.php
+++ b/app/Http/Controllers/ImageController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\Image;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 25;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$image = Image::where('file', 'LIKE', "%$keyword%")
->orWhere('description', 'LIKE', "%$keyword%")
->orWhere('type', 'LIKE', "%$keyword%")
@@ -49,15 +46,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
Image::store($requestData);
return redirect('image')->with('flash_message', 'Image added!');
@@ -67,7 +63,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -81,7 +76,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -94,16 +88,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$image = Image::findOrFail($id);
$image->update($requestData);
@@ -114,12 +106,12 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
{
Image::findOrFail($id)->delete();
+
return redirect('image')->with('flash_message', 'Image deleted!');
}
}
diff --git a/app/Http/Controllers/InspectionItemsController.php b/app/Http/Controllers/InspectionItemsController.php
index 9fea3c9c..c169154f 100644
--- a/app/Http/Controllers/InspectionItemsController.php
+++ b/app/Http/Controllers/InspectionItemsController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\InspectionItem;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 100;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$inspectionitems = InspectionItem::where('value', 'LIKE', "%$keyword%")
->orWhere('inspection_id', 'LIKE', "%$keyword%")
->orWhere('category_id', 'LIKE', "%$keyword%")
@@ -45,15 +42,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
InspectionItem::create($requestData);
return redirect('inspection-items')->with('flash_message', 'InspectionItem added!');
@@ -63,7 +59,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -77,7 +72,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -90,16 +84,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$inspectionitem = InspectionItem::findOrFail($id);
$inspectionitem->update($requestData);
@@ -110,7 +102,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/InspectionsController.php b/app/Http/Controllers/InspectionsController.php
index 989b4c2f..e344ebeb 100644
--- a/app/Http/Controllers/InspectionsController.php
+++ b/app/Http/Controllers/InspectionsController.php
@@ -2,11 +2,8 @@
namespace App\Http\Controllers;
-use Auth;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\Inspection;
+use Auth;
use Illuminate\Http\Request;
class InspectionsController extends Controller
@@ -21,7 +18,7 @@ public function index(Request $request)
// if (Auth::user()->hasRole('superadmin'))
// $inspections = Inspection::all();
// else
- $inspections = $this->getUserInspections()->get();
+ $inspections = $this->getUserInspections()->get();
return view('inspections.index', compact('inspections'));
}
@@ -39,15 +36,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
$this->getUserInspections()->create($requestData);
return redirect('inspections')->with('flash_message', 'Inspection added!');
@@ -57,30 +53,30 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
{
- if (Auth::user()->hasRole(['admin','superadmin']))
+ if (Auth::user()->hasRole(['admin', 'superadmin'])) {
$inspection = Inspection::find($id);
- else
+ } else {
$inspection = $this->getUserInspections()->find($id);
-
- if ($inspection)
+ }
+
+ if ($inspection) {
$items = $inspection->items()->get();
- else
+ } else {
return redirect('inspections')->with('error_message', "Inspection $id not found!");
- //die(print_r($items->toArray()));
+ }
+ // die(print_r($items->toArray()));
- return view('inspections.show', compact('inspection','items'));
+ return view('inspections.show', compact('inspection', 'items'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -93,16 +89,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$inspection = $this->getUserInspections()->find($id);
$inspection->update($requestData);
@@ -113,7 +107,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/LanguageController.php b/app/Http/Controllers/LanguageController.php
index 881be55f..f7428478 100644
--- a/app/Http/Controllers/LanguageController.php
+++ b/app/Http/Controllers/LanguageController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\Language;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 1000;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$languages = Language::paginate($perPage);
} else {
$languages = Language::paginate($perPage);
@@ -42,15 +39,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
Language::create($requestData);
return redirect('languages')->with('flash_message', 'Language added!');
@@ -60,7 +56,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -74,7 +69,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -87,16 +81,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$language = Language::findOrFail($id);
$language->update($requestData);
@@ -107,7 +99,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/MeasurementController.php b/app/Http/Controllers/MeasurementController.php
index 333406b1..f3655946 100644
--- a/app/Http/Controllers/MeasurementController.php
+++ b/app/Http/Controllers/MeasurementController.php
@@ -2,12 +2,9 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\Measurement;
-use Illuminate\Http\Request;
use Cache;
+use Illuminate\Http\Request;
class MeasurementController extends Controller
{
@@ -20,7 +17,7 @@ public function index(Request $request)
{
$keyword = $request->get('search');
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$measurement = Measurement::where('abbreviation', 'LIKE', "%$keyword%")->get();
} else {
$measurement = Measurement::all();
@@ -42,13 +39,12 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
$requestData['min_value'] = $request->filled('min_value') ? floatval($request->input('min_value')) : null;
$requestData['max_value'] = $request->filled('max_value') ? floatval($request->input('max_value')) : null;
@@ -62,7 +58,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -76,7 +71,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -89,18 +83,16 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
$requestData['min_value'] = $request->filled('min_value') ? floatval($request->input('min_value')) : null;
$requestData['max_value'] = $request->filled('max_value') ? floatval($request->input('max_value')) : null;
-
+
$measurement = Measurement::findOrFail($id);
$measurement->update($requestData);
@@ -113,7 +105,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php
index 159cb518..ac13483c 100644
--- a/app/Http/Controllers/PermissionController.php
+++ b/app/Http/Controllers/PermissionController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\Permission;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 1000;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$permissions = Permission::paginate($perPage);
} else {
$permissions = Permission::paginate($perPage);
@@ -42,15 +39,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
Permission::create($requestData);
return redirect('permissions')->with('flash_message', 'Permission added!');
@@ -60,7 +56,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -74,7 +69,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -87,16 +81,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$permission = Permission::findOrFail($id);
$permission->update($requestData);
@@ -107,7 +99,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/PhysicalQuantityController.php b/app/Http/Controllers/PhysicalQuantityController.php
index 2ec10473..a1177a40 100644
--- a/app/Http/Controllers/PhysicalQuantityController.php
+++ b/app/Http/Controllers/PhysicalQuantityController.php
@@ -2,9 +2,6 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
use App\PhysicalQuantity;
use Illuminate\Http\Request;
@@ -20,7 +17,7 @@ public function index(Request $request)
$keyword = $request->get('search');
$perPage = 1000;
- if (!empty($keyword)) {
+ if (! empty($keyword)) {
$physicalquantity = PhysicalQuantity::paginate($perPage);
} else {
$physicalquantity = PhysicalQuantity::paginate($perPage);
@@ -42,15 +39,14 @@ public function create()
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
-
+
$requestData = $request->all();
-
+
PhysicalQuantity::create($requestData);
return redirect('physicalquantity')->with('flash_message', 'PhysicalQuantity added!');
@@ -60,7 +56,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -74,7 +69,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -87,16 +81,14 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
-
+
$requestData = $request->all();
-
+
$physicalquantity = PhysicalQuantity::findOrFail($id);
$physicalquantity->update($requestData);
@@ -107,7 +99,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index 565be30a..3678a0cf 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -2,65 +2,63 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Log;
-
-use App\Http\Controllers\Controller;
-
-use App\User;
-use App\Research;
-use App\Location;
+use App\Device;
use App\Hive;
use App\Inspection;
-use App\Device;
+use App\Location;
use App\Measurement;
-use App\SensorDefinition;
-use App\Models\FlashLog;
use App\Models\CalculationModel;
-
-use PhpOffice\PhpSpreadsheet\Spreadsheet;
-use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use App\Models\FlashLog;
+use App\Research;
+use App\SensorDefinition;
+use App\User;
+use Auth;
use Cache;
use DB;
-use Auth;
-use Str;
-use Storage;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
use InfluxDB;
use Moment\Moment;
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use Storage;
+use Str;
class ResearchController extends Controller
{
- protected $valid_sensors = [];
+ protected $valid_sensors = [];
+
protected $output_sensors = [];
public function __construct()
{
- $this->valid_sensors = Measurement::getValidMeasurements();
+ $this->valid_sensors = Measurement::getValidMeasurements();
$this->output_sensors = Measurement::getValidMeasurements(true);
- $this->client = new \Influx;
- //die(print_r($this->valid_sensors));
+ $this->client = new \Influx;
+ // die(print_r($this->valid_sensors));
}
private function cacheRequestRate($name)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count');
- else
+ } else {
Cache::put($name.'-count', 1);
+ }
}
private function checkAuthorization(Request $request)
{
- if ($request->user()->researchMenuOption() == false)
+ if ($request->user()->researchMenuOption() == false) {
return redirect('dashboard')->with('error', 'Unauthorized');
+ }
}
/**
@@ -72,10 +70,11 @@ public function index(Request $request)
{
$this->checkAuthorization($request);
- if ($request->user()->hasRole('superadmin'))
+ if ($request->user()->hasRole('superadmin')) {
$research = Research::all();
- else
+ } else {
$research = $request->user()->allResearches()->get();
+ }
return view('research.index', compact('research'));
}
@@ -84,20 +83,20 @@ public function consent($id, Request $request)
{
$this->checkAuthorization($request);
- if ($request->user()->hasRole('superadmin'))
+ if ($request->user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
- else
+ } else {
$research = $request->user()->allResearches()->find($id);
-
+ }
+
$consents = DB::table('research_user')
- ->where('research_id', $id)
- ->whereDate('updated_at', '<=', $research->end_date)
- ->orderBy('user_id')
- ->orderBy('updated_at','asc')
- ->get();
-
- foreach ($consents as $c)
- {
+ ->where('research_id', $id)
+ ->whereDate('updated_at', '<=', $research->end_date)
+ ->orderBy('user_id')
+ ->orderBy('updated_at', 'asc')
+ ->get();
+
+ foreach ($consents as $c) {
$c->user_name = User::find($c->user_id)->name;
}
@@ -108,11 +107,12 @@ public function consent_edit($id, $c_id, Request $request)
{
$this->checkAuthorization($request);
- if ($request->user()->hasRole('superadmin') == false)
+ if ($request->user()->hasRole('superadmin') == false) {
return redirect('research.index')->with('error', 'Unauthorized');
-
+ }
+
$research = Research::findOrFail($id);
- $item = DB::table('research_user')->where('id', $c_id)->first();
+ $item = DB::table('research_user')->where('id', $c_id)->first();
// Convert to arrays for selection
$item->consent_sensor_ids = explode(',', $item->consent_sensor_ids);
@@ -121,23 +121,23 @@ public function consent_edit($id, $c_id, Request $request)
$item->user_name = User::find($item->user_id)->name;
- if ($item)
- {
- if ($request->filled('delete') && $request->input('delete') == 1)
- {
+ if ($item) {
+ if ($request->filled('delete') && $request->input('delete') == 1) {
DB::delete('delete from research_user where id = ?', [$c_id]);
+
return redirect()->route('research.consent', $id)->with('success', 'Consent deleted');
- }
- else if ($request->filled('consent_sensor_ids') || $request->filled('consent_location_ids') || $request->filled('consent_hive_ids'))
- {
- if ($request->filled('consent_sensor_ids') && is_array($request->input('consent_sensor_ids')))
- DB::update('update research_user set consent_sensor_ids = ? where id = ?', [implode(',',$request->input('consent_sensor_ids')), $c_id]);
-
- if ($request->filled('consent_location_ids') && is_array($request->input('consent_location_ids')))
- DB::update('update research_user set consent_location_ids = ? where id = ?', [implode(',',$request->input('consent_location_ids')), $c_id]);
-
- if ($request->filled('consent_hive_ids') && is_array($request->input('consent_hive_ids')))
- DB::update('update research_user set consent_hive_ids = ? where id = ?', [implode(',',$request->input('consent_hive_ids')), $c_id]);
+ } elseif ($request->filled('consent_sensor_ids') || $request->filled('consent_location_ids') || $request->filled('consent_hive_ids')) {
+ if ($request->filled('consent_sensor_ids') && is_array($request->input('consent_sensor_ids'))) {
+ DB::update('update research_user set consent_sensor_ids = ? where id = ?', [implode(',', $request->input('consent_sensor_ids')), $c_id]);
+ }
+
+ if ($request->filled('consent_location_ids') && is_array($request->input('consent_location_ids'))) {
+ DB::update('update research_user set consent_location_ids = ? where id = ?', [implode(',', $request->input('consent_location_ids')), $c_id]);
+ }
+
+ if ($request->filled('consent_hive_ids') && is_array($request->input('consent_hive_ids'))) {
+ DB::update('update research_user set consent_hive_ids = ? where id = ?', [implode(',', $request->input('consent_hive_ids')), $c_id]);
+ }
return redirect()->route('research.consent', $id)->with('success', 'Consent updated');
}
@@ -146,7 +146,6 @@ public function consent_edit($id, $c_id, Request $request)
return view('research.consent_edit', compact('research', 'item'));
}
-
/**
* Show the form for creating a new resource.
@@ -155,17 +154,18 @@ public function consent_edit($id, $c_id, Request $request)
*/
public function create()
{
- if(Auth::user()->hasRole('superadmin') == false)
+ if (Auth::user()->hasRole('superadmin') == false) {
return redirect('dashboard')->with('error', 'Unauthorized');
+ }
+
+ $research = new Research;
- $research = new Research();
return view('research.create', compact('research'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
@@ -174,45 +174,46 @@ public function store(Request $request)
$this->checkAuthorization($request);
$this->validate($request, [
- 'name' => 'required|string',
- 'url' => 'nullable|url',
- 'image' => 'nullable|image|max:2000',
- 'start_date' => 'nullable|date',
- 'end_date' => 'nullable|date|after:start',
+ 'name' => 'required|string',
+ 'url' => 'nullable|url',
+ 'image' => 'nullable|image|max:2000',
+ 'start_date' => 'nullable|date',
+ 'end_date' => 'nullable|date|after:start',
'default_user_ids.*' => 'nullable|exists:users,id',
- 'viewer_ids.*' => 'nullable|exists:users,id',
+ 'viewer_ids.*' => 'nullable|exists:users,id',
'checklist_ids.*' => 'nullable|exists:checklists,id',
- 'user_id' => 'nullable|exists:users,id',
- 'visible' => 'boolean',
- 'on_invite_only'=> 'boolean',
+ 'user_id' => 'nullable|exists:users,id',
+ 'visible' => 'boolean',
+ 'on_invite_only' => 'boolean',
]);
$requestData = $request->all();
- if (isset($requestData['image']))
- {
+ if (isset($requestData['image'])) {
$image = Research::storeImage($requestData);
- if ($image)
- {
+ if ($image) {
$requestData['image_id'] = $image->id;
unset($requestData['image']);
}
}
- if (!isset($requestData['default_user_ids']))
+ if (! isset($requestData['default_user_ids'])) {
$requestData['default_user_ids'] = null;
-
+ }
+
$research = Research::create($requestData);
- if (isset($requestData['checklist_ids']))
+ if (isset($requestData['checklist_ids'])) {
$research->checklists()->sync($requestData['checklist_ids']);
- else
+ } else {
$research->checklists()->sync([]);
+ }
- if (isset($requestData['viewer_ids']))
+ if (isset($requestData['viewer_ids'])) {
$research->viewers()->sync($requestData['viewer_ids']);
- else
+ } else {
$research->viewers()->sync([]);
+ }
return redirect('research')->with('flash_message', 'Research added!');
}
@@ -221,7 +222,6 @@ public function store(Request $request)
* Display Research overview.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id, Request $request)
@@ -229,134 +229,130 @@ public function show($id, Request $request)
$this->checkAuthorization($request);
$this->validate($request, [
- 'date_start' => 'nullable|date',
- 'date_until' => 'nullable|date|after:date_start',
- 'user_ids.*' => 'nullable|exists:users,id',
- 'device_ids.*' => 'nullable|exists:sensors,id',
+ 'date_start' => 'nullable|date',
+ 'date_until' => 'nullable|date|after:date_start',
+ 'user_ids.*' => 'nullable|exists:users,id',
+ 'device_ids.*' => 'nullable|exists:sensors,id',
]);
- //die(print_r($request->all()));
+ // die(print_r($request->all()));
- if ($request->user()->hasRole('superadmin'))
+ if ($request->user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
- else
+ } else {
$research = $request->user()->allResearches()->find($id);
+ }
$download_url = null;
- $sensor_urls = [];
- $download = $request->has('download-meta') || $request->has('download-all') ? true : false;
- $dl_sensordata= $request->has('download-all');
- $device_ids = $request->input('device_ids');
- $devices_all = collect();
+ $sensor_urls = [];
+ $download = $request->has('download-meta') || $request->has('download-all') ? true : false;
+ $dl_sensordata = $request->has('download-all');
+ $device_ids = $request->input('device_ids');
+ $devices_all = collect();
$initial_days = 14;
// Make dates table
- $dates = [];
+ $dates = [];
- $date_today = date('Y-m-d');
- $date_last = isset($research->end_date) ? $research->end_date : $date_today;
- $date_start = max($research->start_date, $request->input('date_start', $research->start_date));
- $date_until = min($research->end_date, $request->input('date_until', $date_last));
+ $date_today = date('Y-m-d');
+ $date_last = isset($research->end_date) ? $research->end_date : $date_today;
+ $date_start = max($research->start_date, $request->input('date_start', $research->start_date));
+ $date_until = min($research->end_date, $request->input('date_until', $date_last));
- $moment_now = new Moment();
+ $moment_now = new Moment;
$moment_start = new Moment($date_start);
$moment_until = new Moment($date_until);
- $moment_end = new Moment($research->end_date);
- $moment_now = $moment_now->startof('day');
+ $moment_end = new Moment($research->end_date);
+ $moment_now = $moment_now->startof('day');
$moment_until = $moment_until->endof('day');
- $moment_end = $moment_end->endof('day');
+ $moment_end = $moment_end->endof('day');
- $research_days= $moment_start->from($moment_end)->getDays();
- $days_from_now= $moment_start->from($moment_now)->getDays();
- $days_from_end= $moment_now->from($moment_end)->getDays();
+ $research_days = $moment_start->from($moment_end)->getDays();
+ $days_from_now = $moment_start->from($moment_now)->getDays();
+ $days_from_end = $moment_now->from($moment_end)->getDays();
- $initial_days = min($research_days+1, $initial_days);
- $day_diff = 0;
+ $initial_days = min($research_days + 1, $initial_days);
+ $day_diff = 0;
- if ($days_from_now <= 0) // research has not started yet
- {
+ if ($days_from_now <= 0) { // research has not started yet
$moment_select = new Moment($date_start);
$date_start = $moment_select->startof('day')->format('Y-m-d');
$moment_select = new Moment($date_start);
- $date_until = min($date_until, $moment_select->endof('day')->addDays($initial_days-1)->format('Y-m-d'));
- }
- else if ($days_from_end <= 0) // research has already finished
- {
+ $date_until = min($date_until, $moment_select->endof('day')->addDays($initial_days - 1)->format('Y-m-d'));
+ } elseif ($days_from_end <= 0) { // research has already finished
$moment_select = new Moment($date_until);
- $date_start = $moment_select->startof('day')->addDays(-$initial_days-1)->format('Y-m-d');
+ $date_start = $moment_select->startof('day')->addDays(-$initial_days - 1)->format('Y-m-d');
$moment_select = new Moment($date_until);
$date_until = min($date_until, $moment_select->endof('day')->format('Y-m-d'));
- }
- else // now is within research start end end date
- {
- if ($request->filled('date_start') == false)
- {
+ } else { // now is within research start end end date
+ if ($request->filled('date_start') == false) {
$days_from_sta = max(0, $initial_days - $days_from_now);
- $moment_select = new Moment();
- $date_start = $moment_select->startof('day')->addDays(-$initial_days-1-$days_from_sta)->format('Y-m-d');
+ $moment_select = new Moment;
+ $date_start = $moment_select->startof('day')->addDays(-$initial_days - 1 - $days_from_sta)->format('Y-m-d');
}
- if ($request->filled('date_until') == false)
- {
- $moment_select = new Moment();
- $date_until = min($date_until, $moment_select->endof('day')->addDays(-$days_from_sta)->format('Y-m-d'));
+ if ($request->filled('date_until') == false) {
+ $moment_select = new Moment;
+ $date_until = min($date_until, $moment_select->endof('day')->addDays(-$days_from_sta)->format('Y-m-d'));
}
}
- //dd($date_start, $research->start_date, $date_until, $date_last, $research->end_date, $days_from_now, $days_from_end);
+ // dd($date_start, $research->start_date, $date_until, $date_last, $research->end_date, $days_from_now, $days_from_end);
// Cap to research
- if ($date_start < $research->start_date)
+ if ($date_start < $research->start_date) {
$date_start = $research->start_date;
+ }
- if ($date_until > $research->end_date)
+ if ($date_until > $research->end_date) {
$date_until = $research->end_date;
+ }
$moment_start = new Moment($date_start);
- $moment_end = new Moment($date_until);
+ $moment_end = new Moment($date_until);
+
+ // dd($date_start, $date_until, $research_days, $days_from_now, $days_from_end, $day_diff, $moment_now, $moment_start, $moment_end);
- //dd($date_start, $date_until, $research_days, $days_from_now, $days_from_end, $day_diff, $moment_now, $moment_start, $moment_end);
-
// count user consents within dates
$consent_users_select = DB::table('research_user')
- ->join('users', 'users.id', '=', 'research_user.user_id')
- ->select('users.name','users.id')
- ->selectRaw('sum(research_user.consent) as consents')
- ->where('research_user.research_id', $id)
- ->whereDate('research_user.updated_at', '<', $date_until)
- ->groupBy('research_user.user_id')
- ->having('consents', '>', 0)
- ->pluck('name','id')
- ->toArray();
+ ->join('users', 'users.id', '=', 'research_user.user_id')
+ ->select('users.name', 'users.id')
+ ->selectRaw('sum(research_user.consent) as consents')
+ ->where('research_user.research_id', $id)
+ ->whereDate('research_user.updated_at', '<', $date_until)
+ ->groupBy('research_user.user_id')
+ ->having('consents', '>', 0)
+ ->pluck('name', 'id')
+ ->toArray();
asort($consent_users_select, SORT_NATURAL);
$consent_users_selected = [];
// select users
- if ($request->has('user_ids'))
+ if ($request->has('user_ids')) {
$consent_users_selected = $request->input('user_ids');
- else if (isset($research->default_user_ids))
+ } elseif (isset($research->default_user_ids)) {
$consent_users_selected = $research->default_user_ids;
- else if (count($consent_users_select) > 0)
+ } elseif (count($consent_users_select) > 0) {
$consent_users_selected = [array_keys($consent_users_select)[0]];
+ }
$consents = DB::table('research_user')
- ->where('research_id', $id)
- ->whereIn('user_id', $consent_users_selected)
- ->whereDate('updated_at', '<', $date_until)
- ->groupBy('user_id')
- ->get();
+ ->where('research_id', $id)
+ ->whereIn('user_id', $consent_users_selected)
+ ->whereDate('updated_at', '<', $date_until)
+ ->groupBy('user_id')
+ ->get();
$users = User::whereIn('id', $consent_users_selected)->get();
- //die(print_r([$request->input('user_ids'), $consent_users_selected, $users]));
+ // die(print_r([$request->input('user_ids'), $consent_users_selected, $users]));
// Fill dates array
- $assets = ["users"=>0, "user_names"=>[], "apiaries"=>0, "hives"=>0, "inspections"=>0, "devices"=>0, "devices_online"=>0, "device_names"=>[], "devices_offline"=>[], "measurements"=>0, "measurements_imported"=>0, "measurements_total"=>0, "data_completeness"=>0, "data_completeness_online"=>0, "weather"=>0, "flashlogs"=>0, "samplecodes"=>0, "sensor_definitions"=>0, "alert_rules"=>0, "alerts"=>0];
+ $assets = ['users' => 0, 'user_names' => [], 'apiaries' => 0, 'hives' => 0, 'inspections' => 0, 'devices' => 0, 'devices_online' => 0, 'device_names' => [], 'devices_offline' => [], 'measurements' => 0, 'measurements_imported' => 0, 'measurements_total' => 0, 'data_completeness' => 0, 'data_completeness_online' => 0, 'weather' => 0, 'flashlogs' => 0, 'samplecodes' => 0, 'sensor_definitions' => 0, 'alert_rules' => 0, 'alerts' => 0];
$moment = $moment_start;
- while($moment < $moment_end)
- {
+ while ($moment < $moment_end) {
// make date
$dates[$moment->format('Y-m-d')] = $assets;
// next
@@ -364,536 +360,518 @@ public function show($id, Request $request)
}
$spreadsheet_array = [];
- if ($download)
- {
+ if ($download) {
// Fill export array
-
+
// Define header rows of tabs
$spreadsheet_array['User consents'] = [
- ['User_id',
- __('export.name'),
- 'Consent date',
- 'Consent (0=no, 1=yes)',
- ]
- ];
+ ['User_id',
+ __('export.name'),
+ 'Consent date',
+ 'Consent (0=no, 1=yes)',
+ ],
+ ];
$consents_export = DB::table('research_user')
- ->join('users', 'users.id', '=', 'research_user.user_id')
- ->select('users.id','users.name','research_user.updated_at','research_user.consent')
- ->where('research_user.research_id', $id)
- ->whereIn('user_id', $consent_users_selected)
- ->whereDate('research_user.updated_at', '<', $date_until)
- ->get()
- ->toArray();
-
- foreach($consents_export as $cex)
+ ->join('users', 'users.id', '=', 'research_user.user_id')
+ ->select('users.id', 'users.name', 'research_user.updated_at', 'research_user.consent')
+ ->where('research_user.research_id', $id)
+ ->whereIn('user_id', $consent_users_selected)
+ ->whereDate('research_user.updated_at', '<', $date_until)
+ ->get()
+ ->toArray();
+
+ foreach ($consents_export as $cex) {
$spreadsheet_array['User consents'][] = [$cex->id, $cex->name, $cex->updated_at, "$cex->consent"];
-
+ }
$spreadsheet_array[__('export.users')] = [
- ['User_id',
- __('export.name'),
- __('export.email'),
- __('export.avatar'),
- __('export.created_at'),
- __('export.updated_at'),
- __('export.last_login')]
- ];
+ ['User_id',
+ __('export.name'),
+ __('export.email'),
+ __('export.avatar'),
+ __('export.created_at'),
+ __('export.updated_at'),
+ __('export.last_login')],
+ ];
// add user data to sheet data arrays
- foreach ($users as $user)
+ foreach ($users as $user) {
$spreadsheet_array[__('export.users')][] = $this->getUser($user);
-
+ }
$spreadsheet_array[__('export.locations')] = [
- ['User_id',
- 'Location_id',
- __('export.name'),
- __('export.type'),
- __('export.hives'),
- __('export.coordinate_lat'),
- __('export.coordinate_lon'),
- __('export.address'),
- __('export.postal_code'),
- __('export.city'),
- __('export.country_code'),
- __('export.continent'),
- __('export.created_at'),
- __('export.deleted_at')]
- ];
+ ['User_id',
+ 'Location_id',
+ __('export.name'),
+ __('export.type'),
+ __('export.hives'),
+ __('export.coordinate_lat'),
+ __('export.coordinate_lon'),
+ __('export.address'),
+ __('export.postal_code'),
+ __('export.city'),
+ __('export.country_code'),
+ __('export.continent'),
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
$spreadsheet_array[__('export.hives')] = [
- ['User_id',
- 'Hive_id',
- __('export.name'),
- __('export.type'),
- 'Location_id',
- __('export.color'),
- 'Queen_id',
- __('export.queen'),
- __('export.queen_color'),
- __('export.queen_born'),
- __('export.queen_fertilized'),
- __('export.queen_clipped'),
- __('export.brood_layers'),
- __('export.honey_layers'),
- __('export.frames'),
- __('export.created_at'),
- __('export.deleted_at')]
- ];
+ ['User_id',
+ 'Hive_id',
+ __('export.name'),
+ __('export.type'),
+ 'Location_id',
+ __('export.color'),
+ 'Queen_id',
+ __('export.queen'),
+ __('export.queen_color'),
+ __('export.queen_born'),
+ __('export.queen_fertilized'),
+ __('export.queen_clipped'),
+ __('export.brood_layers'),
+ __('export.honey_layers'),
+ __('export.frames'),
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
$spreadsheet_array['Sample codes'] = [
- ['User_id',
- 'Sample code',
- 'Sample date',
- 'Country code',
- 'Location_id',
- 'Location_name',
- 'Hive_id',
- 'Hive_name',
- 'Queen_id',
- 'Sample note',
- 'Test type',
- 'Test date',
- 'Test result',
- 'Test lab name',
- __('export.updated_at'),
- __('export.created_at')]
- ];
+ ['User_id',
+ 'Sample code',
+ 'Sample date',
+ 'Country code',
+ 'Location_id',
+ 'Location_name',
+ 'Hive_id',
+ 'Hive_name',
+ 'Queen_id',
+ 'Sample note',
+ 'Test type',
+ 'Test date',
+ 'Test result',
+ 'Test lab name',
+ __('export.updated_at'),
+ __('export.created_at')],
+ ];
$spreadsheet_array[__('export.inspections')] = [
- ['User_id',
- 'Inspection_id',
- __('export.created_at'),
- 'Hive_id',
- 'Location_id',
- __('export.impression'),
- __('export.attention'),
- __('export.reminder'),
- __('export.reminder_date'),
- __('export.notes')]
- ];
+ ['User_id',
+ 'Inspection_id',
+ __('export.created_at'),
+ 'Hive_id',
+ 'Location_id',
+ __('export.impression'),
+ __('export.attention'),
+ __('export.reminder'),
+ __('export.reminder_date'),
+ __('export.notes')],
+ ];
$spreadsheet_array[__('export.devices')] = [
- ['User_id',
- 'Device_id',
- __('export.name'),
- 'Hive_id',
- 'Location_id',
- 'Type',
- 'hardware_id',
- 'firmware_version',
- 'hardware_version',
- 'boot_count',
- 'measurement_interval_min',
- 'measurement_transmission_ratio',
- 'ble_pin',
- 'battery_voltage',
- 'next_downlink_message',
- 'last_downlink_result',
- 'rtc_installed',
- 'log_data_valid',
- 'log_data_state',
- 'log_data_csv',
- 'log_data_note',
- 'log_data_info',
- 'last_message_received',
- 'device_datetime_last_received',
- 'device_datetime_offset_sec',
- 'sensor_definition_count',
- __('export.created_at'),
- __('export.deleted_at')]
- ];
+ ['User_id',
+ 'Device_id',
+ __('export.name'),
+ 'Hive_id',
+ 'Location_id',
+ 'Type',
+ 'hardware_id',
+ 'firmware_version',
+ 'hardware_version',
+ 'boot_count',
+ 'measurement_interval_min',
+ 'measurement_transmission_ratio',
+ 'ble_pin',
+ 'battery_voltage',
+ 'next_downlink_message',
+ 'last_downlink_result',
+ 'rtc_installed',
+ 'log_data_valid',
+ 'log_data_state',
+ 'log_data_csv',
+ 'log_data_note',
+ 'log_data_info',
+ 'last_message_received',
+ 'device_datetime_last_received',
+ 'device_datetime_offset_sec',
+ 'sensor_definition_count',
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
$spreadsheet_array[__('export.sensordefs')] = [
- ['Name',
- 'Device_id',
- 'inside_hive',
- 'offset',
- 'multiplier',
- 'input_measurement',
- 'output_measurement',
- __('export.created_at'),
- __('export.deleted_at')]
- ];
-
- if ($dl_sensordata)
+ ['Name',
+ 'Device_id',
+ 'inside_hive',
+ 'offset',
+ 'multiplier',
+ 'input_measurement',
+ 'output_measurement',
+ __('export.created_at'),
+ __('export.deleted_at')],
+ ];
+
+ if ($dl_sensordata) {
$spreadsheet_array['Sensor data'] = [
- ['User_id',
- 'Device_id',
- 'Date from',
- 'Date to',
- 'Data file']
- ];
+ ['User_id',
+ 'Device_id',
+ 'Date from',
+ 'Date to',
+ 'Data file'],
+ ];
+ }
$spreadsheet_array['Sensor Flashlogs'] = [
- ['User_id',
- 'Device_id',
- __('export.created_at'),
- 'Hive_id',
- 'Number of messages in file',
- 'Log saved to disk',
- 'Log parsed correctly',
- 'Log erased from device',
- 'Log has timestamps',
- 'Time percentage (%)',
- 'Bytes received',
- 'Persisted days of data',
- 'Persisted measurements',
- 'Persisted blocks',
- 'Log date start',
- 'Log date end',
- 'Logs per day',
- 'Log time complete (%)',
- 'Log valid',
- 'Log meta',
- 'CSV file',
- 'Raw log file',
- 'Stripped log file',
- 'Parsed log file',
- __('export.deleted_at')]
- ];
-
- if ($dl_sensordata)
+ ['User_id',
+ 'Device_id',
+ __('export.created_at'),
+ 'Hive_id',
+ 'Number of messages in file',
+ 'Log saved to disk',
+ 'Log parsed correctly',
+ 'Log erased from device',
+ 'Log has timestamps',
+ 'Time percentage (%)',
+ 'Bytes received',
+ 'Persisted days of data',
+ 'Persisted measurements',
+ 'Persisted blocks',
+ 'Log date start',
+ 'Log date end',
+ 'Logs per day',
+ 'Log time complete (%)',
+ 'Log valid',
+ 'Log meta',
+ 'CSV file',
+ 'Raw log file',
+ 'Stripped log file',
+ 'Parsed log file',
+ __('export.deleted_at')],
+ ];
+
+ if ($dl_sensordata) {
$spreadsheet_array['Weather data'] = [
- ['User_id',
- 'Device_id',
- 'Location_id',
- 'Location_lat',
- 'Location_lon',
- 'Date from',
- 'Date to',
- 'Data file']
- ];
+ ['User_id',
+ 'Device_id',
+ 'Location_id',
+ 'Location_lat',
+ 'Location_lon',
+ 'Date from',
+ 'Date to',
+ 'Data file'],
+ ];
+ }
$spreadsheet_array['Alert rules'] = [
- [
- 'User_id',
- __('export.created_at'),
- 'Name',
- 'Function',
- 'Calculation minutes',
- 'Last calculated',
- 'Last evaluated'
- ]
- ];
+ [
+ 'User_id',
+ __('export.created_at'),
+ 'Name',
+ 'Function',
+ 'Calculation minutes',
+ 'Last calculated',
+ 'Last evaluated',
+ ],
+ ];
$spreadsheet_array['Alerts'] = [
- [
- 'User_id',
- 'Device_id',
- 'Location_id',
- 'Hive_id',
- __('export.created_at'),
- 'Function',
- 'Value',
- 'Count'
- ]
- ];
+ [
+ 'User_id',
+ 'Device_id',
+ 'Location_id',
+ 'Hive_id',
+ __('export.created_at'),
+ 'Function',
+ 'Value',
+ 'Count',
+ ],
+ ];
// Add item names to header row of inspections
// first combine all user's itemnames
- $item_ancs = [];
+ $item_ancs = [];
$item_names = [];
- foreach ($users as $user)
- {
+ foreach ($users as $user) {
$ins = Inspection::item_names($user->allInspections()->get());
- foreach ($ins as $in)
- {
+ foreach ($ins as $in) {
$name = $in['anc'].$in['name'];
- if (!in_array($name, $item_ancs))
- {
- $item_ancs[] = $name;
- $item_names[] = $in;
+ if (! in_array($name, $item_ancs)) {
+ $item_ancs[] = $name;
+ $item_names[] = $in;
}
}
}
- foreach ($item_ancs as $name)
+ foreach ($item_ancs as $name) {
$spreadsheet_array[__('export.inspections')][0][] = $name;
+ }
$spreadsheet_array[__('export.inspections')][0][] = __('export.deleted_at');
}
// Fill dates array with counts of data, and select the data for each user by consent
- foreach ($users as $u)
- {
- $user_id = $u->id;
- $user = User::find($user_id);
- $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at','asc')->get()->toArray();
-
- if (!isset($user) || !isset($user_consents) || count($user_consents) == 0)
+ foreach ($users as $u) {
+ $user_id = $u->id;
+ $user = User::find($user_id);
+ $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at', 'asc')->get()->toArray();
+
+ if (! isset($user) || ! isset($user_consents) || count($user_consents) == 0) {
continue;
+ }
- $user_consent_obj = $user_consents[0];
- $user_consent = $user_consent_obj->consent;
+ $user_consent_obj = $user_consents[0];
+ $user_consent = $user_consent_obj->consent;
$date_curr_consent = $date_start > $user_consent_obj->updated_at ? $date_start : $user_consent_obj->updated_at;
$date_next_consent = $moment_end->format('Y-m-d H:i:s');
- $index = 0;
+ $index = 0;
- if (count($user_consents) > 1)
- {
+ if (count($user_consents) > 1) {
$date_next_consent = $user_consents[1]->updated_at;
- $index = 1;
- }
- elseif ($user_consent === 0) // if only 1 and consent is false, continue to next user
- {
+ $index = 1;
+ } elseif ($user_consent === 0) { // if only 1 and consent is false, continue to next user
continue;
}
-
- //die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
+ // die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
// add user data
- if (isset($user_consent_obj->consent_location_ids)) // Set consent based on specific items
- {
- $loc_array = explode(',', $user_consent_obj->consent_location_ids);
+ if (isset($user_consent_obj->consent_location_ids)) { // Set consent based on specific items
+ $loc_array = explode(',', $user_consent_obj->consent_location_ids);
$user_apiaries = $user->locations()->withTrashed()->whereIn('id', $loc_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
+ } else {
$user_apiaries = $user->locations()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_hive_ids)) // Set consent based on specific items
- {
- $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
- $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
- $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ if (isset($user_consent_obj->consent_hive_ids)) { // Set consent based on specific items
+ $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
+ $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ } else {
+ $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_sensor_ids)) // Set consent based on specific items
- {
- $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
+ if (isset($user_consent_obj->consent_sensor_ids)) { // Set consent based on specific items
+ $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
$user_devices_all = $user->devices()->withTrashed()->whereIn('id', $device_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
+ } else {
$user_devices_all = $user->devices()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- $devices_all = $devices_all->merge($user_devices_all);
- $user_devices = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids) : $user_devices_all;
+ $devices_all = $devices_all->merge($user_devices_all);
+ $user_devices = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids) : $user_devices_all;
$user_devices_online = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids)->where('last_message_received', '>=', $date_start) : $user_devices_all->where('last_message_received', '>=', $date_start);
- $user_flashlogs = FlashLog::where('user_id', $user_id)->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- $user_samplecodes = $user->samplecodes()->where('sample_date', '>=', $date_start)->where('sample_date', '<', $date_until)->orderBy('sample_date')->get();
+ $user_flashlogs = FlashLog::where('user_id', $user_id)->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $user_samplecodes = $user->samplecodes()->where('sample_date', '>=', $date_start)->where('sample_date', '<', $date_until)->orderBy('sample_date')->get();
$user_measurements = [];
- $user_meas_import = [];
+ $user_meas_import = [];
$user_weather_data = [];
- $user_sensor_defs = [];
- $user_alert_rules = $user->alert_rules()->where('default_rule', 0)->where('active', 1)->get();
- $user_alerts = isset($device_ids) ? $user->alerts()->whereIn('device_id', $device_ids)->where('show', 1)->get() : $user->alerts()->where('show', 1)->get();
-
- //die(print_r($user_devices->toArray()));
+ $user_sensor_defs = [];
+ $user_alert_rules = $user->alert_rules()->where('default_rule', 0)->where('active', 1)->get();
+ $user_alerts = isset($device_ids) ? $user->alerts()->whereIn('device_id', $device_ids)->where('show', 1)->get() : $user->alerts()->where('show', 1)->get();
+
+ // die(print_r($user_devices->toArray()));
// add hive inspections (also from collaborators)
$hive_inspection_ids = [];
- foreach ($user_hives as $hive)
- {
+ foreach ($user_hives as $hive) {
$hive_inspections = $hive->inspections()->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->get();
- foreach ($hive_inspections as $ins)
+ foreach ($hive_inspections as $ins) {
$hive_inspection_ids[] = $ins->id;
-
+ }
+
}
- $hive_inspections = Inspection::whereIn('id', $hive_inspection_ids)->with('items')->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ $hive_inspections = Inspection::whereIn('id', $hive_inspection_ids)->with('items')->where('created_at', '>=', $date_start)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- //die(print_r([$date_until, $hive_inspections->toArray(), $user_hives->toArray()]));
+ // die(print_r([$date_until, $hive_inspections->toArray(), $user_hives->toArray()]));
- if ($user_devices->count() > 0)
- {
+ if ($user_devices->count() > 0) {
// get daily counts of sensor measurements
- $points = [];
- $weather = [];
+ $points = [];
+ $weather = [];
$user_device_keys = [];
$user_dloc_coords = [];
// Add sensor data
- foreach ($user_devices as $device)
- {
- $user_device_keys[]= $device->influxWhereKeys();
+ foreach ($user_devices as $device) {
+ $user_device_keys[] = $device->influxWhereKeys();
$loc = $device->location();
- if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
+ if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon)) {
$user_dloc_coords[] = '("lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\')';
+ }
// Add sensor definitions
$sensor_defs = $this->getSensorDefinitions($device, $date_next_consent);
- foreach ($sensor_defs as $sdef)
+ foreach ($sensor_defs as $sdef) {
$user_sensor_defs[] = $sdef;
+ }
}
- if (count($user_device_keys) > 0)
- {
+ if (count($user_device_keys) > 0) {
$user_device_keys = '('.implode(' OR ', $user_device_keys).')';
- try{
+ try {
$this->cacheRequestRate('influx-get');
$this->cacheRequestRate('influx-research');
- $query = 'SELECT COUNT("bv") as "count" FROM "sensors" WHERE '.$user_device_keys.' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$moment_end->format('Y-m-d H:i:s').'\' GROUP BY time(1d),from_flashlog';
- //die($query);
+ $query = 'SELECT COUNT("bv") as "count" FROM "sensors" WHERE '.$user_device_keys.' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$moment_end->format('Y-m-d H:i:s').'\' GROUP BY time(1d),from_flashlog';
+ // die($query);
$points = $this->client::query($query)->getPoints();
} catch (InfluxDB\Exception $e) {
Log::error('Research data query error: '.$e->getMessage());
// return Response::json('influx-group-by-query-error', 500);
}
- if (count($points) > 0)
- {
- foreach ($points as $point)
- {
- if ($point['from_flashlog'] === '1')
- $user_meas_import[substr($point['time'],0,10)] = $point['count'];
- else
- $user_measurements[substr($point['time'],0,10)] = $point['count'];
+ if (count($points) > 0) {
+ foreach ($points as $point) {
+ if ($point['from_flashlog'] === '1') {
+ $user_meas_import[substr($point['time'], 0, 10)] = $point['count'];
+ } else {
+ $user_measurements[substr($point['time'], 0, 10)] = $point['count'];
+ }
}
}
}
// Add weather data
$user_location_coord_where = '('.implode(' OR ', $user_dloc_coords).')';
- if (count($user_dloc_coords) > 0 && isset($date_curr_consent))
- {
- try{
+ if (count($user_dloc_coords) > 0 && isset($date_curr_consent)) {
+ try {
$weather = $this->client::query('SELECT COUNT("temperature") as "count" FROM "weather" WHERE '.$user_location_coord_where.' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$moment_end->format('Y-m-d H:i:s').'\' GROUP BY time(1d)')->getPoints(); // get first weather date
} catch (InfluxDB\Exception $e) {
Log::error('Research weather query error: '.$e->getMessage());
// return Response::json('influx-group-by-query-error', 500);
}
- if (count($weather) > 0)
- {
- foreach ($weather as $point)
- $user_weather_data[substr($point['time'],0,10)] = $point['count'];
+ if (count($weather) > 0) {
+ foreach ($weather as $point) {
+ $user_weather_data[substr($point['time'], 0, 10)] = $point['count'];
+ }
}
}
}
// go over dates, compare consent dates
$i = 0;
- $user_data_counts = $assets;
+ $user_data_counts = $assets;
$last_devices_online = [];
- foreach ($dates as $d => $v)
- {
- $d_start = $d.' 00:00:00';
- $d_end = $d.' 23:59:59';
+ foreach ($dates as $d => $v) {
+ $d_start = $d.' 00:00:00';
+ $d_end = $d.' 23:59:59';
$next_consent = false;
- if ($d_end >= $date_next_consent && $index > 0 && $index < count($user_consents)) // change user_consent if multiple user_consents exist and check date is past the active consent date
- {
+ if ($d_end >= $date_next_consent && $index > 0 && $index < count($user_consents)) { // change user_consent if multiple user_consents exist and check date is past the active consent date
$next_consent = true;
// take current user_consent
- $user_consent = $user_consents[$index]->consent;
- $date_curr_consent = $user_consents[$index]->updated_at;
- //fill up to next consent date
- if ($index < count($user_consents)-1)
- $date_next_consent = $user_consents[$index+1]->updated_at;
- else
+ $user_consent = $user_consents[$index]->consent;
+ $date_curr_consent = $user_consents[$index]->updated_at;
+ // fill up to next consent date
+ if ($index < count($user_consents) - 1) {
+ $date_next_consent = $user_consents[$index + 1]->updated_at;
+ } else {
$date_next_consent = $moment_end->format('Y-m-d H:i:s');
+ }
// hide this data from dataset, because earlier than requested
- if ($date_next_consent < $date_start || $date_curr_consent > $date_until)
- {
+ if ($date_next_consent < $date_start || $date_curr_consent > $date_until) {
$index++;
+
continue;
}
-
+
// minimize consent dates to start/unit date
- if ($date_curr_consent < $date_start)
+ if ($date_curr_consent < $date_start) {
$date_curr_consent = $date_start.' 00:00:00';
+ }
- if ($date_next_consent > $date_until)
+ if ($date_next_consent > $date_until) {
$date_next_consent = $date_until.' 23:59:59';
+ }
- //print_r([$index, $user_consent, $date_start, $date_until, $date_curr_consent, $date_next_consent, $moment_end]);
+ // print_r([$index, $user_consent, $date_start, $date_until, $date_curr_consent, $date_next_consent, $moment_end]);
$index++;
}
-
-
// Fill objects for consent period
- if ($user_consent && ($next_consent || $i == 0))
- {
- // add
- $user_data_counts['users'] = $user_consent;
- $user_data_counts['apiaries'] = $user_apiaries->where('created_at', '<=', $date_next_consent)->count();
- $user_data_counts['hives'] = $user_hives->where('created_at', '<=', $date_next_consent)->count();
- $user_data_counts['devices'] = $user_devices->where('created_at', '<=', $date_next_consent)->count();
- $user_data_counts['devices_online'] = $user_devices_online->where('created_at', '<=', $date_next_consent)->count();
- $user_data_counts['flashlogs'] = $user_flashlogs->where('created_at', '<=', $date_next_consent)->count();
- $user_data_counts['alert_rules'] = $user_alert_rules->where('created_at', '<=', $date_next_consent)->count();
+ if ($user_consent && ($next_consent || $i == 0)) {
+ // add
+ $user_data_counts['users'] = $user_consent;
+ $user_data_counts['apiaries'] = $user_apiaries->where('created_at', '<=', $date_next_consent)->count();
+ $user_data_counts['hives'] = $user_hives->where('created_at', '<=', $date_next_consent)->count();
+ $user_data_counts['devices'] = $user_devices->where('created_at', '<=', $date_next_consent)->count();
+ $user_data_counts['devices_online'] = $user_devices_online->where('created_at', '<=', $date_next_consent)->count();
+ $user_data_counts['flashlogs'] = $user_flashlogs->where('created_at', '<=', $date_next_consent)->count();
+ $user_data_counts['alert_rules'] = $user_alert_rules->where('created_at', '<=', $date_next_consent)->count();
$user_data_counts['sensor_definitions'] = count($user_sensor_defs);
- //print_r([$i, $index, $user_consent, $date_curr_consent, $date_next_consent, $user_data_counts, $user_devices->toArray()]);
+ // print_r([$i, $index, $user_consent, $date_curr_consent, $date_next_consent, $user_data_counts, $user_devices->toArray()]);
- if ($download)
- {
+ if ($download) {
$locas = $this->getLocations($user_id, $user_apiaries, $date_curr_consent, $date_next_consent);
- foreach ($locas as $loca)
+ foreach ($locas as $loca) {
$spreadsheet_array[__('export.locations')][] = $loca;
+ }
$hives = $this->getHives($user_id, $user_hives, $date_curr_consent, $date_next_consent);
- foreach ($hives as $hive)
+ foreach ($hives as $hive) {
$spreadsheet_array[__('export.hives')][] = $hive;
+ }
$insps = $this->getInspections($user_id, $hive_inspections, $item_ancs, $date_curr_consent, $date_next_consent);
- foreach ($insps as $insp)
+ foreach ($insps as $insp) {
$spreadsheet_array[__('export.inspections')][] = $insp;
+ }
$flash = $this->getFlashlogs($user_id, $user_flashlogs, $date_curr_consent, $date_next_consent);
- foreach ($flash as $fla)
+ foreach ($flash as $fla) {
$spreadsheet_array['Sensor Flashlogs'][] = $fla;
-
+ }
+
$sampe = $this->getSampleCodes($user_id, $user_samplecodes, $date_curr_consent, $date_next_consent);
- foreach ($sampe as $sam)
+ foreach ($sampe as $sam) {
$spreadsheet_array['Sample codes'][] = $sam;
+ }
- if (count($user_sensor_defs) > 0)
- foreach ($user_sensor_defs as $sdef)
+ if (count($user_sensor_defs) > 0) {
+ foreach ($user_sensor_defs as $sdef) {
$spreadsheet_array[__('export.sensordefs')][] = $sdef;
+ }
+ }
$alert_rules = $this->getAlertRules($user_id, $user_alert_rules, $date_curr_consent, $date_next_consent);
- foreach ($alert_rules as $ar)
+ foreach ($alert_rules as $ar) {
$spreadsheet_array['Alert rules'][] = $ar;
+ }
$alerts = $this->getAlerts($user_id, $user_alerts, $date_curr_consent, $date_next_consent);
- foreach ($alerts as $al)
+ foreach ($alerts as $al) {
$spreadsheet_array['Alerts'][] = $al;
+ }
- if ($user_devices->count() > 0)
- {
- foreach ($user_devices as $device)
- {
+ if ($user_devices->count() > 0) {
+ foreach ($user_devices as $device) {
// Add device to spreadsheet
- if ($device->created_at < $date_next_consent)
- {
+ if ($device->created_at < $date_next_consent) {
$spreadsheet_array[__('export.devices')][] = $this->getDevice($user_id, $device);
-
- if ($dl_sensordata)
- {
+
+ if ($dl_sensordata) {
// Export data to file per device / period
- $where = $device->influxWhereKeys().' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
- $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id.'-device-id-'.$device->id.'-sensor-data-'.substr($date_curr_consent,0,10).'-'.substr($date_next_consent,0,10).'-'.Str::random(10).'.csv';
+ $where = $device->influxWhereKeys().' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
+ $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id.'-device-id-'.$device->id.'-sensor-data-'.substr($date_curr_consent, 0, 10).'-'.substr($date_next_consent, 0, 10).'-'.Str::random(10).'.csv';
$filePath = $this->exportCsvFromInflux($where, $fileName, '*', 'sensors');
- if ($filePath)
- {
+ if ($filePath) {
$spreadsheet_array['Sensor data'][] = [$user_id, $device->id, $date_curr_consent, $date_next_consent, "$filePath"];
$sensor_urls[$fileName] = $filePath;
}
// Export data to file per device location / period
$loc = $device->location();
- if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
- {
- $where = '"lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
- $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id.'-device-id-'.$device->id.'-weather-data-'.substr($date_curr_consent,0,10).'-'.substr($date_next_consent,0,10).'-'.Str::random(10).'.csv';
+ if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon)) {
+ $where = '"lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\' AND time >= \''.$date_curr_consent.'\' AND time <= \''.$date_next_consent.'\'';
+ $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id.'-device-id-'.$device->id.'-weather-data-'.substr($date_curr_consent, 0, 10).'-'.substr($date_next_consent, 0, 10).'-'.Str::random(10).'.csv';
$filePath = $this->exportCsvFromInflux($where, $fileName, '*', 'weather');
- if ($filePath)
- {
+ if ($filePath) {
$spreadsheet_array['Weather data'][] = [$user_id, $device->id, $loc->id, $loc->coordinate_lat, $loc->coordinate_lon, $date_curr_consent, $date_next_consent, "$filePath"];
$sensor_urls[$fileName] = $filePath;
}
@@ -907,50 +885,51 @@ public function show($id, Request $request)
}
// Fill day array
- if ($user_consent && $d_start > $date_curr_consent)
- {
+ if ($user_consent && $d_start > $date_curr_consent) {
// Count
- $dates[$d]['users'] += $user_data_counts['users'];
- $dates[$d]['user_names'][]= $user->name;
- $dates[$d]['apiaries'] += $user_data_counts['apiaries'];
- $dates[$d]['hives'] += $user_data_counts['hives'];
- $dates[$d]['devices'] += $user_data_counts['devices'];
- $dates[$d]['devices_online']+= $user_devices_online->where('last_message_received', '>=', $d_start)->count();
- $dates[$d]['device_names']= array_merge($dates[$d]['device_names'], $user_devices_online->where('last_message_received', '>=', $d_start)->pluck('name')->toArray());
-
- if (count($last_devices_online) > 0)
- {
+ $dates[$d]['users'] += $user_data_counts['users'];
+ $dates[$d]['user_names'][] = $user->name;
+ $dates[$d]['apiaries'] += $user_data_counts['apiaries'];
+ $dates[$d]['hives'] += $user_data_counts['hives'];
+ $dates[$d]['devices'] += $user_data_counts['devices'];
+ $dates[$d]['devices_online'] += $user_devices_online->where('last_message_received', '>=', $d_start)->count();
+ $dates[$d]['device_names'] = array_merge($dates[$d]['device_names'], $user_devices_online->where('last_message_received', '>=', $d_start)->pluck('name')->toArray());
+
+ if (count($last_devices_online) > 0) {
$dates[$d]['devices_offline'] = array_diff($last_devices_online, $dates[$d]['device_names']);
}
- $last_devices_online = $dates[$d]['device_names'];
-
+ $last_devices_online = $dates[$d]['device_names'];
+
$dates[$d]['sensor_definitions'] += $user_data_counts['sensor_definitions'];
- $dates[$d]['alert_rules']+= $user_data_counts['alert_rules'];
+ $dates[$d]['alert_rules'] += $user_data_counts['alert_rules'];
- $inspections_today = $hive_inspections->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
+ $inspections_today = $hive_inspections->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
$dates[$d]['inspections'] = $v['inspections'] + $inspections_today;
-
- $flashlogs_today = $user_flashlogs->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
- $dates[$d]['flashlogs'] = $v['flashlogs'] + $flashlogs_today;
- $samplecodes_today = $user_samplecodes->where('sample_date', '>=', $d_start)->where('sample_date', '<=', $d_end)->count();
+ $flashlogs_today = $user_flashlogs->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
+ $dates[$d]['flashlogs'] = $v['flashlogs'] + $flashlogs_today;
+
+ $samplecodes_today = $user_samplecodes->where('sample_date', '>=', $d_start)->where('sample_date', '<=', $d_end)->count();
$dates[$d]['samplecodes'] = $v['samplecodes'] + $samplecodes_today;
- $alerts_today = $user_alerts->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
- $dates[$d]['alerts'] = $v['alerts'] + $alerts_today;
-
- if (in_array($d, array_keys($user_measurements)))
+ $alerts_today = $user_alerts->where('created_at', '>=', $d_start)->where('created_at', '<=', $d_end)->count();
+ $dates[$d]['alerts'] = $v['alerts'] + $alerts_today;
+
+ if (in_array($d, array_keys($user_measurements))) {
$dates[$d]['measurements'] = $v['measurements'] + $user_measurements[$d];
+ }
- if (in_array($d, array_keys($user_meas_import)))
+ if (in_array($d, array_keys($user_meas_import))) {
$dates[$d]['measurements_imported'] = $v['measurements_imported'] + $user_meas_import[$d];
+ }
- $dates[$d]['measurements_total'] = $dates[$d]['measurements'] + $dates[$d]['measurements_imported'];
- $dates[$d]['data_completeness'] = $dates[$d]['devices'] > 0 ? round(100 * $dates[$d]['measurements_total'] / ($dates[$d]['devices'] * (60*24/15))) : '';
- $dates[$d]['data_completeness_online'] = $dates[$d]['devices_online'] > 0 ? min(100, round(100 * $dates[$d]['measurements_total'] / ($dates[$d]['devices_online'] * (60*24/15)))) : '';
+ $dates[$d]['measurements_total'] = $dates[$d]['measurements'] + $dates[$d]['measurements_imported'];
+ $dates[$d]['data_completeness'] = $dates[$d]['devices'] > 0 ? round(100 * $dates[$d]['measurements_total'] / ($dates[$d]['devices'] * (60 * 24 / 15))) : '';
+ $dates[$d]['data_completeness_online'] = $dates[$d]['devices_online'] > 0 ? min(100, round(100 * $dates[$d]['measurements_total'] / ($dates[$d]['devices_online'] * (60 * 24 / 15)))) : '';
- if (in_array($d, array_keys($user_weather_data)))
- $dates[$d]['weather']= $v['weather'] + $user_weather_data[$d];
+ if (in_array($d, array_keys($user_weather_data))) {
+ $dates[$d]['weather'] = $v['weather'] + $user_weather_data[$d];
+ }
}
@@ -962,55 +941,51 @@ public function show($id, Request $request)
krsort($dates);
// Count totals
- $totals = $assets;
+ $totals = $assets;
$data_days = 0;
- foreach ($dates as $day => $day_arr)
- {
- foreach ($day_arr as $asset => $count)
- {
- if (is_numeric($count))
- {
- if ($asset == 'inspections' || $asset == 'measurements' || $asset == 'measurements_imported' || $asset == 'measurements_total' || $asset == 'data_completeness' || $asset == 'data_completeness_online' || $asset == 'weather' || $asset == 'samplecodes' || $asset == 'flashlogs' || $asset == 'alerts')
+ foreach ($dates as $day => $day_arr) {
+ foreach ($day_arr as $asset => $count) {
+ if (is_numeric($count)) {
+ if ($asset == 'inspections' || $asset == 'measurements' || $asset == 'measurements_imported' || $asset == 'measurements_total' || $asset == 'data_completeness' || $asset == 'data_completeness_online' || $asset == 'weather' || $asset == 'samplecodes' || $asset == 'flashlogs' || $asset == 'alerts') {
$totals[$asset] += $count;
- else
+ } else {
$totals[$asset] = max($totals[$asset], $count);
+ }
- if ($asset == 'measurements_total' && $count > 0)
+ if ($asset == 'measurements_total' && $count > 0) {
$data_days++;
+ }
}
}
}
// Average data completenes
- if ($data_days > 0)
- {
- $totals['data_completeness'] = round($totals['data_completeness'] / $data_days);
+ if ($data_days > 0) {
+ $totals['data_completeness'] = round($totals['data_completeness'] / $data_days);
$totals['data_completeness_online'] = round($totals['data_completeness_online'] / $data_days);
}
// Export data, show download link
- if ($download)
- {
- //die(print_r([$consents, $totals, $spreadsheet_array[__('export.devices')], $spreadsheet_array[__('export.sensordefs')]]));
- $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id;
+ if ($download) {
+ // die(print_r([$consents, $totals, $spreadsheet_array[__('export.devices')], $spreadsheet_array[__('export.sensordefs')]]));
+ $fileName = strtolower(env('APP_NAME')).'-export-research-'.$research->id;
$download_url = $this->export($spreadsheet_array, $fileName, $date_start, $date_until);
}
- // Make readable devices select list
+ // Make readable devices select list
$devices_select = [];
$devices_sorted = $devices_all->sortBy('user_id')->sortBy('name');
- foreach ($devices_sorted as $d)
- $devices_select[$d->id] = $d->name.' - ('.$d->user->name.')';
+ foreach ($devices_sorted as $d) {
+ $devices_select[$d->id] = $d->name.' - ('.$d->user->name.')';
+ }
return view('research.show', compact('research', 'dates', 'consent_users_select', 'consent_users_selected', 'download_url', 'sensor_urls', 'totals', 'date_start', 'date_until', 'devices_select', 'device_ids'));
}
-
-/**
+ /**
* Display Research data per device.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function data($id, Request $request)
@@ -1018,52 +993,52 @@ public function data($id, Request $request)
$this->checkAuthorization($request);
$this->validate($request, [
- 'date_start' => 'nullable|date',
- 'date_until' => 'nullable|date|after:date_start',
- 'user_ids.*' => 'nullable|exists:users,id',
- 'device_ids.*' => 'nullable|exists:sensors,id',
- 'add_flashlogs' => 'nullable|boolean',
- 'until_last_fl' => 'nullable|boolean',
- 'invalid_log_prognose' => 'nullable|boolean',
- 'add_db_data' => 'nullable|boolean',
- 'log_device_id' => 'nullable|exists:sensors,id',
- 'log_device_note' => 'nullable|string',
- 'only_change' => 'nullable|string',
- 'only_change_value' => 'nullable|string',
- 'reparse_fl_ids' => 'nullable|string',
+ 'date_start' => 'nullable|date',
+ 'date_until' => 'nullable|date|after:date_start',
+ 'user_ids.*' => 'nullable|exists:users,id',
+ 'device_ids.*' => 'nullable|exists:sensors,id',
+ 'add_flashlogs' => 'nullable|boolean',
+ 'until_last_fl' => 'nullable|boolean',
+ 'invalid_log_prognose' => 'nullable|boolean',
+ 'add_db_data' => 'nullable|boolean',
+ 'log_device_id' => 'nullable|exists:sensors,id',
+ 'log_device_note' => 'nullable|string',
+ 'only_change' => 'nullable|string',
+ 'only_change_value' => 'nullable|string',
+ 'reparse_fl_ids' => 'nullable|string',
]);
$demo = $request->filled('demo') && boolval($request->input('demo')) ? true : false;
- //die(print_r($request->all()));
+ // die(print_r($request->all()));
- if ($request->user()->hasRole('superadmin'))
+ if ($request->user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
- else
+ } else {
$research = $request->user()->allResearches()->find($id);
+ }
- $device_ids = $request->input('device_ids');
- $log_device_id = intval($request->input('log_device_id'));
- $log_device_note = $request->input('log_device_note');
- $log_device_change= $request->input('only_change');
+ $device_ids = $request->input('device_ids');
+ $log_device_id = intval($request->input('log_device_id'));
+ $log_device_note = $request->input('log_device_note');
+ $log_device_change = $request->input('only_change');
$log_device_value = $request->input('only_change_value');
- $add_flashlogs = boolval($request->input('add_flashlogs', 1));
- $until_last_fl = boolval($request->input('until_last_fl', 1));
+ $add_flashlogs = boolval($request->input('add_flashlogs', 1));
+ $until_last_fl = boolval($request->input('until_last_fl', 1));
$invalid_log_prognose = boolval($request->input('invalid_log_prognose', 0));
- $add_db_data = boolval($request->input('add_db_data', 0));
- $devices_all = collect();
- $devices_show = collect();
- $initial_days = 30;
- $reparse_fl_ids = [];
-
- if ($request->filled('reparse_fl_ids'))
- {
+ $add_db_data = boolval($request->input('add_db_data', 0));
+ $devices_all = collect();
+ $devices_show = collect();
+ $initial_days = 30;
+ $reparse_fl_ids = [];
+
+ if ($request->filled('reparse_fl_ids')) {
$fl_ids = explode(',', $request->input('reparse_fl_ids'));
- foreach ($fl_ids as $fl_id)
- {
+ foreach ($fl_ids as $fl_id) {
$fl = FlashLog::find($fl_id);
- if ($fl)
+ if ($fl) {
$fl->addMetaToFlashlog();
+ }
}
}
@@ -1072,244 +1047,222 @@ public function data($id, Request $request)
key1 => [points, imported]
key2 => [points, imported]
]
-
+
*/
- $dates = [];
+ $dates = [];
- $date_today = date('Y-m-d');
- $date_last = isset($research->end_date) ? $research->end_date : $date_today;
- $date_start = max(substr($research->start_date, 0, 10), $request->input('date_start', $research->start_date));
- $date_until = min(substr($research->end_date, 0, 10), $request->input('date_until', $date_last));
+ $date_today = date('Y-m-d');
+ $date_last = isset($research->end_date) ? $research->end_date : $date_today;
+ $date_start = max(substr($research->start_date, 0, 10), $request->input('date_start', $research->start_date));
+ $date_until = min(substr($research->end_date, 0, 10), $request->input('date_until', $date_last));
- $moment_now = new Moment();
+ $moment_now = new Moment;
$moment_start = new Moment($date_start);
$moment_until = new Moment($date_until);
- $moment_end = new Moment($research->end_date);
- $moment_now = $moment_now->startof('day');
+ $moment_end = new Moment($research->end_date);
+ $moment_now = $moment_now->startof('day');
$moment_until = $moment_until->endof('day');
- $moment_end = $moment_end->endof('day');
+ $moment_end = $moment_end->endof('day');
- $research_days= $moment_start->from($moment_end)->getDays();
- $days_from_now= $moment_start->from($moment_now)->getDays();
- $days_from_end= $moment_now->from($moment_end)->getDays();
+ $research_days = $moment_start->from($moment_end)->getDays();
+ $days_from_now = $moment_start->from($moment_now)->getDays();
+ $days_from_end = $moment_now->from($moment_end)->getDays();
- $initial_days = min($research_days+1, $initial_days);
- $day_diff = 0;
+ $initial_days = min($research_days + 1, $initial_days);
+ $day_diff = 0;
- if ($days_from_now <= 0) // research has not started yet
- {
+ if ($days_from_now <= 0) { // research has not started yet
$moment_select = new Moment($date_start);
$date_start = $moment_select->startof('day')->format('Y-m-d');
$moment_select = new Moment($date_start);
- $date_until = min($date_until, $moment_select->endof('day')->addDays($initial_days-1)->format('Y-m-d'));
- }
- else if ($days_from_end <= 0) // research has already finished
- {
+ $date_until = min($date_until, $moment_select->endof('day')->addDays($initial_days - 1)->format('Y-m-d'));
+ } elseif ($days_from_end <= 0) { // research has already finished
$moment_select = new Moment($date_until);
- $date_start = $moment_select->startof('day')->addDays(-$initial_days-1)->format('Y-m-d');
+ $date_start = $moment_select->startof('day')->addDays(-$initial_days - 1)->format('Y-m-d');
$moment_select = new Moment($date_until);
$date_until = min($date_until, $moment_select->endof('day')->format('Y-m-d'));
- }
- else // now is within research start end end date
- {
- if ($request->filled('date_start') == false)
- {
+ } else { // now is within research start end end date
+ if ($request->filled('date_start') == false) {
$days_from_sta = max(0, $initial_days - $days_from_now);
- $moment_select = new Moment();
- $date_start = $moment_select->startof('day')->addDays(-$initial_days-1-$days_from_sta)->format('Y-m-d');
+ $moment_select = new Moment;
+ $date_start = $moment_select->startof('day')->addDays(-$initial_days - 1 - $days_from_sta)->format('Y-m-d');
}
- if ($request->filled('date_until') == false)
- {
- $moment_select = new Moment();
- $date_until = min($date_until, $moment_select->endof('day')->addDays(-$days_from_sta)->format('Y-m-d'));
+ if ($request->filled('date_until') == false) {
+ $moment_select = new Moment;
+ $date_until = min($date_until, $moment_select->endof('day')->addDays(-$days_from_sta)->format('Y-m-d'));
}
}
- //dd($date_start, $research->start_date, $date_until, $date_last, $research->end_date, $days_from_now, $days_from_end);
+ // dd($date_start, $research->start_date, $date_until, $date_last, $research->end_date, $days_from_now, $days_from_end);
// Cap to research
- if ($date_start < $research->start_date)
+ if ($date_start < $research->start_date) {
$date_start = substr($research->start_date, 0, 10);
+ }
- if ($date_until > $research->end_date)
+ if ($date_until > $research->end_date) {
$date_until = substr($research->end_date, 0, 10);
+ }
- $moment_start = new Moment($date_start);
- $moment_end = new Moment($date_until);
+ $moment_start = new Moment($date_start);
+ $moment_end = new Moment($date_until);
$last_data_date = $date_until;
- //dd($date_start, $date_until, $research_days, $days_from_now, $days_from_end, $day_diff, $moment_now, $moment_start, $moment_end);
-
+ // dd($date_start, $date_until, $research_days, $days_from_now, $days_from_end, $day_diff, $moment_now, $moment_start, $moment_end);
+
// count user consents within dates
$consent_users_select = DB::table('research_user')
- ->join('users', 'users.id', '=', 'research_user.user_id')
- ->select('users.name','users.id')
- ->selectRaw('sum(research_user.consent) as consents')
- ->where('research_user.research_id', $id)
- ->whereDate('research_user.updated_at', '<', $date_until)
- ->groupBy('research_user.user_id')
- ->having('consents', '>', 0)
- ->pluck('name','id')
- ->toArray();
+ ->join('users', 'users.id', '=', 'research_user.user_id')
+ ->select('users.name', 'users.id')
+ ->selectRaw('sum(research_user.consent) as consents')
+ ->where('research_user.research_id', $id)
+ ->whereDate('research_user.updated_at', '<', $date_until)
+ ->groupBy('research_user.user_id')
+ ->having('consents', '>', 0)
+ ->pluck('name', 'id')
+ ->toArray();
asort($consent_users_select, SORT_NATURAL);
$consent_users_selected = [];
// select users
- if ($request->has('user_ids'))
+ if ($request->has('user_ids')) {
$consent_users_selected = $request->input('user_ids');
- else if (isset($research->default_user_ids))
+ } elseif (isset($research->default_user_ids)) {
$consent_users_selected = $research->default_user_ids;
- else if (count($consent_users_select) > 0)
+ } elseif (count($consent_users_select) > 0) {
$consent_users_selected = [array_keys($consent_users_select)[0]];
+ }
$consents = DB::table('research_user')
- ->where('research_id', $id)
- ->whereIn('user_id', $consent_users_selected)
- ->whereDate('updated_at', '<', $date_until)
- ->groupBy('user_id')
- ->get();
+ ->where('research_id', $id)
+ ->whereIn('user_id', $consent_users_selected)
+ ->whereDate('updated_at', '<', $date_until)
+ ->groupBy('user_id')
+ ->get();
$users = User::whereIn('id', $consent_users_selected)->get();
- //die(print_r([$request->input('user_ids'), $consent_users_selected, $users]));
+ // die(print_r([$request->input('user_ids'), $consent_users_selected, $users]));
// Fill dates array
- $assets = ["users"=>0, "user_names"=>[], "devices"=>[], "devices_online"=>0, "device_names"=>[], "devices_offline"=>[], "measurements"=>0, "measurements_imported"=>0, "measurements_total"=>0, "data_completeness"=>0, "data_completeness_online"=>0, "flashlogs"=>0];
+ $assets = ['users' => 0, 'user_names' => [], 'devices' => [], 'devices_online' => 0, 'device_names' => [], 'devices_offline' => [], 'measurements' => 0, 'measurements_imported' => 0, 'measurements_total' => 0, 'data_completeness' => 0, 'data_completeness_online' => 0, 'flashlogs' => 0];
$moment = $moment_start;
-
+
// Fill $dates array
- while($moment < $moment_end)
- {
+ while ($moment < $moment_end) {
// make date
$dates[$moment->format('Y-m-d')] = $assets;
// next
$moment = $moment->addDays(1);
}
-
// Fill dates array with counts of data, and select the data for each user by consent
- foreach ($users as $u)
- {
- $user_id = $u->id;
- $user = User::find($user_id);
- $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at','asc')->get()->toArray();
-
- if (!isset($user) || !isset($user_consents) || count($user_consents) == 0)
+ foreach ($users as $u) {
+ $user_id = $u->id;
+ $user = User::find($user_id);
+ $user_consents = DB::table('research_user')->where('research_id', $id)->where('user_id', $user_id)->whereDate('updated_at', '<', $date_until)->orderBy('updated_at', 'asc')->get()->toArray();
+
+ if (! isset($user) || ! isset($user_consents) || count($user_consents) == 0) {
continue;
+ }
- $user_consent_obj = $user_consents[0];
- $user_consent = $user_consent_obj->consent;
+ $user_consent_obj = $user_consents[0];
+ $user_consent = $user_consent_obj->consent;
$date_curr_consent = $date_start > substr($user_consent_obj->updated_at, 0, 10) ? $date_start : $user_consent_obj->updated_at;
$date_next_consent = $moment_end->format('Y-m-d H:i:s');
- $index = 0;
+ $index = 0;
- if (count($user_consents) > 1)
- {
+ if (count($user_consents) > 1) {
$date_next_consent = $user_consents[1]->updated_at;
- $index = 1;
- }
- elseif ($user_consent === 0) // if only 1 and consent is false, continue to next user
- {
+ $index = 1;
+ } elseif ($user_consent === 0) { // if only 1 and consent is false, continue to next user
continue;
}
-
- //die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
+ // die(print_r([$user_consents, $date_curr_consent, $date_next_consent, $index]));
// add user data
- if (isset($user_consent_obj->consent_location_ids)) // Set consent based on specific items
- {
- $loc_array = explode(',', $user_consent_obj->consent_location_ids);
+ if (isset($user_consent_obj->consent_location_ids)) { // Set consent based on specific items
+ $loc_array = explode(',', $user_consent_obj->consent_location_ids);
$user_apiaries = $user->locations()->withTrashed()->whereIn('id', $loc_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
+ } else {
$user_apiaries = $user->locations()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_hive_ids)) // Set consent based on specific items
- {
- $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
- $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
- $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ if (isset($user_consent_obj->consent_hive_ids)) { // Set consent based on specific items
+ $hive_array = explode(',', $user_consent_obj->consent_hive_ids);
+ $user_hives = $user->hives()->withTrashed()->whereIn('id', $hive_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
+ } else {
+ $user_hives = $user->hives()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- if (isset($user_consent_obj->consent_sensor_ids)) // Set consent based on specific items
- {
- $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
+ if (isset($user_consent_obj->consent_sensor_ids)) { // Set consent based on specific items
+ $device_array = explode(',', $user_consent_obj->consent_sensor_ids);
$user_devices_all = $user->devices()->withTrashed()->whereIn('id', $device_array)->where('created_at', '<', $date_until)->orderBy('created_at')->get();
- }
- else
- {
+ } else {
$user_devices_all = $user->devices()->withTrashed()->where('created_at', '<', $date_until)->orderBy('created_at')->get();
}
- $devices_all = $devices_all->merge($user_devices_all);
- $user_devices = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids) : $user_devices_all;
- $devices_show = $devices_show->merge($user_devices);
+ $devices_all = $devices_all->merge($user_devices_all);
+ $user_devices = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids) : $user_devices_all;
+ $devices_show = $devices_show->merge($user_devices);
$user_devices_online = isset($device_ids) ? $user_devices_all->whereIn('id', $device_ids)->where('last_message_received', '>=', $date_start) : $user_devices_all->where('last_message_received', '>=', $date_start);
-
- $user_flashlogs = collect();
- if ($add_flashlogs)
- {
- if (isset($device_ids))
- $user_flashlogs= FlashLog::where('user_id', $user_id)->whereIn('device_id', $device_ids)->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get(); // only parsed and checked Flashlogs
- else
- $user_flashlogs= FlashLog::where('user_id', $user_id)->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get(); // only parsed and checked Flashlogs
-
+
+ $user_flashlogs = collect();
+ if ($add_flashlogs) {
+ if (isset($device_ids)) {
+ $user_flashlogs = FlashLog::where('user_id', $user_id)->whereIn('device_id', $device_ids)->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get();
+ } // only parsed and checked Flashlogs
+ else {
+ $user_flashlogs = FlashLog::where('user_id', $user_id)->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get();
+ } // only parsed and checked Flashlogs
+
// cap start time to last flashlog creted_at
- if ($until_last_fl && $user_flashlogs->count() > 0)
- {
+ if ($until_last_fl && $user_flashlogs->count() > 0) {
$last_flashlog_upload_date = $user_flashlogs->sortByDesc('created_at')->first()->created_at; // Carbon
- if ($last_flashlog_upload_date->timestamp < $moment_end->format('U'))
- {
+ if ($last_flashlog_upload_date->timestamp < $moment_end->format('U')) {
$moment_end = new Moment($last_flashlog_upload_date->timestamp);
$last_data_date = $moment_end->format('Y-m-d H:i:s');
}
}
}
-
-
$user_weather_data = [];
// $user_sensor_defs = [];
// $user_alert_rules = $user->alert_rules()->where('default_rule', 0)->where('active', 1)->get();
// $user_alerts = isset($device_ids) ? $user->alerts()->whereIn('device_id', $device_ids)->where('show', 1)->get() : $user->alerts()->where('show', 1)->get();
-
- //die(print_r($user_devices->toArray()));
- if ($user_devices->count() > 0)
- {
+ // die(print_r($user_devices->toArray()));
+
+ if ($user_devices->count() > 0) {
// get daily counts of sensor measurements
- $points = [];
- $weather = [];
+ $points = [];
+ $weather = [];
$user_device_keys = [];
$device_key_looup = [];
$user_dloc_coords = [];
$device_key_mpday = []; // key => measurements per day (= 1440 / interval_min)
// Add sensor data
- foreach ($user_devices as $device)
- {
- $device_all_keys = $device->allKeys();
- $current_key = $device->key;
+ foreach ($user_devices as $device) {
+ $device_all_keys = $device->allKeys();
+ $current_key = $device->key;
// create lookup table to combine former device key log data to current device key
- foreach ($device_all_keys as $key)
- $device_key_looup[$key] = $current_key;
-
+ foreach ($device_all_keys as $key) {
+ $device_key_looup[$key] = $current_key;
+ }
+
// Define measurements per day per device
$device_interval_min = isset($device->measurement_interval_min) && $device->measurement_interval_min > 0 ? $device->measurement_interval_min : 15;
$device_key_mpday[$current_key] = 1440 / $device_interval_min;
$loc = $device->location();
- if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon))
+ if ($loc !== null && isset($loc->coordinate_lat) && isset($loc->coordinate_lon)) {
$user_dloc_coords[] = '("lat" = \''.$loc->coordinate_lat.'\' AND "lon" = \''.$loc->coordinate_lon.'\')';
+ }
// Add sensor definitions
// $sensor_defs = $this->getSensorDefinitions($device, $date_next_consent);
@@ -1320,17 +1273,16 @@ public function data($id, Request $request)
}
// Get Influx data from device keys (also former) and combine them later to the current device key
- if (count($user_device_keys) > 0)
- {
+ if (count($user_device_keys) > 0) {
$user_device_keys = '('.implode(' OR ', $user_device_keys).')';
- try{
+ try {
$this->cacheRequestRate('influx-get');
$this->cacheRequestRate('influx-research');
- $query = 'SELECT COUNT("w_v") as "count", MIN("bv") as "bv" FROM "sensors" WHERE '.$user_device_keys.' AND time >= \''.$date_curr_consent.'\' AND time < \''.$moment_end->format('Y-m-d').' 00:00:00\' GROUP BY "key",time(1d),from_flashlog';
- //Log::debug($query);
+ $query = 'SELECT COUNT("w_v") as "count", MIN("bv") as "bv" FROM "sensors" WHERE '.$user_device_keys.' AND time >= \''.$date_curr_consent.'\' AND time < \''.$moment_end->format('Y-m-d').' 00:00:00\' GROUP BY "key",time(1d),from_flashlog';
+ // Log::debug($query);
$points = $this->client::query($query)->getPoints();
-
+
// $points = [];
// if (isset($point_data->results))
// $points = $point_data->getPoints();
@@ -1339,58 +1291,48 @@ public function data($id, Request $request)
Log::error('Research data query error: '.$e->getMessage());
// return Response::json('influx-group-by-query-error', 500);
}
- //Log::debug("Points: ".count($points));
- if (count($points) > 0)
- {
+ // Log::debug("Points: ".count($points));
+ if (count($points) > 0) {
// TODO: remove dd
- //dd($points);
- foreach ($points as $point)
- {
- $date = substr($point['time'],0,10);
- $key = isset($device_key_looup[$point['key']]) ? $device_key_looup[$point['key']] : $point['key']; // lookup current device for former keys
- $fl = isset($point['from_flashlog']) && $point['from_flashlog'] === '1' ? true : false;
-
- if (isset($dates[$date]))
- {
- if (!isset($dates[$date]['devices'][$key]))
- $dates[$date]['devices'][$key] = ['points'=>0, 'from_flashlog'=>0, 'total'=>0, 'perc'=>0, 'first_date'=>$date];
+ // dd($points);
+ foreach ($points as $point) {
+ $date = substr($point['time'], 0, 10);
+ $key = isset($device_key_looup[$point['key']]) ? $device_key_looup[$point['key']] : $point['key']; // lookup current device for former keys
+ $fl = isset($point['from_flashlog']) && $point['from_flashlog'] === '1' ? true : false;
+
+ if (isset($dates[$date])) {
+ if (! isset($dates[$date]['devices'][$key])) {
+ $dates[$date]['devices'][$key] = ['points' => 0, 'from_flashlog' => 0, 'total' => 0, 'perc' => 0, 'first_date' => $date];
+ }
$meas_per_day = isset($device_key_mpday[$key]) ? $device_key_mpday[$key] : 96;
- if ($meas_per_day != 96 && $meas_per_day > 0)
- $dates[$date]['devices'][$key]['err'] = 'measurement interval: '.(1440/$meas_per_day).' min';
+ if ($meas_per_day != 96 && $meas_per_day > 0) {
+ $dates[$date]['devices'][$key]['err'] = 'measurement interval: '.(1440 / $meas_per_day).' min';
+ }
$dates[$date]['devices'][$key]['total'] += $point['count'];
- $dates[$date]['devices'][$key]['bv'] = $point['bv'];
- $dates[$date]['devices'][$key]['perc'] = min(100, round(100 * $dates[$date]['devices'][$key]['total'] / $meas_per_day)); // data once each 15 min
-
- if ($fl)
- {
+ $dates[$date]['devices'][$key]['bv'] = $point['bv'];
+ $dates[$date]['devices'][$key]['perc'] = min(100, round(100 * $dates[$date]['devices'][$key]['total'] / $meas_per_day)); // data once each 15 min
+
+ if ($fl) {
$dates[$date]['devices'][$key]['from_flashlog'] = $point['count'];
- }
- else
- {
+ } else {
$dates[$date]['devices'][$key]['points'] = $point['count'];
}
-
- }
- else
- {
- Log::debug("Date not set: ".$date);
+
+ } else {
+ Log::debug('Date not set: '.$date);
}
}
- }
- else if ($demo) // DEMO
- {
- foreach ($dates as $date => $value)
- {
- foreach ($user_devices as $d)
- {
+ } elseif ($demo) { // DEMO
+ foreach ($dates as $date => $value) {
+ foreach ($user_devices as $d) {
$dates[$date]['devices'][$d->key]['first_date'] = $date;
$dates[$date]['devices'][$d->key]['points'] = 0;
$dates[$date]['devices'][$d->key]['from_flashlog'] = 0;
$dates[$date]['devices'][$d->key]['total'] = 0;
$dates[$date]['devices'][$d->key]['perc'] = random_int(0, 100);
- $dates[$date]['devices'][$d->key]['bv'] = random_int(240, 380)/100;
+ $dates[$date]['devices'][$d->key]['bv'] = random_int(240, 380) / 100;
}
}
@@ -1410,72 +1352,62 @@ public function data($id, Request $request)
// }
// if (count($weather) > 0)
// {
- // foreach ($weather as $point)
+ // foreach ($weather as $point)
// $user_weather_data[substr($point['time'],0,10)] = $point['count'];
// }
// }
-
// Add possible validated Flashlog data blocks as flashlog_prognose
- if ($user_flashlogs->count() > 0)
- {
- foreach ($user_flashlogs as $fl)
- {
+ if ($user_flashlogs->count() > 0) {
+ foreach ($user_flashlogs as $fl) {
// Add id's to reparse list
- if ($fl->shouldBeParsed())
+ if ($fl->shouldBeParsed()) {
$reparse_fl_ids[] = $fl->id;
+ }
$fl_dev_key = $fl->getDeviceKeyAttribute();
- $key = isset($device_key_looup[$fl_dev_key]) ? $device_key_looup[$fl_dev_key] : null;
+ $key = isset($device_key_looup[$fl_dev_key]) ? $device_key_looup[$fl_dev_key] : null;
- if ($key)
- {
- $valid = $fl->validLog();
- $days_log = $fl->getLogDays();
+ if ($key) {
+ $valid = $fl->validLog();
+ $days_log = $fl->getLogDays();
- if ($valid || $invalid_log_prognose)
- {
+ if ($valid || $invalid_log_prognose) {
$valid_data_p = null;
- $lowest_bv = null;
- $use_data_days= false;
+ $lowest_bv = null;
+ $use_data_days = false;
- if (isset($fl->meta_data['valid_data_points']))
- {
+ if (isset($fl->meta_data['valid_data_points'])) {
$valid_data_p = $fl->meta_data['valid_data_points'];
- $use_data_days= true;
+ $use_data_days = true;
}
- if (isset($fl->meta_data['lowest_bv']))
+ if (isset($fl->meta_data['lowest_bv'])) {
$lowest_bv = $fl->meta_data['lowest_bv'];
+ }
$meas_per_day = isset($fl->device) ? $fl->device->getMeasurementsPerDay() : 96;
- $start_u = strtotime($fl->log_date_start);
- $days_total = $fl->getLogDays(false); // full period
- $logpd = $fl->getLogPerDay();
- $logperc = $fl->getTimeLogPercentage($logpd);
- $logperc_arr = [];
+ $start_u = strtotime($fl->log_date_start);
+ $days_total = $fl->getLogDays(false); // full period
+ $logpd = $fl->getLogPerDay();
+ $logperc = $fl->getTimeLogPercentage($logpd);
+ $logperc_arr = [];
// Walk through data days in Flashlog
- for ($d=0; $d < $days_total; $d++)
- {
- $date = date('Y-m-d', $start_u + $d * 24 * 3600);
-
- if (!$use_data_days || isset($valid_data_p[$date]))
- {
- $logpd_date = isset($valid_data_p[$date]) ? $valid_data_p[$date] : $logpd; // specific day count, or general count
- $logperc = $fl->getTimeLogPercentage($logpd_date);
+ for ($d = 0; $d < $days_total; $d++) {
+ $date = date('Y-m-d', $start_u + $d * 24 * 3600);
+
+ if (! $use_data_days || isset($valid_data_p[$date])) {
+ $logpd_date = isset($valid_data_p[$date]) ? $valid_data_p[$date] : $logpd; // specific day count, or general count
+ $logperc = $fl->getTimeLogPercentage($logpd_date);
$logperc_arr[] = $logperc;
- $logp_id = $fl->id.': '.$logperc;
+ $logp_id = $fl->id.': '.$logperc;
// Only add logs that have weight and time data
- if ($logpd_date > 0 && isset($dates[$date]))
- {
- if (!isset($dates[$date]['devices'][$key]))
- {
- $dates[$date]['devices'][$key] = ['points'=>$logpd, 'from_flashlog'=>$logpd, 'flashlog_prognose'=>$logp_id, 'total'=>$logpd, 'perc'=>$logperc, 'first_date'=>$date];
- }
- else if (isset($dates[$date]['devices'][$key]['total']) && $logpd >= $dates[$date]['devices'][$key]['total']) // replace total with prognose, because Flashlog should contain all
- {
+ if ($logpd_date > 0 && isset($dates[$date])) {
+ if (! isset($dates[$date]['devices'][$key])) {
+ $dates[$date]['devices'][$key] = ['points' => $logpd, 'from_flashlog' => $logpd, 'flashlog_prognose' => $logp_id, 'total' => $logpd, 'perc' => $logperc, 'first_date' => $date];
+ } elseif (isset($dates[$date]['devices'][$key]['total']) && $logpd >= $dates[$date]['devices'][$key]['total']) { // replace total with prognose, because Flashlog should contain all
$dates[$date]['devices'][$key]['flashlog_prognose'] = $logp_id; // id: %
$dates[$date]['devices'][$key]['total'] = $logpd;
// Calculate new perc
@@ -1483,32 +1415,35 @@ public function data($id, Request $request)
}
}
// Indicate the flashlogs in already available data
- if (isset($dates[$date]['devices'][$key]))
+ if (isset($dates[$date]['devices'][$key])) {
$dates[$date]['devices'][$key]['flashlog'] = $fl->id;
+ }
}
// Add lowest bv from Flashlog
- if(isset($lowest_bv[$date]) && isset($dates[$date]['devices'][$key]))
+ if (isset($lowest_bv[$date]) && isset($dates[$date]['devices'][$key])) {
$dates[$date]['devices'][$key]['bv'] = $lowest_bv[$date];
+ }
}
- if (count($logperc_arr) > 0)
+ if (count($logperc_arr) > 0) {
$logperc = min(100, round(array_sum($logperc_arr) / count($logperc_arr)));
+ }
// Indicate upload date with arrow in table
$created_date = substr($fl->created_at, 0, 10);
- if (isset($dates[$created_date]['devices'][$key]))
- $dates[$created_date]['devices'][$key]['flashlog_created'] = "$fl->id uploaded at $fl->created_at, containing $days_log days ($fl->log_date_start - $fl->log_date_end) of $logperc% ".($valid?'':'NOT YET')." validated weight/time data";
- }
- else if ($invalid_log_prognose) // show uploaded but not yet validated FLs
- {
+ if (isset($dates[$created_date]['devices'][$key])) {
+ $dates[$created_date]['devices'][$key]['flashlog_created'] = "$fl->id uploaded at $fl->created_at, containing $days_log days ($fl->log_date_start - $fl->log_date_end) of $logperc% ".($valid ? '' : 'NOT YET').' validated weight/time data';
+ }
+ } elseif ($invalid_log_prognose) { // show uploaded but not yet validated FLs
// Indicate upload date with arrow in table
$created_date = substr($fl->created_at, 0, 10);
- if (isset($dates[$created_date]['devices'][$key]))
- $dates[$created_date]['devices'][$key]['flashlog_created'] = "$fl->id uploaded at $fl->created_at, containing $days_log days ($fl->log_date_start - $fl->log_date_end) ".($valid?'':'NOT YET')." validated weight/time data";
+ if (isset($dates[$created_date]['devices'][$key])) {
+ $dates[$created_date]['devices'][$key]['flashlog_created'] = "$fl->id uploaded at $fl->created_at, containing $days_log days ($fl->log_date_start - $fl->log_date_end) ".($valid ? '' : 'NOT YET').' validated weight/time data';
+ }
}
}
- //dd($fl, $dates);
+ // dd($fl, $dates);
}
}
} // end device loop
@@ -1517,16 +1452,14 @@ public function data($id, Request $request)
// reverse array for display
krsort($dates);
- //dd ($dates);
+ // dd ($dates);
// Count totals
- $totals = $assets;
+ $totals = $assets;
$data_days = count($dates);
- foreach ($dates as $day => $day_arr)
- {
- foreach ($day_arr as $asset => $items)
- {
+ foreach ($dates as $day => $day_arr) {
+ foreach ($day_arr as $asset => $items) {
// if (is_numeric($items))
// {
// if ($asset == 'inspections' || $asset == 'measurements' || $asset == 'measurements_imported' || $asset == 'measurements_total' || $asset == 'data_completeness' || $asset == 'data_completeness_online' || $asset == 'weather' || $asset == 'samplecodes' || $asset == 'flashlogs' || $asset == 'alerts')
@@ -1537,12 +1470,11 @@ public function data($id, Request $request)
// // if ($asset == 'measurements_total' && $items > 0)
// // $data_days++;
// }
- if ($asset == 'devices')
- {
- foreach ($items as $key => $device_data_array)
- {
- if (!isset($totals['devices'][$key]))
- $totals['devices'][$key] = ['total'=>0, 'from_flashlog'=>0, 'points'=>0, 'perc'=>null];
+ if ($asset == 'devices') {
+ foreach ($items as $key => $device_data_array) {
+ if (! isset($totals['devices'][$key])) {
+ $totals['devices'][$key] = ['total' => 0, 'from_flashlog' => 0, 'points' => 0, 'perc' => null];
+ }
$totals['devices'][$key]['total'] += $device_data_array['total'];
$totals['devices'][$key]['points'] += $device_data_array['points'];
@@ -1557,148 +1489,127 @@ public function data($id, Request $request)
// Average data completenes
$data_completeness_array = [];
- if ($data_days > 0)
- {
- foreach ($totals['devices'] as $key => $totals_data_array)
- {
- $device_data_days = isset($totals_data_array['first_date']) && isset($totals_data_array['last_date']) ? round((strtotime($totals_data_array['last_date']) - strtotime($totals_data_array['first_date'])) / (24 * 3600)) : $data_days;
+ if ($data_days > 0) {
+ foreach ($totals['devices'] as $key => $totals_data_array) {
+ $device_data_days = isset($totals_data_array['first_date']) && isset($totals_data_array['last_date']) ? round((strtotime($totals_data_array['last_date']) - strtotime($totals_data_array['first_date'])) / (24 * 3600)) : $data_days;
$device_data_completeness = round($totals_data_array['perc'] / $device_data_days, 2);
$totals['devices'][$key]['data_days'] = $device_data_days;
// Add to average if > 2%
- if ($device_data_completeness > 2)
- {
+ if ($device_data_completeness > 2) {
$totals['devices'][$key]['data_completeness'] = round($device_data_completeness);
$data_completeness_array[] = $device_data_completeness;
}
}
$data_completeness_count = count($data_completeness_array);
- $data_completeness = $data_completeness_count > 0 ? round(array_sum($data_completeness_array) / $data_completeness_count) : '';
+ $data_completeness = $data_completeness_count > 0 ? round(array_sum($data_completeness_array) / $data_completeness_count) : '';
}
- //dd($totals);
+ // dd($totals);
- // Make readable devices select list
+ // Make readable devices select list
$devices_select = [];
$devices_sorted = $devices_all->sortBy('user_id')->sortBy('name');
- foreach ($devices_sorted as $d)
- $devices_select[$d->id] = $d->name.' - ('.$d->user->name.')';
-
+ foreach ($devices_sorted as $d) {
+ $devices_select[$d->id] = $d->name.' - ('.$d->user->name.')';
+ }
// Create device log_file_info (CSV)
$device_log = null;
- if (in_array($log_device_id, $devices_all->pluck('id')->toArray()))
- {
- //dd($log_device_id);
- $device_log= $devices_all->where('id', '=', $log_device_id)->first();
-
+ if (in_array($log_device_id, $devices_all->pluck('id')->toArray())) {
+ // dd($log_device_id);
+ $device_log = $devices_all->where('id', '=', $log_device_id)->first();
// Only change 1 log_file_info value
- if (isset($log_device_change) && isset($log_device_value))
- {
+ if (isset($log_device_change) && isset($log_device_value)) {
$log_file_info = $device_log->log_file_info;
- if (empty($log_file_info))
+ if (empty($log_file_info)) {
$log_file_info = [];
+ }
$log_file_info["$log_device_change"] = "$log_device_value";
$device_log->log_file_info = $log_file_info;
$device_log->save();
- }
- else // Export CSV and update all log_file_info
- {
- $flashlogs = $device_log->flashlogs()->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get(); // increasing start
- $date_start_ts = strtotime("$date_start 00:00:00");
- $date_until_ts = strtotime("$date_until 00:00:00");
+ } else { // Export CSV and update all log_file_info
+ $flashlogs = $device_log->flashlogs()->where('log_date_end', '>=', $date_start)->where('log_date_start', '<', $date_until)->orderBy('log_date_start')->get(); // increasing start
+ $date_start_ts = strtotime("$date_start 00:00:00");
+ $date_until_ts = strtotime("$date_until 00:00:00");
$flashlog_count = $flashlogs->count();
- $flashlog_i = 0;
- $data_array = [];
- $measurements = ['time','source','bv','t_i','w_v','weight_kg']; // 's_bin_71_122','s_bin_122_173','s_bin_173_224','s_bin_224_276','s_bin_276_327','s_bin_327_378','s_bin_378_429','s_bin_429_480','s_bin_480_532','s_bin_532_583',
+ $flashlog_i = 0;
+ $data_array = [];
+ $measurements = ['time', 'source', 'bv', 't_i', 'w_v', 'weight_kg']; // 's_bin_71_122','s_bin_122_173','s_bin_173_224','s_bin_224_276','s_bin_276_327','s_bin_327_378','s_bin_378_429','s_bin_429_480','s_bin_480_532','s_bin_532_583',
- Log::debug("_______________________________");
+ Log::debug('_______________________________');
Log::debug("CSV device=$log_device_id add $flashlog_count FL DATA from=$date_start until=$date_until");
-
- if ($flashlog_count == 0 && $add_db_data && isset($date_start) && isset($date_until))
- {
+
+ if ($flashlog_count == 0 && $add_db_data && isset($date_start) && isset($date_until)) {
// get data from DB instead of from Flashlog for this time block
Log::debug("CSV device=$log_device_id DB ONLY DATA from=$date_start until=$date_until");
$this->addDbDataToDataArray($data_array, $device_log, $date_start, $date_until, $measurements);
- }
- else
- {
+ } else {
- foreach ($flashlogs as $flashlog)
- {
- $valid_log = $flashlog->validLog();
- $log_date_start = $flashlog->log_date_start;
- $log_date_start_ts = max($date_start_ts, strtotime($log_date_start));
- $log_date_start = date('Y-m-d', $log_date_start_ts); // replace actual date with max date
+ foreach ($flashlogs as $flashlog) {
+ $valid_log = $flashlog->validLog();
+ $log_date_start = $flashlog->log_date_start;
+ $log_date_start_ts = max($date_start_ts, strtotime($log_date_start));
+ $log_date_start = date('Y-m-d', $log_date_start_ts); // replace actual date with max date
- $log_date_until = $flashlog->log_date_end;
- $log_date_until_ts = min($date_until_ts, strtotime($log_date_until));
- $log_date_until = date('Y-m-d', $log_date_until_ts); // replace actual date with min date
+ $log_date_until = $flashlog->log_date_end;
+ $log_date_until_ts = min($date_until_ts, strtotime($log_date_until));
+ $log_date_until = date('Y-m-d', $log_date_until_ts); // replace actual date with min date
- $log_date_start_next = $flashlog_i < $flashlog_count-1 ? $flashlogs->get($flashlog_i + 1)->log_date_start : $date_until.' 00:00:00';
+ $log_date_start_next = $flashlog_i < $flashlog_count - 1 ? $flashlogs->get($flashlog_i + 1)->log_date_start : $date_until.' 00:00:00';
$log_date_start_next_ts = isset($log_date_start_next) ? min($date_until_ts, strtotime($log_date_start_next)) : $date_until_ts;
// Add log data to data_array
- if (isset($flashlog->log_parsed) && ($invalid_log_prognose || $valid_log))
- {
+ if (isset($flashlog->log_parsed) && ($invalid_log_prognose || $valid_log)) {
Log::debug("CSV device=$log_device_id fl=$flashlog->id valid=$valid_log FL DATA from=$log_date_start until=$log_date_until next_start=$log_date_start_next");
// Add flashlog data to data_array
$flashlog_parsed_text = $flashlog->getFileContent('log_file_parsed');
- if (!empty($flashlog_parsed_text))
- {
+ if (! empty($flashlog_parsed_text)) {
$flashlog_data_array = json_decode($flashlog_parsed_text, true);
- if (isset($flashlog->meta_data['valid_data_points']))
- {
- $valid_data_points = $flashlog->meta_data['valid_data_points'];
- $invalid_data_dates = [];
-
- foreach ($valid_data_points as $date => $datapoints)
- {
+ if (isset($flashlog->meta_data['valid_data_points'])) {
+ $valid_data_points = $flashlog->meta_data['valid_data_points'];
+ $invalid_data_dates = [];
+
+ foreach ($valid_data_points as $date => $datapoints) {
$inside_target_period = $date >= $log_date_start && $date <= $log_date_until ? true : false;
- if ($inside_target_period == false || $datapoints < 5 || $datapoints > 97)
+ if ($inside_target_period == false || $datapoints < 5 || $datapoints > 97) {
$invalid_data_dates[$date] = $inside_target_period;
+ }
}
// Unset Flashlog high and low (time & weight) data days
- $start_index = count($flashlog_data_array)-1;
+ $start_index = count($flashlog_data_array) - 1;
$invalid_data_date_array = array_keys($invalid_data_dates);
- for ($i=$start_index; $i >= 0; $i--) {
- // code...
- if (isset($flashlog_data_array[$i]['time']))
- {
+ for ($i = $start_index; $i >= 0; $i--) {
+ // code...
+ if (isset($flashlog_data_array[$i]['time'])) {
$item_date_check = substr($flashlog_data_array[$i]['time'], 0, 10);
- if (in_array($item_date_check, $invalid_data_date_array))
- {
- //dd($item_date_check, $highDataDays, $flashlog->meta_data, $flashlog_data_array[$i]);
+ if (in_array($item_date_check, $invalid_data_date_array)) {
+ // dd($item_date_check, $highDataDays, $flashlog->meta_data, $flashlog_data_array[$i]);
unset($flashlog_data_array[$i]);
- }
- else // valid
- {
+ } else { // valid
// add sensor definitions
- if (isset($flashlog_data_array[$i]['w_v']) && (!isset($flashlog_data_array[$i]['weight_kg']) || $flashlog_data_array[$i]['w_v'] == $flashlog_data_array[$i]['weight_kg']))
+ if (isset($flashlog_data_array[$i]['w_v']) && (! isset($flashlog_data_array[$i]['weight_kg']) || $flashlog_data_array[$i]['w_v'] == $flashlog_data_array[$i]['weight_kg'])) {
$flashlog_data_array[$i] = SensorDefinition::addDeviceMeasurementCalibrations($device_log, $flashlog_data_array[$i]);
-
+ }
+
}
- }
- else
- {
+ } else {
unset($flashlog_data_array[$i]);
}
}
- //dd($date_start, $log_date_start, $date_until, $log_date_until, $invalid_data_dates);
-
+ // dd($date_start, $log_date_start, $date_until, $log_date_until, $invalid_data_dates);
+
// Replace high data days and zero data days with DB values if available
- foreach ($invalid_data_dates as $date => $inside_target_period)
- {
- if ($inside_target_period === true)
- {
+ foreach ($invalid_data_dates as $date => $inside_target_period) {
+ if ($inside_target_period === true) {
$replace_date_start = "$date 00:00:00";
$replace_date_until = "$date 23:59:59";
$added_points = $this->addDbDataToDataArray($flashlog_data_array, $device_log, $replace_date_start, $replace_date_until, $measurements);
@@ -1707,21 +1618,17 @@ public function data($id, Request $request)
}
}
- //$flashlog->addMetaData($flashlog_data_array, true);
+ // $flashlog->addMetaData($flashlog_data_array, true);
$data_array = array_merge($data_array, $flashlog_data_array);
}
// Add flashlog data up to next start from DB
- if ($add_db_data && isset($log_date_until) && isset($log_date_start_next) && $log_date_start_next_ts - $log_date_until_ts > 84600) // more than a day of data in between
- {
- //dd($add_db_data, $date_start, $date_until, $log_date_start, $log_date_until, $log_date_start_next, $log_date_start_next_ts, $log_date_until_ts, $log_date_start_next_ts-$log_date_until_ts);
+ if ($add_db_data && isset($log_date_until) && isset($log_date_start_next) && $log_date_start_next_ts - $log_date_until_ts > 84600) { // more than a day of data in between
+ // dd($add_db_data, $date_start, $date_until, $log_date_start, $log_date_until, $log_date_start_next, $log_date_start_next_ts, $log_date_until_ts, $log_date_start_next_ts-$log_date_until_ts);
$added_points = $this->addDbDataToDataArray($data_array, $device_log, $log_date_until, $log_date_start_next, $measurements);
Log::debug("CSV device=$log_device_id fl=$flashlog->id valid=$valid_log ADDED $added_points DB DATA POINTS from=$log_date_until until=$log_date_start_next");
}
- }
- else
- {
- if ($add_db_data && isset($log_date_start) && isset($log_date_start_next) && $log_date_start_next_ts - $log_date_start_ts > 84600) // more than a day of data in between
- {
+ } else {
+ if ($add_db_data && isset($log_date_start) && isset($log_date_start_next) && $log_date_start_next_ts - $log_date_start_ts > 84600) { // more than a day of data in between
// get data from DB instead of from Flashlog for this time block
$added_points = $this->addDbDataToDataArray($data_array, $device_log, $log_date_start, $log_date_start_next, $measurements);
Log::debug("CSV device=$log_device_id fl=$flashlog->id valid=$valid_log ADDED $added_points DB ONLY DATA POINTS from=$log_date_start until=$log_date_start_next");
@@ -1734,73 +1641,70 @@ public function data($id, Request $request)
// Check result data set
$data_count = count($data_array);
- if ($data_count > 0)
- {
+ if ($data_count > 0) {
Log::debug("CSV device=$log_device_id RESULT DATA count=$data_count");
- $csv_file_name = "device-$log_device_id-flashlog-data";
- $save_output = FlashLog::exportData($data_array, $csv_file_name, true, ',', true, true, $date_start_ts, $date_until_ts, $measurements); // Research data is also exported with , as separator
+ $csv_file_name = "device-$log_device_id-flashlog-data";
+ $save_output = FlashLog::exportData($data_array, $csv_file_name, true, ',', true, true, $date_start_ts, $date_until_ts, $measurements); // Research data is also exported with , as separator
- if (isset($save_output['link']))
- {
+ if (isset($save_output['link'])) {
// Get meta of complete (concatenated) dataset
$dummy_flashlog = new FlashLog; // required for addMetaData
- $meta_data = $dummy_flashlog->addMetaData($data_array, true, true);
-
- if (isset($device_log->log_file_info['note']) && $device_log->log_file_info['note'] == $log_device_note)
- $log_device_note = ''; // empty note at new parse
+ $meta_data = $dummy_flashlog->addMetaData($data_array, true, true);
+
+ if (isset($device_log->log_file_info['note']) && $device_log->log_file_info['note'] == $log_device_note) {
+ $log_device_note = '';
+ } // empty note at new parse
- $device_log->log_file_info = array_merge(['note'=>$log_device_note, 'created_date'=>date('Y-m-d H:i:s'), 'csv_url'=>$save_output['link']], $meta_data);
+ $device_log->log_file_info = array_merge(['note' => $log_device_note, 'created_date' => date('Y-m-d H:i:s'), 'csv_url' => $save_output['link']], $meta_data);
$device_log->save();
}
}
}
}
- if ($device_log)
- $devices_all->merge($device_log); // add for display of newly added log values
+ if ($device_log) {
+ $devices_all->merge($device_log);
+ } // add for display of newly added log values
-
- return view('research.data', compact('research', 'devices_all', 'devices_show', 'data_days', 'dates', 'totals', 'data_completeness', 'data_completeness_count', 'consent_users_select', 'consent_users_selected', 'devices_select', 'device_ids', 'date_start', 'date_until', 'add_flashlogs', 'until_last_fl', 'invalid_log_prognose','add_db_data','reparse_fl_ids'));
+ return view('research.data', compact('research', 'devices_all', 'devices_show', 'data_days', 'dates', 'totals', 'data_completeness', 'data_completeness_count', 'consent_users_select', 'consent_users_selected', 'devices_select', 'device_ids', 'date_start', 'date_until', 'add_flashlogs', 'until_last_fl', 'invalid_log_prognose', 'add_db_data', 'reparse_fl_ids'));
}
-
- private function addDbDataToDataArray(&$data_array, $device, $from_date, $until_date, $measurements='*')
- {
+ private function addDbDataToDataArray(&$data_array, $device, $from_date, $until_date, $measurements = '*')
+ {
// get data from DB instead of from Flashlog for this time block
- $start_date_u = strtotime($from_date);
- $until_date_u = strtotime($until_date);
- $total_secs = $until_date_u - $start_date_u;
- $total_count = 0;
+ $start_date_u = strtotime($from_date);
+ $until_date_u = strtotime($until_date);
+ $total_secs = $until_date_u - $start_date_u;
+ $total_count = 0;
- if (is_array($measurements) && count($measurements) > 0)
+ if (is_array($measurements) && count($measurements) > 0) {
$measurements = '"'.implode('","', $measurements).'"';
+ }
- if ($total_secs > 0)
- {
+ if ($total_secs > 0) {
// Divide in chunks of max 5000 data points (30 days = 30 * 24 * 4 = 2880)
$total_days = $total_secs / 86400;
- $chunks = ceil($total_days / 30);
+ $chunks = ceil($total_days / 30);
$chunk_secs = round($total_secs / $chunks);
- //Log::debug("Add DB DATA device=$device->id from=$from_date until=$until_date => days=$total_days in chunks=$chunks");
+ // Log::debug("Add DB DATA device=$device->id from=$from_date until=$until_date => days=$total_days in chunks=$chunks");
- for ($i=0; $i < $chunks; $i++)
- {
+ for ($i = 0; $i < $chunks; $i++) {
$start_date = date('Y-m-d H:m:i', $start_date_u + $i * $chunk_secs);
- $end_date = date('Y-m-d H:m:i', $start_date_u + ($i+1) * $chunk_secs);
-
- $query = 'SELECT '.$measurements.' FROM "sensors" WHERE '.$device->influxWhereKeys().' AND from_flashlog != \'1\' AND time >= \''.$start_date.'\' AND time < \''.$end_date.'\' ORDER BY time ASC LIMIT 5000'; // from start of (invalid) fl to start of next
+ $end_date = date('Y-m-d H:m:i', $start_date_u + ($i + 1) * $chunk_secs);
+
+ $query = 'SELECT '.$measurements.' FROM "sensors" WHERE '.$device->influxWhereKeys().' AND from_flashlog != \'1\' AND time >= \''.$start_date.'\' AND time < \''.$end_date.'\' ORDER BY time ASC LIMIT 5000'; // from start of (invalid) fl to start of next
$db_data = Device::getInfluxQuery($query, 'flashlog');
- $db_count= count($db_data);
+ $db_count = count($db_data);
- //Log::debug("Add DB DATA device=$device->id from=$start_date to=$end_date count=$db_count");
+ // Log::debug("Add DB DATA device=$device->id from=$start_date to=$end_date count=$db_count");
- foreach ($db_data as $d_i => $d)
- {
+ foreach ($db_data as $d_i => $d) {
// add sensor definitions
- if (isset($d['w_v']) && (!isset($d['weight_kg']) || $d['w_v'] == $d['weight_kg']))
+ if (isset($d['w_v']) && (! isset($d['weight_kg']) || $d['w_v'] == $d['weight_kg'])) {
$d = SensorDefinition::addDeviceMeasurementCalibrations($device, $d);
-
+ }
+
$d = FlashLog::cleanDbDataItem($d);
$d['db'] = 1;
$data_array[] = $d;
@@ -1808,23 +1712,23 @@ private function addDbDataToDataArray(&$data_array, $device, $from_date, $until_
$total_count += $db_count;
}
}
+
return $total_count;
}
-
/**
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
{
- if (Auth::user()->hasRole('superadmin'))
+ if (Auth::user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
- else
+ } else {
$research = Auth::user()->researchesOwned()->findOrFail($id);
+ }
return view('research.edit', compact('research'));
}
@@ -1832,9 +1736,7 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
@@ -1842,51 +1744,52 @@ public function update(Request $request, $id)
$this->checkAuthorization($request);
$this->validate($request, [
- 'name' => 'required|string',
- 'url' => 'nullable|url',
- 'image' => 'nullable|image|max:2000',
- 'start_date' => 'nullable|date',
- 'end_date' => 'nullable|date|after:start',
- 'user_id' => 'nullable|exists:users,id',
+ 'name' => 'required|string',
+ 'url' => 'nullable|url',
+ 'image' => 'nullable|image|max:2000',
+ 'start_date' => 'nullable|date',
+ 'end_date' => 'nullable|date|after:start',
+ 'user_id' => 'nullable|exists:users,id',
'default_user_ids.*' => 'nullable|exists:users,id',
- 'viewer_ids.*' => 'nullable|exists:users,id',
+ 'viewer_ids.*' => 'nullable|exists:users,id',
'checklist_ids.*' => 'nullable|exists:checklists,id',
- 'visible' => 'boolean',
- 'on_invite_only'=> 'boolean',
+ 'visible' => 'boolean',
+ 'on_invite_only' => 'boolean',
]);
- if (Auth::user()->hasRole('superadmin'))
+ if (Auth::user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
- else
- $research =$request->user()->researchesOwned()->findOrFail($id);
+ } else {
+ $research = $request->user()->researchesOwned()->findOrFail($id);
+ }
$requestData = $request->all();
-
- if (isset($requestData['image']))
- {
+
+ if (isset($requestData['image'])) {
$image = Research::storeImage($requestData);
- if ($image)
- {
+ if ($image) {
$requestData['image_id'] = $image->id;
unset($requestData['image']);
}
}
- if (!isset($requestData['default_user_ids']))
+ if (! isset($requestData['default_user_ids'])) {
$requestData['default_user_ids'] = null;
+ }
$research->update($requestData);
- if (isset($requestData['checklist_ids']))
+ if (isset($requestData['checklist_ids'])) {
$research->checklists()->sync($requestData['checklist_ids']);
- else
+ } else {
$research->checklists()->sync([]);
+ }
- if (isset($requestData['viewer_ids']))
+ if (isset($requestData['viewer_ids'])) {
$research->viewers()->sync($requestData['viewer_ids']);
- else
+ } else {
$research->viewers()->sync([]);
-
+ }
return redirect('research')->with('flash_message', 'Research updated!');
}
@@ -1895,17 +1798,13 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
{
- if (Auth::user()->hasRole('superadmin'))
- {
+ if (Auth::user()->hasRole('superadmin')) {
Research::destroy($id);
- }
- else
- {
+ } else {
$research = Auth::user()->researchesOwned()->findOrFail($id);
$research->delete();
}
@@ -1913,12 +1812,11 @@ public function destroy($id)
return redirect('research')->with('flash_message', 'Research deleted!');
}
-
/* Data export functions */
- private function export($spreadsheetArray, $fileName='export', $date_start='Research start', $date_until='Research end')
+ private function export($spreadsheetArray, $fileName = 'export', $date_start = 'Research start', $date_until = 'Research end')
{
- $spreadsheet = new Spreadsheet();
+ $spreadsheet = new Spreadsheet;
$sheet = $spreadsheet->getActiveSheet();
// Set meta data
@@ -1934,26 +1832,24 @@ private function export($spreadsheetArray, $fileName='export', $date_start='Rese
$sheet->setCellValue('C6', count($spreadsheetArray));
$row = 8;
- foreach ($spreadsheetArray as $title => $data)
- {
+ foreach ($spreadsheetArray as $title => $data) {
$sheet->setCellValue('A'.$row, $title);
- $sheet->setCellValue('C'.$row, count($data)-1);
+ $sheet->setCellValue('C'.$row, count($data) - 1);
$row++;
}
-
+
// Fill sheet with tabs and data
- foreach ($spreadsheetArray as $title => $data)
- {
+ foreach ($spreadsheetArray as $title => $data) {
$sheet = $spreadsheet->createSheet();
$sheet->setTitle($title);
$sheet->fromArray($data);
}
-
+
// save sheet
$fileName = $fileName.'-'.Str::random(40);
$filePath = 'exports/'.$fileName.'.xlsx';
$writer = new Xlsx($spreadsheet);
- //$writer->setOffice2003Compatibility(true);
+ // $writer->setOffice2003Compatibility(true);
ob_start();
$writer->save('php://output');
@@ -1961,12 +1857,13 @@ private function export($spreadsheetArray, $fileName='export', $date_start='Rese
ob_end_clean();
$disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']))
+ if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])) {
return Storage::disk($disk)->url($filePath);
+ }
return null;
}
-
+
private function getUser(User $user)
{
return [
@@ -1976,14 +1873,13 @@ private function getUser(User $user)
$user->avatar,
$user->created_at,
$user->updated_at,
- $user->last_login
+ $user->last_login,
];
}
- private function getLocations($user_id, $locations, $date_start=null, $date_until=null)
+ private function getLocations($user_id, $locations, $date_start = null, $date_until = null)
{
- return $locations->where('created_at', '<=', $date_until)->sortBy('name')->map(function($item) use ($user_id)
- {
+ return $locations->where('created_at', '<=', $date_until)->sortBy('name')->map(function ($item) use ($user_id) {
return [
$user_id,
$item->id,
@@ -2002,16 +1898,15 @@ private function getLocations($user_id, $locations, $date_start=null, $date_unti
];
});
}
-
- private function getHives($user_id, $hives, $date_start=null, $date_until=null)
+
+ private function getHives($user_id, $hives, $date_start = null, $date_until = null)
{
- return $hives->where('created_at', '<=', $date_until)->sortBy('name')->map(function($item) use ($user_id)
- {
+ return $hives->where('created_at', '<=', $date_until)->sortBy('name')->map(function ($item) use ($user_id) {
$queen = $item->queen;
return [
$user_id,
- $item->id,
+ $item->id,
$item->name,
$item->type,
$item->location_id,
@@ -2026,32 +1921,30 @@ private function getHives($user_id, $hives, $date_start=null, $date_until=null)
$item->getHoneylayersAttribute(),
$item->frames()->count(),
$item->created_at,
- $item->deleted_at
+ $item->deleted_at,
];
});
}
- private function getSampleCodes($user_id, $samplecodes, $date_start=null, $date_until=null)
+ private function getSampleCodes($user_id, $samplecodes, $date_start = null, $date_until = null)
{
- return $samplecodes->where('sample_date', '<=', $date_until)->sortByDesc('sample_date')->sortByDesc('sample_date')->sortBy('hive_id')->map(function($item) use ($user_id)
- {
- $hive = $item->hive;
+ return $samplecodes->where('sample_date', '<=', $date_until)->sortByDesc('sample_date')->sortByDesc('sample_date')->sortBy('hive_id')->map(function ($item) use ($user_id) {
+ $hive = $item->hive;
$hive_name = isset($hive) ? $hive->name : '';
- $loc_id = '';
- $loc_name = '';
- $loc_cc = '';
-
- if (isset($hive->location_id))
- {
- $loc_id = $hive->location_id;
- $loc_name = $hive->location;
- $loc = Location::withTrashed()->find($hive->location_id);
- $loc_cc = strtoupper($loc->country_code);
+ $loc_id = '';
+ $loc_name = '';
+ $loc_cc = '';
+
+ if (isset($hive->location_id)) {
+ $loc_id = $hive->location_id;
+ $loc_name = $hive->location;
+ $loc = Location::withTrashed()->find($hive->location_id);
+ $loc_cc = strtoupper($loc->country_code);
}
return [
$user_id,
- $item->sample_code,
+ $item->sample_code,
$item->sample_date,
$loc_cc,
$loc_id,
@@ -2065,24 +1958,25 @@ private function getSampleCodes($user_id, $samplecodes, $date_start=null, $date_
$item->test_result,
$item->test_lab_name,
$item->created_at,
- $item->updated_at
+ $item->updated_at,
];
});
}
private function getDevice($user_id, $item)
{
- $log_data_valid = isset($item->log_file_info['valid']) && boolval($item->log_file_info['valid']) ? true : false;
- $log_data_state = $log_data_valid && isset($item->log_file_info['log_date_end']) ? "Validated until: ".$item->log_file_info['log_date_end'] : ($item->flashlogs()->count() == 0 ? "No flashlogs uploaded yet" : "Validation ongoing");
- $log_data_note = isset($item->log_file_info['note']) ? $item->log_file_info['note'] : null;
- $log_data_csv = isset($item->log_file_info['csv_url']) ? $item->log_file_info['csv_url'] : null;
- $log_data_info = isset($item->log_file_info) ? CalculationModel::arrayToString($item->log_file_info, ' | ', '', ['csv_url','valid_data_points','note','port2_times_device']) : null;
+ $log_data_valid = isset($item->log_file_info['valid']) && boolval($item->log_file_info['valid']) ? true : false;
+ $log_data_state = $log_data_valid && isset($item->log_file_info['log_date_end']) ? 'Validated until: '.$item->log_file_info['log_date_end'] : ($item->flashlogs()->count() == 0 ? 'No flashlogs uploaded yet' : 'Validation ongoing');
+ $log_data_note = isset($item->log_file_info['note']) ? $item->log_file_info['note'] : null;
+ $log_data_csv = isset($item->log_file_info['csv_url']) ? $item->log_file_info['csv_url'] : null;
+ $log_data_info = isset($item->log_file_info) ? CalculationModel::arrayToString($item->log_file_info, ' | ', '', ['csv_url', 'valid_data_points', 'note', 'port2_times_device']) : null;
isset($item->log_file_info['note']) ? $item->log_file_info['note'] : null;
+
return [
$user_id,
- $item->id,
- $item->name,
+ $item->id,
+ $item->name,
$item->hive_id,
$item->location_id,
$item->getTypeAttribute(),
@@ -2107,37 +2001,35 @@ private function getDevice($user_id, $item)
$item->datetime_offset_sec,
$item->sensorDefinitions()->count(),
$item->created_at,
- $item->deleted_at
+ $item->deleted_at,
];
}
- private function getSensorDefinitions($device, $date_until=null)
+ private function getSensorDefinitions($device, $date_until = null)
{
- return $device->sensorDefinitions()->where('created_at', '<=', $date_until)->orderBy('created_at')->get()->map(function($item)
- {
+ return $device->sensorDefinitions()->where('created_at', '<=', $date_until)->orderBy('created_at')->get()->map(function ($item) {
return [
$item->name,
- $item->device_id,
+ $item->device_id,
$item->inside,
$item->offset,
$item->multiplier,
$item->input_abbr,
$item->output_abbr,
$item->created_at,
- $item->deleted_at
+ $item->deleted_at,
];
});
}
- private function getFlashlogs($user_id, $flashlogs, $date_start=null, $date_until=null)
+ private function getFlashlogs($user_id, $flashlogs, $date_start = null, $date_until = null)
{
- return $flashlogs->where('created_at', '<=', $date_until)->sortBy('device_id')->sortByDesc('created_at')->map(function($item) use ($user_id)
- {
- $meta_data = isset($item->meta_data) ? CalculationModel::arrayToString($item->meta_data, ' | ', '', ['valid_data_points','port2_times_device']) : null;
-
+ return $flashlogs->where('created_at', '<=', $date_until)->sortBy('device_id')->sortByDesc('created_at')->map(function ($item) use ($user_id) {
+ $meta_data = isset($item->meta_data) ? CalculationModel::arrayToString($item->meta_data, ' | ', '', ['valid_data_points', 'port2_times_device']) : null;
+
return [
$user_id,
- $item->device_id,
+ $item->device_id,
$item->created_at,
$item->hive_id,
$item->log_messages,
@@ -2160,7 +2052,7 @@ private function getFlashlogs($user_id, $flashlogs, $date_start=null, $date_unti
$item->log_file,
$item->log_file_stripped,
$item->log_file_parsed,
- $item->deleted_at
+ $item->deleted_at,
];
});
}
@@ -2178,18 +2070,17 @@ private function getFlashlogs($user_id, $flashlogs, $date_start=null, $date_unti
]
];
*/
- private function getAlertRules($user_id, $alert_rules, $date_start=null, $date_until=null)
+ private function getAlertRules($user_id, $alert_rules, $date_start = null, $date_until = null)
{
- return $alert_rules->where('created_at', '<=', $date_until)->sortByDesc('created_at')->map(function($item) use ($user_id)
- {
+ return $alert_rules->where('created_at', '<=', $date_until)->sortByDesc('created_at')->map(function ($item) use ($user_id) {
return [
$user_id,
$item->created_at,
- $item->name,
+ $item->name,
$item->readableFunction(),
$item->calculation_minutes,
$item->last_calculated_at,
- $item->last_evaluated_at
+ $item->last_evaluated_at,
];
});
}
@@ -2208,63 +2099,56 @@ private function getAlertRules($user_id, $alert_rules, $date_start=null, $date_u
]
];
*/
- private function getAlerts($user_id, $alerts, $date_start=null, $date_until=null)
+ private function getAlerts($user_id, $alerts, $date_start = null, $date_until = null)
{
- return $alerts->where('created_at', '>=', $date_start)->where('created_at', '<=', $date_until)->sortByDesc('created_at')->sortBy('hive_id')->map(function($item) use ($user_id)
- {
+ return $alerts->where('created_at', '>=', $date_start)->where('created_at', '<=', $date_until)->sortByDesc('created_at')->sortBy('hive_id')->map(function ($item) use ($user_id) {
return [
$user_id,
- $item->device_id,
+ $item->device_id,
$item->location_id,
$item->hive_id,
$item->created_at,
$item->alert_function,
$item->alert_value,
- $item->count
+ $item->count,
];
});
}
-
- private function getInspections($user_id, $inspections, $item_names, $date_start=null, $date_until=null)
+ private function getInspections($user_id, $inspections, $item_names, $date_start = null, $date_until = null)
{
// array of inspection items and data
$inspection_data = array_fill_keys($item_names, '');
$inspections = $inspections->where('created_at', '>=', $date_start)->where('created_at', '<=', $date_until)->sortByDesc('created_at');
-
- $table = $inspections->map(function($inspection) use ($inspection_data, $user_id)
- {
- if (isset($inspection->items))
- {
- foreach ($inspection->items as $inspectionItem)
- {
- $array_key = $inspectionItem->anc.$inspectionItem->name;
+ $table = $inspections->map(function ($inspection) use ($inspection_data, $user_id) {
+ if (isset($inspection->items)) {
+ foreach ($inspection->items as $inspectionItem) {
+ $array_key = $inspectionItem->anc.$inspectionItem->name;
$inspection_data[$array_key] = $inspectionItem->humanReadableValue();
}
}
$locationId = ($inspection->locations()->withTrashed()->count() > 0 ? $inspection->locations()->withTrashed()->first()->id : ($inspection->hives()->withTrashed()->count() > 0 ? $inspection->hives()->withTrashed()->first()->location()->first()->id : ''));
-
- $reminder_date= '';
- if (isset($inspection->reminder_date) && $inspection->reminder_date != null)
- {
- $reminder_mom = new Moment($inspection->reminder_date);
+
+ $reminder_date = '';
+ if (isset($inspection->reminder_date) && $inspection->reminder_date != null) {
+ $reminder_mom = new Moment($inspection->reminder_date);
$reminder_date = $reminder_mom->format('Y-m-d H:i:s');
}
- $smileys = __('taxonomy.smileys_3');
- $boolean = __('taxonomy.boolean');
-
+ $smileys = __('taxonomy.smileys_3');
+ $boolean = __('taxonomy.boolean');
+
// add general inspection data columns
$pre = [
'user_id' => $user_id,
'inspection_id' => $inspection->id,
__('export.created_at') => $inspection->created_at,
- __('export.hive') => $inspection->hives()->withTrashed()->count() > 0 ? $inspection->hives()->withTrashed()->first()->id : '',
- __('export.location') => $locationId,
- __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
- __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
+ __('export.hive') => $inspection->hives()->withTrashed()->count() > 0 ? $inspection->hives()->withTrashed()->first()->id : '',
+ __('export.location') => $locationId,
+ __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
+ __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
__('export.reminder') => $inspection->reminder,
__('export.reminder_date') => $reminder_date,
__('export.notes') => $inspection->notes,
@@ -2274,65 +2158,63 @@ private function getInspections($user_id, $inspections, $item_names, $date_start
return array_values($dat);
});
- //die(print_r($table));
+
+ // die(print_r($table));
return $table;
}
- private function exportCsvFromInflux($where, $fileName='research-export-', $measurements='*', $database='sensors', $separator=',')
+ private function exportCsvFromInflux($where, $fileName = 'research-export-', $measurements = '*', $database = 'sensors', $separator = ',')
{
- $options= ['precision'=>'rfc3339', 'format'=>'csv'];
-
- if ($database == 'sensors')
- {
- if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0)
+ $options = ['precision' => 'rfc3339', 'format' => 'csv'];
+
+ if ($database == 'sensors') {
+ if (isset($measurements) && gettype($measurements) == 'array' && count($measurements) > 0) {
$names = $measurements;
- else
+ } else {
$names = $this->output_sensors;
+ }
$queryList = Device::getAvailableSensorNamesNoCache($names, $where, $database);
-
- if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0)
+
+ if (isset($queryList) && gettype($queryList) == 'array' && count($queryList) > 0) {
$groupBySelect = implode(', ', $queryList);
- else
- $groupBySelect = '"'.implode('","',$names).'"';
+ } else {
+ $groupBySelect = '"'.implode('","', $names).'"';
+ }
$query = 'SELECT '.$groupBySelect.',"from_flashlog" FROM "'.$database.'" WHERE '.$where;
- }
- else // i.e. weather data
- {
- if ($measurements == null || $measurements == '' || $measurements === '*')
+ } else { // i.e. weather data
+ if ($measurements == null || $measurements == '' || $measurements === '*') {
$sensor_measurements = '*';
- else
+ } else {
$sensor_measurements = $measurements;
+ }
$query = 'SELECT '.$sensor_measurements.' FROM "'.$database.'" WHERE '.$where;
}
-
- try{
- $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
+
+ try {
+ $data = $this->client::query($query, $options)->getPoints(); // get first sensor date
} catch (InfluxDB\Exception $e) {
return null;
}
- if (count($data) == 0)
+ if (count($data) == 0) {
return null;
+ }
$csv_file = $data;
- //format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
- $csv_file = "";
+ // format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Excluse the 'sensor' and 'key' columns
+ $csv_file = '';
$csv_sens = array_keys($data[0]);
$csv_head = [];
- foreach ($csv_sens as $sensor_name)
- {
- if ($sensor_name == 'from_flashlog')
- {
+ foreach ($csv_sens as $sensor_name) {
+ if ($sensor_name == 'from_flashlog') {
$csv_head[] = 'Imported from device flash log';
- }
- else
- {
- $meas = Measurement::where('abbreviation', $sensor_name)->first();
+ } else {
+ $meas = Measurement::where('abbreviation', $sensor_name)->first();
$csv_head[] = $meas ? $meas->pq_name_unit().' ('.$sensor_name.')' : $sensor_name;
}
}
@@ -2340,20 +2222,19 @@ private function exportCsvFromInflux($where, $fileName='research-export-', $meas
// format CSV file body
$csv_body = [];
- foreach ($data as $sensor_values)
- {
+ foreach ($data as $sensor_values) {
$csv_body[] = implode($separator, $sensor_values);
}
$csv_file = $csv_head.implode("\r\n", $csv_body);
// return the CSV file content in a file on disk
$filePath = 'exports/'.$fileName;
- $disk = env('EXPORT_STORAGE', 'public');
+ $disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv']))
+ if (Storage::disk($disk)->put($filePath, $csv_file, ['mimetype' => 'text/csv'])) {
return Storage::disk($disk)->url($filePath);
+ }
return null;
}
-
}
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index 9c371e4f..b50aef81 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -2,11 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-use App\Http\Controllers\Controller;
-use App\Role;
use App\Permission;
+use App\Role;
use DB;
+use Illuminate\Http\Request;
class RoleController extends Controller
{
@@ -17,8 +16,9 @@ class RoleController extends Controller
*/
public function index(Request $request)
{
- $roles = Role::orderBy('id','DESC')->paginate(10);
- return view('roles.index',compact('roles'))
+ $roles = Role::orderBy('id', 'DESC')->paginate(10);
+
+ return view('roles.index', compact('roles'))
->with('i', ($request->input('page', 1) - 1) * 10);
}
@@ -30,13 +30,13 @@ public function index(Request $request)
public function create()
{
$permission = Permission::get();
- return view('roles.create',compact('permission'));
+
+ return view('roles.create', compact('permission'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
@@ -48,7 +48,7 @@ public function store(Request $request)
'permission' => 'required',
]);
- $role = new Role();
+ $role = new Role;
$role->name = $request->input('name');
$role->display_name = $request->input('display_name');
$role->description = $request->input('description');
@@ -59,8 +59,9 @@ public function store(Request $request)
}
return redirect()->route('roles.index')
- ->with('success','Role created successfully');
+ ->with('success', 'Role created successfully');
}
+
/**
* Display the specified resource.
*
@@ -70,11 +71,11 @@ public function store(Request $request)
public function show($id)
{
$role = Role::find($id);
- $rolePermissions = Permission::join("permission_role","permission_role.permission_id","=","permissions.id")
- ->where("permission_role.role_id",$id)
+ $rolePermissions = Permission::join('permission_role', 'permission_role.permission_id', '=', 'permissions.id')
+ ->where('permission_role.role_id', $id)
->get();
- return view('roles.show',compact('role','rolePermissions'));
+ return view('roles.show', compact('role', 'rolePermissions'));
}
/**
@@ -87,17 +88,17 @@ public function edit($id)
{
$role = Role::find($id);
$permission = Permission::get();
- $rolePermissions = DB::table("permission_role")->where("permission_role.role_id",$id)
- ->pluck("permission_id");
- //print_r($permission);
- //die($rolePermissions);
- return view('roles.edit',compact('role','permission','rolePermissions'));
+ $rolePermissions = DB::table('permission_role')->where('permission_role.role_id', $id)
+ ->pluck('permission_id');
+
+ // print_r($permission);
+ // die($rolePermissions);
+ return view('roles.edit', compact('role', 'permission', 'rolePermissions'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
@@ -114,7 +115,7 @@ public function update(Request $request, $id)
$role->description = $request->input('description');
$role->save();
- DB::table("permission_role")->where("permission_role.role_id",$id)
+ DB::table('permission_role')->where('permission_role.role_id', $id)
->delete();
foreach ($request->input('permission') as $key => $value) {
@@ -122,8 +123,9 @@ public function update(Request $request, $id)
}
return redirect()->route('roles.index')
- ->with('success','Role updated successfully');
+ ->with('success', 'Role updated successfully');
}
+
/**
* Remove the specified resource from storage.
*
@@ -132,8 +134,9 @@ public function update(Request $request, $id)
*/
public function destroy($id)
{
- DB::table("roles")->where('id',$id)->delete();
+ DB::table('roles')->where('id', $id)->delete();
+
return redirect()->route('roles.index')
- ->with('success','Role deleted successfully');
+ ->with('success','Role deleted successfully');
}
-}
\ No newline at end of file
+}
diff --git a/app/Http/Controllers/SampleCodeController.php b/app/Http/Controllers/SampleCodeController.php
index b293b774..f3499bec 100644
--- a/app/Http/Controllers/SampleCodeController.php
+++ b/app/Http/Controllers/SampleCodeController.php
@@ -2,27 +2,22 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-
-use Mail;
-use Auth;
-use Storage;
-use Session;
-use App\SampleCode;
+use App\Category;
+use App\Inspection;
+use App\InspectionItem;
use App\Mail\SampleCodeMail;
+use App\SampleCode;
+use Auth;
use Illuminate\Http\Request;
-use Illuminate\Support\Str;
use Illuminate\Support\Facades\Log;
-
use LaravelLocalization;
+use Mail;
use Moment\Moment;
-use App\Category;
-use App\Inspection;
-use App\InspectionItem;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use Session;
+use Storage;
class SampleCodeController extends Controller
{
@@ -36,8 +31,8 @@ public function code()
public function upload()
{
$template_url = $this->createExcelTemplate();
- $data = Session::get('data');
- $col_names = Session::get('col_names');
+ $data = Session::get('data');
+ $col_names = Session::get('col_names');
return view('sample-code.upload', compact('template_url', 'data', 'col_names'));
}
@@ -45,94 +40,85 @@ public function upload()
// Upload filled excel template to input
public function upload_store(Request $request)
{
- $msg = 'No file found';
- $res = 'error';
- $items_replaced = 0;
- $items_added = 0;
- $items_removed = 0;
- $inspection_cnt = 0;
- $data = [];
- $col_names = [];
- $col_input_types= [];
+ $msg = 'No file found';
+ $res = 'error';
+ $items_replaced = 0;
+ $items_added = 0;
+ $items_removed = 0;
+ $inspection_cnt = 0;
+ $data = [];
+ $col_names = [];
+ $col_input_types = [];
$sample_code_id = Category::findCategoryIdByParentAndName('laboratory_test', 'sample_code');
- if ($request->has('checked') && $request->has('data')) // Persist checked data
- {
+ if ($request->has('checked') && $request->has('data')) { // Persist checked data
$data = json_decode($request->input('data'), true);
$checked_ids = $request->input('checked');
- $emails_sent = 0;
+ $emails_sent = 0;
// Add this data as inspection items to the inspection where the corresponding sample code has been generated
- foreach ($data as $checked_id => $inspection_items) // $inspection_items is array of ['cat_id'=>value]
- {
+ foreach ($data as $checked_id => $inspection_items) { // $inspection_items is array of ['cat_id'=>value]
- if (in_array($checked_id, $checked_ids) && isset($inspection_items[$sample_code_id])) // only store inspections of checked entries
- {
+ if (in_array($checked_id, $checked_ids) && isset($inspection_items[$sample_code_id])) { // only store inspections of checked entries
$sample_code = $inspection_items[$sample_code_id];
unset($inspection_items[0]); // remove initial checked item
-
+
// look up inspection
$inspection_id = InspectionItem::where('category_id', $sample_code_id)->where('value', $sample_code)->value('inspection_id');
- $inspection = Inspection::find($inspection_id);
-
- if ($inspection)
- {
+ $inspection = Inspection::find($inspection_id);
+
+ if ($inspection) {
$inspection_cnt++;
$items_changed = 0;
- foreach ($inspection_items as $category_id => $value)
- {
+ foreach ($inspection_items as $category_id => $value) {
$inspection_item_exists = $inspection->items()->where('category_id', $category_id);
$value_filled = filled($value);
- if ($inspection_item_exists->count() > 0)
- {
+ if ($inspection_item_exists->count() > 0) {
$inspection_item_exists->delete();
-
- if ($value_filled)
+
+ if ($value_filled) {
$items_replaced++;
- else
+ } else {
$items_removed++;
- }
- else
- {
- if ($value_filled)
+ }
+ } else {
+ if ($value_filled) {
$items_added++;
+ }
}
- if ($value_filled)
- {
- $itemData =
+ if ($value_filled) {
+ $itemData =
[
- 'category_id' => $category_id,
+ 'category_id' => $category_id,
'inspection_id' => $inspection_id,
- 'value' => $value,
+ 'value' => $value,
];
InspectionItem::create($itemData);
}
-
+
$items_changed++;
}
// send e-mail to user
- if ($items_changed > 0 && $inspection->users()->count() > 0)
- {
- $hive_id = null;
+ if ($items_changed > 0 && $inspection->users()->count() > 0) {
+ $hive_id = null;
$hive_name = null;
- if (isset($inspection->hives) && $inspection->hives->count() > 0)
- {
- $hive = $inspection->hives->first();
- $hive_id = $hive->id;
+ if (isset($inspection->hives) && $inspection->hives->count() > 0) {
+ $hive = $inspection->hives->first();
+ $hive_id = $hive->id;
$hive_name = $hive->name;
}
$link = null;
- if (isset($hive_id))
+ if (isset($hive_id)) {
$link = "hives/$hive_id/inspections?search=id%3D$inspection_id";
+ }
- foreach ($inspection->users as $u)
- {
+ foreach ($inspection->users as $u) {
Log::debug("Sample result upload for code $sample_code sending email to user $u->email");
Mail::to($u->email)->send(new SampleCodeMail($u->name, $sample_code, $hive_name, $link));
$emails_sent++;
@@ -144,94 +130,78 @@ public function upload_store(Request $request)
}
// show result
$msg = "Added data for $inspection_cnt inspections. Added $items_added, removed $items_removed, replaced $items_replaced inspection items in total. Sent $emails_sent data upload notification emails to the creators of the sample codes.";
- if ($inspection_cnt > 0 && $items_added + $items_replaced > 0)
- {
- $res = 'success';
+ if ($inspection_cnt > 0 && $items_added + $items_replaced > 0) {
+ $res = 'success';
$data = [];
}
- }
- else if ($request->has('sample-code-excel') && $request->hasFile('sample-code-excel')) // Check and visualize Excel input
- {
+ } elseif ($request->has('sample-code-excel') && $request->hasFile('sample-code-excel')) { // Check and visualize Excel input
$file = $request->file('sample-code-excel');
- if ($file->isValid())
- {
- $msg = 'File uploaded';
- $res = 'success';
+ if ($file->isValid()) {
+ $msg = 'File uploaded';
+ $res = 'success';
$path = $request->file('sample-code-excel')->getRealPath();
-
+
$reader = IOFactory::createReader('Xlsx');
$reader->setReadDataOnly(true);
$reader->setReadEmptyCells(false);
- $sheet = $reader->load($path);
- //dd($sheet);
+ $sheet = $reader->load($path);
+ // dd($sheet);
$sheets = $sheet->getSheetCount();
$wsheet = $sheet->getSheet(0); // get first sheet
$template = $this->createExcelTemplate(true); // array[row[0 -> 6]=>[col_0, ..., col_n]] (col0 being the explanation column)
- $t_sheet = reset($template); // [0=>CATEGORY ID, 1=>HIERACHY, 2=>NAME, 3=>PHYSICAL QUANTITY, 4=>UNIT, 5=>INPUT TYPE, 6=>INPUT RANGE, 7=>First empty row for entry]
- //dd($t_sheet);
- $t_headers= count($t_sheet)-1; // one blank row is the first entry row
- $t_types = $t_sheet[5];
- $cat_ids = $t_sheet[0];
+ $t_sheet = reset($template); // [0=>CATEGORY ID, 1=>HIERACHY, 2=>NAME, 3=>PHYSICAL QUANTITY, 4=>UNIT, 5=>INPUT TYPE, 6=>INPUT RANGE, 7=>First empty row for entry]
+ // dd($t_sheet);
+ $t_headers = count($t_sheet) - 1; // one blank row is the first entry row
+ $t_types = $t_sheet[5];
+ $cat_ids = $t_sheet[0];
- if ($cat_ids[0] == 'CATEGORY ID')
+ if ($cat_ids[0] == 'CATEGORY ID') {
unset($cat_ids[0]);
+ }
// Create data array to show and persist
- $cat_ids_valid = [];
- $col_names_valid = [];
+ $cat_ids_valid = [];
+ $col_names_valid = [];
$input_types_valid = [];
- $col_names[0] = 'Ok?';
+ $col_names[0] = 'Ok?';
- foreach ($wsheet->getRowIterator() as $row_num => $row)
- {
+ foreach ($wsheet->getRowIterator() as $row_num => $row) {
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(true);
// map header rows to (possibly different) template category_id column order in Excel
- if ($row_num == 1) // map category_id header row in Excel
- {
+ if ($row_num == 1) { // map category_id header row in Excel
$col_index = 0;
- foreach ($cellIterator as $col_name => $cell)
- {
+ foreach ($cellIterator as $col_name => $cell) {
$cat_id = $cell->getValue();
- if (isset($cat_id) && in_array($cat_id, $cat_ids))
- {
+ if (isset($cat_id) && in_array($cat_id, $cat_ids)) {
$cat_ids_valid[$col_name] = $cat_id; // Cat id per col name: ["B"=>1371, "C"=>1425, "Col_name"=>cat_id, etc]
- $col_names[$cat_id] = $t_sheet[1][$col_index].$t_sheet[2][$col_index]; // [cat_id => "Hierachy + Name"]
+ $col_names[$cat_id] = $t_sheet[1][$col_index].$t_sheet[2][$col_index]; // [cat_id => "Hierachy + Name"]
$col_input_types[$cat_id] = $t_sheet[5][$col_index]; // [cat_id => "Input type"]
}
$col_index++;
}
$col_names_valid = array_keys($cat_ids_valid); // [0=>"B", 1=>"C", etc]
- //dd($col_names_valid, $cat_ids_valid, $col_names, $col_input_types);
- }
- else if ($row_num > $t_headers) // entered values
- {
- foreach ($cellIterator as $col_name => $cell)
- {
- if (in_array($col_name, $col_names_valid)) // valid cat_id col: $col_names_valid = [0=>"B", 1=>"C", etc]
- {
+ // dd($col_names_valid, $cat_ids_valid, $col_names, $col_input_types);
+ } elseif ($row_num > $t_headers) { // entered values
+ foreach ($cellIterator as $col_name => $cell) {
+ if (in_array($col_name, $col_names_valid)) { // valid cat_id col: $col_names_valid = [0=>"B", 1=>"C", etc]
$value = trim($cell->getValue()); // remove whitespace from beginning and end of the string
- $cat_id= $cat_ids_valid[$col_name];
+ $cat_id = $cat_ids_valid[$col_name];
- if (isset($value))
- {
- if ($value === '')
- {
+ if (isset($value)) {
+ if ($value === '') {
$data[$row_num][$cat_id] = ''; // do not store, but remove this value at persist stage
- }
- else
- {
+ } else {
// Convert known fields to the type of data
$corrected_value = $value;
// Check if there is a formula, if so, try to parse it
- if (substr($value,0,1) == '=')
- {
+ if (substr($value, 0, 1) == '=') {
try {
$corrected_value = $cell->getCalculatedValue();
} catch (Exception $e) {
@@ -242,24 +212,20 @@ public function upload_store(Request $request)
// Try to force values in the requested format
$input_type = $col_input_types[$cat_id];
- switch($input_type)
- {
+ switch ($input_type) {
case 'sample_code':
$corrected_value = strtoupper(substr(str_replace(' ', '', $value), 0, 8));
break;
case 'date':
- if (is_numeric($value))
- {
+ if (is_numeric($value)) {
$unix_timestamp = ($value - 25569) * 86400;
- $corrected_value= date("Y-m-d H:i:s", $unix_timestamp);
- }
- else
- {
- $corrected_value= date("Y-m-d H:i:s", strtotime($value));
+ $corrected_value = date('Y-m-d H:i:s', $unix_timestamp);
+ } else {
+ $corrected_value = date('Y-m-d H:i:s', strtotime($value));
}
break;
case 'text':
- $corrected_value = (string)$value;
+ $corrected_value = (string) $value;
break;
case 'boolean':
case 'boolean_yes_red':
@@ -277,34 +243,38 @@ public function upload_store(Request $request)
case 'number_positive':
case 'number_negative':
case 'number_percentage':
- if (strpos($value, ',') !== false) // replace , with .
+ if (strpos($value, ',') !== false) { // replace , with .
$value = str_replace(',', '.', $value);
+ }
- $corrected_value = (float)$value;
+ $corrected_value = (float) $value;
- if ($input_type == 'number_0_decimals')
+ if ($input_type == 'number_0_decimals') {
$corrected_value = round($corrected_value, 0);
- else if ($input_type == 'number_1_decimals')
+ } elseif ($input_type == 'number_1_decimals') {
$corrected_value = round($corrected_value, 1);
- else if ($input_type == 'number_2_decimals')
+ } elseif ($input_type == 'number_2_decimals') {
$corrected_value = round($corrected_value, 2);
- else if ($input_type == 'number_3_decimals')
+ } elseif ($input_type == 'number_3_decimals') {
$corrected_value = round($corrected_value, 3);
- else if ($input_type == 'number_positive')
+ } elseif ($input_type == 'number_positive') {
$corrected_value = abs($corrected_value);
- else if ($input_type == 'number_negative')
+ } elseif ($input_type == 'number_negative') {
$corrected_value = -1 * abs($corrected_value);
- else if ($input_type == 'number_percentage')
+ } elseif ($input_type == 'number_percentage') {
$corrected_value = min(100, max(0, $corrected_value));
-
+ }
+
break;
}
- if (!isset($data[$row_num]))
+ if (! isset($data[$row_num])) {
$data[$row_num] = [];
+ }
- if ($cat_id == $sample_code_id) // check if sample code exists in DB
- $data[$row_num][0] = SampleCode::where('sample_code',$corrected_value)->count();
+ if ($cat_id == $sample_code_id) { // check if sample code exists in DB
+ $data[$row_num][0] = SampleCode::where('sample_code', $corrected_value)->count();
+ }
$data[$row_num][$cat_id] = $corrected_value;
}
@@ -313,53 +283,48 @@ public function upload_store(Request $request)
}
}
}
- $cols = $wsheet->getHighestColumn();
- $rows = $wsheet->getHighestRow();
- $entries= count($data);
+ $cols = $wsheet->getHighestColumn();
+ $rows = $wsheet->getHighestRow();
+ $entries = count($data);
$editor = $sheet->getProperties()->getLastModifiedBy();
$lastmo = date('Y-m-d H:i:s', $sheet->getProperties()->getModified());
- $msg .= ". $sheets Tabs, First tab: $entries entries ($rows rows up to col $cols), Last modified by: $editor @ $lastmo";
- }
- else
- {
- $msg = 'File uploaded, but invalid';
+ $msg .= ". $sheets Tabs, First tab: $entries entries ($rows rows up to col $cols), Last modified by: $editor @ $lastmo";
+ } else {
+ $msg = 'File uploaded, but invalid';
}
}
- //dd($col_names, $data);
+ // dd($col_names, $data);
- return redirect('code-upload')->with(["$res"=>$msg, 'data'=>$data, 'col_names'=>$col_names, 'col_input_types'=>$col_input_types]);
+ return redirect('code-upload')->with(["$res" => $msg, 'data' => $data, 'col_names' => $col_names, 'col_input_types' => $col_input_types]);
}
-
private function createExcelTemplate($array_only = false)
{
- $locale = LaravelLocalization::getCurrentLocale();
+ $locale = LaravelLocalization::getCurrentLocale();
$spreadsheet_array = [];
- $today = date('Y-m-d');
- $sheet_title = 'Sample code template '.$today;
+ $today = date('Y-m-d');
+ $sheet_title = 'Sample code template '.$today;
// Add item names to header row of inspections
// first combine all user's itemnames
$lab_cats = Category::descendentsByRootParentAndName('disorder', 'disorder', 'laboratory_test');
- $rows = [
+ $rows = [
['CATEGORY ID'],
['HIERACHY'],
['NAME'],
['PHYSICAL QUANTITY'],
['UNIT'],
['INPUT TYPE'],
- ['INPUT RANGE']
+ ['INPUT RANGE'],
]; // 7 rows
$rows[] = []; // 2nd column is for sample code
- foreach ($lab_cats as $c)
- {
- $hidden = ['image','label','sample_code'];
+ foreach ($lab_cats as $c) {
+ $hidden = ['image', 'label', 'sample_code'];
- if ($c->input == 'sample_code')
- {
+ if ($c->input == 'sample_code') {
$rows[0][1] = $c->id;
$rows[1][1] = $c->ancName($locale);
$rows[2][1] = $c->transName($locale);
@@ -369,8 +334,9 @@ private function createExcelTemplate($array_only = false)
$rows[6][1] = 'Enter all sample codes in this column';
}
- if (in_array($c->input, $hidden))
+ if (in_array($c->input, $hidden)) {
continue;
+ }
$rows[0][] = $c->id;
$rows[1][] = $c->ancName($locale);
@@ -383,8 +349,9 @@ private function createExcelTemplate($array_only = false)
$spreadsheet_array[$sheet_title] = $rows;
- if ($array_only)
+ if ($array_only) {
return $spreadsheet_array;
+ }
// $spreadsheet_array[$sheet_title][0][] = __('export.deleted_at');
@@ -393,7 +360,7 @@ private function createExcelTemplate($array_only = false)
// foreach ($lab_catsps as $lab_catsp)
// $spreadsheet_array[$sheet_title][] = $lab_catsp;
- //dd($spreadsheet_array);
+ // dd($spreadsheet_array);
$template_excel = $this->export($spreadsheet_array, $sheet_title);
@@ -403,42 +370,39 @@ private function createExcelTemplate($array_only = false)
private function num2alpha($n)
{
- for($r = ""; $n >= 0; $n = intval($n / 26) - 1)
- $r = chr($n%26 + 0x41) . $r;
+ for ($r = ''; $n >= 0; $n = intval($n / 26) - 1) {
+ $r = chr($n % 26 + 0x41).$r;
+ }
+
return $r;
}
- private function export($spreadsheetArray, $fileName='filename')
+ private function export($spreadsheetArray, $fileName = 'filename')
{
- //dd($spreadsheetArray);
+ // dd($spreadsheetArray);
- $spreadsheet = new Spreadsheet();
+ $spreadsheet = new Spreadsheet;
$sheet = $spreadsheet->getActiveSheet();
// Fill sheet with tabs and data
- $col = 1;
+ $col = 1;
$cols = 1;
$rows = 0;
- $lines= [];
+ $lines = [];
$head = null;
- foreach ($spreadsheetArray as $title => $sheet_array)
- {
+ foreach ($spreadsheetArray as $title => $sheet_array) {
$sheet->setTitle($title);
$sheet->fromArray($sheet_array);
$rows = count($sheet_array);
- foreach ($sheet_array as $row_index => $col_array)
- {
- if ($row_index == 1)
- {
- if ($head == null)
- {
- foreach($col_array as $col_index => $header)
- {
- if ($header != $head)
- {
- if ($head != null)
+ foreach ($sheet_array as $row_index => $col_array) {
+ if ($row_index == 1) {
+ if ($head == null) {
+ foreach ($col_array as $col_index => $header) {
+ if ($header != $head) {
+ if ($head != null) {
$lines[] = $col_index;
+ }
$head = $header;
}
@@ -450,11 +414,11 @@ private function export($spreadsheetArray, $fileName='filename')
$cols = max($cols, count($col_array));
}
}
- //dd($lines);
+ // dd($lines);
// style the header
$header_lst_col = $this->num2alpha($cols);
- $header_cells = 'A1:'.$this->num2alpha($cols).$rows;
+ $header_cells = 'A1:'.$this->num2alpha($cols).$rows;
$styleArrayHeaderBlock = [
'alignment' => [
'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP,
@@ -466,7 +430,7 @@ private function export($spreadsheetArray, $fileName='filename')
];
$sheet->getStyle($header_cells)->applyFromArray($styleArrayHeaderBlock);
-
+
// protect sheet
// $sheet->getProtection()->setSheet(true);
// $protection = $sheet->getProtection();
@@ -486,10 +450,10 @@ private function export($spreadsheetArray, $fileName='filename')
],
],
];
- $bottomHeaderRow = 'A'.($rows-1).':'.$header_lst_col.($rows-1);
+ $bottomHeaderRow = 'A'.($rows - 1).':'.$header_lst_col.($rows - 1);
$sheet->getStyle($bottomHeaderRow)->applyFromArray($styleArrayBottomBorder);
- // vertical borders
+ // vertical borders
$styleArrayVertLine = [
'borders' => [
'left' => [
@@ -498,16 +462,15 @@ private function export($spreadsheetArray, $fileName='filename')
],
],
];
- foreach ($lines as $col)
- {
- $colChar = $this->num2alpha($col);
- $colCells = $colChar.'1:'.$colChar.'500';
+ foreach ($lines as $col) {
+ $colChar = $this->num2alpha($col);
+ $colCells = $colChar.'1:'.$colChar.'500';
$sheet->getStyle($colCells)->applyFromArray($styleArrayVertLine);
}
-
+
// Set cell width and bold first col
- $firstColCells = 'A1:A500';
- $secondColCells = 'B1:B500';
+ $firstColCells = 'A1:A500';
+ $secondColCells = 'B1:B500';
$styleArrayFirstCol = [
'font' => [
'bold' => true,
@@ -557,16 +520,15 @@ private function export($spreadsheetArray, $fileName='filename')
$sheet->getStyle($firstColCells)->applyFromArray($styleArrayFirstCol);
$sheet->getStyle($secondColCells)->applyFromArray($styleArraySampleCodeCol);
- for ($c=0; $c <= $cols; $c++)
- {
+ for ($c = 0; $c <= $cols; $c++) {
$colChar = $this->num2alpha($c);
$sheet->getColumnDimension($colChar)->setWidth(15);
}
-
+
// save sheet
$filePath = 'exports/'.$fileName.'.xlsx';
- $writer = new Xlsx($spreadsheet);
- //$writer->setOffice2003Compatibility(true);
+ $writer = new Xlsx($spreadsheet);
+ // $writer->setOffice2003Compatibility(true);
ob_start();
$writer->save('php://output');
@@ -574,52 +536,47 @@ private function export($spreadsheetArray, $fileName='filename')
ob_end_clean();
$disk = env('EXPORT_STORAGE', 'public');
- if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], 'public'))
- return ['url'=>Storage::disk($disk)->url($filePath), 'path'=>$filePath];
+ if (Storage::disk($disk)->put($filePath, $file_content, ['mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], 'public')) {
+ return ['url' => Storage::disk($disk)->url($filePath), 'path' => $filePath];
+ }
return null;
}
-
- private function getInspections($sample_code, $inspections, $item_names, $date_start=null, $date_until=null)
+ private function getInspections($sample_code, $inspections, $item_names, $date_start = null, $date_until = null)
{
// array of inspection items and data
$inspection_data = array_fill_keys($item_names, '');
$inspections = $inspections->where('created_at', '>=', $date_start)->where('created_at', '<=', $date_until)->sortByDesc('created_at');
-
- $table = $inspections->map(function($inspection) use ($inspection_data, $user_id)
- {
- if (isset($inspection->items))
- {
- foreach ($inspection->items as $inspectionItem)
- {
- $array_key = $inspectionItem->anc.$inspectionItem->name;
+ $table = $inspections->map(function ($inspection) use ($inspection_data) {
+ if (isset($inspection->items)) {
+ foreach ($inspection->items as $inspectionItem) {
+ $array_key = $inspectionItem->anc.$inspectionItem->name;
$inspection_data[$array_key] = $inspectionItem->humanReadableValue();
}
}
$locationId = ($inspection->locations()->count() > 0 ? $inspection->locations()->first()->id : ($inspection->hives()->count() > 0 ? $inspection->hives()->first()->location_id : ''));
-
- $reminder_date= '';
- if (isset($inspection->reminder_date) && $inspection->reminder_date != null)
- {
- $reminder_mom = new Moment($inspection->reminder_date);
+
+ $reminder_date = '';
+ if (isset($inspection->reminder_date) && $inspection->reminder_date != null) {
+ $reminder_mom = new Moment($inspection->reminder_date);
$reminder_date = $reminder_mom->format('Y-m-d H:i:s');
}
- $smileys = __('taxonomy.smileys_3');
- $boolean = __('taxonomy.boolean');
-
+ $smileys = __('taxonomy.smileys_3');
+ $boolean = __('taxonomy.boolean');
+
// add general inspection data columns
$pre = [
'Sample code' => $sample_code,
'inspection_id' => $inspection->id,
__('export.created_at') => $inspection->created_at,
- __('export.hive') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->id : '',
- __('export.location') => $locationId,
- __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
- __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
+ __('export.hive') => $inspection->hives()->count() > 0 ? $inspection->hives()->first()->id : '',
+ __('export.location') => $locationId,
+ __('export.impression') => $inspection->impression > -1 && $inspection->impression < count($smileys) ? $smileys[$inspection->impression] : '',
+ __('export.attention') => $inspection->attention > -1 && $inspection->attention < count($boolean) ? $boolean[$inspection->attention] : '',
__('export.reminder') => $inspection->reminder,
__('export.reminder_date') => $reminder_date,
__('export.notes') => $inspection->notes,
@@ -629,17 +586,18 @@ private function getInspections($sample_code, $inspections, $item_names, $date_s
return array_values($dat);
});
- //die(print_r($table));
+
+ // die(print_r($table));
return $table;
}
-
public function check(Request $request)
{
$samplecode = SampleCode::where('sample_code', $request->input('samplecode'))->first();
- if ($samplecode)
+ if ($samplecode) {
return view('sample-code.result', compact('samplecode'));
+ }
return redirect('code')->with('error', 'Sample code not found');
}
@@ -648,29 +606,32 @@ public function resultsave(Request $request)
{
$samplecode = SampleCode::where('sample_code', $request->input('samplecode'))->first();
- if ($samplecode)
- {
- if ($request->filled('test_lab_name'))
+ if ($samplecode) {
+ if ($request->filled('test_lab_name')) {
$samplecode->test_lab_name = $request->input('test_lab_name');
+ }
- if ($request->filled('test_date'))
+ if ($request->filled('test_date')) {
$samplecode->test_date = $request->input('test_date');
+ }
- if ($request->filled('test'))
+ if ($request->filled('test')) {
$samplecode->test = $request->input('test');
+ }
- if ($request->filled('test_result'))
+ if ($request->filled('test_result')) {
$samplecode->test_result = $request->input('test_result');
+ }
$samplecode->save();
return redirect('code')->with('success', 'Sample code results saved');
}
+
return redirect('code')->with('error', 'Sample code not found');
}
-
/**
* Display a listing of the resource.
*
@@ -679,7 +640,7 @@ public function resultsave(Request $request)
public function index(Request $request)
{
$samplecode = SampleCode::all();
-
+
return view('sample-code.index', compact('samplecode'));
}
@@ -690,29 +651,29 @@ public function index(Request $request)
*/
public function create()
{
- $samplecode = new SampleCode();
+ $samplecode = new SampleCode;
$samplecode->sample_code = SampleCode::generate_code();
$samplecode->user_id = Auth::user()->id;
$samplecode->hive_id = Auth::user()->hives->first()->id;
$samplecode->queen_id = Auth::user()->queens->first()->id;
+
return view('sample-code.create', compact('samplecode'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request)
{
$this->validate($request, [
- 'sample_code' => 'required',
- 'hive_id' => 'required'
- ]);
+ 'sample_code' => 'required',
+ 'hive_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
SampleCode::create($requestData);
return redirect('sample-code')->with('flash_message', 'SampleCode added!');
@@ -722,7 +683,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -736,7 +696,6 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
@@ -749,19 +708,17 @@ public function edit($id)
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
{
$this->validate($request, [
- 'sample_code' => 'required',
- 'hive_id' => 'required'
- ]);
+ 'sample_code' => 'required',
+ 'hive_id' => 'required',
+ ]);
$requestData = $request->all();
-
+
$samplecode = SampleCode::findOrFail($id);
$samplecode->update($requestData);
@@ -772,7 +729,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index 2442fb7d..e5681731 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -2,14 +2,10 @@
namespace App\Http\Controllers;
-use App\Http\Requests;
-use App\Http\Controllers\Controller;
-use Illuminate\Support\Facades\Log;
-
-use App\User;
use App\Device;
use App\Measurement;
use App\SensorDefinition;
+use App\User;
use Illuminate\Http\Request;
class SensorDefinitionController extends Controller
@@ -21,70 +17,64 @@ class SensorDefinitionController extends Controller
*/
public function index(Request $request)
{
- $page = $request->get('page');
- $keyword = $request->get('search');
+ $page = $request->get('page');
+ $keyword = $request->get('search');
$search_user = $request->get('user');
- $search_dev = $request->get('device');
- $search_mid = $request->get('measurement_id');
- $device_id = $request->get('device_id');
- $perPage = 50;
- $defs = SensorDefinition::where('id', '!=', null);
-
- if (!empty($device_id))
- {
+ $search_dev = $request->get('device');
+ $search_mid = $request->get('measurement_id');
+ $device_id = $request->get('device_id');
+ $perPage = 50;
+ $defs = SensorDefinition::where('id', '!=', null);
+
+ if (! empty($device_id)) {
$defs = $defs->where('device_id', $device_id);
}
- if (!empty($search_mid))
- {
+ if (! empty($search_mid)) {
$defs = $defs->where('input_measurement_id', $search_mid)->orWhere('output_measurement_id', $search_mid);
}
-
- if (!empty($search_dev))
- {
+
+ if (! empty($search_dev)) {
$dev_ids = Device::where('hive_id', 'LIKE', "%$search_dev%")
- ->orWhere('id', 'LIKE', "%$search_dev%")
- ->orWhere('name', 'LIKE', "%$search_dev%")
- ->orWhere('key', 'LIKE', "%$search_dev%")
- ->orWhere('former_key_list', 'LIKE', "%$search_dev%")
- ->orWhere('last_message_received', 'LIKE', "%$search_dev%")
- ->orWhere('hardware_id', 'LIKE', "%$search_dev%")
- ->orWhere('firmware_version', 'LIKE', "%$search_dev%")
- ->orWhere('hardware_version', 'LIKE', "%$search_dev%")
- ->orWhere('measurement_interval_min', 'LIKE', "%$search_dev%")
- ->orWhere('battery_voltage', 'LIKE', "%$search_dev%")
- ->orWhere('datetime', 'LIKE', "%$search_dev%")
- ->orWhere('datetime_offset_sec', 'LIKE', "%$search_dev%")
- ->pluck('id');
- if ($dev_ids)
+ ->orWhere('id', 'LIKE', "%$search_dev%")
+ ->orWhere('name', 'LIKE', "%$search_dev%")
+ ->orWhere('key', 'LIKE', "%$search_dev%")
+ ->orWhere('former_key_list', 'LIKE', "%$search_dev%")
+ ->orWhere('last_message_received', 'LIKE', "%$search_dev%")
+ ->orWhere('hardware_id', 'LIKE', "%$search_dev%")
+ ->orWhere('firmware_version', 'LIKE', "%$search_dev%")
+ ->orWhere('hardware_version', 'LIKE', "%$search_dev%")
+ ->orWhere('measurement_interval_min', 'LIKE', "%$search_dev%")
+ ->orWhere('battery_voltage', 'LIKE', "%$search_dev%")
+ ->orWhere('datetime', 'LIKE', "%$search_dev%")
+ ->orWhere('datetime_offset_sec', 'LIKE', "%$search_dev%")
+ ->pluck('id');
+ if ($dev_ids) {
$defs = $defs->whereIn('device_id', $dev_ids);
-
+ }
+
}
- if (!empty($search_user))
- {
+ if (! empty($search_user)) {
$user_ids = User::where('name', 'LIKE', "%$search_user%")
- ->orWhere('email', 'LIKE', "%$search_user%")
- ->orWhere('locale', 'LIKE', "%$search_user%")
- ->orWhere('id', 'LIKE', "%$search_user%")
- ->pluck('id');
-
- if (count($user_ids) > 0)
- {
+ ->orWhere('email', 'LIKE', "%$search_user%")
+ ->orWhere('locale', 'LIKE', "%$search_user%")
+ ->orWhere('id', 'LIKE', "%$search_user%")
+ ->pluck('id');
+
+ if (count($user_ids) > 0) {
$dev_ids = Device::whereIn('user_id', $user_ids)->pluck('id');
- $defs = $defs->whereIn('device_id', $dev_ids);
+ $defs = $defs->whereIn('device_id', $dev_ids);
}
}
- if (!empty($keyword))
- {
+ if (! empty($keyword)) {
$defs = $defs->where('name', 'LIKE', "%$keyword%");
}
$sensordefinition = $defs->orderByDesc('id')->paginate($perPage);
-
- return view('sensordefinition.index', compact('sensordefinition','search_mid','page'));
+ return view('sensordefinition.index', compact('sensordefinition', 'search_mid', 'page'));
}
/**
@@ -94,15 +84,15 @@ public function index(Request $request)
*/
public function create()
{
- $devices_select = Device::selectList();
+ $devices_select = Device::selectList();
$measurement_select = Measurement::selectList();
- return view('sensordefinition.create', compact('devices_select','measurement_select'));
+
+ return view('sensordefinition.create', compact('devices_select', 'measurement_select'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
@@ -113,7 +103,7 @@ public function store(Request $request)
'input_measurement_id' => 'integer|exists:measurements,id',
]);
$requestData = $request->all();
- $updated_at = str_replace('T', ' ', $requestData['updated_at']).':00';
+ $updated_at = str_replace('T', ' ', $requestData['updated_at']).':00';
$requestData['updated_at'] = $updated_at;
$sensordefinition = SensorDefinition::create($requestData);
$sensordefinition->updated_at = $updated_at;
@@ -126,7 +116,6 @@ public function store(Request $request)
* Display the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function show($id)
@@ -140,23 +129,21 @@ public function show($id)
* Show the form for editing the specified resource.
*
* @param int $id
- *
* @return \Illuminate\View\View
*/
public function edit($id)
{
- $sensordefinition = SensorDefinition::findOrFail($id);
- $devices_select = Device::selectList();
+ $sensordefinition = SensorDefinition::findOrFail($id);
+ $devices_select = Device::selectList();
$measurement_select = Measurement::selectList();
- return view('sensordefinition.edit', compact('sensordefinition','devices_select','measurement_select'));
+
+ return view('sensordefinition.edit', compact('sensordefinition', 'devices_select', 'measurement_select'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id)
@@ -167,7 +154,7 @@ public function update(Request $request, $id)
]);
$sensordefinition = SensorDefinition::findOrFail($id);
$requestData = $request->all();
- $updated_at = str_replace('T', ' ', $requestData['updated_at']).':00';
+ $updated_at = str_replace('T', ' ', $requestData['updated_at']).':00';
$requestData['updated_at'] = $updated_at;
// prevent updated_at from updating by the update action
$sensordefinition->update($requestData); // first change updated_at
@@ -181,7 +168,6 @@ public function update(Request $request, $id)
* Remove the specified resource from storage.
*
* @param int $id
- *
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id)
diff --git a/app/Http/Controllers/TaxonomyController.php b/app/Http/Controllers/TaxonomyController.php
index 0dd49637..7c571d37 100644
--- a/app/Http/Controllers/TaxonomyController.php
+++ b/app/Http/Controllers/TaxonomyController.php
@@ -1,109 +1,98 @@
removeKeys($item) : $item;
}, $array);
- return array_filter($array, function($value, $key)
- {
- return !in_array($key, static::BLACKLISTED_KEYS, TRUE) && (!is_array($value) || count($value) > 0);
+ return array_filter($array, function ($value, $key) {
+ return ! in_array($key, static::BLACKLISTED_KEYS, true) && (! is_array($value) || count($value) > 0);
}, ARRAY_FILTER_USE_BOTH);
}
public function display()
{
- $fixed = Category::fixTree(); // kalnoy/nestedset: to fix the tree to fill _lft and _rgt columns
+ $fixed = Category::fixTree(); // kalnoy/nestedset: to fix the tree to fill _lft and _rgt columns
- $locale = LaravelLocalization::getCurrentLocale();
- $locale_name= LaravelLocalization::getCurrentLocaleName();
+ $locale = LaravelLocalization::getCurrentLocale();
+ $locale_name = LaravelLocalization::getCurrentLocaleName();
$categories = Category::getTaxonomy(null, false, true, []); // unordered flat
- $cat_names = [];
- $cat_ids_excl = [];
- $cat_names_excl = ['frame_2_side_a','frame_2_side_b','frame_3_side_a','frame_3_side_b','frame_4_side_a','frame_4_side_b','frame_5_side_a','frame_5_side_b','frame_6_side_a','frame_6_side_b','frame_7_side_a','frame_7_side_b','frame_8_side_a','frame_8_side_b','frame_9_side_a','frame_9_side_b','frame_10_side_a','frame_10_side_b','frame_11_side_a','frame_11_side_b','frame_12_side_a','frame_12_side_b','frame_13_side_a','frame_13_side_b','frame_14_side_a','frame_14_side_b','frame_15_side_a','frame_15_side_b','frame_16_side_a','frame_16_side_b','frame_17_side_a','frame_17_side_b','frame_18_side_a','frame_18_side_b','frame_19_side_a','frame_19_side_b','frame_20_side_a','frame_20_side_b','frame_21_side_a','frame_21_side_b','frame_22_side_a','frame_22_side_b','frame_23_side_a','frame_23_side_b','frame_24_side_a','frame_24_side_b'];
+ $cat_names = [];
+ $cat_ids_excl = [];
+ $cat_names_excl = ['frame_2_side_a', 'frame_2_side_b', 'frame_3_side_a', 'frame_3_side_b', 'frame_4_side_a', 'frame_4_side_b', 'frame_5_side_a', 'frame_5_side_b', 'frame_6_side_a', 'frame_6_side_b', 'frame_7_side_a', 'frame_7_side_b', 'frame_8_side_a', 'frame_8_side_b', 'frame_9_side_a', 'frame_9_side_b', 'frame_10_side_a', 'frame_10_side_b', 'frame_11_side_a', 'frame_11_side_b', 'frame_12_side_a', 'frame_12_side_b', 'frame_13_side_a', 'frame_13_side_b', 'frame_14_side_a', 'frame_14_side_b', 'frame_15_side_a', 'frame_15_side_b', 'frame_16_side_a', 'frame_16_side_b', 'frame_17_side_a', 'frame_17_side_b', 'frame_18_side_a', 'frame_18_side_b', 'frame_19_side_a', 'frame_19_side_b', 'frame_20_side_a', 'frame_20_side_b', 'frame_21_side_a', 'frame_21_side_b', 'frame_22_side_a', 'frame_22_side_b', 'frame_23_side_a', 'frame_23_side_b', 'frame_24_side_a', 'frame_24_side_b'];
- foreach ($categories as $id => $cat)
- {
- if (in_array($cat->name, $cat_names_excl))
+ foreach ($categories as $id => $cat) {
+ if (in_array($cat->name, $cat_names_excl)) {
$cat_ids_excl[] = $cat->id;
- else if (!in_array($cat->parent_id, $cat_ids_excl))
- $cat_names[' .'.$cat->ancName($locale, '.').$cat->transName($locale)] = ['base'=>$cat->rootNodeName(), 'parent'=>' .'.substr($cat->ancName($locale, '.'), 0, -1), 'name'=>$cat->name];
+ } elseif (! in_array($cat->parent_id, $cat_ids_excl)) {
+ $cat_names[' .'.$cat->ancName($locale, '.').$cat->transName($locale)] = ['base' => $cat->rootNodeName(), 'parent' => ' .'.substr($cat->ancName($locale, '.'), 0, -1), 'name' => $cat->name];
+ }
}
ksort($cat_names);
- $cats = [['id'=>' ','base'=>'', 'parent'=>'']];
- $prev_id = null;
- $prev_base = null;
+ $cats = [['id' => ' ', 'base' => '', 'parent' => '']];
+ $prev_id = null;
+ $prev_base = null;
$prev_parent = null;
- $extra_cats = [];
+ $extra_cats = [];
- foreach ($cat_names as $id => $cat_array)
- {
- $base = $cat_array['base'];
+ foreach ($cat_names as $id => $cat_array) {
+ $base = $cat_array['base'];
$parent = $cat_array['parent'];
- if ($prev_parent != $parent && $id != $parent && $prev_id != $parent && $base != '') // some categories might be skipped
- {
- $parent_parent_parent = implode(".", explode(".", $parent, -2));
- if (!isset($cat_names[$parent_parent_parent]) && $parent_parent_parent != " " && $parent_parent_parent != "" && !in_array($parent_parent_parent, $extra_cats))
- {
- array_push($cats, ['id'=>$parent_parent_parent, 'base'=>$base]);
+ if ($prev_parent != $parent && $id != $parent && $prev_id != $parent && $base != '') { // some categories might be skipped
+ $parent_parent_parent = implode('.', explode('.', $parent, -2));
+ if (! isset($cat_names[$parent_parent_parent]) && $parent_parent_parent != ' ' && $parent_parent_parent != '' && ! in_array($parent_parent_parent, $extra_cats)) {
+ array_push($cats, ['id' => $parent_parent_parent, 'base' => $base]);
$extra_cats[] = $parent_parent_parent;
}
- $parent_parent = implode(".", explode(".", $parent, -1));
- if (!isset($cat_names[$parent_parent]) && $parent_parent != " " && $parent_parent != "" && !in_array($parent_parent, $extra_cats))
- {
- array_push($cats, ['id'=>$parent_parent, 'base'=>$base]);
+ $parent_parent = implode('.', explode('.', $parent, -1));
+ if (! isset($cat_names[$parent_parent]) && $parent_parent != ' ' && $parent_parent != '' && ! in_array($parent_parent, $extra_cats)) {
+ array_push($cats, ['id' => $parent_parent, 'base' => $base]);
$extra_cats[] = $parent_parent;
}
- if (!isset($cat_names[$parent]) && $parent != " " && $parent != "" && !in_array($parent, $extra_cats))
- {
- array_push($cats, ['id'=>$parent, 'base'=>$base]);
+ if (! isset($cat_names[$parent]) && $parent != ' ' && $parent != '' && ! in_array($parent, $extra_cats)) {
+ array_push($cats, ['id' => $parent, 'base' => $base]);
$extra_cats[] = $parent;
}
}
- array_push($cats, ['id'=>$id, 'base'=>$base]);
- $prev_id = $id;
+ array_push($cats, ['id' => $id, 'base' => $base]);
+ $prev_id = $id;
$prev_base = $base;
$prev_parent = $parent;
}
- //die(print_r($cats));
-
- $count = count($cats)-1;
- $catsJson = json_encode($cats, JSON_PRETTY_PRINT);
-
- // add filtered JSON tree
- $tree_base = Category::getTaxonomy(null, true, false)->toArray(); // ordered tree
- $filtered_tree = $this->removeKeys($tree_base);
- $filtered_json = json_encode($filtered_tree, JSON_PRETTY_PRINT);
-
- return view('taxonomy.display', compact('catsJson','count','filtered_json','locale_name','fixed'));
- }
+ // die(print_r($cats));
+ $count = count($cats) - 1;
+ $catsJson = json_encode($cats, JSON_PRETTY_PRINT);
+ // add filtered JSON tree
+ $tree_base = Category::getTaxonomy(null, true, false)->toArray(); // ordered tree
+ $filtered_tree = $this->removeKeys($tree_base);
+ $filtered_json = json_encode($filtered_tree, JSON_PRETTY_PRINT);
+ return view('taxonomy.display', compact('catsJson', 'count', 'filtered_json', 'locale_name', 'fixed'));
+ }
}
diff --git a/app/Http/Controllers/TranslationController.php b/app/Http/Controllers/TranslationController.php
index 1e0a7ae5..c69dd456 100644
--- a/app/Http/Controllers/TranslationController.php
+++ b/app/Http/Controllers/TranslationController.php
@@ -2,164 +2,135 @@
namespace App\Http\Controllers;
-use App\Translation;
-use App\Language;
use App\Category;
+use App\Language;
use App\Measurement;
-use App\PhysicalQuantity;
-use App\Models\ChartGroup;
use App\Models\AlertRule;
+use App\PhysicalQuantity;
+use App\Translation;
use Illuminate\Http\Request;
-use Kalnoy\Nestedset\Collection;
-use Cache;
+use Kalnoy\Nestedset\Collection;
class TranslationController extends Controller
{
public function index()
- {
- return view('translations.index');
- }
-
- public function edit(Language $language, Request $request)
- {
- $output_csv = boolval($request->input('csv', 0));
-
- $categories = $this->getCategoryOptions(null);
- $measurements = Measurement::all();
- $physical_quantities = PhysicalQuantity::all();
- $alert_rules = AlertRule::where('default_rule', true)->get();
-
- return view('translations.edit', compact('measurements','language','physical_quantities','alert_rules','output_csv','categories'));
- }
-
-
- public function update(Language $language, Request $request)
- {
- $translation_measurement = $request->input('translation_measurement');
- $translation_category = $request->input('translation_category');
- $translation_physical_quantity = $request->input('translation_physical_quantity');
- $translation_alert_rule = $request->input('translation_alert_rule');
- $translation_alert_rule_descr = $request->input('translation_alert_rule_descr');
-
- $count = 0;
- if (isset($translation_measurement))
- {
- foreach ($translation_measurement as $m_id => $translation)
- {
- if (isset($translation) && $translation != '')
- {
- $measurement = Measurement::find($m_id);
- //die(print_r(['$m_id'=>$m_id, 'm'=>$measurement]));
- if (isset($measurement))
- {
- $count += Translation::saveText($language->abbreviation, $measurement->abbreviation, 'measurement', $translation);
- $measurement->forgetCache();
- }
- }
- }
- }
- if (isset($translation_physical_quantity))
- {
- foreach ($translation_physical_quantity as $p_id => $translation)
- {
- if (isset($translation) && $translation != '')
- {
- $physical_quantity = PhysicalQuantity::find($p_id);
- //die(print_r(['$p_id'=>$p_id, 'm'=>$physical_quantity]));
- if (isset($physical_quantity))
- {
- $count += Translation::saveText($language->abbreviation, $physical_quantity->abbreviation, 'physical_quantity', $translation);
- $physical_quantity->forgetCache();
- }
- }
- }
- }
- if (isset($translation_category))
- {
- foreach ($translation_category as $cat_id => $translation)
- {
- if (isset($translation) && $translation != '')
- {
- $category = Category::find($cat_id);
- if (isset($category))
- {
- $count += Translation::saveText($language->abbreviation, $category->name, 'category', $translation);
- $category->forgetCache();
- }
- }
- }
- }
- if (isset($translation_alert_rule))
- {
- foreach ($translation_alert_rule as $r_id => $translation)
- {
- if (isset($translation) && $translation != '')
- {
- $alert_rule = AlertRule::find($r_id);
- if (isset($alert_rule))
- {
- $count += Translation::saveText($language->abbreviation, $alert_rule->name, 'alert_rule', $translation);
- $alert_rule->forgetCache();
- }
- }
- }
- }
- if (isset($translation_alert_rule_descr))
- {
- foreach ($translation_alert_rule_descr as $r_id => $translation)
- {
- if (isset($translation) && $translation != '')
- {
- $alert_rule = AlertRule::find($r_id);
- if (isset($alert_rule))
- {
- $count += Translation::saveText($language->abbreviation, $alert_rule->description, 'alert_rule_description', $translation);
- $alert_rule->forgetCache();
- }
- }
- }
- }
-
- if ($count > 0)
- return redirect()->route('translations.edit', [ $language->id ])->with('success', "$count translations successfully updated!");
-
- return redirect()->route('translations.edit', [ $language->id ])->with('error', "No translations updated.");
- }
-
-
-
- /**
- * @param Collection $items
- *
+ {
+ return view('translations.index');
+ }
+
+ public function edit(Language $language, Request $request)
+ {
+ $output_csv = boolval($request->input('csv', 0));
+
+ $categories = $this->getCategoryOptions(null);
+ $measurements = Measurement::all();
+ $physical_quantities = PhysicalQuantity::all();
+ $alert_rules = AlertRule::where('default_rule', true)->get();
+
+ return view('translations.edit', compact('measurements', 'language', 'physical_quantities', 'alert_rules', 'output_csv', 'categories'));
+ }
+
+ public function update(Language $language, Request $request)
+ {
+ $translation_measurement = $request->input('translation_measurement');
+ $translation_category = $request->input('translation_category');
+ $translation_physical_quantity = $request->input('translation_physical_quantity');
+ $translation_alert_rule = $request->input('translation_alert_rule');
+ $translation_alert_rule_descr = $request->input('translation_alert_rule_descr');
+
+ $count = 0;
+ if (isset($translation_measurement)) {
+ foreach ($translation_measurement as $m_id => $translation) {
+ if (isset($translation) && $translation != '') {
+ $measurement = Measurement::find($m_id);
+ // die(print_r(['$m_id'=>$m_id, 'm'=>$measurement]));
+ if (isset($measurement)) {
+ $count += Translation::saveText($language->abbreviation, $measurement->abbreviation, 'measurement', $translation);
+ $measurement->forgetCache();
+ }
+ }
+ }
+ }
+ if (isset($translation_physical_quantity)) {
+ foreach ($translation_physical_quantity as $p_id => $translation) {
+ if (isset($translation) && $translation != '') {
+ $physical_quantity = PhysicalQuantity::find($p_id);
+ // die(print_r(['$p_id'=>$p_id, 'm'=>$physical_quantity]));
+ if (isset($physical_quantity)) {
+ $count += Translation::saveText($language->abbreviation, $physical_quantity->abbreviation, 'physical_quantity', $translation);
+ $physical_quantity->forgetCache();
+ }
+ }
+ }
+ }
+ if (isset($translation_category)) {
+ foreach ($translation_category as $cat_id => $translation) {
+ if (isset($translation) && $translation != '') {
+ $category = Category::find($cat_id);
+ if (isset($category)) {
+ $count += Translation::saveText($language->abbreviation, $category->name, 'category', $translation);
+ $category->forgetCache();
+ }
+ }
+ }
+ }
+ if (isset($translation_alert_rule)) {
+ foreach ($translation_alert_rule as $r_id => $translation) {
+ if (isset($translation) && $translation != '') {
+ $alert_rule = AlertRule::find($r_id);
+ if (isset($alert_rule)) {
+ $count += Translation::saveText($language->abbreviation, $alert_rule->name, 'alert_rule', $translation);
+ $alert_rule->forgetCache();
+ }
+ }
+ }
+ }
+ if (isset($translation_alert_rule_descr)) {
+ foreach ($translation_alert_rule_descr as $r_id => $translation) {
+ if (isset($translation) && $translation != '') {
+ $alert_rule = AlertRule::find($r_id);
+ if (isset($alert_rule)) {
+ $count += Translation::saveText($language->abbreviation, $alert_rule->description, 'alert_rule_description', $translation);
+ $alert_rule->forgetCache();
+ }
+ }
+ }
+ }
+
+ if ($count > 0) {
+ return redirect()->route('translations.edit', [$language->id])->with('success', "$count translations successfully updated!");
+ }
+
+ return redirect()->route('translations.edit', [$language->id])->with('error', 'No translations updated.');
+ }
+
+ /**
* @return static
*/
protected function makeOptions(Collection $items)
{
$options = [];
- foreach ($items as $item)
- {
- $options[$item->getKey()] = ['depth'=>$item->depth, 'name'=>$item->name];
+ foreach ($items as $item) {
+ $options[$item->getKey()] = ['depth' => $item->depth, 'name' => $item->name];
}
return $options;
}
- /**
- * @param Category $except
- *
- * @return CategoriesController
- */
- protected function getCategoryOptions($except = null)
- {
- /** @var \Kalnoy\Nestedset\QueryBuilder $query */
- $query = Category::select('id', 'name')->withDepth();
-
- if ($except)
- {
- $query->whereNotDescendantOf($except)->where('id', '<>', $except->id);
- }
-
- return $this->makeOptions($query->get());
- }
+ /**
+ * @param Category $except
+ * @return CategoriesController
+ */
+ protected function getCategoryOptions($except = null)
+ {
+ /** @var \Kalnoy\Nestedset\QueryBuilder $query */
+ $query = Category::select('id', 'name')->withDepth();
+
+ if ($except) {
+ $query->whereNotDescendantOf($except)->where('id', '<>', $except->id);
+ }
+
+ return $this->makeOptions($query->get());
+ }
}
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index 02439aa0..1286aff5 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -2,22 +2,19 @@
namespace App\Http\Controllers;
-use Illuminate\Http\Request;
-use Illuminate\Support\Str;
-use App\Http\Controllers\Controller;
-use App\User;
-use App\Role;
use App\Device;
+use App\Role;
+use App\User;
+use Auth;
use DB;
use Hash;
-use Image;
-use Auth;
-use Storage;
+use Illuminate\Http\Request;
+use Illuminate\Support\Str;
use InterventionImage;
+use Storage;
class UserController extends Controller
{
-
/**
* Display a listing of the resource.
*
@@ -25,31 +22,28 @@ class UserController extends Controller
*/
public function index(Request $request)
{
- $page = $request->input('page');
+ $page = $request->input('page');
$show_stats = $request->filled('stats');
- if (Auth::user()->hasRole('superadmin'))
- {
- $keyword = $request->get('search');
- $perPage = 50;
- $users = User::where('id', '!=', null);
+ if (Auth::user()->hasRole('superadmin')) {
+ $keyword = $request->get('search');
+ $perPage = 50;
+ $users = User::where('id', '!=', null);
- if (!empty($keyword))
- {
+ if (! empty($keyword)) {
$users = $users->where('name', 'LIKE', "%$keyword%")
- ->orWhere('email', 'LIKE', "%$keyword%")
- ->orWhere('locale', 'LIKE', "%$keyword%")
- ->orWhere('id', 'LIKE', "%$keyword%");
+ ->orWhere('email', 'LIKE', "%$keyword%")
+ ->orWhere('locale', 'LIKE', "%$keyword%")
+ ->orWhere('id', 'LIKE', "%$keyword%");
}
-
+
$data = $users->orderBy('name')->with('roles')->paginate($perPage);
- }
- else
- {
+ } else {
$data = [Auth::user()];
}
- return view('users.index',compact('data', 'show_stats', 'page'));
+
+ return view('users.index', compact('data', 'show_stats', 'page'));
}
/**
@@ -60,20 +54,19 @@ public function index(Request $request)
public function create()
{
$roles = $this->getMyPermittedRoles(Auth::user());
- $sensors = Device::all()->pluck('name','id');
- return view('users.create',compact('roles','sensors'));
+ $sensors = Device::all()->pluck('name', 'id');
+
+ return view('users.create', compact('roles', 'sensors'));
}
/**
* Store a newly created resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
- if ($this->checkRoleAuthorization($request, "user-create") == false)
- {
+ if ($this->checkRoleAuthorization($request, 'user-create') == false) {
return redirect()->route('users.index')->with('error', 'You are not allowed to create this type of user');
}
@@ -81,46 +74,41 @@ public function store(Request $request)
'name' => 'required',
'email' => 'required|email|unique:users,email',
'password' => 'required|same:confirm-password',
- //'roles' => 'required'
+ // 'roles' => 'required'
]);
$input = $request->all();
$input['password'] = Hash::make($input['password']);
$input['api_token'] = Str::random(60);
- $storage = env('IMAGE_STORAGE', 's3');
-
+ $storage = env('IMAGE_STORAGE', 's3');
+
// Handle the user upload of avatar
- if($request->hasFile('avatar')){
- $avatar = $request->file('avatar');
- $filename = time() . '.' . $avatar->getClientOriginalExtension();
- $path = 'avatars/'.$filename;
- $thumb = InterventionImage::make($avatar)->resize(300, 300);
+ if ($request->hasFile('avatar')) {
+ $avatar = $request->file('avatar');
+ $filename = time().'.'.$avatar->getClientOriginalExtension();
+ $path = 'avatars/'.$filename;
+ $thumb = InterventionImage::make($avatar)->resize(300, 300);
Storage::disk($storage)->put($path, $thumb->stream());
$input['avatar'] = Storage::disk($storage)->url($path);
- }
- else
- {
+ } else {
$input['avatar'] = Storage::disk($storage)->url('avatars/default.jpg');
}
$user = User::create($input);
-
+
// Handle role assignment, only store permitted role
- if ($request->filled('roles'))
- {
+ if ($request->filled('roles')) {
$roleIds = $this->getMyPermittedRoles(Auth::user(), true);
- foreach ($request->input('roles') as $key => $value)
- {
- if (in_array($value, $roleIds))
- {
+ foreach ($request->input('roles') as $key => $value) {
+ if (in_array($value, $roleIds)) {
$user->attachRole($value);
}
}
}
// Edit sensors
- if($request->filled('sensors')){
+ if ($request->filled('sensors')) {
foreach ($request->input('sensors') as $key => $value) {
DB::table('sensor_user')->insert(
['user_id' => $user->id, 'sensor_id' => $value]
@@ -129,7 +117,7 @@ public function store(Request $request)
}
return redirect()->route('users.index')
- ->with('success','User created successfully');
+ ->with('success', 'User created successfully');
}
/**
@@ -141,8 +129,9 @@ public function store(Request $request)
public function show($id)
{
$user = User::find($id);
- $sensors = []; //DB::table('sensors')->join('sensor_user', 'sensors.id', '=', 'sensor_user.sensor_id')->where('user_id',$id)->orderBy('name','asc')->pluck('name','id');
- return view('users.show',compact('user','sensors'));
+ $sensors = []; // DB::table('sensors')->join('sensor_user', 'sensors.id', '=', 'sensor_user.sensor_id')->where('user_id',$id)->orderBy('name','asc')->pluck('name','id');
+
+ return view('users.show', compact('user', 'sensors'));
}
/**
@@ -153,26 +142,26 @@ public function show($id)
*/
public function edit($id)
{
- $user = User::find($id);
- $roles = $this->getMyPermittedRoles($user);
- $userRole = $user->roles->pluck('id','id')->toArray();
- $sensors = DB::table('sensors')->orderBy('name','asc')->pluck('name','id');
- $userSensor = DB::table('sensor_user')->where('user_id',$id)->pluck('sensor_id','sensor_id')->toArray();
+ $user = User::find($id);
+ $roles = $this->getMyPermittedRoles($user);
+ $userRole = $user->roles->pluck('id', 'id')->toArray();
+ $sensors = DB::table('sensors')->orderBy('name', 'asc')->pluck('name', 'id');
+ $userSensor = DB::table('sensor_user')->where('user_id', $id)->pluck('sensor_id', 'sensor_id')->toArray();
- return view('users.edit',compact('user','roles','userRole','sensors','userSensor'));
+ return view('users.edit', compact('user', 'roles', 'userRole', 'sensors', 'userSensor'));
}
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
- if ($this->checkRoleAuthorization($request, "user-edit", $id) == false)
+ if ($this->checkRoleAuthorization($request, 'user-edit', $id) == false) {
return redirect()->route('users.index')->with('error', 'You are not allowed to edit this user');
+ }
// Do normal validation
$this->validate($request, [
@@ -180,26 +169,25 @@ public function update(Request $request, $id)
'email' => 'required|email|unique:users,email,'.$id,
'password' => 'same:confirm-password',
// 'roles' => 'required',
- 'avatar' => 'mimes:jpeg,gif,png'
+ 'avatar' => 'mimes:jpeg,gif,png',
]);
-
$input = $request->all();
- if(!empty($input['password'])){
+ if (! empty($input['password'])) {
$input['password'] = Hash::make($input['password']);
- }else{
- unset($input['password']);
+ } else {
+ unset($input['password']);
}
$user = User::find($id);
-
+
// Handle the user upload of avatar
- if($request->hasFile('avatar')){
- $avatar = $request->file('avatar');
+ if ($request->hasFile('avatar')) {
+ $avatar = $request->file('avatar');
$filename = time().'.'.$avatar->getClientOriginalExtension();
- $path = 'avatars/'.$filename;
- $storage = env('IMAGE_STORAGE', 's3');
- $thumb = InterventionImage::make($avatar)->resize(300, 300);
+ $path = 'avatars/'.$filename;
+ $storage = env('IMAGE_STORAGE', 's3');
+ $thumb = InterventionImage::make($avatar)->resize(300, 300);
Storage::disk($storage)->put($path, $thumb->stream());
$input['avatar'] = Storage::disk($storage)->url($path);
}
@@ -207,38 +195,31 @@ public function update(Request $request, $id)
$user->update($input);
// Edit role
- if ($request->filled('roles'))
- {
- if ($request->filled('roles'))
- {
- DB::table('role_user')->where('user_id',$id)->delete();
+ if ($request->filled('roles')) {
+ if ($request->filled('roles')) {
+ DB::table('role_user')->where('user_id', $id)->delete();
foreach ($request->input('roles') as $key => $value) {
$user->attachRole($value);
}
}
- }
- else
- {
+ } else {
$user->roles()->detach();
}
// Edit sensors
- if($request->filled('sensors'))
- {
- DB::table('sensor_user')->where('user_id',$id)->delete();
+ if ($request->filled('sensors')) {
+ DB::table('sensor_user')->where('user_id', $id)->delete();
foreach ($request->input('sensors') as $key => $value) {
DB::table('sensor_user')->insert(
['user_id' => $id, 'sensor_id' => $value]
);
}
- }
- else
- {
+ } else {
DB::table('sensor_user')->where('user_id', $user->id)->delete();
}
- return redirect()->route('users.index',['search='.$id])
- ->with("success", "User updated successfully");
+ return redirect()->route('users.index', ['search='.$id])
+ ->with('success', 'User updated successfully');
}
/**
@@ -249,68 +230,62 @@ public function update(Request $request, $id)
*/
public function destroy($id)
{
- if ($this->checkRoleAuthorization(null, "user-delete", $id) == false)
- return redirect()->route('users.index')->with('error','User not deleted, you have no permission');
-
+ if ($this->checkRoleAuthorization(null, 'user-delete', $id) == false) {
+ return redirect()->route('users.index')->with('error', 'User not deleted, you have no permission');
+ }
User::find($id)->delete();
+
return redirect()->route('users.index')
- ->with('success','User deleted successfully');
+ ->with('success', 'User deleted successfully');
}
- private function checkRoleAuthorization($request=null, $permission=null, $id=null)
+ private function checkRoleAuthorization($request = null, $permission = null, $id = null)
{
- if ($id && Auth::user()->id == $id) // edit self is allowed
+ if ($id && Auth::user()->id == $id) { // edit self is allowed
return true;
-
- if ($permission && Auth::user()->can($permission) == false) // check permissions
+ }
+
+ if ($permission && Auth::user()->can($permission) == false) { // check permissions
return false;
+ }
// Check for unauthorized role editing
- if ($request != null && $request->filled('roles') && count($request->input('roles')) > 0)
- {
- if ($request->input('roles')[0] == '')
- return true; // no role
+ if ($request != null && $request->filled('roles') && count($request->input('roles')) > 0) {
+ if ($request->input('roles')[0] == '') {
+ return true;
+ } // no role
- $superId = Role::where('name','=','superadmin')->pluck('id','id')->toArray();
- $reqIsSup= count(array_diff($request->input('roles'), $superId)) == 0 ? true : false; // check if super admin id role is requested
+ $superId = Role::where('name', '=', 'superadmin')->pluck('id', 'id')->toArray();
+ $reqIsSup = count(array_diff($request->input('roles'), $superId)) == 0 ? true : false; // check if super admin id role is requested
$roleIds = $this->getMyPermittedRoles(Auth::user(), true);
- $reqMatch= count(array_diff($request->input('roles'), $roleIds)) == 0 ? true : false; // check if all roles match
+ $reqMatch = count(array_diff($request->input('roles'), $roleIds)) == 0 ? true : false; // check if all roles match
- if ($reqMatch == false || ($reqIsSup && Auth::user()->hasRole('superadmin') == false)){
+ if ($reqMatch == false || ($reqIsSup && Auth::user()->hasRole('superadmin') == false)) {
return false;
}
}
+
return true;
}
// Helpers
- private function getMyPermittedRoles($user, $returnIdArray=false)
+ private function getMyPermittedRoles($user, $returnIdArray = false)
{
- //die($user->roles->pluck('id'));
- if (Auth::user()->hasRole('superadmin'))
- {
+ // die($user->roles->pluck('id'));
+ if (Auth::user()->hasRole('superadmin')) {
$roles = Role::all();
- }
- else if (Auth::user()->hasRole('admin'))
- {
- $roles = Role::where('name','!=','superadmin');
- }
- else
- {
+ } elseif (Auth::user()->hasRole('admin')) {
+ $roles = Role::where('name', '!=', 'superadmin');
+ } else {
$roles = $user->roles;
}
- //die($roles);
- if ($returnIdArray)
- {
- return $roles->pluck('id','id')->toArray();
- }
- else
- {
+ // die($roles);
+ if ($returnIdArray) {
+ return $roles->pluck('id', 'id')->toArray();
+ } else {
return $roles->pluck('display_name','id');
}
}
-
-
-}
\ No newline at end of file
+}
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
index 13268bc6..a4be5c58 100644
--- a/app/Http/Middleware/Authenticate.php
+++ b/app/Http/Middleware/Authenticate.php
@@ -1,6 +1,9 @@
user())
+ if (! $request->user()) {
return Response::json('invalid_user', 400);
+ }
if ($request->user() instanceof MustVerifyEmail && ! $request->user()->hasVerifiedEmail()) {
return Response::json('email_not_verified', 403);
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
index e4cec9c8..1e2f1493 100644
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -11,7 +11,6 @@ class RedirectIfAuthenticated
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
- * @param \Closure $next
* @param string|null $guard
* @return mixed
*/
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php
index 07a44ea0..c661475c 100644
--- a/app/Http/Middleware/TrustProxies.php
+++ b/app/Http/Middleware/TrustProxies.php
@@ -1,7 +1,10 @@
'nullable|required_without:names|string',
- 'names' => 'nullable|required_without:name|string',
- 'category_input_id' => 'required|exists:category_inputs,id',
- 'physical_quantity_id' => 'present|required_with:physical_quantities,id',
- 'parent_id' => 'nullable|exists:categories,id',
- 'type' => 'string',
- 'icon' => 'image',
- ];
- }
+class PostCategoryRequest extends Request
+{
+ /**
+ * Determine if the user is authorized to make this request.
+ *
+ * @return bool
+ */
+ public function authorize()
+ {
+ return true;
+ }
+ /**
+ * Get the validation rules that apply to the request.
+ *
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ 'name' => 'nullable|required_without:names|string',
+ 'names' => 'nullable|required_without:name|string',
+ 'category_input_id' => 'required|exists:category_inputs,id',
+ 'physical_quantity_id' => 'present|required_with:physical_quantities,id',
+ 'parent_id' => 'nullable|exists:categories,id',
+ 'type' => 'string',
+ 'icon' => 'image',
+ ];
+ }
}
diff --git a/app/Http/Requests/PostHiveRequest.php b/app/Http/Requests/PostHiveRequest.php
index 9e01924a..d5794179 100644
--- a/app/Http/Requests/PostHiveRequest.php
+++ b/app/Http/Requests/PostHiveRequest.php
@@ -1,54 +1,51 @@
- 'required|string',
- 'location_id' => 'required|integer|exists:locations,id',
- 'brood_layers' => 'nullable|required_without:layers|integer|min:0',
- 'honey_layers' => 'nullable|required_without:layers|integer|min:0',
- 'frames' => 'nullable|integer|min:0',
- 'order' => 'nullable|integer',
- 'layers' => 'nullable|required_without_all:brood_layers,honey_layers|array',
- 'color' => 'nullable|string|max:9', // #754B1F32 extra 2 characters are opacity
- 'hive_type_id' => 'nullable|integer|exists:categories,id',
- 'bb_width_cm' => 'nullable|numeric|min:0',
- 'bb_depth_cm' => 'nullable|numeric|min:0',
- 'bb_height_cm' => 'nullable|numeric|min:0',
- 'fr_width_cm' => 'nullable|numeric|min:0',
- 'fr_height_cm' => 'nullable|numeric|min:0',
- 'queen.race_id' => 'nullable|integer|exists:categories,id',
- 'queen.birth_date' => 'nullable|date',
- 'queen.name' => 'nullable|string',
- 'queen.description' => 'nullable|string',
- 'queen.line' => 'nullable|string',
- 'queen.tree' => 'nullable|string',
- 'queen.color' => 'nullable|string|max:9', // #754B1F32 extra 2 characters are opacity
- 'queen.clipped' => 'nullable|integer',
- 'queen.fertilized' => 'nullable|integer',
- 'timezone' => 'nullable|timezone',
- ];
- }
+class PostHiveRequest extends Request
+{
+ /**
+ * Determine if the user is authorized to make this request.
+ *
+ * @return bool
+ */
+ public function authorize()
+ {
+ return true;
+ }
+ /**
+ * Get the validation rules that apply to the request.
+ *
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ 'name' => 'required|string',
+ 'location_id' => 'required|integer|exists:locations,id',
+ 'brood_layers' => 'nullable|required_without:layers|integer|min:0',
+ 'honey_layers' => 'nullable|required_without:layers|integer|min:0',
+ 'frames' => 'nullable|integer|min:0',
+ 'order' => 'nullable|integer',
+ 'layers' => 'nullable|required_without_all:brood_layers,honey_layers|array',
+ 'color' => 'nullable|string|max:9', // #754B1F32 extra 2 characters are opacity
+ 'hive_type_id' => 'nullable|integer|exists:categories,id',
+ 'bb_width_cm' => 'nullable|numeric|min:0',
+ 'bb_depth_cm' => 'nullable|numeric|min:0',
+ 'bb_height_cm' => 'nullable|numeric|min:0',
+ 'fr_width_cm' => 'nullable|numeric|min:0',
+ 'fr_height_cm' => 'nullable|numeric|min:0',
+ 'queen.race_id' => 'nullable|integer|exists:categories,id',
+ 'queen.birth_date' => 'nullable|date',
+ 'queen.name' => 'nullable|string',
+ 'queen.description' => 'nullable|string',
+ 'queen.line' => 'nullable|string',
+ 'queen.tree' => 'nullable|string',
+ 'queen.color' => 'nullable|string|max:9', // #754B1F32 extra 2 characters are opacity
+ 'queen.clipped' => 'nullable|integer',
+ 'queen.fertilized' => 'nullable|integer',
+ 'timezone' => 'nullable|timezone',
+ ];
+ }
}
diff --git a/app/Http/Requests/PostLocationRequest.php b/app/Http/Requests/PostLocationRequest.php
index be21fa49..86135a9b 100644
--- a/app/Http/Requests/PostLocationRequest.php
+++ b/app/Http/Requests/PostLocationRequest.php
@@ -1,32 +1,29 @@
- 'required|string',
- 'hive_type_id' => 'nullable|integer|exists:categories,id',
- ];
- }
+class PostLocationRequest extends Request
+{
+ /**
+ * Determine if the user is authorized to make this request.
+ *
+ * @return bool
+ */
+ public function authorize()
+ {
+ return true;
+ }
+ /**
+ * Get the validation rules that apply to the request.
+ *
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ 'name' => 'required|string',
+ 'hive_type_id' => 'nullable|integer|exists:categories,id',
+ ];
+ }
}
diff --git a/app/Http/Requests/PostSensorRequest.php b/app/Http/Requests/PostSensorRequest.php
index d2373a30..2131355b 100644
--- a/app/Http/Requests/PostSensorRequest.php
+++ b/app/Http/Requests/PostSensorRequest.php
@@ -1,36 +1,32 @@
- 'nullable|integer|unique:sensors,id,'.$this->input('id'),
- 'name' => 'required|string',
- 'hive_id' => 'required|exists:hives,id',
- 'type' => 'nullable|string|exists:categories,name',
- 'key' => 'required|string|unique:sensors,key,'.$this->input('id'),
- ];
- }
+class PostSensorRequest extends Request
+{
+ /**
+ * Determine if the user is authorized to make this request.
+ *
+ * @return bool
+ */
+ public function authorize()
+ {
+ return true;
+ }
+ /**
+ * Get the validation rules that apply to the request.
+ *
+ * @return array
+ */
+ public function rules()
+ {
+ return [
+ 'id' => 'nullable|integer|unique:sensors,id,'.$this->input('id'),
+ 'name' => 'required|string',
+ 'hive_id' => 'required|exists:hives,id',
+ 'type' => 'nullable|string|exists:categories,name',
+ 'key' => 'required|string|unique:sensors,key,'.$this->input('id'),
+ ];
+ }
}
diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php
index cfe86fd5..4e9bc456 100755
--- a/app/Http/Requests/Request.php
+++ b/app/Http/Requests/Request.php
@@ -1,11 +1,11 @@
-belongsTo(Category::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
+
public function hive()
{
return $this->belongsTo(Hive::class);
}
+
public function inspection()
{
return $this->belongsTo(Inspection::class);
}
-
// Static functions
public static function imageUrl($filename, $type)
{
- $storage = env('IMAGE_STORAGE', Image::$storage);
- $url = Storage::disk($storage)->url(Image::getImagePath($filename, $type));
- if ($storage == 'public')
+ $storage = env('IMAGE_STORAGE', Image::$storage);
+ $url = Storage::disk($storage)->url(Image::getImagePath($filename, $type));
+ if ($storage == 'public') {
$url = env('APP_URL').$url;
+ }
return $url;
}
public static function imageThumbUrl($filename, $type)
{
- $storage = env('IMAGE_STORAGE', Image::$storage);
- $url = Storage::disk($storage)->url(Image::getImagePath($filename, $type, true));
-
- if ($storage == 'public')
+ $storage = env('IMAGE_STORAGE', Image::$storage);
+ $url = Storage::disk($storage)->url(Image::getImagePath($filename, $type, true));
+
+ if ($storage == 'public') {
$url = env('APP_URL').$url;
+ }
return $url;
}
- public static function getImagePath($fileName, $type='inspection', $thumb=false)
+ public static function getImagePath($fileName, $type = 'inspection', $thumb = false)
{
- $imageDir = env('IMAGE_FULL_DIRECTORY', Image::$imageDir);
- $thumbDir = env('IMAGE_THUMB_DIRECTORY', Image::$thumbDir);
+ $imageDir = env('IMAGE_FULL_DIRECTORY', Image::$imageDir);
+ $thumbDir = env('IMAGE_THUMB_DIRECTORY', Image::$thumbDir);
$dir = $thumb ? $thumbDir : $imageDir;
$uid = Auth::user()->id;
+
return 'users/'.$uid.'/'.$dir.'/'.$type.'/'.$fileName;
}
public static function formatExifDate($exifDateString) // from 2020:01:04 11:20:18 -> Y-m-d H:i:s, format is already in UTC
{
$dateTimeArray = explode(' ', $exifDateString); // 2020:01:04
- $dateArray = explode(':', $dateTimeArray[0]); // 2020 01 04
+ $dateArray = explode(':', $dateTimeArray[0]); // 2020 01 04
- if (count($dateArray) == 3 && checkdate($dateArray[1], $dateArray[2], $dateArray[0]))
- {
+ if (count($dateArray) == 3 && checkdate($dateArray[1], $dateArray[2], $dateArray[0])) {
$dateString = implode('-', $dateArray); // 2020-01-04
- $dateTime = $dateString.'T'.$dateTimeArray[1];
+ $dateTime = $dateString.'T'.$dateTimeArray[1];
$m = new Moment($dateTime, 'UTC');
+
return $m->setTimezone('UTC')->format('Y-m-d H:i:s');
}
+
return null;
}
- public static function store($requestData, $type='inspection')
+ public static function store($requestData, $type = 'inspection')
{
// check if image needs to be updated, or newly created
- $image = null;
-
- if(isset($requestData['id']))
- {
+ $image = null;
+
+ if (isset($requestData['id'])) {
$image = Auth::user()->images()->findOrFail($requestData['id']);
}
- $storage = env('IMAGE_STORAGE', Image::$storage);
+ $storage = env('IMAGE_STORAGE', Image::$storage);
$maxPizelSize = env('IMAGE_RESIZE_PIXELS', Image::$maxPizelSize);
- $thumbPixels = env('IMAGE_THUMB_PIXELS', Image::$thumbPixels);
+ $thumbPixels = env('IMAGE_THUMB_PIXELS', Image::$thumbPixels);
$thumbQuality = env('IMAGE_THUMB_QUALITY', Image::$thumbQuality);
- $imageDir = env('IMAGE_FULL_DIRECTORY', Image::$imageDir);
- $thumbDir = env('IMAGE_THUMB_DIRECTORY', Image::$thumbDir);
+ $imageDir = env('IMAGE_FULL_DIRECTORY', Image::$imageDir);
+ $thumbDir = env('IMAGE_THUMB_DIRECTORY', Image::$thumbDir);
- $anu = function($constraint)
- {
- $constraint->aspectRatio();
- $constraint->upsize();
+ $anu = function ($constraint) {
+ $constraint->aspectRatio();
+ $constraint->upsize();
};
- //get file extension
- if(isset($requestData['file']) || isset($requestData['image']))
- {
+ // get file extension
+ if (isset($requestData['file']) || isset($requestData['image'])) {
$imageFile = isset($requestData['image']) && $requestData['image']->isValid() ? $requestData['image'] : $requestData['file'];
- if ($imageFile->isValid())
- {
- //filename to store
+ if ($imageFile->isValid()) {
+ // filename to store
$extension = $imageFile->getClientOriginalExtension();
- $fileName = Str::random(60).'.'.$extension;
+ $fileName = Str::random(60).'.'.$extension;
$imagePath = Image::getImagePath($fileName, $type);
$thumbPath = Image::getImagePath($fileName, $type, true);
// save big image
- $imageResized= InterventionImage::make($imageFile)->resize($maxPizelSize, $maxPizelSize, $anu);
- $fileDate = Image::formatExifDate($imageResized->exif('DateTimeOriginal')); // formed as 2020:01:04 11:20:18
+ $imageResized = InterventionImage::make($imageFile)->resize($maxPizelSize, $maxPizelSize, $anu);
+ $fileDate = Image::formatExifDate($imageResized->exif('DateTimeOriginal')); // formed as 2020:01:04 11:20:18
$imageHeight = $imageResized->getHeight();
- $imageWidth = $imageResized->getWidth();
+ $imageWidth = $imageResized->getWidth();
$imageStored = Storage::disk($storage)->put($imagePath, $imageResized->stream());
- $fileSize = Storage::disk($storage)->size($imagePath);
+ $fileSize = Storage::disk($storage)->size($imagePath);
// $fileTime = Storage::disk($storage)->lastModified($thumbPath);
- $fileDate = $fileDate ? $fileDate : date('Y-m-d H:i:s');
-
+ $fileDate = $fileDate ? $fileDate : date('Y-m-d H:i:s');
+
// save thumbnail
- $thumb = InterventionImage::make($imageResized)->resize($thumbPixels, $thumbPixels, $anu);
+ $thumb = InterventionImage::make($imageResized)->resize($thumbPixels, $thumbPixels, $anu);
$thumbStored = Storage::disk($storage)->put($thumbPath, $thumb->stream());
-
- if ($imageStored)
- {
+
+ if ($imageStored) {
$saveArr = [
- 'storage' => $storage,
- 'filename' => $fileName,
- 'image_url' => Image::imageUrl($fileName, $type),
- 'thumb_url' => Image::imageThumbUrl($fileName, $type),
+ 'storage' => $storage,
+ 'filename' => $fileName,
+ 'image_url' => Image::imageUrl($fileName, $type),
+ 'thumb_url' => Image::imageThumbUrl($fileName, $type),
'description' => isset($requestData['description']) ? $requestData['description'] : null,
- 'type' => $type,
- 'height' => $imageHeight,
- 'width' => $imageWidth,
- 'size_kb' => round($fileSize/1024),
- 'date' => $fileDate,
- 'user_id' => Auth::user()->id,
- 'hive_id' => isset($requestData['hive_id']) ? $requestData['hive_id'] : null,
+ 'type' => $type,
+ 'height' => $imageHeight,
+ 'width' => $imageWidth,
+ 'size_kb' => round($fileSize / 1024),
+ 'date' => $fileDate,
+ 'user_id' => Auth::user()->id,
+ 'hive_id' => isset($requestData['hive_id']) ? $requestData['hive_id'] : null,
'category_id' => isset($requestData['category_id']) ? $requestData['category_id'] : null,
- 'inspection_id'=> isset($requestData['inspection_id']) ? $requestData['inspection_id'] : null,
-
- ];
+ 'inspection_id' => isset($requestData['inspection_id']) ? $requestData['inspection_id'] : null,
+
+ ];
-
- if($image)
- {
+ if ($image) {
return $image->update($saveArr);
}
@@ -187,24 +190,24 @@ public static function store($requestData, $type='inspection')
}
}
}
+
return null;
}
public function delete()
{
- // delete all related photos
+ // delete all related photos
$storage = isset($this->storage) ? $this->storage : env('IMAGE_STORAGE', Image::$storage);
$pathImage = Image::getImagePath($this->filename, $this->type);
if (Storage::disk($storage)->exists($pathImage));
- Storage::disk($storage)->delete($pathImage);
+ Storage::disk($storage)->delete($pathImage);
$pathThumb = Image::getImagePath($this->filename, $this->type, true);
if (Storage::disk($storage)->exists($pathThumb));
- Storage::disk($storage)->delete($pathThumb);
+ Storage::disk($storage)->delete($pathThumb);
// delete the photo
return parent::delete();
}
-
}
diff --git a/app/Inspection.php b/app/Inspection.php
index d79b8a58..cff956be 100644
--- a/app/Inspection.php
+++ b/app/Inspection.php
@@ -2,21 +2,21 @@
namespace App;
+use Auth;
+use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
use LaravelLocalization;
-
-use Auth;
-use Cache;
use Moment\Moment;
class Inspection extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
+
protected $cascadeDeletes = ['items'];
-
+
/**
* The database table used by the model.
*
@@ -25,10 +25,10 @@ class Inspection extends Model
protected $table = 'inspections';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -38,82 +38,76 @@ class Inspection extends Model
*/
protected $fillable = ['notes', 'created_at', 'impression', 'attention', 'reminder', 'reminder_date', 'checklist_id', 'image_id'];
- protected $hidden = ['pivot','deleted_at', 'hives', 'locations', 'items'];
+ protected $hidden = ['pivot', 'deleted_at', 'hives', 'locations', 'items'];
- protected $appends = ['owner', 'thumb_url', 'hive_id', 'location_id', 'item_count', 'searchable'];
+ protected $appends = ['owner', 'thumb_url', 'hive_id', 'location_id', 'item_count', 'searchable'];
public $timestamps = false;
-
public static function boot()
{
parent::boot();
static::created(function ($i) {
- //Log::info("Created Inspection $i->id");
+ // Log::info("Created Inspection $i->id");
$i->empty_cache();
});
- static::updated(function($i)
- {
+ static::updated(function ($i) {
$i->empty_cache(false);
});
- static::deleted(function($i)
- {
+ static::deleted(function ($i) {
$i->empty_cache();
});
}
// Cache functions
- public function empty_cache($clear_users=true)
+ public function empty_cache($clear_users = true)
{
Cache::forget('inspection-'.$this->id.'-hive-ids');
Cache::forget('inspection-'.$this->id.'-location-ids');
Cache::forget('inspection-'.$this->id.'-item-count');
Cache::forget('inspection-'.$this->id.'-searchable-array');
-
+
Log::debug("inspection ID $this->id cache emptied (clear_users=$clear_users)");
- foreach ($this->hives as $hive)
- {
- //Log::debug("inspection ID $this->id try to empty hive $hive->id cache");
+ foreach ($this->hives as $hive) {
+ // Log::debug("inspection ID $this->id try to empty hive $hive->id cache");
$hive->empty_cache(false);
}
- if ($clear_users)
- {
+ if ($clear_users) {
$user_ids = $this->users()->pluck('id')->toArray();
foreach ($user_ids as $uid) {
- //Log::debug("inspection ID $this->id try to empty user $uid cache");
+ // Log::debug("inspection ID $this->id try to empty user $uid cache");
User::emptyIdCache($uid, 'inspection');
}
}
}
-
-
public function getOwnerAttribute()
{
- if ($this->users()->whereIn('id', [Auth::user()->id])->count() > 0)
+ if ($this->users()->whereIn('id', [Auth::user()->id])->count() > 0) {
return true;
-
+ }
+
return false;
}
public function getThumbUrlAttribute()
{
- if (isset($this->image_id))
+ if (isset($this->image_id)) {
return $this->image->thumb_url;
+ }
return null;
}
public function getHiveIdsAttribute()
{
- return Cache::rememberForever('inspection-'.$this->id.'-hive-ids', function ()
- {
+ return Cache::rememberForever('inspection-'.$this->id.'-hive-ids', function () {
return $this->hives()->pluck('id')->toArray();
});
}
@@ -121,13 +115,13 @@ public function getHiveIdsAttribute()
public function getHiveIdAttribute()
{
$hive_ids = $this->getHiveIdsAttribute();
+
return count($hive_ids) > 0 ? $hive_ids[0] : null;
}
public function getLocationIdsAttribute()
{
- return Cache::rememberForever('inspection-'.$this->id.'-location-ids', function ()
- {
+ return Cache::rememberForever('inspection-'.$this->id.'-location-ids', function () {
return $this->locations()->pluck('id')->toArray();
});
}
@@ -135,21 +129,20 @@ public function getLocationIdsAttribute()
public function getLocationIdAttribute()
{
$loc_ids = $this->getLocationIdsAttribute();
+
return count($loc_ids) > 0 ? $loc_ids[0] : null;
}
public function getItemCountAttribute()
{
- return Cache::rememberForever('inspection-'.$this->id.'-item-count', function ()
- {
+ return Cache::rememberForever('inspection-'.$this->id.'-item-count', function () {
return $this->items()->count();
});
}
public function getSearchableAttribute()
{
- return Cache::rememberForever('inspection-'.$this->id.'-searchable-array', function ()
- {
+ return Cache::rememberForever('inspection-'.$this->id.'-searchable-array', function () {
return $this->items->whereIn('type', ['text', 'sample_code', 'date'])->pluck('value')->toArray();
});
}
@@ -184,44 +177,46 @@ public function image()
{
return $this->belongsTo(Image::class);
}
-
+
public function delete()
{
- // delete image
- if(isset($this->image_id))
+ // delete image
+ if (isset($this->image_id)) {
$this->image()->delete();
+ }
// delete the research
return parent::delete();
}
- public static function createInspection($items=[], $hive_ids=null, $location_ids=null, $notes='', $timeZone="UTC")
+ public static function createInspection($items = [], $hive_ids = null, $location_ids = null, $notes = '', $timeZone = 'UTC')
{
- $now = new Moment();
- $inspection_data = [];
- $inspection_data['created_at'] = $now->setTimezone($timeZone)->format('Y-m-d H:i');
- $inspection_data['notes'] = $notes;
- $inspection_data['items'] = $items;
+ $now = new Moment;
+ $inspection_data = [];
+ $inspection_data['created_at'] = $now->setTimezone($timeZone)->format('Y-m-d H:i');
+ $inspection_data['notes'] = $notes;
+ $inspection_data['items'] = $items;
$inspection = Inspection::create($inspection_data);
- foreach ($inspection_data['items'] as $cat_id => $value)
- {
- $itemData =
+ foreach ($inspection_data['items'] as $cat_id => $value) {
+ $itemData =
[
- 'category_id' => $cat_id,
+ 'category_id' => $cat_id,
'inspection_id' => $inspection->id,
- 'value' => $value,
+ 'value' => $value,
];
InspectionItem::create($itemData);
}
$inspection->users()->sync(Auth::user()->id);
- if (isset($hive_ids))
+ if (isset($hive_ids)) {
$inspection->hives()->sync($hive_ids);
+ }
- if (isset($location_ids))
+ if (isset($location_ids)) {
$inspection->locations()->sync($location_ids);
+ }
// To make sure the user cache is updated after syncs, bust the cache
$inspection->empty_cache();
@@ -229,57 +224,54 @@ public static function createInspection($items=[], $hive_ids=null, $location_ids
return $inspection;
}
- public static function item_names($inspections, $include_inspection_items=false) // get a locale ordered list of InspectionItem names
+ public static function item_names($inspections, $include_inspection_items = false) // get a locale ordered list of InspectionItem names
{
- $locale = LaravelLocalization::getCurrentLocale();
- $inspection_ids = $inspections->pluck('id')->toArray();
- $inspection_items= InspectionItem::whereIn('inspection_id',$inspection_ids)->groupBy('category_id')->get(); // let the newest id be selected, if multiple on one day
+ $locale = LaravelLocalization::getCurrentLocale();
+ $inspection_ids = $inspections->pluck('id')->toArray();
+ $inspection_items = InspectionItem::whereIn('inspection_id', $inspection_ids)->groupBy('category_id')->get(); // let the newest id be selected, if multiple on one day
$inspection_objs = Inspection::whereIn('id', $inspection_ids)->orderBy('created_at', 'desc')->get();
- //die(print_r([$include_inspection_items, $inspections->toArray(), $inspection_items->toArray()]));
+ // die(print_r([$include_inspection_items, $inspections->toArray(), $inspection_items->toArray()]));
$item_names = [];
- foreach ($inspection_items as $item)
- {
+ foreach ($inspection_items as $item) {
$cat_id = $item->category_id;
- $cat = $item->category;
+ $cat = $item->category;
// Commented out to enable showing 'system' category inspection items
// if ($cat->isSystem())
// continue;
- //die(print_r($item->toArray()));
-
- if ($include_inspection_items)
- {
+ // die(print_r($item->toArray()));
+
+ if ($include_inspection_items) {
$arr = [];
$set = false;
- foreach ($inspection_objs as $d => $inspection)
- {
- $inspection_all_items = $inspection->items;//->with('name')->orderBy('name', 'asc')->get();
+ foreach ($inspection_objs as $d => $inspection) {
+ $inspection_all_items = $inspection->items; // ->with('name')->orderBy('name', 'asc')->get();
$arr[$d] = '';
- //die(print_r($inspection_all_items));
- foreach ($inspection_all_items as $inspection_item)
- {
- if ($inspection_item->category_id == $cat_id)
- {
+ // die(print_r($inspection_all_items));
+ foreach ($inspection_all_items as $inspection_item) {
+ if ($inspection_item->category_id == $cat_id) {
$arr[$d] = $inspection_item;
$set = true;
+
continue;
}
}
}
- if ($set && isset($cat))
- $item_names[] = ['anc' => $cat->ancName($locale), 'name' => $cat->transName($locale), 'type'=>$cat->input, 'range'=>$cat->inputRange(), 'items' => $arr];
- }
- else if (isset($cat))
- {
- $item_names[] = ['anc' => $cat->ancName($locale), 'name' => $cat->transName($locale), 'type'=>$cat->input, 'range'=>$cat->inputRange()];
+ if ($set && isset($cat)) {
+ $item_names[] = ['anc' => $cat->ancName($locale), 'name' => $cat->transName($locale), 'type' => $cat->input, 'range' => $cat->inputRange(), 'items' => $arr];
+ }
+ } elseif (isset($cat)) {
+ $item_names[] = ['anc' => $cat->ancName($locale), 'name' => $cat->transName($locale), 'type' => $cat->input, 'range' => $cat->inputRange()];
}
}
- usort($item_names, function($a,$b){ return strcasecmp($a['anc'].$a['name'], $b['anc'].$b['name']); } ); // place items in alphabetical order
+ usort($item_names, function ($a, $b) {
+ return strcasecmp($a['anc'].$a['name'], $b['anc'].$b['name']);
+ }); // place items in alphabetical order
- //die(print_r($item_names));
+ // die(print_r($item_names));
return $item_names;
}
}
diff --git a/app/InspectionItem.php b/app/InspectionItem.php
index 6a2420aa..1a46674e 100644
--- a/app/InspectionItem.php
+++ b/app/InspectionItem.php
@@ -4,8 +4,6 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
-use LaravelLocalization;
-use Moment\Moment;
class InspectionItem extends Model
{
@@ -19,10 +17,10 @@ class InspectionItem extends Model
protected $table = 'inspection_items';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -32,9 +30,9 @@ class InspectionItem extends Model
*/
protected $fillable = ['value', 'inspection_id', 'category_id'];
- protected $appends = ['val','unit','type'];
-
- protected $hidden = ['category','deleted_at','inspection_id'];
+ protected $appends = ['val', 'unit', 'type'];
+
+ protected $hidden = ['category', 'deleted_at', 'inspection_id'];
public $timestamps = false;
@@ -42,18 +40,22 @@ public function getNameAttribute()
{
return $this->name();
}
+
public function getAncAttribute()
{
return $this->ancestors();
}
+
public function getValAttribute()
{
return $this->val();
}
+
public function getUnitAttribute()
{
return $this->unit();
}
+
public function getTypeAttribute()
{
return $this->type();
@@ -61,16 +63,18 @@ public function getTypeAttribute()
public function type()
{
- if (isset($this->category))
+ if (isset($this->category)) {
return $this->category->input;
+ }
return null;
}
public function inputType()
{
- if (isset($this->category))
+ if (isset($this->category)) {
return $this->category->inputType;
+ }
return null;
}
@@ -87,35 +91,39 @@ public function category()
public function name()
{
- if (isset($this->category))
+ if (isset($this->category)) {
return $this->category->transName();
+ }
return '';
}
public function ancestors()
{
- if (isset($this->category))
+ if (isset($this->category)) {
return $this->category->ancName();
+ }
return '';
}
public function val($locale = null)
{
- $val = $this->value;
+ $val = $this->value;
$input = $this->inputType();
- if (!isset($val) || $val === null || $input === null)
+ if (! isset($val) || $val === null || $input === null) {
return null;
+ }
return $input->render($val, $locale);
}
public function unit()
{
- if (isset($this->category))
+ if (isset($this->category)) {
return $this->category->unit;
+ }
return '';
}
@@ -123,13 +131,11 @@ public function unit()
public function humanReadableValue()
{
$value = $this->val;
-
- if (isset($this->unit))
+
+ if (isset($this->unit)) {
$value .= ' '.$this->unit;
+ }
return $value;
}
-
-
-
}
diff --git a/app/Language.php b/app/Language.php
index 765eb105..6aae6855 100644
--- a/app/Language.php
+++ b/app/Language.php
@@ -6,7 +6,7 @@
class Language extends Model
{
- protected $fillable = ['name','name_english','icon','abbreviation','twochar'];
+ protected $fillable = ['name', 'name_english', 'icon', 'abbreviation', 'twochar'];
protected $appends = ['lang'];
@@ -14,7 +14,7 @@ class Language extends Model
public function getLangAttribute()
{
- return $this->twochar;
+ return $this->twochar;
}
// Relations
@@ -22,5 +22,4 @@ public function translations()
{
return $this->belongsToMany(Translation::class);
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Listeners/LogSuccessfulLogin.php b/app/Listeners/LogSuccessfulLogin.php
index 7ff82d1d..00ad810b 100644
--- a/app/Listeners/LogSuccessfulLogin.php
+++ b/app/Listeners/LogSuccessfulLogin.php
@@ -3,8 +3,6 @@
namespace App\Listeners;
use Illuminate\Auth\Events\Login;
-use Illuminate\Queue\InteractsWithQueue;
-use Illuminate\Contracts\Queue\ShouldQueue;
class LogSuccessfulLogin
{
@@ -21,7 +19,6 @@ public function __construct()
/**
* Handle the event.
*
- * @param Login $event
* @return void
*/
public function handle(Login $event)
diff --git a/app/Location.php b/app/Location.php
index bfa96bef..7000816b 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -2,23 +2,26 @@
namespace App;
+use Auth;
+use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use Cache;
-use Auth;
class Location extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
protected $cascadeDeletes = ['hives', 'inspections'];
protected $fillable = ['user_id', 'continent_id', 'category_id', 'name', 'coordinate_lat', 'coordinate_lon', 'street', 'street_no', 'postal_code', 'country_code', 'city', 'roofed', 'last_weather_time', 'hex_color'];
- protected $guarded = ['id'];
- protected $hidden = ['user_id', 'continent_id', 'category_id'];
- protected $appends = ['type', 'continent', 'owner'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['user_id', 'continent_id', 'category_id'];
+
+ protected $appends = ['type', 'continent', 'owner'];
public $timestamps = false;
@@ -32,8 +35,9 @@ public static function boot()
});
static::updated(function ($l) {
- if ($l->wasChanged('last_weather_time') == false) // do not empty cache by only weather time change
+ if ($l->wasChanged('last_weather_time') == false) { // do not empty cache by only weather time change
$l->empty_cache();
+ }
});
static::deleted(function ($l) {
@@ -42,15 +46,15 @@ public static function boot()
}
// Cache functions
- public function empty_cache($clear_user=true)
+ public function empty_cache($clear_user = true)
{
Log::debug("Location ID $this->id cache emptied");
- if ($clear_user)
+ if ($clear_user) {
User::emptyIdCache($this->user_id, 'apiary');
+ }
}
-
// Relations
public function getTypeAttribute()
{
@@ -68,13 +72,14 @@ public function getContinentAttribute()
public function getOwnerAttribute()
{
- if ($this->user_id == Auth::user()->id)
+ if ($this->user_id == Auth::user()->id) {
return true;
-
+ }
+
return false;
}
- public function hives()
+ public function hives()
{
return $this->hasMany(Hive::class);
}
@@ -111,6 +116,6 @@ public function continent()
public static function selectList()
{
- return Location::orderBy('name')->pluck('name','id');
+ return Location::orderBy('name')->pluck('name', 'id');
}
}
diff --git a/app/Mail/AlertMail.php b/app/Mail/AlertMail.php
index 42a58559..c3411541 100644
--- a/app/Mail/AlertMail.php
+++ b/app/Mail/AlertMail.php
@@ -2,13 +2,10 @@
namespace App\Mail;
+use App\Models\Alert;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
-
-use Auth;
-use App\Models\Alert;
class AlertMail extends Mailable
{
@@ -22,9 +19,9 @@ class AlertMail extends Mailable
public function __construct(Alert $alert, $name, $last_values_string, $display_date_local)
{
$this->alert = $alert;
- $this->name = $name;
- $this->last_values_string = $last_values_string;
- $this->display_date_local = $display_date_local;
+ $this->name = $name;
+ $this->last_values_string = $last_values_string;
+ $this->display_date_local = $display_date_local;
}
/**
@@ -34,16 +31,17 @@ public function __construct(Alert $alert, $name, $last_values_string, $display_d
*/
public function build()
{
- $subject = __('alert.subject').(null !== $this->alert->alert_rule_name ? ' - '.$this->alert->alert_rule_name : '').(null !== $this->alert->hive_name ? ' - '.__('beep.Hive').': '.$this->alert->hive_name : '');
+ $subject = __('alert.subject').($this->alert->alert_rule_name !== null ? ' - '.$this->alert->alert_rule_name : '').($this->alert->hive_name !== null ? ' - '.__('beep.Hive').': '.$this->alert->hive_name : '');
+
return $this->markdown(
'emails.alert',
[
- 'alert'=>$this->alert,
- 'name' =>$this->name,
- 'last_values_string' =>$this->last_values_string,
- 'display_date_local' =>$this->display_date_local,
- 'url' =>env('WEBAPP_URL').'alerts',
- 'url_settings' =>env('WEBAPP_URL').'alertrules'
+ 'alert' => $this->alert,
+ 'name' => $this->name,
+ 'last_values_string' => $this->last_values_string,
+ 'display_date_local' => $this->display_date_local,
+ 'url' => env('WEBAPP_URL').'alerts',
+ 'url_settings' => env('WEBAPP_URL').'alertrules',
])
->subject($subject);
}
diff --git a/app/Mail/DataExport.php b/app/Mail/DataExport.php
index 7fd07c85..25e7da9f 100644
--- a/app/Mail/DataExport.php
+++ b/app/Mail/DataExport.php
@@ -2,11 +2,9 @@
namespace App\Mail;
-use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
class DataExport extends Mailable
{
@@ -19,7 +17,7 @@ class DataExport extends Mailable
*/
public function __construct($user, $attachment_disk, $attachment_path)
{
- $this->user = $user;
+ $this->user = $user;
$this->attachment_disk = $attachment_disk;
$this->attachment_path = $attachment_path;
}
@@ -31,6 +29,6 @@ public function __construct($user, $attachment_disk, $attachment_path)
*/
public function build()
{
- return $this->markdown('emails.export',['name'=>$this->user->name])->attachFromStorageDisk($this->attachment_disk, $this->attachment_path);
+ return $this->markdown('emails.export', ['name' => $this->user->name])->attachFromStorageDisk($this->attachment_disk, $this->attachment_path);
}
}
diff --git a/app/Mail/GroupAcceptation.php b/app/Mail/GroupAcceptation.php
index ad707630..ca34f85d 100644
--- a/app/Mail/GroupAcceptation.php
+++ b/app/Mail/GroupAcceptation.php
@@ -5,9 +5,6 @@
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
-
-use App\Group;
class GroupAcceptation extends Mailable
{
@@ -20,9 +17,9 @@ class GroupAcceptation extends Mailable
*/
public function __construct($name, $group, $user)
{
- $this->name = $name;
+ $this->name = $name;
$this->group = $group;
- $this->user = $user;
+ $this->user = $user;
}
/**
@@ -35,11 +32,11 @@ public function build()
return $this->markdown(
'emails.group_acceptation',
[
- 'group'=>$this->group,
- 'name'=>$this->name,
- 'user'=>$this->user
+ 'group' => $this->group,
+ 'name' => $this->name,
+ 'user' => $this->user,
]
)
- ->subject(__('group.subject_accept'));
+ ->subject(__('group.subject_accept'));
}
}
diff --git a/app/Mail/GroupInvitation.php b/app/Mail/GroupInvitation.php
index 3f69af39..91793b0b 100644
--- a/app/Mail/GroupInvitation.php
+++ b/app/Mail/GroupInvitation.php
@@ -2,13 +2,11 @@
namespace App\Mail;
+use App\Group;
+use Auth;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
-
-use Auth;
-use App\Group;
class GroupInvitation extends Mailable
{
@@ -22,7 +20,7 @@ class GroupInvitation extends Mailable
public function __construct(Group $group, $name, $admin, $token, $invited_by)
{
$this->group = $group;
- $this->name = $name;
+ $this->name = $name;
$this->admin = $admin;
$this->token = $token;
$this->invited_by = $invited_by;
@@ -38,11 +36,11 @@ public function build()
return $this->markdown(
'emails.group_invitation',
[
- 'group'=>$this->group,
- 'name'=>$this->name,
- 'admin'=>$this->admin,
- 'acceptUrl'=>env('WEBAPP_URL').'groups/'.$this->group->id.'/token/'.$this->token,
- 'invited_by'=>$this->invited_by
+ 'group' => $this->group,
+ 'name' => $this->name,
+ 'admin' => $this->admin,
+ 'acceptUrl' => env('WEBAPP_URL').'groups/'.$this->group->id.'/token/'.$this->token,
+ 'invited_by' => $this->invited_by,
])
->replyTo(Auth::user()->email, $this->invited_by)
->subject(__('group.subject_invite'));
diff --git a/app/Mail/GroupRefusal.php b/app/Mail/GroupRefusal.php
index 9aea502a..6ece6292 100644
--- a/app/Mail/GroupRefusal.php
+++ b/app/Mail/GroupRefusal.php
@@ -5,9 +5,6 @@
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
-
-use App\Group;
class GroupRefusal extends Mailable
{
@@ -20,9 +17,9 @@ class GroupRefusal extends Mailable
*/
public function __construct($name, $group, $user)
{
- $this->name = $name;
+ $this->name = $name;
$this->group = $group;
- $this->user = $user;
+ $this->user = $user;
}
/**
@@ -35,11 +32,11 @@ public function build()
return $this->markdown(
'emails.group_refusal',
[
- 'group'=>$this->group,
- 'name'=>$this->name,
- 'user'=>$this->user
+ 'group' => $this->group,
+ 'name' => $this->name,
+ 'user' => $this->user,
]
)
- ->subject(__('group.subject_refusal'));
+ ->subject(__('group.subject_refusal'));
}
}
diff --git a/app/Mail/SampleCodeMail.php b/app/Mail/SampleCodeMail.php
index 73ca0243..93986b13 100644
--- a/app/Mail/SampleCodeMail.php
+++ b/app/Mail/SampleCodeMail.php
@@ -5,10 +5,6 @@
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
-use Illuminate\Contracts\Queue\ShouldQueue;
-
-use Auth;
-use App\Models\Alert;
class SampleCodeMail extends Mailable
{
@@ -21,10 +17,10 @@ class SampleCodeMail extends Mailable
*/
public function __construct($name, $code, $hive, $link)
{
- $this->name = $name;
- $this->code = $code;
- $this->hive = $hive;
- $this->link = $link;
+ $this->name = $name;
+ $this->code = $code;
+ $this->hive = $hive;
+ $this->link = $link;
}
/**
@@ -34,14 +30,15 @@ public function __construct($name, $code, $hive, $link)
*/
public function build()
{
- $subject = __('samplecode.subject').' ('.$this->code.')'.(null !== $this->hive ? ' - '.__('samplecode.Hive', ['hive'=>$this->hive]) : '');
+ $subject = __('samplecode.subject').' ('.$this->code.')'.($this->hive !== null ? ' - '.__('samplecode.Hive', ['hive' => $this->hive]) : '');
+
return $this->markdown(
'emails.samplecode',
[
- 'code'=>$this->code,
- 'name' =>$this->name,
- 'hive' =>$this->hive,
- 'link' =>env('WEBAPP_URL').$this->link,
+ 'code' => $this->code,
+ 'name' => $this->name,
+ 'hive' => $this->hive,
+ 'link' => env('WEBAPP_URL').$this->link,
])
->subject($subject);
}
diff --git a/app/Measurement.php b/app/Measurement.php
index 82a3be67..63b1a94a 100644
--- a/app/Measurement.php
+++ b/app/Measurement.php
@@ -2,10 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Model;
-use App\PhysicalQuantity;
-use App\Translation;
use Cache;
+use Illuminate\Database\Eloquent\Model;
use LaravelLocalization;
class Measurement extends Model
@@ -18,10 +16,10 @@ class Measurement extends Model
protected $table = 'measurements';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -32,27 +30,27 @@ class Measurement extends Model
*
* @var array
*/
- protected $fillable = ['abbreviation', 'physical_quantity_id', 'show_in_charts', 'chart_group', 'min_value', 'max_value', 'hex_color', 'show_in_alerts', 'show_in_dials', 'weather', 'data_source_type', 'data_api_url', 'data_repository_url', 'future'];
- protected $hidden = ['created_at', 'updated_at']; //'parent'
- protected $appends = ['pq','unit','pq_name_unit', 'low_value', 'high_value']; //'parent'
- public static $data_source_types = ['db_influx'=>'Influx Database', 'api'=>'API', 'lambda_model'=>'Lambda Model', 'open_weather'=>'Open Weather'];
+ protected $fillable = ['abbreviation', 'physical_quantity_id', 'show_in_charts', 'chart_group', 'min_value', 'max_value', 'hex_color', 'show_in_alerts', 'show_in_dials', 'weather', 'data_source_type', 'data_api_url', 'data_repository_url', 'future'];
+
+ protected $hidden = ['created_at', 'updated_at']; // 'parent'
+
+ protected $appends = ['pq', 'unit', 'pq_name_unit', 'low_value', 'high_value']; // 'parent'
+
+ public static $data_source_types = ['db_influx' => 'Influx Database', 'api' => 'API', 'lambda_model' => 'Lambda Model', 'open_weather' => 'Open Weather'];
public static function boot()
{
parent::boot();
- static::created(function($m)
- {
+ static::created(function ($m) {
$m->forgetCache();
});
- static::updated(function($m)
- {
+ static::updated(function ($m) {
$m->forgetCache();
});
- static::deleted(function($m)
- {
+ static::deleted(function ($m) {
$m->forgetCache();
});
}
@@ -91,11 +89,11 @@ public function forgetCache()
Cache::forget('meas-id-'.$this->id.'-max'); // fot SensorDefinition
Cache::forget('measurement-display-decimals');
Category::forgetTaxonomyListCache();
- if (isset($this->physical_quantity_id))
+ if (isset($this->physical_quantity_id)) {
$this->physical_quantity->forgetCache();
+ }
}
-
public function getPqAttribute()
{
return $this->pq_name();
@@ -137,14 +135,14 @@ public function pq_name()
{
// add sensor name (temporarily)
return Cache::remember('measurement-'.$this->id.'-pq-'.$this->physical_quantity_id.'-'.$this->abbreviation.'-name', env('CACHE_TIMEOUT_LONG'), function () {
- //$abbr = '';
+ // $abbr = '';
// if (isset($this->abbreviation))
// {
// $mabb = $this->abbreviation;
- // $aind = strpos($mabb, '_');
+ // $aind = strpos($mabb, '_');
// $abbr = ' - '.($aind ? substr($mabb, 0, $aind) : $mabb);
// }
- return $this->physical_quantity_cached()->name; //.$abbr;
+ return $this->physical_quantity_cached()->name; // .$abbr;
});
}
@@ -152,50 +150,55 @@ public function unit()
{
return Cache::remember('measurement-'.$this->id.'-pq-'.$this->physical_quantity_id.'-unit', env('CACHE_TIMEOUT_LONG'), function () {
$pq = $this->physical_quantity_cached();
- if ($pq)
+ if ($pq) {
return $pq->unit;
- else
+ } else {
return '';
+ }
});
}
-
+
public function pq_name_unit()
{
- if ($this->physical_quantity_id != null)
- {
+ if ($this->physical_quantity_id != null) {
$unit = $this->unit() != null && $this->unit() != '' ? ' ('.$this->unit().')' : '';
$name = $this->pq_name().$unit;
- if ($name)
+ if ($name) {
return $name;
+ }
}
+
return null;
}
public function trans()
{
- //$trans = Translation::where('name', $this->name)->with('language')->get()->pluck('translation','language.lang');
+ // $trans = Translation::where('name', $this->name)->with('language')->get()->pluck('translation','language.lang');
$out = Cache::rememberForever('measurement-'.$this->id.'-trans-'.$this->abbreviation, function () {
$trans = DB::table('translations')
- ->join('languages', 'translations.language_id', '=', 'languages.id')
- ->where('translations.type', 'measurement')
- ->where('translations.name', $this->abbreviation)
- ->select('translations.translation', 'languages.twochar')
- ->get();
-
- if ($trans)
- {
+ ->join('languages', 'translations.language_id', '=', 'languages.id')
+ ->where('translations.type', 'measurement')
+ ->where('translations.name', $this->abbreviation)
+ ->select('translations.translation', 'languages.twochar')
+ ->get();
+
+ if ($trans) {
$out = [];
- foreach($trans as $item)
- $out[$item->twochar] = $item->translation;
-
- if (count($out) > 0)
+ foreach ($trans as $item) {
+ $out[$item->twochar] = $item->translation;
+ }
+
+ if (count($out) > 0) {
return $out;
+ }
}
+
return null;
});
- if ($out)
+ if ($out) {
return $out;
+ }
return null;
}
@@ -207,42 +210,43 @@ public function getAbbrNamedObjectAttribute()
public static function getIdByAbbreviation($abbreviation)
{
- $measurement_abbr_ids = Cache::remember('measurement-abbr-ids', env('CACHE_TIMEOUT_LONG'), function ()
- {
+ $measurement_abbr_ids = Cache::remember('measurement-abbr-ids', env('CACHE_TIMEOUT_LONG'), function () {
return Measurement::pluck('id', 'abbreviation')->toArray();
});
- if (isset($measurement_abbr_ids[$abbreviation]))
+ if (isset($measurement_abbr_ids[$abbreviation])) {
return $measurement_abbr_ids[$abbreviation];
+ }
return null;
}
public static function getMatchingMeasurements()
{
- return ['bv','w_v','weight_kg', 't_i','t_0','t_1','s_bin_71_122','s_bin_122_173','s_bin_173_224','s_bin_224_276','s_bin_276_327','s_bin_327_378','s_bin_378_429','s_bin_429_480','s_bin_480_532','s_bin_532_583','s_bin_0_201','s_bin_201_402','s_bin_402_602','s_bin_602_803','s_bin_803_1004','s_bin_1004_1205','s_bin_1205_1406','s_bin_1406_1607','s_bin_1607_1807','s_bin_1807_2008'];
+ return ['bv', 'w_v', 'weight_kg', 't_i', 't_0', 't_1', 's_bin_71_122', 's_bin_122_173', 's_bin_173_224', 's_bin_224_276', 's_bin_276_327', 's_bin_327_378', 's_bin_378_429', 's_bin_429_480', 's_bin_480_532', 's_bin_532_583', 's_bin_0_201', 's_bin_201_402', 's_bin_402_602', 's_bin_602_803', 's_bin_803_1004', 's_bin_1004_1205', 's_bin_1205_1406', 's_bin_1406_1607', 's_bin_1607_1807', 's_bin_1807_2008'];
}
- public static function getValidMeasurements($output=false, $weather=false, $locale=null)
+ public static function getValidMeasurements($output = false, $weather = false, $locale = null)
{
$name_table = $weather ? 'weather' : 'sensors';
$name_value = $output ? 'output' : 'valid';
- $locale = $locale == null ? LaravelLocalization::getCurrentLocale() : $locale;
- return Cache::remember('measurement-list-'.$locale.'-'.$name_table.'-'.$name_value, env('CACHE_TIMEOUT_LONG'), function () use ($output, $weather)
- {
- if ($output)
- return Measurement::where('weather',$weather)->where('show_in_charts', true)->pluck('abbreviation')->toArray();
+ $locale = $locale == null ? LaravelLocalization::getCurrentLocale() : $locale;
+
+ return Cache::remember('measurement-list-'.$locale.'-'.$name_table.'-'.$name_value, env('CACHE_TIMEOUT_LONG'), function () use ($output, $weather) {
+ if ($output) {
+ return Measurement::where('weather', $weather)->where('show_in_charts', true)->pluck('abbreviation')->toArray();
+ }
- return Measurement::where('weather',$weather)->get()->pluck('pq', 'abbreviation')->toArray();
+ return Measurement::where('weather', $weather)->get()->pluck('pq', 'abbreviation')->toArray();
});
}
public static function getWeightMeasurementIds()
{
- return Cache::remember('measurement-weight-ids', env('CACHE_TIMEOUT_LONG'), function ()
- {
- $input_id = Measurement::where('abbreviation','w_v')->value('id');
- $output_id = Measurement::where('abbreviation','weight_kg')->value('id');
- return ['input_id'=>$input_id, 'output_id'=>$output_id];
+ return Cache::remember('measurement-weight-ids', env('CACHE_TIMEOUT_LONG'), function () {
+ $input_id = Measurement::where('abbreviation', 'w_v')->value('id');
+ $output_id = Measurement::where('abbreviation', 'weight_kg')->value('id');
+
+ return ['input_id' => $input_id, 'output_id' => $output_id];
});
}
@@ -264,14 +268,14 @@ public static function selectList()
$list = [];
$list[''] = '-';
- foreach(Measurement::orderBy('abbreviation')->get() as $q)
- {
+ foreach (Measurement::orderBy('abbreviation')->get() as $q) {
$id = $q->id;
$label = $q->abbreviation.' ('.$q->pq_name_unit.')';
$list[$id] = $label;
}
+
return $list;
}
}
diff --git a/app/Models/Alert.php b/app/Models/Alert.php
index 4bb45ece..1be52ba8 100644
--- a/app/Models/Alert.php
+++ b/app/Models/Alert.php
@@ -2,13 +2,12 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
-use App\Models\AlertRule;
-use App\Measurement;
-use App\Location;
-use App\Hive;
use App\Device;
+use App\Hive;
+use App\Location;
+use App\Measurement;
use App\User;
+use Illuminate\Database\Eloquent\Model;
class Alert extends Model
{
@@ -20,10 +19,10 @@ class Alert extends Model
protected $table = 'alerts';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -32,14 +31,17 @@ class Alert extends Model
* @var array
*/
protected $fillable = ['alert_rule_id', 'alert_function', 'alert_value', 'measurement_id', 'show', 'location_name', 'hive_name', 'device_name', 'location_id', 'hive_id', 'device_id', 'user_id', 'count'];
- protected $hidden = ['show', 'alert_rule']; // 2021-03-09: not (yet) required in front-end, alerts will be deleted
- protected $appends = ['alert_rule_name'];
+
+ protected $hidden = ['show', 'alert_rule']; // 2021-03-09: not (yet) required in front-end, alerts will be deleted
+
+ protected $appends = ['alert_rule_name'];
// Relations
public function getAlertRuleNameAttribute()
{
- if ($this->alert_rule_id != null && $this->alert_rule)
+ if ($this->alert_rule_id != null && $this->alert_rule) {
return $this->alert_rule->name;
+ }
return null;
}
@@ -48,25 +50,29 @@ public function alert_rule()
{
return $this->belongsTo(AlertRule::class);
}
+
public function measurement()
{
return $this->belongsTo(Measurement::class);
}
+
public function location()
{
return $this->belongsTo(Location::class);
}
+
public function hive()
{
return $this->belongsTo(Hive::class);
}
+
public function device()
{
return $this->belongsTo(Device::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
-
}
diff --git a/app/Models/AlertRule.php b/app/Models/AlertRule.php
index a8ad5bb1..79773ee6 100644
--- a/app/Models/AlertRule.php
+++ b/app/Models/AlertRule.php
@@ -2,20 +2,18 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
-use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\App;
+use App\Device;
+use App\Mail\AlertMail;
use App\Measurement;
use App\User;
-use App\Device;
-use App\Models\Alert;
-use Moment\Moment;
-use Mail;
use Cache;
-use Translation;
-use App\Mail\AlertMail;
-use App\Models\AlertRuleFormula;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\App;
+use Illuminate\Support\Facades\Log;
use LaravelLocalization;
+use Mail;
+use Moment\Moment;
+use Translation;
class AlertRule extends Model
{
@@ -27,10 +25,10 @@ class AlertRule extends Model
protected $table = 'alert_rules';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -38,27 +36,32 @@ class AlertRule extends Model
*
* @var array
*/
- protected $fillable = ['name', 'description', 'measurement_id', 'calculation', 'calculation_minutes', 'comparator', 'comparison', 'threshold_value', 'exclude_months', 'exclude_hours', 'exclude_hive_ids', 'alert_via_email', 'webhook_url', 'active', 'user_id', 'default_rule', 'timezone', 'alert_on_occurences', 'last_calculated_at', 'last_evaluated_at'];
- protected $hidden = ['last_calculated_at','alert_rule_formulas'];
- protected $appends = ['formulas','no_value'];
+ protected $fillable = ['name', 'description', 'measurement_id', 'calculation', 'calculation_minutes', 'comparator', 'comparison', 'threshold_value', 'exclude_months', 'exclude_hours', 'exclude_hive_ids', 'alert_via_email', 'webhook_url', 'active', 'user_id', 'default_rule', 'timezone', 'alert_on_occurences', 'last_calculated_at', 'last_evaluated_at'];
+
+ protected $hidden = ['last_calculated_at', 'alert_rule_formulas'];
+
+ protected $appends = ['formulas', 'no_value'];
+
+ public static $calculations = ['min' => 'Minimum', 'max' => 'Maximum', 'ave' => 'Average', 'cnt' => 'Count']; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
+
+ public static $influx_calc = ['min' => 'MIN', 'max' => 'MAX', 'ave' => 'MEAN', 'der' => 'DERIVATIVE', 'cnt' => 'COUNT'];
+
+ public static $comparators = ['=' => 'equal_to', '<' => 'less_than', '>' => 'greater_than', '<=' => 'less_than_or_equal', '>=' => 'greater_than_or_equal'];
+
+ public static $comparisons = ['val' => 'Value', 'inc' => 'Increase', 'dec' => 'Decrease', 'abs_dif' => 'Absolute_value_of_dif']; // excluse "abs"=>"Absolute_value","dif"=>"Difference" because it has no usecase
+
+ public static $exclude_months = [1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec'];
- public static $calculations = ["min"=>"Minimum", "max"=>"Maximum", "ave"=>"Average", "cnt"=>"Count"]; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
- public static $influx_calc = ["min"=>"MIN", "max"=>"MAX", "ave"=>"MEAN", "der"=>"DERIVATIVE", "cnt"=>"COUNT"];
-
- public static $comparators = ["="=>"equal_to", "<"=>"less_than", ">"=>"greater_than", "<="=>"less_than_or_equal", ">="=>"greater_than_or_equal"];
- public static $comparisons = ["val"=>"Value", "inc"=>"Increase", "dec"=>"Decrease", "abs_dif"=>"Absolute_value_of_dif"]; // excluse "abs"=>"Absolute_value","dif"=>"Difference" because it has no usecase
- public static $exclude_months = [1=>"Jan",2=>"Feb",3=>"Mar",4=>"Apr",5=>"May",6=>"Jun",7=>"Jul",8=>"Aug",9=>"Sep",10=>"Oct",11=>"Nov",12=>"Dec"];
- public static $exclude_hours = [0=>"0:00 - 0:59",1=>"1:00 - 1:59",2=>"2:00 - 2:59",3=>"3:00 - 3:59",4=>"4:00 - 4:59",5=>"5:00 - 5:59",6=>"6:00 - 6:59",7=>"7:00 - 7:59",8=>"8:00 - 8:59",9=>"9:00 - 9:59",10=>"10:00 - 10:59",11=>"11:00 - 11:59",12=>"12:00 - 12:59",13=>"13:00 - 13:59",14=>"14:00 - 14:59",15=>"15:00 - 15:59",16=>"16:00 - 16:59",17=>"17:00 - 17:59",18=>"18:00 - 18:59",19=>"19:00 - 19:59",20=>"20:00 - 20:59",21=>"21:00 - 21:59",22=>"22:00 - 22:59",23=>"23:00 - 23:59"];
+ public static $exclude_hours = [0 => '0:00 - 0:59', 1 => '1:00 - 1:59', 2 => '2:00 - 2:59', 3 => '3:00 - 3:59', 4 => '4:00 - 4:59', 5 => '5:00 - 5:59', 6 => '6:00 - 6:59', 7 => '7:00 - 7:59', 8 => '8:00 - 8:59', 9 => '9:00 - 9:59', 10 => '10:00 - 10:59', 11 => '11:00 - 11:59', 12 => '12:00 - 12:59', 13 => '13:00 - 13:59', 14 => '14:00 - 14:59', 15 => '15:00 - 15:59', 16 => '16:00 - 16:59', 17 => '17:00 - 17:59', 18 => '18:00 - 18:59', 19 => '19:00 - 19:59', 20 => '20:00 - 20:59', 21 => '21:00 - 21:59', 22 => '22:00 - 22:59', 23 => '23:00 - 23:59'];
- public static $calc_minutes = [0, 60, 180, 360, 720, 1440, 2880, 10080];
+ public static $calc_minutes = [0, 60, 180, 360, 720, 1440, 2880, 10080];
public static function boot()
{
parent::boot();
- static::created(function($r)
- {
- $a = new Alert(['alert_rule_id'=>$r->id, 'alert_function'=>'alert_rule_created', 'alert_value'=>$r->readableFunction(), 'measurement_id'=>$r->measurement_id, 'user_id'=>$r->user_id]);
+ static::created(function ($r) {
+ $a = new Alert(['alert_rule_id' => $r->id, 'alert_function' => 'alert_rule_created', 'alert_value' => $r->readableFunction(), 'measurement_id' => $r->measurement_id, 'user_id' => $r->user_id]);
$a->save();
});
@@ -77,34 +80,38 @@ public static function boot()
// });
}
-
public function getExcludeMonthsAttribute()
{
- return !empty($this->attributes['exclude_months']) ? array_map(function($value){ return intval($value); }, explode(",", $this->attributes['exclude_months'])) : [];
+ return ! empty($this->attributes['exclude_months']) ? array_map(function ($value) {
+ return intval($value);
+ }, explode(',', $this->attributes['exclude_months'])) : [];
}
public function getExcludeHoursAttribute()
{
- return !empty($this->attributes['exclude_hours']) ? array_map(function($value){ return intval($value); }, explode(",", $this->attributes['exclude_hours'])) : [];
+ return ! empty($this->attributes['exclude_hours']) ? array_map(function ($value) {
+ return intval($value);
+ }, explode(',', $this->attributes['exclude_hours'])) : [];
}
public function getExcludeHiveIdsAttribute()
{
- return !empty($this->attributes['exclude_hive_ids']) ? array_map(function($value){ return intval($value); }, explode(",", $this->attributes['exclude_hive_ids'])) : [];
+ return ! empty($this->attributes['exclude_hive_ids']) ? array_map(function ($value) {
+ return intval($value);
+ }, explode(',', $this->attributes['exclude_hive_ids'])) : [];
}
public function getNoValueAttribute()
{
- if ($this->threshold_value == 0 && !empty($this->attributes['calculation']) && $this->attributes['calculation'] == 'cnt')
- {
+ if ($this->threshold_value == 0 && ! empty($this->attributes['calculation']) && $this->attributes['calculation'] == 'cnt') {
return true;
- }
- else if ($this->formulas->count() > 0)
- {
+ } elseif ($this->formulas->count() > 0) {
$f = $this->formulas->first();
- if ($f->threshold_value == 0 && $f->calculation == 'cnt')
+ if ($f->threshold_value == 0 && $f->calculation == 'cnt') {
return true;
+ }
}
+
return false;
}
@@ -118,28 +125,27 @@ public function getUnit()
return $this->calculation == 'cnt' || $this->calculation == 'der' || $this->measurement->unit == '-' ? '' : ''.$this->measurement->unit;
}
- public function getPq($abbr=false)
+ public function getPq($abbr = false)
{
$pq = null;
-
- if (isset($this->measurement_id) && isset($this->measurement->physical_quantity))
+
+ if (isset($this->measurement_id) && isset($this->measurement->physical_quantity)) {
$pq = $abbr ? $this->measurement->physical_quantity->abbreviation : $this->measurement->pq;
+ }
- if ($pq)
- {
+ if ($pq) {
$loc = LaravelLocalization::getCurrentLocale();
- return Cache::remember('ar-'.$this->id.'-pq-name-'.$loc.'-'.$pq, env('CACHE_TIMEOUT_LONG'), function () use ($loc, $pq)
- {
- if ($this->calculation == 'der' || !isset($pq))
- return '';
- elseif (isset($pq))
- return $pq;
+ return Cache::remember('ar-'.$this->id.'-pq-name-'.$loc.'-'.$pq, env('CACHE_TIMEOUT_LONG'), function () use ($pq) {
+ if ($this->calculation == 'der' || ! isset($pq)) {
return '';
- });
- }
- else
- {
+ } elseif (isset($pq)) {
+ return $pq;
+ }
+
+ return '';
+ });
+ } else {
return '';
}
}
@@ -148,194 +154,194 @@ public function measurement()
{
return $this->belongsTo(Measurement::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
+
public function alert_rule_formulas()
{
return $this->hasMany(AlertRuleFormula::class);
}
+
public function alerts()
{
return $this->hasMany(Alert::class);
}
-
+
public static function selectList()
{
- return self::orderBy('name')->pluck('name','id');
+ return self::orderBy('name')->pluck('name', 'id');
}
public function remove_hive_id_from_exclude_hive_ids($hive_id)
{
$hive_ids_array = $this->exclude_hive_ids;
- $array_index = array_search($hive_id, $hive_ids_array);
-
- if ($array_index !== false)
- {
+ $array_index = array_search($hive_id, $hive_ids_array);
+
+ if ($array_index !== false) {
array_splice($hive_ids_array, $array_index, 1);
- $this->exclude_hive_ids = implode(",", $hive_ids_array);
+ $this->exclude_hive_ids = implode(',', $hive_ids_array);
$this->save();
}
}
-
-
- public static function cacheRequestRate($name, $amount=1)
+ public static function cacheRequestRate($name, $amount = 1)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count', $amount);
- else
+ } else {
Cache::put($name.'-count', $amount);
+ }
}
- public function readableFunction($short=false, $value=null)
+ public function readableFunction($short = false, $value = null)
{
- $rule = $this;
-
- $locales = config('laravellocalization.supportedLocales');
- $locale = isset($rule->user) && isset($locales[$rule->user->locale]) ? $rule->user->locale : LaravelLocalization::getCurrentLocale();
- $pq_name = isset($m_abbr) ? Translation::get($locale, $m_abbr, 'measurement') : $rule->getPq();
- $unit = $rule->getUnit();
- $direct = $rule->calculation_minutes == 0 ? true : false;
- $calc = $direct ? '' : ''.__('beep.'.$rule->calculation).' '; // min / max / average / count
+ $rule = $this;
+
+ $locales = config('laravellocalization.supportedLocales');
+ $locale = isset($rule->user) && isset($locales[$rule->user->locale]) ? $rule->user->locale : LaravelLocalization::getCurrentLocale();
+ $pq_name = isset($m_abbr) ? Translation::get($locale, $m_abbr, 'measurement') : $rule->getPq();
+ $unit = $rule->getUnit();
+ $direct = $rule->calculation_minutes == 0 ? true : false;
+ $calc = $direct ? '' : ''.__('beep.'.$rule->calculation).' '; // min / max / average / count
$comparison = $rule->comparison == 'val' ? '' : ' '.__('beep.'.$rule->comparison); // value (not shown) / increase / difference
- $cnt_zero = $rule->calculation == 'cnt' && ($value === 0 || $rule->threshold_value == 0) ? true : false;
- $text_zero = ucfirst(__('beep.cnt_zero')).' '; // Absence of
+ $cnt_zero = $rule->calculation == 'cnt' && ($value === 0 || $rule->threshold_value == 0) ? true : false;
+ $text_zero = ucfirst(__('beep.cnt_zero')).' '; // Absence of
$calc_trans = $direct ? '' : ($cnt_zero ? $text_zero : $calc.$comparison); // Absence of / average value
// alert function with value
- if ($value != null)
- {
- if ($cnt_zero)
+ if ($value != null) {
+ if ($cnt_zero) {
return ucfirst($calc_trans).$pq_name.__('beep.values');
- else
- return ucfirst($calc_trans).' '.$pq_name.' = '.$value.$unit."\n(".$rule->comparator.' '.$rule->threshold_value.$unit.')'; // value Temperature average value = 10.3°C
+ } else {
+ return ucfirst($calc_trans).' '.$pq_name.' = '.$value.$unit."\n(".$rule->comparator.' '.$rule->threshold_value.$unit.')';
+ } // value Temperature average value = 10.3°C
}
// alert function for logging
- if ($short)
+ if ($short) {
return $rule->getPq(true).' '.$calc.$rule->comparison.' '.$rule->comparator.' '.$rule->threshold_value.$unit;
+ }
// alert function without value (for alert rule display)
- if ($cnt_zero)
- return ucfirst($calc_trans).$pq_name.__('beep.values'); // Absence of Temperature values
- else
- return $pq_name.' '.$calc_trans.__('beep.'.$rule->comparison).' '.$rule->comparator.' '.$rule->threshold_value.$unit; // Temperature average value = 10.3°C
+ if ($cnt_zero) {
+ return ucfirst($calc_trans).$pq_name.__('beep.values');
+ } // Absence of Temperature values
+ else {
+ return $pq_name.' '.$calc_trans.__('beep.'.$rule->comparison).' '.$rule->comparator.' '.$rule->threshold_value.$unit;
+ } // Temperature average value = 10.3°C
}
- public function evaluateDeviceRuleAlerts($device, $user, $alert_rule_calc_date, $data_array=null, $log_on=false)
+ public function evaluateDeviceRuleAlerts($device, $user, $alert_rule_calc_date, $data_array = null, $log_on = false)
{
$r = $this;
$d = $device;
$u = $user;
- $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
+ $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
$debug_start = ' |- D='.$d->id.' ';
- if (!isset($d->hive_id) || in_array($d->hive_id, $r->exclude_hive_ids)) // only parse existing hives that are not excluded
- {
- if($log_on)
- Log::debug($debug_start.' No hive_id to evaluate, excluded hive_ids='.implode(',',$r->exclude_hive_ids));
+ if (! isset($d->hive_id) || in_array($d->hive_id, $r->exclude_hive_ids)) { // only parse existing hives that are not excluded
+ if ($log_on) {
+ Log::debug($debug_start.' No hive_id to evaluate, excluded hive_ids='.implode(',', $r->exclude_hive_ids));
+ }
+
return 0;
}
- if (!isset(self::$influx_calc[$r->calculation]))
- {
- if($log_on)
+ if (! isset(self::$influx_calc[$r->calculation])) {
+ if ($log_on) {
Log::debug($debug_start.' Undefined calculation: '.$r->calculation);
+ }
+
return 0;
}
- $diff_comp = $r->comparison == 'dif' || $r->comparison == 'abs_dif' || $r->comparison == 'inc' || $r->comparison == 'dec' ? true : false;
+ $diff_comp = $r->comparison == 'dif' || $r->comparison == 'abs_dif' || $r->comparison == 'inc' || $r->comparison == 'dec' ? true : false;
$round_decim = $diff_comp ? 2 : 1; // round to 2 decimals for difference comparison, because difference can be 0 too sooon for 1 decimal (temperature sensor of e.g. brood), otherwise to 1 decimal
- $m_abbr = $r->measurement->abbreviation;
+ $m_abbr = $r->measurement->abbreviation;
$influx_func = self::$influx_calc[$r->calculation];
- $limit = $diff_comp ? $r->alert_on_occurences + 1 : $r->alert_on_occurences; // one extra for diff calculation
+ $limit = $diff_comp ? $r->alert_on_occurences + 1 : $r->alert_on_occurences; // one extra for diff calculation
$direct_data = isset($data_array) && count($data_array) > 0 && isset($data_array[0][$m_abbr]) ? true : false;
- if ($direct_data)
- $last_val_inf= ['values'=>$data_array, 'query'=>'', 'from'=>'measurement', 'min_ago'=>0];
- else
- $last_val_inf= $d->getAlertSensorValues($m_abbr, $influx_func, $r->calculation_minutes, $limit); // provides: ['values'=>$values,'query'=>$query, 'from'=>'cache', 'min_ago'=>$val_min_ago]
-
+ if ($direct_data) {
+ $last_val_inf = ['values' => $data_array, 'query' => '', 'from' => 'measurement', 'min_ago' => 0];
+ } else {
+ $last_val_inf = $d->getAlertSensorValues($m_abbr, $influx_func, $r->calculation_minutes, $limit);
+ } // provides: ['values'=>$values,'query'=>$query, 'from'=>'cache', 'min_ago'=>$val_min_ago]
- $last_values = $last_val_inf['values'];
- $alert_count = 0;
+ $last_values = $last_val_inf['values'];
+ $alert_count = 0;
$evaluation_count = 0;
- $alert_function = '';
- $alert_values = [];
+ $alert_function = '';
+ $alert_values = [];
$last_values_data = [];
$last_value_count = $diff_comp ? count($last_values) - 1 : min($r->alert_on_occurences, count($last_values));
$alert_on_no_vals = $r->calculation == 'cnt' && $r->threshold_value == 0 ? true : false;
-
- if ($last_val_inf['min_ago'] > $r->calculation_minutes && $alert_on_no_vals == false)
- {
- if($log_on)
+
+ if ($last_val_inf['min_ago'] > $r->calculation_minutes && $alert_on_no_vals == false) {
+ if ($log_on) {
Log::debug($debug_start.' Not evaluating, data from '.$last_val_inf['min_ago'].'m ago is longer ago than '.$r->calculation_minutes.'m (calc min)');
+ }
+
return 0;
}
- if ($last_value_count > 0 || $alert_on_no_vals)
- {
- //Log::debug(json_encode(['r'=>$r->name, 'd'=>$d->name, 'lv'=>$last_values, 'mve'=>$last_value_count]));
+ if ($last_value_count > 0 || $alert_on_no_vals) {
+ // Log::debug(json_encode(['r'=>$r->name, 'd'=>$d->name, 'lv'=>$last_values, 'mve'=>$last_value_count]));
// evaluate measurement values
- if ($last_value_count > 0)
- {
- for ($i=0; $i < $last_value_count; $i++) // start with most recent value (ordered desc on time)
- {
- if (!isset($last_values[$i][$m_abbr]))
- {
+ if ($last_value_count > 0) {
+ for ($i = 0; $i < $last_value_count; $i++) { // start with most recent value (ordered desc on time)
+ if (! isset($last_values[$i][$m_abbr])) {
continue;
- }
- else
- {
+ } else {
$value = $last_values[$i][$m_abbr];
// Save last calc values for reference
- $key = $m_abbr.'_'.$i;
- if (isset($last_values[$i]['time']))
+ $key = $m_abbr.'_'.$i;
+ if (isset($last_values[$i]['time'])) {
$key = $last_values[$i]['time'];
-
+ }
+
$last_values_data["$key"] = $value;
// Continue if unset
- if (!isset($value) || $value == '' || $value == 'null')
+ if (! isset($value) || $value == '' || $value == 'null') {
continue;
+ }
}
-
+
$value_prev = null;
- if ($i+1 < count($last_values) && isset($last_values[$i+1][$m_abbr]))
- {
- $value_prev = $last_values[$i+1][$m_abbr];
+ if ($i + 1 < count($last_values) && isset($last_values[$i + 1][$m_abbr])) {
+ $value_prev = $last_values[$i + 1][$m_abbr];
// Save last calc values for reference
- if ($diff_comp && $i == $last_value_count-1)
- {
- //die(print_r([$i,$m_abbr]));
- $key = $m_abbr.'_'.($i+1);
- if (isset($last_values[$i+1]['time']))
- $key = $last_values[$i+1]['time'];
+ if ($diff_comp && $i == $last_value_count - 1) {
+ // die(print_r([$i,$m_abbr]));
+ $key = $m_abbr.'_'.($i + 1);
+ if (isset($last_values[$i + 1]['time'])) {
+ $key = $last_values[$i + 1]['time'];
+ }
$last_values_data["$key"] = $value_prev;
}
// Continue if unset
- if (!isset($value_prev) || $value_prev == '' || $value_prev == 'null')
+ if (! isset($value_prev) || $value_prev == '' || $value_prev == 'null') {
continue;
+ }
}
-
// Calculate value for rule
$calc = null;
- if ($diff_comp)
- {
- switch($r->comparison)
- {
+ if ($diff_comp) {
+ switch ($r->comparison) {
case 'inc':
case 'dif':
$calc = $value - $value_prev;
@@ -347,121 +353,106 @@ public function evaluateDeviceRuleAlerts($device, $user, $alert_rule_calc_date,
$calc = abs($value - $value_prev);
break;
}
- }
- else
- {
+ } else {
$calc = $value;
}
- if (is_nan($calc))
+ if (is_nan($calc)) {
continue;
+ }
-
- $calc = round($calc, $round_decim); // round, just like the threshold_value
+ $calc = round($calc, $round_decim); // round, just like the threshold_value
$thres = round($r->threshold_value, $round_decim);
-
+
$evaluation = false;
- switch($r->comparator)
- {
+ switch ($r->comparator) {
case '=':
$evaluation = $calc == $thres ? true : false;
break;
case '<':
$evaluation = $calc < $thres ? true : false;
- break;
+ break;
case '>':
$evaluation = $calc > $thres ? true : false;
- break;
+ break;
case '<=':
$evaluation = $calc <= $thres ? true : false;
- break;
+ break;
case '>=':
$evaluation = $calc >= $thres ? true : false;
- break;
+ break;
}
- if ($evaluation)
- {
+ if ($evaluation) {
$evaluation_count++;
$alert_values[] = $calc;
}
}
- }
- else if ($alert_on_no_vals && $last_value_count == 0)
- {
+ } elseif ($alert_on_no_vals && $last_value_count == 0) {
$evaluation_count = $r->alert_on_occurences;
- for ($i=0; $i < $evaluation_count; $i++)
- {
- $alert_values[] = 0; // alert on 0 value count
+ for ($i = 0; $i < $evaluation_count; $i++) {
+ $alert_values[] = 0; // alert on 0 value count
$last_values_data[] = 0;
}
}
// check if alert should be made
- if ($evaluation_count >= $r->alert_on_occurences)
- {
+ if ($evaluation_count >= $r->alert_on_occurences) {
// check if same alert was created at last alert of this alert_rule
$alert_counter = 1; // # of occurrences in a row
- $a = null;
- $check_alert = null;
- $device_min = $d->getRefreshMin()*2; // do not create new alert on every 1 missing value
- $alerts_min_max= max($r->calculation_minutes, $parse_min, $device_min)+1; // the higher, the earlier the $alerts_after, the more alerts are matching
- $alerts_after = date('Y-m-d H:i:s', time()-60*$alerts_min_max); // a bit less than alerts_min_max ago
- //die(print_r(['am'=>$alerts_min_max, 'cm'=>$r->calculation_minutes, 'pm'=>$parse_min, 'dm'=>$device_min]));
- if ($alerts_after)
+ $a = null;
+ $check_alert = null;
+ $device_min = $d->getRefreshMin() * 2; // do not create new alert on every 1 missing value
+ $alerts_min_max = max($r->calculation_minutes, $parse_min, $device_min) + 1; // the higher, the earlier the $alerts_after, the more alerts are matching
+ $alerts_after = date('Y-m-d H:i:s', time() - 60 * $alerts_min_max); // a bit less than alerts_min_max ago
+ // die(print_r(['am'=>$alerts_min_max, 'cm'=>$r->calculation_minutes, 'pm'=>$parse_min, 'dm'=>$device_min]));
+ if ($alerts_after) {
$check_alert = $d->alerts()->where('user_id', $u->id)->where('alert_rule_id', $r->id)->where('device_id', $d->id)->where('updated_at', '>=', $alerts_after)->orderBy('updated_at', 'desc')->first();
-
- if ($check_alert) // check if user already has this alert, if so, update it if diff value is bigger
- {
+ }
+
+ if ($check_alert) { // check if user already has this alert, if so, update it if diff value is bigger
$newest_alert_value = $alert_values[0];
- $value_diff_new = abs($newest_alert_value - $r->threshold_value);
+ $value_diff_new = abs($newest_alert_value - $r->threshold_value);
$value_diff_old_max = 0;
-
+
$old_alert_values = explode(', ', $check_alert->alert_value);
- foreach ($old_alert_values as $v)
+ foreach ($old_alert_values as $v) {
$value_diff_old_max = max($value_diff_old_max, abs($v - $r->threshold_value));
+ }
$alert_counter = $check_alert->count + 1;
// update attributes that could be changed over time
- $check_alert->updated_at = $alert_rule_calc_date;
+ $check_alert->updated_at = $alert_rule_calc_date;
$check_alert->alert_function = $r->readableFunction();
$check_alert->measurement_id = $r->measurement_id;
- $check_alert->location_id = $d->hive ? $d->hive->location_id : null;
- $check_alert->location_name = $d->location_name;
- $check_alert->device_name = $d->name;
- $check_alert->hive_id = $d->hive_id;
- $check_alert->hive_name = $d->hive_name;
- $check_alert->count = $alert_counter;
-
- if ($value_diff_new > $value_diff_old_max) // update the existing alert with new (higher diff) value and trigger e-mail
- {
- $check_alert->alert_value = implode(', ', $alert_values);
+ $check_alert->location_id = $d->hive ? $d->hive->location_id : null;
+ $check_alert->location_name = $d->location_name;
+ $check_alert->device_name = $d->name;
+ $check_alert->hive_id = $d->hive_id;
+ $check_alert->hive_name = $d->hive_name;
+ $check_alert->count = $alert_counter;
+
+ if ($value_diff_new > $value_diff_old_max) { // update the existing alert with new (higher diff) value and trigger e-mail
+ $check_alert->alert_value = implode(', ', $alert_values);
$check_alert->alert_function = $r->readableFunction(false, $check_alert->alert_value);
- $a = $check_alert;
-
- if($log_on)
- {
- $alert_comp = $r->comparator == '=' ? '==' : '!=';
- $diff_expla = ', Thr='.$r->threshold_value.' diff_new='.$value_diff_new.' > diff_old='.$value_diff_old_max;
+ $a = $check_alert;
+
+ if ($log_on) {
+ $alert_comp = $r->comparator == '=' ? '==' : '!=';
+ $diff_expla = ', Thr='.$r->threshold_value.' diff_new='.$value_diff_new.' > diff_old='.$value_diff_old_max;
Log::debug($debug_start.' Update Alert id='.$check_alert->id.' count='.$alert_counter.', v_new='.$newest_alert_value.' '.$alert_comp.' v_last='.$check_alert->alert_value.$diff_expla.', from: '.$last_val_inf['from']);
}
- }
- else // only update count of existing alert
- {
+ } else { // only update count of existing alert
$check_alert->alert_function = $r->readableFunction(false, $check_alert->alert_value);
- if($log_on)
- {
- if ($value_diff_new == $value_diff_old_max)
- {
- $alert_compv= '==';
+ if ($log_on) {
+ if ($value_diff_new == $value_diff_old_max) {
+ $alert_compv = '==';
$alert_comp = '==';
$diff_expla = '';
- }
- else
- {
- $alert_compv= '!=';
+ } else {
+ $alert_compv = '!=';
$alert_comp = '<';
$diff_expla = ', Thr='.$r->threshold_value.' diff_new='.$value_diff_new.' '.$alert_comp.' diff_old='.$value_diff_old_max;
}
@@ -470,84 +461,78 @@ public function evaluateDeviceRuleAlerts($device, $user, $alert_rule_calc_date,
}
}
$check_alert->save();
- }
- else // no previous alerts, so create
- {
+ } else { // no previous alerts, so create
$alert_value = implode(', ', $alert_values);
- $alert_func = $r->readableFunction(false, $alert_value);
+ $alert_func = $r->readableFunction(false, $alert_value);
- if($log_on)
+ if ($log_on) {
Log::debug($debug_start.' Create new Alert, v='.$alert_value.', eval_count='.$evaluation_count.' alert_count='.$alert_counter.' f='.$r->readableFunction(true).', from: '.$last_val_inf['from']);
+ }
- $a = new Alert();
- $a->created_at = $alert_rule_calc_date;
- $a->updated_at = $alert_rule_calc_date;
- $a->alert_rule_id = $r->id;
+ $a = new Alert;
+ $a->created_at = $alert_rule_calc_date;
+ $a->updated_at = $alert_rule_calc_date;
+ $a->alert_rule_id = $r->id;
$a->alert_function = $alert_func;
- $a->alert_value = $alert_value;
+ $a->alert_value = $alert_value;
$a->measurement_id = $r->measurement_id;
- $a->location_id = $d->hive ? $d->hive->location_id : null;
- $a->location_name = $d->location_name;
- $a->device_id = $d->id;
- $a->device_name = $d->name;
- $a->hive_id = $d->hive_id;
- $a->hive_name = $d->hive_name;
- $a->user_id = $u->id;
- $a->count = $alert_counter;
+ $a->location_id = $d->hive ? $d->hive->location_id : null;
+ $a->location_name = $d->location_name;
+ $a->device_id = $d->id;
+ $a->device_name = $d->name;
+ $a->hive_id = $d->hive_id;
+ $a->hive_name = $d->hive_name;
+ $a->user_id = $u->id;
+ $a->count = $alert_counter;
$a->save();
}
-
- $alert_count++;
+ $alert_count++;
- if ($a && $r->alert_via_email)
- {
+ if ($a && $r->alert_via_email) {
$last_values_string = null;
- if ($diff_comp)
- {
- $last_values_data = array_reverse($last_values_data); // for
- $last_values_array= [];
- foreach ($last_values_data as $key => $value)
- {
+ if ($diff_comp) {
+ $last_values_data = array_reverse($last_values_data); // for
+ $last_values_array = [];
+ foreach ($last_values_data as $key => $value) {
$last_values_array[] = round($value, $round_decim);
}
- $last_values_string = implode(' -> ',$last_values_array).$r->getUnit();
+ $last_values_string = implode(' -> ', $last_values_array).$r->getUnit();
}
// Set locale for date
- $created_date = gettype($a->created_at) == 'string' ? $a->created_at : $a->created_at->toDateTimeString();
+ $created_date = gettype($a->created_at) == 'string' ? $a->created_at : $a->created_at->toDateTimeString();
$created_date_local = new Moment($created_date, 'UTC');
- $locale_array = config('laravellocalization.supportedLocales');
- $locale_identifier = isset($locale_array[$u->locale]) ? $locale_array[$u->locale]['regional'] : null;
+ $locale_array = config('laravellocalization.supportedLocales');
+ $locale_identifier = isset($locale_array[$u->locale]) ? $locale_array[$u->locale]['regional'] : null;
- if ($locale_identifier)
+ if ($locale_identifier) {
\Moment\Moment::setLocale($locale_identifier);
+ }
+
+ $display_date_local = $created_date_local->setTimezone($r->timezone)->format('LLLL', new \Moment\CustomFormats\MomentJs);
- $display_date_local = $created_date_local->setTimezone($r->timezone)->format('LLLL', new \Moment\CustomFormats\MomentJs());
-
- if ($locale_identifier) // reset global locale
+ if ($locale_identifier) { // reset global locale
\Moment\Moment::setLocale('en_GB');
-
- if($log_on)
+ }
+
+ if ($log_on) {
Log::debug($debug_start.' Updated or created Alert, sending email to '.$u->email);
+ }
Mail::to($u->email)->send(new AlertMail($a, $u->name, $last_values_string, $display_date_local));
}
- }
- else if($log_on)
- {
+ } elseif ($log_on) {
Log::debug($debug_start.' evaluation_count='.$evaluation_count.'x (< '.$r->alert_on_occurences.'x), from: '.$last_val_inf['from'].', last_values='.json_encode($last_values_data));
}
- }
- else if($log_on)
- {
+ } elseif ($log_on) {
Log::debug($debug_start.' last_value_count=0, from: '.$last_val_inf['from'].', query: '.$last_val_inf['query']);
}
return $alert_count;
}
- public function parseRule($device_id=null, $data_array=null, $log_on=false)
+ public function parseRule($device_id = null, $data_array = null, $log_on = false)
{
/*
0. define UTC timezone
@@ -562,70 +547,63 @@ public function parseRule($device_id=null, $data_array=null, $log_on=false)
*/
$r = $this;
- $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
- $m_abbr = $r->measurement->abbreviation;
+ $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
+ $m_abbr = $r->measurement->abbreviation;
$debug_start = '|- R='.$r->id.' U='.$r->user_id.' ';
$direct_data = isset($data_array) && count($data_array) > 0 && isset($data_array[0][$m_abbr]) ? true : false;
-
+
// exclude parsing of rules
- $min_ago = 0;
+ $min_ago = 0;
$last_evaluated_at = $r->last_evaluated_at;
- $check_min = $direct_data ? 1 : max($r->calculation_minutes, $parse_min);
+ $check_min = $direct_data ? 1 : max($r->calculation_minutes, $parse_min);
- if (isset($last_evaluated_at))
- {
- $now = new Moment(); // UTC
- $min_ago = -1 * round($now->from($last_evaluated_at)->getMinutes()); // round to whole value
+ if (isset($last_evaluated_at)) {
+ $now = new Moment; // UTC
+ $min_ago = -1 * round($now->from($last_evaluated_at)->getMinutes()); // round to whole value
}
- if($log_on)
- Log::debug($debug_start.'direct_data='.($direct_data?'1':'0').' ('.$r->readableFunction(true).' @ '.$r->alert_on_occurences.'x'.$r->calculation_minutes.'m) last eval '.$min_ago.'m ago (check_min='.$check_min.') @ '.$last_evaluated_at);
-
- if ($min_ago > 0)
- {
- if ($min_ago < $check_min) // do not parse too often
- {
- //Log::debug($debug_start.' Not evaluated: last evaluated '.$min_ago.' min ago (< calc_min='.$r->calculation_minutes.')');
- return ['eval'=>0,'calc'=>0,'msg'=>'too_soon: min_ago='.$min_ago.' check_min='.$check_min];
- }
+ if ($log_on) {
+ Log::debug($debug_start.'direct_data='.($direct_data ? '1' : '0').' ('.$r->readableFunction(true).' @ '.$r->alert_on_occurences.'x'.$r->calculation_minutes.'m) last eval '.$min_ago.'m ago (check_min='.$check_min.') @ '.$last_evaluated_at);
}
+ if ($min_ago > 0) {
+ if ($min_ago < $check_min) { // do not parse too often
+ // Log::debug($debug_start.' Not evaluated: last evaluated '.$min_ago.' min ago (< calc_min='.$r->calculation_minutes.')');
+ return ['eval' => 0, 'calc' => 0, 'msg' => 'too_soon: min_ago='.$min_ago.' check_min='.$check_min];
+ }
+ }
$now_local = new Moment('now', $r->timezone); // Timezone of user that set alert rule (default: Europe/Amsterdam)
$now_month = $now_local->getMonth();
-
- if (isset($r->exclude_months) && in_array($now_month, $r->exclude_months))
- {
- //Log::debug($debug_start.' Not evaluated: current month ('.$now_month.') in exclude_months='.implode(',',$r->exclude_months));
- return ['eval'=>0,'calc'=>0,'msg'=>'excl_month='.$now_month];
+
+ if (isset($r->exclude_months) && in_array($now_month, $r->exclude_months)) {
+ // Log::debug($debug_start.' Not evaluated: current month ('.$now_month.') in exclude_months='.implode(',',$r->exclude_months));
+ return ['eval' => 0, 'calc' => 0, 'msg' => 'excl_month='.$now_month];
}
- $now_hour = $now_local->getHour();
+ $now_hour = $now_local->getHour();
- if (isset($r->exclude_hours) && in_array($now_hour, $r->exclude_hours))
- {
- //Log::debug($debug_start.' Not evaluated: current hour ('.$now_hour.') in exclude_hours='.implode(',',$r->exclude_hours));
- return ['eval'=>0,'calc'=>0,'msg'=>'excl_hour='.$now_hour];
+ if (isset($r->exclude_hours) && in_array($now_hour, $r->exclude_hours)) {
+ // Log::debug($debug_start.' Not evaluated: current hour ('.$now_hour.') in exclude_hours='.implode(',',$r->exclude_hours));
+ return ['eval' => 0, 'calc' => 0, 'msg' => 'excl_hour='.$now_hour];
}
// check if user (still) exists
- $user_id = $r->user_id;
- $user = User::find($user_id);
- if (!isset($user))
- {
- if ($r->default_rule == false)
- {
+ $user_id = $r->user_id;
+ $user = User::find($user_id);
+ if (! isset($user)) {
+ if ($r->default_rule == false) {
$alerts = Alert::where('alert_rule_id', $r->id);
Log::warning($debug_start.' Not evaluated: user not found, so deleting '.$alerts->count().' alerts and rule: '.$r->name);
$alerts->delete();
$r->delete();
}
- return ['eval'=>0,'calc'=>0,'msg'=>'no_user'];
- }
- else
- {
- if (isset($user->locale))
- App::setLocale($user->locale); // make sure all (blade)translations are in users language
+
+ return ['eval' => 0, 'calc' => 0, 'msg' => 'no_user'];
+ } else {
+ if (isset($user->locale)) {
+ App::setLocale($user->locale);
+ } // make sure all (blade)translations are in users language
}
// Evaluate rule
@@ -635,86 +613,79 @@ public function parseRule($device_id=null, $data_array=null, $log_on=false)
// define calculation per user device
$min_msg_date = '2019-01-01 00:00:00';
- if ($r->calculation != 'cnt')
- $min_msg_date = date('Y-m-d H:i:s', time()-(60*max($parse_min, $r->calculation_minutes))); // at least
+ if ($r->calculation != 'cnt') {
+ $min_msg_date = date('Y-m-d H:i:s', time() - (60 * max($parse_min, $r->calculation_minutes)));
+ } // at least
$all_user_devices = $user->allDevices()->where('hive_id', '!=', null)->whereNotIn('hive_id', $r->exclude_hive_ids)->get();
- if ($device_id == null) // default all devices
- {
+ if ($device_id == null) { // default all devices
$user_devices = $all_user_devices->where('last_message_received', '>=', $min_msg_date);
- }
- else
- {
- //die(print_r(['d'=>$data_array,'r'=>$r->toArray()]));
- if ($direct_data) // new last_message_received not yet saved
+ } else {
+ // die(print_r(['d'=>$data_array,'r'=>$r->toArray()]));
+ if ($direct_data) { // new last_message_received not yet saved
$user_devices = $all_user_devices->where('id', $device_id);
- else
+ } else {
$user_devices = $all_user_devices->where('last_message_received', '>=', $min_msg_date)->where('id', $device_id);
+ }
}
$calculated = 0;
- if (count($user_devices) > 0)
- {
- foreach ($user_devices as $device)
+ if (count($user_devices) > 0) {
+ foreach ($user_devices as $device) {
$calculated += $r->evaluateDeviceRuleAlerts($device, $user, $alert_rule_calc_date, $data_array, $log_on);
- }
- else
- {
- return ['eval'=>1,'calc'=>0,'msg'=>'no device ('.$device_id.' data='.$direct_data.') with hive and msg >= '.$min_msg_date];
+ }
+ } else {
+ return ['eval' => 1, 'calc' => 0, 'msg' => 'no device ('.$device_id.' data='.$direct_data.') with hive and msg >= '.$min_msg_date];
}
// save last evaluated date
- if ($calculated > 0)
- {
+ if ($calculated > 0) {
$r->last_calculated_at = $alert_rule_calc_date;
$r->save();
}
- return ['eval'=>1,'calc'=>$calculated,'msg'=>'ok'];
-
+ return ['eval' => 1, 'calc' => $calculated, 'msg' => 'ok'];
+
}
- public static function parseUserDeviceDirectAlertRules($rule_ids, $device_id=null, $data_array=null)
+ public static function parseUserDeviceDirectAlertRules($rule_ids, $device_id = null, $data_array = null)
{
$alertCount = 0;
- $evalCount = 0;
- $min_ago_e = date('Y-m-d H:i:s', time()-59); // a bit less than 1 min ago
- $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
- $log_on = env('LOG_ALERT_RULE_PARSING', false);
+ $evalCount = 0;
+ $min_ago_e = date('Y-m-d H:i:s', time() - 59); // a bit less than 1 min ago
+ $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
+ $log_on = env('LOG_ALERT_RULE_PARSING', false);
$alertRules = self::whereIn('id', $rule_ids)
- ->where('active', 1)
- ->where('default_rule', 0)
- ->where('alert_on_occurences', '=', 1)
- ->where('calculation_minutes', '<', $parse_min) // only parse alerts that are set to parsing 'at time of device data' (i.e. calculation_minutes == 0)
- ->where(function($query) use ($min_ago_e) {
- $query->where('last_evaluated_at','<=', $min_ago_e)
- ->orWhereNull('last_evaluated_at');
- })
- ->orderBy('last_evaluated_at')
- ->get();
-
- if ($log_on)
+ ->where('active', 1)
+ ->where('default_rule', 0)
+ ->where('alert_on_occurences', '=', 1)
+ ->where('calculation_minutes', '<', $parse_min) // only parse alerts that are set to parsing 'at time of device data' (i.e. calculation_minutes == 0)
+ ->where(function ($query) use ($min_ago_e) {
+ $query->where('last_evaluated_at', '<=', $min_ago_e)
+ ->orWhereNull('last_evaluated_at');
+ })
+ ->orderBy('last_evaluated_at')
+ ->get();
+
+ if ($log_on) {
Log::info('Evaluating (D='.$device_id.') '.count($alertRules).' direct alert rules last evaluated before '.$min_ago_e.' (59s ago)');
- //die(print_r(['$user_id'=>$user_id,'$parse_min'=>$parse_min,'ar'=>$alertRules->toArray()]));
+ }
+ // die(print_r(['$user_id'=>$user_id,'$parse_min'=>$parse_min,'ar'=>$alertRules->toArray()]));
$m_abbr_no_data = [];
- foreach ($alertRules as $r)
- {
+ foreach ($alertRules as $r) {
$debug_start = '|- R='.$r->id.' U='.$r->user_id.' ';
- $m_abbr = $r->measurement->abbreviation;
+ $m_abbr = $r->measurement->abbreviation;
$direct_data = isset($data_array) && count($data_array) > 0 && isset($data_array[0][$m_abbr]) ? true : false;
- if ($direct_data)
- {
+ if ($direct_data) {
$parsed = $r->parseRule($device_id, $data_array, $log_on); // returns ['eval'=>0,'calc'=>0,'msg'=>'no_user'];
$alertCount += $parsed['calc'];
- //$evalCount += $parsed['eval'];
+ // $evalCount += $parsed['eval'];
// if ($parsed['eval'] == 0)
// Log::debug(' |- '.$parsed['msg']);
- }
- else if ($log_on)
- {
+ } elseif ($log_on) {
Log::debug($debug_start.'direct_data=0 ('.$r->readableFunction(true).') No data available for: '.$m_abbr);
}
}
@@ -728,33 +699,32 @@ public static function parseUserDeviceDirectAlertRules($rule_ids, $device_id=nul
public static function parseRules()
{
$alertCount = 0;
- $now = new Moment(); // UTC
- $now_min = $now->getMinute();
- $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
- $log_on = env('LOG_ALERT_RULE_PARSING', false);
+ $now = new Moment; // UTC
+ $now_min = $now->getMinute();
+ $parse_min = min(60, env('PARSE_ALERT_RULES_EVERY_X_MIN', 15));
+ $log_on = env('LOG_ALERT_RULE_PARSING', false);
- if ($now_min % $parse_min == 0)
- {
- $evalCount = 0;
- $min_ago_e = date('Y-m-d H:i:s', time()-(59*$parse_min)); // a bit less than 15 min ago
+ if ($now_min % $parse_min == 0) {
+ $evalCount = 0;
+ $min_ago_e = date('Y-m-d H:i:s', time() - (59 * $parse_min)); // a bit less than 15 min ago
$alertRules = self::where('active', 1)
- ->where('default_rule', 0)
- ->where('user_id', '!=', null)
- ->where('calculation_minutes', '>=', $parse_min) // do not parse alerts that are set to parsing 'at time of device data' (i.e. calculation_minutes == 0)
- ->where(function($query) use ($min_ago_e) {
- $query->where('last_evaluated_at','<=', $min_ago_e)
- ->orWhereNull('last_evaluated_at');
- })
- ->orderBy('user_id')
- ->orderBy('last_evaluated_at')
- ->get();
-
- if ($log_on)
+ ->where('default_rule', 0)
+ ->where('user_id', '!=', null)
+ ->where('calculation_minutes', '>=', $parse_min) // do not parse alerts that are set to parsing 'at time of device data' (i.e. calculation_minutes == 0)
+ ->where(function ($query) use ($min_ago_e) {
+ $query->where('last_evaluated_at', '<=', $min_ago_e)
+ ->orWhereNull('last_evaluated_at');
+ })
+ ->orderBy('user_id')
+ ->orderBy('last_evaluated_at')
+ ->get();
+
+ if ($log_on) {
Log::info('Evaluating '.count($alertRules).' active alert rules last evaluated before '.$min_ago_e.' ('.$parse_min.'m ago)');
+ }
- foreach ($alertRules as $r)
- {
+ foreach ($alertRules as $r) {
$parsed = $r->parseRule(null, null, $log_on); // returns ['eval'=>0,'calc'=>0,'msg'=>'no_user'];
$alertCount += $parsed['calc'];
// $evalCount += $parsed['eval'];
@@ -763,6 +733,7 @@ public static function parseRules()
// Log::debug('|=> Evaluated rules='.$evalCount.', created/updated alerts='.$alertCount);
}
self::cacheRequestRate('alert-timed', $alertCount);
+
return $alertCount;
}
}
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index 601152a8..e56810d6 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -2,12 +2,11 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
use App\Measurement;
-use Translation;
-use App\Models\AlertRule;
-use LaravelLocalization;
use Cache;
+use Illuminate\Database\Eloquent\Model;
+use LaravelLocalization;
+use Translation;
class AlertRuleFormula extends Model
{
@@ -19,10 +18,10 @@ class AlertRuleFormula extends Model
protected $table = 'alert_rule_formulas';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -30,21 +29,26 @@ class AlertRuleFormula extends Model
*
* @var array
*/
- protected $fillable = ['alert_rule_id', 'measurement_id', 'calculation', 'comparator', 'comparison', 'logical', 'period_minutes', 'threshold_value', 'future'];
- protected $hidden = [];
- protected $casts = ['future'=>'boolean'];
- //protected $appends = ['calculation_minutes']; // CAUSES LOOP BY append of alert_rule->formulas
+ protected $fillable = ['alert_rule_id', 'measurement_id', 'calculation', 'comparator', 'comparison', 'logical', 'period_minutes', 'threshold_value', 'future'];
+
+ protected $hidden = [];
+
+ protected $casts = ['future' => 'boolean'];
+ // protected $appends = ['calculation_minutes']; // CAUSES LOOP BY append of alert_rule->formulas
+
+ public static $calculations = ['min' => 'Minimum', 'max' => 'Maximum', 'ave' => 'Average', 'cnt' => 'Count']; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
- public static $calculations = ["min"=>"Minimum", "max"=>"Maximum", "ave"=>"Average", "cnt"=>"Count"]; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
- public static $comparators = ["="=>"equal_to", "<"=>"less_than", ">"=>"greater_than", "<="=>"less_than_or_equal", ">="=>"greater_than_or_equal"];
- public static $comparisons = ["val"=>"Value", "inc"=>"Increase", "dec"=>"Decrease", "abs_dif"=>"Absolute_value_of_dif"]; // exclude "abs"=>"Absolute_value","dif"=>"Difference" because it has no usecase
- public static $logicals = ["or"=>"Or", "and"=>"And"];
-
+ public static $comparators = ['=' => 'equal_to', '<' => 'less_than', '>' => 'greater_than', '<=' => 'less_than_or_equal', '>=' => 'greater_than_or_equal'];
+
+ public static $comparisons = ['val' => 'Value', 'inc' => 'Increase', 'dec' => 'Decrease', 'abs_dif' => 'Absolute_value_of_dif']; // exclude "abs"=>"Absolute_value","dif"=>"Difference" because it has no usecase
+
+ public static $logicals = ['or' => 'Or', 'and' => 'And'];
public function alert_rule()
{
return $this->belongsTo(AlertRule::class);
}
+
public function measurement()
{
return $this->belongsTo(Measurement::class);
@@ -55,19 +59,22 @@ public function user()
return $this->alert_rule->user();
}
- public function user_devices($include_shared=true)
+ public function user_devices($include_shared = true)
{
- if ($include_shared)
+ if ($include_shared) {
return $this->user->allDevices()->get();
+ }
return $this->user->devices;
}
+
public function getCalculationMinutesAttribute()
{
$ar = $this->alert_rule;
- if ($ar)
+ if ($ar) {
return $ar->calculation_minutes;
+ }
return null;
@@ -78,157 +85,152 @@ public function getUnit()
return $this->calculation == 'cnt' || $this->calculation == 'der' || $this->measurement->unit == '-' ? '' : ''.$this->measurement->unit;
}
- public function getPq($abbr=false)
+ public function getPq($abbr = false)
{
$loc = LaravelLocalization::getCurrentLocale();
- $pq = '';
+ $pq = '';
- if (isset($this->measurement_id) && isset($this->measurement->physical_quantity))
- {
+ if (isset($this->measurement_id) && isset($this->measurement->physical_quantity)) {
$pq = $this->measurement->physical_quantity;
- return Cache::remember('ar-'.$this->id.'-pq-name-'.$loc, env('CACHE_TIMEOUT_LONG'), function () use ($loc, $pq, $abbr)
- {
- if ($this->calculation == 'der' || !isset($pq))
- {
+
+ return Cache::remember('ar-'.$this->id.'-pq-name-'.$loc, env('CACHE_TIMEOUT_LONG'), function () use ($pq, $abbr) {
+ if ($this->calculation == 'der' || ! isset($pq)) {
return '';
- }
- elseif (isset($pq))
- {
- if ($abbr)
+ } elseif (isset($pq)) {
+ if ($abbr) {
return $pq->abbreviation;
- else
+ } else {
return $pq->transName();
+ }
}
return '';
});
}
+
return '';
}
- public function readableFunction($short=false, $value=null)
+ public function readableFunction($short = false, $value = null)
{
- $arf = $this;
- $user = $arf->user;
- $locales = config('laravellocalization.supportedLocales');
- $locale = $user && isset($locales[$user->locale]) ? $user->locale : LaravelLocalization::getCurrentLocale();
-
- $pq_name = isset($m_abbr) ? Translation::get($locale, $m_abbr, 'measurement') : $arf->getPq();
- $unit = $arf->getUnit();
- $direct = $arf->calculation_minutes == 0 ? true : false;
- $calc = $direct ? '' : ''.__('beep.'.$arf->calculation).' '; // min / max / average / count
+ $arf = $this;
+ $user = $arf->user;
+ $locales = config('laravellocalization.supportedLocales');
+ $locale = $user && isset($locales[$user->locale]) ? $user->locale : LaravelLocalization::getCurrentLocale();
+
+ $pq_name = isset($m_abbr) ? Translation::get($locale, $m_abbr, 'measurement') : $arf->getPq();
+ $unit = $arf->getUnit();
+ $direct = $arf->calculation_minutes == 0 ? true : false;
+ $calc = $direct ? '' : ''.__('beep.'.$arf->calculation).' '; // min / max / average / count
$comparison = $arf->comparison == 'val' ? '' : ' '.__('beep.'.$arf->comparison); // value (not shown) / increase / difference
- $cnt_zero = $arf->calculation == 'cnt' && ($value === 0 || $arf->threshold_value == 0) ? true : false;
- $text_zero = ucfirst(__('beep.cnt_zero')).' '; // Absence of
+ $cnt_zero = $arf->calculation == 'cnt' && ($value === 0 || $arf->threshold_value == 0) ? true : false;
+ $text_zero = ucfirst(__('beep.cnt_zero')).' '; // Absence of
$calc_trans = $direct ? '' : ($cnt_zero ? $text_zero : $calc.$comparison); // Absence of / average value
// alert function with value
- if ($value != null)
- {
- if ($cnt_zero)
+ if ($value != null) {
+ if ($cnt_zero) {
return ucfirst($calc_trans).$pq_name.__('beep.values');
- else
- return ucfirst($calc_trans).' '.$pq_name.' = '.$value.$unit."\n(".$arf->comparator.' '.$arf->threshold_value.$unit.')'; // value Temperature average value = 10.3°C
+ } else {
+ return ucfirst($calc_trans).' '.$pq_name.' = '.$value.$unit."\n(".$arf->comparator.' '.$arf->threshold_value.$unit.')';
+ } // value Temperature average value = 10.3°C
}
// alert function for logging
- if ($short)
+ if ($short) {
return $arf->getPq(true).' '.$calc.$arf->comparison.' '.$arf->comparator.' '.$arf->threshold_value.$unit;
+ }
// alert function without value (for alert rule display)
- if ($cnt_zero)
- return ucfirst($calc_trans).$pq_name.__('beep.values'); // Absence of Temperature values
+ if ($cnt_zero) {
+ return ucfirst($calc_trans).$pq_name.__('beep.values');
+ } // Absence of Temperature values
return $pq_name.' '.$calc_trans.__('beep.'.$arf->comparison).' '.$arf->comparator.' '.$arf->threshold_value.$unit; // Temperature average value = 10.3°C
}
// for selected measurement, get data and evaluate formula on data
- public function evaluateFormula($data_array=null, $log_on=false)
+ public function evaluateFormula($data_array = null, $log_on = false)
{
$f = $this;
// Check measurement source, if source != db_influx, only allow comparison == val
- $diff_comp = $f->comparison == 'dif' || $f->comparison == 'abs_dif' || $f->comparison == 'inc' || $f->comparison == 'dec' ? true : false;
- $m_abbr = $f->measurement->abbreviation;
+ $diff_comp = $f->comparison == 'dif' || $f->comparison == 'abs_dif' || $f->comparison == 'inc' || $f->comparison == 'dec' ? true : false;
+ $m_abbr = $f->measurement->abbreviation;
$influx_func = AlertRule::$influx_calc[$f->calculation];
- $limit = $diff_comp ? $f->alert_on_occurences + 1 : $f->alert_on_occurences; // one extra for diff calculation
+ $limit = $diff_comp ? $f->alert_on_occurences + 1 : $f->alert_on_occurences; // one extra for diff calculation
$direct_data = isset($data_array) && count($data_array) > 0 && isset($data_array[0][$m_abbr]) ? true : false;
- if ($direct_data)
- $last_val_inf= ['values'=>$data_array, 'query'=>'', 'from'=>'measurement', 'min_ago'=>0];
- else
- $last_val_inf= $d->getAlertSensorValues($m_abbr, $influx_func, $f->calculation_minutes, $limit); // provides: ['values'=>$values,'query'=>$query, 'from'=>'cache', 'min_ago'=>$val_min_ago]
+ if ($direct_data) {
+ $last_val_inf = ['values' => $data_array, 'query' => '', 'from' => 'measurement', 'min_ago' => 0];
+ } else {
+ $last_val_inf = $d->getAlertSensorValues($m_abbr, $influx_func, $f->calculation_minutes, $limit);
+ } // provides: ['values'=>$values,'query'=>$query, 'from'=>'cache', 'min_ago'=>$val_min_ago]
- if ($last_val_inf['min_ago'] > $f->calculation_minutes)
- {
- if($log_on)
+ if ($last_val_inf['min_ago'] > $f->calculation_minutes) {
+ if ($log_on) {
Log::debug($debug_start.' Not evaluating, data from '.$last_val_inf['min_ago'].'m ago is longer ago than '.$f->calculation_minutes.'m (calc min)');
+ }
+
return 0;
}
- $last_values = $last_val_inf['values'];
- $alert_count = 0;
+ $last_values = $last_val_inf['values'];
+ $alert_count = 0;
$evaluation_count = 0;
- $alert_function = '';
- $alert_values = [];
+ $alert_function = '';
+ $alert_values = [];
$last_values_data = [];
$last_value_count = $diff_comp ? count($last_values) - 1 : min($f->alert_on_occurences, count($last_values));
$alert_on_no_vals = $f->calculation == 'cnt' && $f->threshold_value == 0 ? true : false;
- if ($last_value_count > 0 || $alert_on_no_vals)
- {
- //Log::debug(json_encode(['r'=>$f->name, 'd'=>$d->name, 'lv'=>$last_values, 'mve'=>$last_value_count]));
+ if ($last_value_count > 0 || $alert_on_no_vals) {
+ // Log::debug(json_encode(['r'=>$f->name, 'd'=>$d->name, 'lv'=>$last_values, 'mve'=>$last_value_count]));
// evaluate measurement values
- if ($last_value_count > 0)
- {
- for ($i=0; $i < $last_value_count; $i++) // start with most recent value (ordered desc on time)
- {
- if (!isset($last_values[$i][$m_abbr]))
- {
+ if ($last_value_count > 0) {
+ for ($i = 0; $i < $last_value_count; $i++) { // start with most recent value (ordered desc on time)
+ if (! isset($last_values[$i][$m_abbr])) {
continue;
- }
- else
- {
+ } else {
$value = $last_values[$i][$m_abbr];
// Save last calc values for reference
- $key = $m_abbr.'_'.$i;
- if (isset($last_values[$i]['time']))
+ $key = $m_abbr.'_'.$i;
+ if (isset($last_values[$i]['time'])) {
$key = $last_values[$i]['time'];
-
+ }
+
$last_values_data["$key"] = $value;
// Continue if unset
- if (!isset($value) || $value == '' || $value == 'null')
+ if (! isset($value) || $value == '' || $value == 'null') {
continue;
+ }
}
-
+
$value_prev = null;
- if ($i+1 < count($last_values) && isset($last_values[$i+1][$m_abbr]))
- {
- $value_prev = $last_values[$i+1][$m_abbr];
+ if ($i + 1 < count($last_values) && isset($last_values[$i + 1][$m_abbr])) {
+ $value_prev = $last_values[$i + 1][$m_abbr];
// Save last calc values for reference
- if ($diff_comp && $i == $last_value_count-1)
- {
- //die(print_r([$i,$m_abbr]));
- $key = $m_abbr.'_'.($i+1);
- if (isset($last_values[$i+1]['time']))
- $key = $last_values[$i+1]['time'];
+ if ($diff_comp && $i == $last_value_count - 1) {
+ // die(print_r([$i,$m_abbr]));
+ $key = $m_abbr.'_'.($i + 1);
+ if (isset($last_values[$i + 1]['time'])) {
+ $key = $last_values[$i + 1]['time'];
+ }
$last_values_data["$key"] = $value_prev;
}
// Continue if unset
- if (!isset($value_prev) || $value_prev == '' || $value_prev == 'null')
+ if (! isset($value_prev) || $value_prev == '' || $value_prev == 'null') {
continue;
+ }
}
-
// Calculate value for rule
$calc = null;
- if ($diff_comp)
- {
- switch($f->comparison)
- {
+ if ($diff_comp) {
+ switch ($f->comparison) {
case 'inc':
case 'dif':
$calc = $value - $value_prev;
@@ -240,120 +242,106 @@ public function evaluateFormula($data_array=null, $log_on=false)
$calc = abs($value - $value_prev);
break;
}
- }
- else
- {
+ } else {
$calc = $value;
}
- if (is_nan($calc))
+ if (is_nan($calc)) {
continue;
+ }
- $calc = round($calc, 1); // round to 1 decimal, just like the threshold_value
+ $calc = round($calc, 1); // round to 1 decimal, just like the threshold_value
$thres = round($f->threshold_value, 1);
-
+
$evaluation = false;
- switch($f->comparator)
- {
+ switch ($f->comparator) {
case '=':
$evaluation = $calc == $thres ? true : false;
break;
case '<':
$evaluation = $calc < $thres ? true : false;
- break;
+ break;
case '>':
$evaluation = $calc > $thres ? true : false;
- break;
+ break;
case '<=':
$evaluation = $calc <= $thres ? true : false;
- break;
+ break;
case '>=':
$evaluation = $calc >= $thres ? true : false;
- break;
+ break;
}
- if ($evaluation)
- {
+ if ($evaluation) {
$evaluation_count++;
$alert_values[] = $calc;
}
}
- }
- else if ($alert_on_no_vals && $last_value_count == 0)
- {
+ } elseif ($alert_on_no_vals && $last_value_count == 0) {
$evaluation_count = $f->alert_on_occurences;
- for ($i=0; $i < $evaluation_count; $i++)
- {
- $alert_values[] = 0; // alert on 0 value count
+ for ($i = 0; $i < $evaluation_count; $i++) {
+ $alert_values[] = 0; // alert on 0 value count
$last_values_data[] = 0;
}
}
// check if alert should be made
- if ($evaluation_count >= $f->alert_on_occurences)
- {
+ if ($evaluation_count >= $f->alert_on_occurences) {
// check if same alert was created at last alert of this alert_rule
$alert_counter = 1; // # of occurrences in a row
- $a = null;
- $check_alert = null;
- $device_min = $d->getRefreshMin()*2; // do not create new alert on every 1 missing value
- $alerts_min_max= max($f->calculation_minutes, $parse_min, $device_min)+1; // the higher, the earlier the $alerts_after, the more alerts are matching
- $alerts_after = date('Y-m-d H:i:s', time()-60*$alerts_min_max); // a bit less than alerts_min_max ago
- //die(print_r(['am'=>$alerts_min_max, 'cm'=>$f->calculation_minutes, 'pm'=>$parse_min, 'dm'=>$device_min]));
- if ($alerts_after)
+ $a = null;
+ $check_alert = null;
+ $device_min = $d->getRefreshMin() * 2; // do not create new alert on every 1 missing value
+ $alerts_min_max = max($f->calculation_minutes, $parse_min, $device_min) + 1; // the higher, the earlier the $alerts_after, the more alerts are matching
+ $alerts_after = date('Y-m-d H:i:s', time() - 60 * $alerts_min_max); // a bit less than alerts_min_max ago
+ // die(print_r(['am'=>$alerts_min_max, 'cm'=>$f->calculation_minutes, 'pm'=>$parse_min, 'dm'=>$device_min]));
+ if ($alerts_after) {
$check_alert = $d->alerts()->where('user_id', $u->id)->where('alert_rule_id', $f->id)->where('device_id', $d->id)->where('updated_at', '>=', $alerts_after)->orderBy('updated_at', 'desc')->first();
-
- if ($check_alert) // check if user already has this alert, if so, update it if diff value is bigger
- {
+ }
+
+ if ($check_alert) { // check if user already has this alert, if so, update it if diff value is bigger
$newest_alert_value = $alert_values[0];
- $value_diff_new = abs($newest_alert_value - $f->threshold_value);
+ $value_diff_new = abs($newest_alert_value - $f->threshold_value);
$value_diff_old_max = 0;
-
+
$old_alert_values = explode(', ', $check_alert->alert_value);
- foreach ($old_alert_values as $v)
+ foreach ($old_alert_values as $v) {
$value_diff_old_max = max($value_diff_old_max, abs($v - $f->threshold_value));
+ }
$alert_counter = $check_alert->count + 1;
// update attributes that could be changed over time
- $check_alert->updated_at = $alert_rule_calc_date;
+ $check_alert->updated_at = $alert_rule_calc_date;
$check_alert->alert_function = $f->readableFunction();
$check_alert->measurement_id = $f->measurement_id;
- $check_alert->location_id = $d->hive ? $d->hive->location_id : null;
- $check_alert->location_name = $d->location_name;
- $check_alert->device_name = $d->name;
- $check_alert->hive_id = $d->hive_id;
- $check_alert->hive_name = $d->hive_name;
- $check_alert->count = $alert_counter;
-
- if ($value_diff_new > $value_diff_old_max) // update the existing alert with new (higher diff) value and trigger e-mail
- {
- $check_alert->alert_value = implode(', ', $alert_values);
+ $check_alert->location_id = $d->hive ? $d->hive->location_id : null;
+ $check_alert->location_name = $d->location_name;
+ $check_alert->device_name = $d->name;
+ $check_alert->hive_id = $d->hive_id;
+ $check_alert->hive_name = $d->hive_name;
+ $check_alert->count = $alert_counter;
+
+ if ($value_diff_new > $value_diff_old_max) { // update the existing alert with new (higher diff) value and trigger e-mail
+ $check_alert->alert_value = implode(', ', $alert_values);
$check_alert->alert_function = $f->readableFunction(false, $check_alert->alert_value);
- $a = $check_alert;
-
- if($log_on)
- {
- $alert_comp = $f->comparator == '=' ? '==' : '!=';
- $diff_expla = ', Thr='.$f->threshold_value.' diff_new='.$value_diff_new.' > diff_old='.$value_diff_old_max;
+ $a = $check_alert;
+
+ if ($log_on) {
+ $alert_comp = $f->comparator == '=' ? '==' : '!=';
+ $diff_expla = ', Thr='.$f->threshold_value.' diff_new='.$value_diff_new.' > diff_old='.$value_diff_old_max;
Log::debug($debug_start.' Update Alert id='.$check_alert->id.' count='.$alert_counter.', v_new='.$newest_alert_value.' '.$alert_comp.' v_last='.$check_alert->alert_value.$diff_expla.', from: '.$last_val_inf['from']);
}
- }
- else // only update count of existing alert
- {
+ } else { // only update count of existing alert
$check_alert->alert_function = $f->readableFunction(false, $check_alert->alert_value);
- if($log_on)
- {
- if ($value_diff_new == $value_diff_old_max)
- {
- $alert_compv= '==';
+ if ($log_on) {
+ if ($value_diff_new == $value_diff_old_max) {
+ $alert_compv = '==';
$alert_comp = '==';
$diff_expla = '';
- }
- else
- {
- $alert_compv= '!=';
+ } else {
+ $alert_compv = '!=';
$alert_comp = '<';
$diff_expla = ', Thr='.$f->threshold_value.' diff_new='.$value_diff_new.' '.$alert_comp.' diff_old='.$value_diff_old_max;
}
@@ -362,80 +350,74 @@ public function evaluateFormula($data_array=null, $log_on=false)
}
}
$check_alert->save();
- }
- else // no previous alerts, so create
- {
+ } else { // no previous alerts, so create
$alert_value = implode(', ', $alert_values);
- $alert_func = $f->readableFunction(false, $alert_value);
+ $alert_func = $f->readableFunction(false, $alert_value);
- if($log_on)
+ if ($log_on) {
Log::debug($debug_start.' Create new Alert, v='.$alert_value.', eval_count='.$evaluation_count.' alert_count='.$alert_counter.' f='.$f->readableFunction(true).', from: '.$last_val_inf['from']);
+ }
- $a = new Alert();
- $a->created_at = $alert_rule_calc_date;
- $a->updated_at = $alert_rule_calc_date;
- $a->alert_rule_id = $f->id;
+ $a = new Alert;
+ $a->created_at = $alert_rule_calc_date;
+ $a->updated_at = $alert_rule_calc_date;
+ $a->alert_rule_id = $f->id;
$a->alert_function = $alert_func;
- $a->alert_value = $alert_value;
+ $a->alert_value = $alert_value;
$a->measurement_id = $f->measurement_id;
- $a->location_id = $d->hive ? $d->hive->location_id : null;
- $a->location_name = $d->location_name;
- $a->device_id = $d->id;
- $a->device_name = $d->name;
- $a->hive_id = $d->hive_id;
- $a->hive_name = $d->hive_name;
- $a->user_id = $u->id;
- $a->count = $alert_counter;
+ $a->location_id = $d->hive ? $d->hive->location_id : null;
+ $a->location_name = $d->location_name;
+ $a->device_id = $d->id;
+ $a->device_name = $d->name;
+ $a->hive_id = $d->hive_id;
+ $a->hive_name = $d->hive_name;
+ $a->user_id = $u->id;
+ $a->count = $alert_counter;
$a->save();
}
-
- $alert_count++;
+ $alert_count++;
- if ($a && $f->alert_via_email)
- {
+ if ($a && $f->alert_via_email) {
$last_values_string = null;
- if ($diff_comp)
- {
- $last_values_data = array_reverse($last_values_data); // for
- $last_values_array= [];
- foreach ($last_values_data as $key => $value)
- {
+ if ($diff_comp) {
+ $last_values_data = array_reverse($last_values_data); // for
+ $last_values_array = [];
+ foreach ($last_values_data as $key => $value) {
$last_values_array[] = round($value, 1);
}
- $last_values_string = implode(' -> ',$last_values_array).$f->getUnit();
+ $last_values_string = implode(' -> ', $last_values_array).$f->getUnit();
}
// Set locale for date
- $created_date = gettype($a->created_at) == 'string' ? $a->created_at : $a->created_at->toDateTimeString();
+ $created_date = gettype($a->created_at) == 'string' ? $a->created_at : $a->created_at->toDateTimeString();
$created_date_local = new Moment($created_date, 'UTC');
- $locale_array = config('laravellocalization.supportedLocales');
- $locale_identifier = isset($locale_array[$u->locale]) ? $locale_array[$u->locale]['regional'] : null;
+ $locale_array = config('laravellocalization.supportedLocales');
+ $locale_identifier = isset($locale_array[$u->locale]) ? $locale_array[$u->locale]['regional'] : null;
- if ($locale_identifier)
+ if ($locale_identifier) {
\Moment\Moment::setLocale($locale_identifier);
+ }
- $display_date_local = $created_date_local->setTimezone($f->timezone)->format('LLLL', new \Moment\CustomFormats\MomentJs());
-
- if ($locale_identifier) // reset global locale
+ $display_date_local = $created_date_local->setTimezone($f->timezone)->format('LLLL', new \Moment\CustomFormats\MomentJs);
+
+ if ($locale_identifier) { // reset global locale
\Moment\Moment::setLocale('en_GB');
-
- if($log_on)
+ }
+
+ if ($log_on) {
Log::debug($debug_start.' Updated or created Alert, sending email to '.$u->email);
+ }
Mail::to($u->email)->send(new AlertMail($a, $u->name, $last_values_string, $display_date_local));
}
- }
- else if($log_on)
- {
+ } elseif ($log_on) {
Log::debug($debug_start.' evaluation_count='.$evaluation_count.'x (< '.$f->alert_on_occurences.'x), from: '.$last_val_inf['from'].', last_values='.json_encode($last_values_data));
}
- }
- else if($log_on)
- {
+ } elseif ($log_on) {
Log::debug($debug_start.' last_value_count=0, from: '.$last_val_inf['from'].', query: '.$last_val_inf['query']);
}
-
+
return $alert_count;
}
}
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 027b95bc..0ebe5d3f 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -2,15 +2,13 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
use App\Device;
use App\Measurement;
-use App\Models\AlertRuleFormula;
-use Moment\Moment;
-use GuzzleHttp\Exception\GuzzleException;
+use Cache;
use GuzzleHttp\Client;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
-use Cache;
+use Moment\Moment;
class CalculationModel extends Model
{
@@ -22,10 +20,10 @@ class CalculationModel extends Model
protected $table = 'calculation_models';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -34,7 +32,8 @@ class CalculationModel extends Model
* @var array
*/
protected $fillable = ['name', 'measurement_id', 'data_measurement_id', 'data_interval', 'data_relative_interval', 'data_interval_index', 'data_api_url', 'data_api_http_request', 'data_last_call', 'calculation', 'repository_url', 'data_interval_amount', 'calculation_interval_minutes'];
- protected $casts = ['data_relative_interval'=>'boolean'];
+
+ protected $casts = ['data_relative_interval' => 'boolean'];
/**
* Model properties:
@@ -49,21 +48,22 @@ class CalculationModel extends Model
* data_last_call timest Timestamp of last request
* calculation enum internal/api/lambda
* repository_url str Description of the current model
- * data_processing_function str Name of the function to post process the data before
+ * data_processing_function str Name of the function to post process the data before
* data_interval_amount int Amount of data intervals to fetch
* calculation_interval_minutes int Prefered calculation interval
*/
// Internal or external model calculation type
- public static $request_types= ["GET"=>"GET request", "POST"=>"POST request"];
- public static $calculations = ["model_cumulative_daily_weight_anomaly"=>"Cumulative daily hive weight anomaly",
- "model_colony_failure_weight_history"=>"Colony failure weight history (AWS Lambda)"];
+ public static $request_types = ['GET' => 'GET request', 'POST' => 'POST request'];
+ public static $calculations = ['model_cumulative_daily_weight_anomaly' => 'Cumulative daily hive weight anomaly',
+ 'model_colony_failure_weight_history' => 'Colony failure weight history (AWS Lambda)'];
public function input_measurement()
{
return $this->belongsTo(Measurement::class, 'data_measurement_id');
}
+
public function measurement()
{
return $this->belongsTo(Measurement::class);
@@ -71,47 +71,40 @@ public function measurement()
public function run_model($user)
{
- $model_result = ['error'=>'empty result'];
-
- if ($user)
- {
+ $model_result = ['error' => 'empty result'];
+
+ if ($user) {
$interval_array = $this->interval_array();
- $model_result = ['user'=>$user->name, 'interval_array'=>$interval_array];
-
- switch($this->calculation)
- {
+ $model_result = ['user' => $user->name, 'interval_array' => $interval_array];
+
+ switch ($this->calculation) {
case 'model_cumulative_daily_weight_anomaly':
$devices = $user->allDevices()->get();
- if ($devices->count() > 0)
- {
+ if ($devices->count() > 0) {
// get data arrays per apiary ()
$apiaries = $devices->groupBy('location_name');
$model_result['devices'] = $devices->count();
- foreach ($apiaries as $apiary_name => $hive_devices)
- {
+ foreach ($apiaries as $apiary_name => $hive_devices) {
$model_result[$apiary_name] = [];
$model_result[$apiary_name]['hives'] = $hive_devices->count();
$apiary_data = [];
$has_data = false;
- foreach ($hive_devices as $device)
- {
+ foreach ($hive_devices as $device) {
$model_result[$apiary_name][$device->name] = [];
-
+
$apiary_data = $this->addDeviceCleanWeight($apiary_data, $device, $interval_array);
- if (isset($apiary_data['query']))
- {
+ if (isset($apiary_data['query'])) {
$model_result[$apiary_name][$device->name]['query'] = $apiary_data['query'];
- }
- else if (count($apiary_data) > 0)
- {
+ } elseif (count($apiary_data) > 0) {
$has_data = true;
}
}
- if ($has_data){
+ if ($has_data) {
$model_result[$apiary_name]['apiary_data'] = $apiary_data;
- $model_result[$apiary_name]['api_result'] = $this->model_cumulative_daily_weight_anomaly($apiary_data);
+ $model_result[$apiary_name]['api_result'] = $this->model_cumulative_daily_weight_anomaly($apiary_data);
+
return $model_result; // TODO: remove after it works
}
}
@@ -121,32 +114,27 @@ public function run_model($user)
case 'model_colony_failure_weight_history':
// Send 240 cumulative weight values in a flat array
$devices = $user->allDevices()->get();
- if ($devices->count() > 0)
- {
+ if ($devices->count() > 0) {
// get data arrays per apiary ()
$apiaries = $devices->groupBy('location_name');
$model_result['devices'] = $devices->count();
- foreach ($apiaries as $apiary_name => $hive_devices)
- {
+ foreach ($apiaries as $apiary_name => $hive_devices) {
$model_result[$apiary_name] = [];
$model_result[$apiary_name]['hives'] = $hive_devices->count();
$has_data = false;
- foreach ($hive_devices as $device)
- {
+ foreach ($hive_devices as $device) {
$model_result[$apiary_name][$device->name] = [];
-
+
$device_data = [];
$device_data = $this->addDeviceCleanWeight($device_data, $device, $interval_array);
- if (isset($device_data['query']))
- {
+ if (isset($device_data['query'])) {
$model_result[$apiary_name][$device->name]['query'] = $device_data['query'];
- }
- else if (count($device_data) > 0)
- {
+ } elseif (count($device_data) > 0) {
$has_data = true;
- $model_result[$apiary_name][$device->name]['api_result'] = $this->model_colony_failure_weight_history($device_data);
+ $model_result[$apiary_name][$device->name]['api_result'] = $this->model_colony_failure_weight_history($device_data);
+
return $model_result; // TODO: remove after it works
}
}
@@ -157,6 +145,7 @@ public function run_model($user)
// No calculation
}
}
+
return $model_result;
}
@@ -171,7 +160,7 @@ private function model_cumulative_daily_weight_anomaly($apiary_weight_data_array
// Send data to external model Lambda in JSON POST format
// http://calculation.beep.nl:8080/cumulative_weight_anomaly
$model_result_json = $this->callApi($apiary_weight_data_arrays);
-
+
return $model_result_json;
}
@@ -182,132 +171,120 @@ private function model_colony_failure_weight_history($data_arrays)
$weight_array = [];
// transform from 240 timestamps + values to single array of 240 values
- foreach ($data_arrays as $data_array)
- {
- if (isset($data_array['net_weight_kg']))
+ foreach ($data_arrays as $data_array) {
+ if (isset($data_array['net_weight_kg'])) {
$weight_array[] = $data_array['net_weight_kg'];
+ }
}
- $model_result_json = $this->callApi(['weights'=>$weight_array]);
+ $model_result_json = $this->callApi(['weights' => $weight_array]);
return $model_result_json * 100;
}
-
// Calculate relevant start/end time interval
private function interval_array()
{
- $relative_interval = $this->data_relative_interval;
- $interval_char = substr($this->data_interval, -1); // m, h, d, w, etc
- $index = $this->data_interval_index;
- $interval_count = $this->data_interval_amount;
- $timeZone = 'UTC';
- $interval = 'day';
- $total_minutes = 1440;
- $timeFormat = 'Y-m-d H:i:s';
-
- switch($interval_char)
- {
- case "m":
+ $relative_interval = $this->data_relative_interval;
+ $interval_char = substr($this->data_interval, -1); // m, h, d, w, etc
+ $index = $this->data_interval_index;
+ $interval_count = $this->data_interval_amount;
+ $timeZone = 'UTC';
+ $interval = 'day';
+ $total_minutes = 1440;
+ $timeFormat = 'Y-m-d H:i:s';
+
+ switch ($interval_char) {
+ case 'm':
$total_minutes = $interval_count;
- $interval = 'minute';
- break;
- case "h":
- $total_minutes = $interval_count*60;
- $interval = 'hour';
+ $interval = 'minute';
+ break;
+ case 'h':
+ $total_minutes = $interval_count * 60;
+ $interval = 'hour';
break;
- case "d":
- $total_minutes = $interval_count*24*60;
- $interval = 'day';
+ case 'd':
+ $total_minutes = $interval_count * 24 * 60;
+ $interval = 'day';
break;
- case "w":
- $total_minutes = $interval_count*24*60*7;
- $interval = 'week';
+ case 'w':
+ $total_minutes = $interval_count * 24 * 60 * 7;
+ $interval = 'week';
break;
}
- // Calculate start/end based on
+ // Calculate start/end based on
$staTimestamp = new Moment(null, $timeZone);
$endTimestamp = new Moment(null, $timeZone);
-
+
// set start/end of interval
$staIndex = $index;
$endIndex = $index;
- if ($relative_interval)
+ if ($relative_interval) {
$staIndex += 1;
+ }
- $staTimestamp->subtractMinutes($staIndex*$total_minutes);
- $endTimestamp->subtractMinutes($endIndex*$total_minutes);
+ $staTimestamp->subtractMinutes($staIndex * $total_minutes);
+ $endTimestamp->subtractMinutes($endIndex * $total_minutes);
// Relative
- if ($relative_interval)
- {
+ if ($relative_interval) {
// $start = $staTimestamp->setTimezone('UTC')->format($timeFormat);
// $end = $endTimestamp->setTimezone('UTC')->format($timeFormat);
$start = $staTimestamp->startOf($interval)->setTimezone('UTC')->format($timeFormat);
- $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($timeFormat);
- }
- else // absolute time intervals
- {
+ $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($timeFormat);
+ } else { // absolute time intervals
$start = $staTimestamp->startOf($interval)->setTimezone('UTC')->format($timeFormat);
- $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($timeFormat);
+ $end = $endTimestamp->endOf($interval)->setTimezone('UTC')->format($timeFormat);
}
- return ['start'=>$start, 'end'=>$end, 'interval'=>$interval, 'relative_interval'=>$relative_interval, 'index'=>$index, 'total_minutes'=>$total_minutes, 'timeZone'=>$timeZone];
+ return ['start' => $start, 'end' => $end, 'interval' => $interval, 'relative_interval' => $relative_interval, 'index' => $index, 'total_minutes' => $total_minutes, 'timeZone' => $timeZone];
}
// Add device clean weight to data array
private function addDeviceCleanWeight($apiary_data, $device, $interval_array)
{
- //$cleanWeight_query = $device -> getCleanedWeightQuery($this->data_interval, $interval_array['start'], $interval_array['end']); // getCleanedWeightQuery($resolution, $start_date, $end_date, $limit=5000, $threshold=0.75, $frame=2, $timeZone='UTC')
-
- $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
+ // $cleanWeight_query = $device -> getCleanedWeightQuery($this->data_interval, $interval_array['start'], $interval_array['end']); // getCleanedWeightQuery($resolution, $start_date, $end_date, $limit=5000, $threshold=0.75, $frame=2, $timeZone='UTC')
+
+ $fill = env('INFLUX_FILL') !== null ? env('INFLUX_FILL') : 'null';
$groupByResolution = 'GROUP BY time('.$this->data_interval.') fill('.$fill.')';
- $whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$interval_array['start'].'\' AND time <= \''.$interval_array['end'].'\'';
- $name = "weight_$device->id";
+ $whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$interval_array['start'].'\' AND time <= \''.$interval_array['end'].'\'';
+ $name = "weight_$device->id";
$cleanWeight_query = 'SELECT MEAN("weight_kg") as "'.$name.'" FROM "sensors" WHERE '.$whereKeyAndTime.' '.$groupByResolution.' LIMIT '.$this->data_interval_amount;
- $cleanWeight_out = Cache::remember($cleanWeight_query, env('CACHE_TIMEOUT_LONG'), function () use ($cleanWeight_query)
- {
+ $cleanWeight_out = Cache::remember($cleanWeight_query, env('CACHE_TIMEOUT_LONG'), function () use ($cleanWeight_query) {
return Device::getInfluxQuery($cleanWeight_query, 'alert');
});
- if (count($cleanWeight_out) > 0)
- {
- //dd(['ccw' => count($cleanWeight_out), 'so' => count($cleanWeight_out)]);
-
- if (count($cleanWeight_out) == (count($apiary_data)+1))
- {
+ if (count($cleanWeight_out) > 0) {
+ // dd(['ccw' => count($cleanWeight_out), 'so' => count($cleanWeight_out)]);
+
+ if (count($cleanWeight_out) == (count($apiary_data) + 1)) {
array_shift($cleanWeight_out);
}
-
- if (count($apiary_data) == 0)
- {
+
+ if (count($apiary_data) == 0) {
$apiary_data = $cleanWeight_out;
- }
- else
- {
- if (count($cleanWeight_out) == count($apiary_data))
- {
- foreach ($apiary_data as $key => $value)
- {
- foreach ($cleanWeight_out[$key] as $name => $value)
- {
- if ($name != 'time')
- $apiary_data[$key][$name] = $value;
+ } else {
+ if (count($cleanWeight_out) == count($apiary_data)) {
+ foreach ($apiary_data as $key => $value) {
+ foreach ($cleanWeight_out[$key] as $name => $value) {
+ if ($name != 'time') {
+ $apiary_data[$key][$name] = $value;
+ }
}
}
}
}
-
+
}
// else
// {
// $apiary_data['query'] = $cleanWeight_query;
// }
- //dd(['cleanWeight_out'=> count($cleanWeight_out), 'apiary_data' => count($apiary_data), 'sensor_query' => $sensorQuery, 'cleanWeight_query' => $cleanWeight_query, 'cleanWeight_out'=>$cleanWeight_out, 'apiary_data'=>$apiary_data]);
-
+ // dd(['cleanWeight_out'=> count($cleanWeight_out), 'apiary_data' => count($apiary_data), 'sensor_query' => $sensorQuery, 'cleanWeight_query' => $cleanWeight_query, 'cleanWeight_out'=>$cleanWeight_out, 'apiary_data'=>$apiary_data]);
+
return $apiary_data;
}
@@ -316,41 +293,34 @@ private function callApi($data)
{
$out = null;
- if ($data)
- {
- $url = $this->data_api_url;
+ if ($data) {
+ $url = $this->data_api_url;
$type = $this->data_api_http_request == 'POST' ? 'POST' : 'GET';
- $out = ['url'=>$url, 'type'=>$type];
- try
- {
- $guzzle = new Client();
+ $out = ['url' => $url, 'type' => $type];
+ try {
+ $guzzle = new Client;
$response = $guzzle->request($type, $url, ['json' => json_encode($data), 'verify' => true, 'http_errors' => false]);
- if ($response)
- {
+ if ($response) {
$out['status'] = $response->getStatusCode();
- if ($response->getStatusCode() == 200)
- {
+ if ($response->getStatusCode() == 200) {
return json_decode($response->getBody());
- }
- else
- {
- Log::error(['service'=>'CalculationModel::callApi', 'url'=>$url, 'type'=>$type, 'error'=>['body'=>json_decode($response->getBody()), 'code'=>$response->getStatusCode()]]);
+ } else {
+ Log::error(['service' => 'CalculationModel::callApi', 'url' => $url, 'type' => $type, 'error' => ['body' => json_decode($response->getBody()), 'code' => $response->getStatusCode()]]);
$out['body'] = json_decode($response->getBody());
}
}
- }
- catch(\Exception $e)
- {
- Log::error(['service'=>'CalculationModel::callApi', 'url'=>$url, 'type'=>$type, 'error'=>$e->getMessage()]);
+ } catch (\Exception $e) {
+ Log::error(['service' => 'CalculationModel::callApi', 'url' => $url, 'type' => $type, 'error' => $e->getMessage()]);
$out['error'] = $e->getMessage();
}
}
+
return $out;
}
// Boxplot from data array
- public static function calculateBoxplot(array $data): array
+ public static function calculateBoxplot(array $data): array
{
$count = count($data);
@@ -373,12 +343,13 @@ public static function calculateBoxplot(array $data): array
if ($n % 2 === 1) {
return $arr[$mid];
}
+
return ($arr[$mid - 1] + $arr[$mid]) / 2;
};
$min = $data[0];
$max = $data[$count - 1];
- $q2 = $median($data);
+ $q2 = $median($data);
// Build halves in a way that excludes the median when count is odd
if ($count === 1) {
@@ -390,7 +361,7 @@ public static function calculateBoxplot(array $data): array
// For upper half: skip the median if odd; start at intdiv($count,2) for even,
// or intdiv($count,2)+1 for odd.
$upperStart = ($count % 2 === 0) ? intdiv($count, 2) : intdiv($count, 2) + 1;
- $upperHalf = array_slice($data, $upperStart);
+ $upperHalf = array_slice($data, $upperStart);
// median() can return null for empty slices; fallback to overall median $q2
$q1 = $median($lowerHalf) ?? $q2;
@@ -431,27 +402,26 @@ public static function calculateBoxplot(array $data): array
];
}
+ public static function arrayToString($array, string $separator = ', ', string $prefix = '', $not_keys = []): string
+ {
- public static function arrayToString($array, string $separator = ', ', string $prefix = '', $not_keys=[]): string {
-
- if (is_array($array))
- {
+ if (is_array($array)) {
$result = [];
- foreach ($array as $key => $value)
- {
- if (is_array($not_keys) && in_array($key, $not_keys))
+ foreach ($array as $key => $value) {
+ if (is_array($not_keys) && in_array($key, $not_keys)) {
continue;
+ }
$compositeKey = $prefix === '' ? $key : "$prefix.$key";
- if (is_array($value))
- {
+ if (is_array($value)) {
$result[] = self::arrayToString($value, $separator, $compositeKey, $not_keys);
} else {
-
+
$rounded_value = $value;
- if (is_numeric($rounded_value))
+ if (is_numeric($rounded_value)) {
$rounded_value = round($rounded_value, 2);
+ }
$result[] = "$compositeKey: $rounded_value";
}
@@ -460,9 +430,6 @@ public static function arrayToString($array, string $separator = ', ', string $p
return implode($separator, $result);
}
- return '';
+ return '';
}
}
-
-
-
diff --git a/app/Models/ChecklistSvg.php b/app/Models/ChecklistSvg.php
index d44f8490..b3d617a7 100644
--- a/app/Models/ChecklistSvg.php
+++ b/app/Models/ChecklistSvg.php
@@ -2,9 +2,9 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
use App\Checklist;
use App\User;
+use Illuminate\Database\Eloquent\Model;
class ChecklistSvg extends Model
{
@@ -16,10 +16,10 @@ class ChecklistSvg extends Model
protected $table = 'checklist_svgs';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -33,9 +33,9 @@ public function checklist()
{
return $this->belongsTo(Checklist::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
-
}
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index 29e776a7..2ac59a5d 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -2,9 +2,8 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
-
use App\User;
+use Illuminate\Database\Eloquent\Model;
class DashboardGroup extends Model
{
@@ -16,10 +15,10 @@ class DashboardGroup extends Model
protected $table = 'dashboard_groups';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -29,22 +28,23 @@ class DashboardGroup extends Model
*/
protected $fillable = ['user_id', 'code', 'name', 'hive_ids', 'speed', 'interval', 'show_inspections', 'show_all', 'hide_measurements', 'logo_url', 'description'];
- protected $hidden = ['user_id','user','created_at','updated_at'];
-
- protected $casts = ['hive_ids'=>'array'];
+ protected $hidden = ['user_id', 'user', 'created_at', 'updated_at'];
- public static $intervals = ['hour'=>'Hour', 'day'=>'Day', 'week'=>'Week', 'month'=>'Month', 'year'=>'Year', 'selection'=>'Selection'];
+ protected $casts = ['hive_ids' => 'array'];
+
+ public static $intervals = ['hour' => 'Hour', 'day' => 'Day', 'week' => 'Week', 'month' => 'Month', 'year' => 'Year', 'selection' => 'Selection'];
public function hives()
{
- if (is_array($this->hive_ids) && count($this->hive_ids) > 0)
+ if (is_array($this->hive_ids) && count($this->hive_ids) > 0) {
return $this->user->hives()->whereIn('id', $this->hive_ids);
+ }
return collect();
}
+
public function user()
{
return $this->belongsTo(User::class);
}
-
}
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index 693472b5..e1af6b52 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -2,28 +2,29 @@
namespace App\Models;
+use App\Device;
+use App\Hive;
+use App\Measurement;
+use App\Traits\MeasurementLoRaDecoderTrait;
+use App\User;
+use Cache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
-use App\Traits\MeasurementLoRaDecoderTrait;
-
-use App\Hive;
-use App\Device;
-use App\User;
-use App\Measurement;
-use App\Models\CalculationModel;
use Moment\Moment;
use Storage;
-use Cache;
class FlashLog extends Model
{
use MeasurementLoRaDecoderTrait;
-
- protected $precision = 's';
+
+ protected $precision = 's';
+
protected $timeFormat = 'Y-m-d H:i:s';
+
protected $weight_mid = 20;
- protected static $minUnixTime= 1546297200; // min time for Flashlog internal time is: 2019-01-01 00:00:00
+
+ protected static $minUnixTime = 1546297200; // min time for Flashlog internal time is: 2019-01-01 00:00:00
/**
* The database table used by the model.
@@ -33,10 +34,10 @@ class FlashLog extends Model
protected $table = 'flash_logs';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -45,85 +46,98 @@ class FlashLog extends Model
* @var array
*/
protected $fillable = ['user_id', 'device_id', 'hive_id', 'log_messages', 'log_saved', 'log_parsed', 'log_has_timestamps', 'bytes_received', 'log_file', 'log_file_stripped', 'log_file_parsed', 'log_size_bytes', 'log_erased', 'time_percentage', 'persisted_days', 'persisted_measurements', 'persisted_block_ids', 'log_date_start', 'log_date_end', 'logs_per_day', 'csv_url', 'meta_data', 'time_corrections', 'valid_override'];
- protected $hidden = ['device', 'hive', 'user', 'persisted_block_ids'];
- protected $appends = ['device_name', 'hive_name', 'user_name'];
- protected $casts = ['meta_data' => 'array', 'time_corrections'=>'array'];
+ protected $hidden = ['device', 'hive', 'user', 'persisted_block_ids'];
+ protected $appends = ['device_name', 'hive_name', 'user_name'];
+
+ protected $casts = ['meta_data' => 'array', 'time_corrections' => 'array'];
public function hive()
{
return $this->belongsTo(Hive::class);
}
+
public function device()
{
return $this->belongsTo(Device::class)->withTrashed();
}
+
public function user()
{
return $this->belongsTo(User::class);
}
+
public function getDeviceKeyAttribute()
{
$device = $this->device;
- if (isset($device))
+ if (isset($device)) {
return $device->key;
+ }
return null;
}
+
public function getDeviceNameAttribute()
{
$device = $this->device;
- if (isset($device))
+ if (isset($device)) {
return $device->name.' ('.$device->id.')';
+ }
return null;
}
+
public function getHiveNameAttribute()
{
$hive = $this->hive;
- if (isset($hive))
+ if (isset($hive)) {
return $hive->name;
+ }
return null;
}
+
public function getUserNameAttribute()
{
$user = $this->user;
- if (isset($user))
+ if (isset($user)) {
return $user->name;
+ }
return null;
}
-
+
// Get content of log_file, log_file_stripped, or log_file_parsed
- public function getFileSizeBytes($type='log_file')
+ public function getFileSizeBytes($type = 'log_file')
{
- if(isset($this->{$type}))
- {
+ if (isset($this->{$type})) {
$file = $this->getFlashlogStoragePath($this->{$type});
$disk = env('FLASHLOG_STORAGE', 'public');
- if (isset($file) && Storage::disk($disk)->exists($file))
+ if (isset($file) && Storage::disk($disk)->exists($file)) {
return Storage::disk($disk)->size($file);
+ }
}
+
return null;
}
- public function getFileContent($type='log_file')
+ public function getFileContent($type = 'log_file')
{
- if(isset($this->{$type}))
- {
+ if (isset($this->{$type})) {
$file = $this->getFlashlogStoragePath($this->{$type});
$disk = env('FLASHLOG_STORAGE', 'public');
- if (isset($file) && Storage::disk($disk)->exists($file))
+ if (isset($file) && Storage::disk($disk)->exists($file)) {
return Storage::disk($disk)->get($file);
+ }
}
+
return null;
}
private function getFlashlogStoragePath($path)
{
- if (!isset($path) || $path === '') {
+ if (! isset($path) || $path === '') {
return null;
}
@@ -139,17 +153,16 @@ private function getFlashlogStoragePath($path)
public function getPersistedBlockIdsArrayAttribute($value)
{
- if (isset($value) == false)
+ if (isset($value) == false) {
$value = $this->persisted_block_ids;
+ }
$array = [];
- if (isset($value))
- {
+ if (isset($value)) {
$array = explode(',', $value);
- foreach ($array as $key => $value)
- {
+ foreach ($array as $key => $value) {
$array[$key] = intval($value);
}
}
@@ -167,229 +180,222 @@ public function setPersistedBlockIdsArrayAttribute($array)
public function shouldBeParsed()
{
- if ($this->bytes_received > 100 && !isset($this->meta_data['auto_parsed']) &&
+ if ($this->bytes_received > 100 && ! isset($this->meta_data['auto_parsed']) &&
(
- empty($this->log_date_start) ||
- empty($this->meta_data) ||
- empty($this->csv_url) ||
- !isset($this->meta_data['rtc_bug']) ||
- !isset($this->meta_data['valid_data_points']) ||
+ empty($this->log_date_start) ||
+ empty($this->meta_data) ||
+ empty($this->csv_url) ||
+ ! isset($this->meta_data['rtc_bug']) ||
+ ! isset($this->meta_data['valid_data_points']) ||
count($this->getHighDataDates()) > 0 ||
$this->hasNoWeightData() ||
$this->parsed == false
)
- )
- {
+ ) {
return true;
}
- return false;
+ return false;
}
public static function parseUnparsedFlashlogs()
{
- $parse_fl_sec = env('FLASHLOG_PARSE_HISTORY_SEC', (24*7*3600)); // last week
- $last_week_date = date('Y-m-d', time()-$parse_fl_sec);
- $fls = self::where('created_at', '>' , $last_week_date)->whereNotNull('log_file')->where('log_messages', '>', 0)->where('log_messages', '<', 65000)->orderByDesc('created_at')->get(); // prevent memory issues by parsing only log files ~ < 3.5MB
- $cnt = $fls->count();
+ $parse_fl_sec = env('FLASHLOG_PARSE_HISTORY_SEC', (24 * 7 * 3600)); // last week
+ $last_week_date = date('Y-m-d', time() - $parse_fl_sec);
+ $fls = self::where('created_at', '>', $last_week_date)->whereNotNull('log_file')->where('log_messages', '>', 0)->where('log_messages', '<', 65000)->orderByDesc('created_at')->get(); // prevent memory issues by parsing only log files ~ < 3.5MB
+ $cnt = $fls->count();
Log::info("Auto parse check for $cnt Flashlogs since $last_week_date");
-
- foreach($fls as $fl)
- {
- if ($fl->shouldBeParsed())
- {
+
+ foreach ($fls as $fl) {
+ if ($fl->shouldBeParsed()) {
Log::info("Flashlog $fl->id :");
$data = $fl->getFileContent('log_file');
- if (isset($data))
- {
+ if (isset($data)) {
// log($data='', $log_bytes=null, $save=true, $fill=?, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null, $save_override=false, $from_cache=false, $match_days_offset=0, $add_sensordefinitions=true, $use_rtc=true, $correct_data=false)
- $res = $fl->log($data, null, true, true, false, null, null, null, false, false, 0, true, true, true);
+ $res = $fl->log($data, null, true, true, false, null, null, null, false, false, 0, true, true, true);
foreach ($res as $key => $value) {
- Log::info("$key=$value");
+ Log::info("$key=$value");
}
$meta_data = $fl->meta_data;
- $meta_data['auto_parsed']=date('Y-m-d H:i:s');
+ $meta_data['auto_parsed'] = date('Y-m-d H:i:s');
$fl->meta_data = $meta_data;
$fl->save();
- Log::info("________________________");
- }
- else
- {
- Log::info("No data");
+ Log::info('________________________');
+ } else {
+ Log::info('No data');
}
}
}
}
- public function getLogDays($data_only=true) // only logs with set time
+ public function getLogDays($data_only = true) // only logs with set time
{
- if ($data_only && isset($this->meta_data['data_days']))
- {
+ if ($data_only && isset($this->meta_data['data_days'])) {
return round($this->meta_data['data_days'], 2);
- }
- else if ($data_only && isset($this->meta_data['valid_data_points']))
- {
+ } elseif ($data_only && isset($this->meta_data['valid_data_points'])) {
return count($this->meta_data['valid_data_points']);
+ } elseif (isset($this->log_date_start) && isset($this->log_date_end)) {
+ return round((strtotime($this->log_date_end) - strtotime($this->log_date_start)) / (24 * 3600), 2);
}
- else if (isset($this->log_date_start) && isset($this->log_date_end))
- {
- return round( (strtotime($this->log_date_end) - strtotime($this->log_date_start))/(24*3600), 2);
- }
+
return null;
}
public function getLogPerDay()
{
// first check if meta data contains the exact value
- if (isset($this->meta_data['valid_data_points']))
- {
+ if (isset($this->meta_data['valid_data_points'])) {
$data_points_sum = 0;
$data_points_cnt = 0;
$data_points_arr = array_values($this->meta_data['valid_data_points']); // keys are dates, make integer
$data_points_len = count($data_points_arr);
- for ($i=0; $i < $data_points_len; $i++)
- {
- $v = $data_points_arr[$i];
- if (is_numeric($v))
- {
- $v_p = $i > 0 ? $data_points_arr[$i-1] : null;
- $v_n = $i < $data_points_len - 1 ? $data_points_arr[$i+1] : null;
- {
- if ($v > 0 && $v_p != 0 && $v_n != 0) // only count full day values, no days at start and end, that are half
- {
- $data_points_sum += $v;
- $data_points_cnt ++;
- }
+ for ($i = 0; $i < $data_points_len; $i++) {
+ $v = $data_points_arr[$i];
+ if (is_numeric($v)) {
+ $v_p = $i > 0 ? $data_points_arr[$i - 1] : null;
+ $v_n = $i < $data_points_len - 1 ? $data_points_arr[$i + 1] : null;
+
+ if ($v > 0 && $v_p != 0 && $v_n != 0) { // only count full day values, no days at start and end, that are half
+ $data_points_sum += $v;
+ $data_points_cnt++;
}
+
}
}
- $logs_per_day = $data_points_cnt == 0 ? 0 : round($data_points_sum/$data_points_cnt);
+ $logs_per_day = $data_points_cnt == 0 ? 0 : round($data_points_sum / $data_points_cnt);
+
return $logs_per_day;
}
// else base on log_messages and log_days
$log_days = $this->getLogDays();
- if (isset($log_days) && $log_days > 0 && isset($this->log_messages))
- {
- return round($this->log_messages * (min(100, $this->time_percentage)/100) / $log_days);
+ if (isset($log_days) && $log_days > 0 && isset($this->log_messages)) {
+ return round($this->log_messages * (min(100, $this->time_percentage) / 100) / $log_days);
}
+
return null;
}
public function getTimeLogPercentage($logs_per_day = null)
{
- if ($logs_per_day === null || !is_numeric($logs_per_day))
+ if ($logs_per_day === null || ! is_numeric($logs_per_day)) {
$logs_per_day = $this->getLogPerDay();
+ }
- if (isset($logs_per_day)) // means that $this->log_date_end is set
- {
+ if (isset($logs_per_day)) { // means that $this->log_date_end is set
$logs_per_day_full = isset($this->device) ? $this->device->getMeasurementsPerDay() : 96;
$logs_per_day_perc = max(0, round(100 * $logs_per_day / $logs_per_day_full, 1));
+
return $logs_per_day_perc;
}
+
return 0;
}
public function getWeightLogPercentage()
{
- $weight_kg_perc = 0;
- if (isset($this->meta_data['data_days_weight']) && isset($this->meta_data['data_days']) && $this->meta_data['data_days'] > 0)
- {
+ $weight_kg_perc = 0;
+ if (isset($this->meta_data['data_days_weight']) && isset($this->meta_data['data_days']) && $this->meta_data['data_days'] > 0) {
$weight_kg_perc = round(100 * $this->meta_data['data_days_weight'] / $this->meta_data['data_days']);
}
+
return $weight_kg_perc;
}
public function validLog()
{
- /* validate log if:
+ /* validate log if:
1. Manual validation, or
2. created_at (upload date) is within 1 hour from last timestamp
3. log % > 90%: interval 15 min should have 96 msg/day (>86msg = >90%)
*/
- if (isset($this->valid_override) && $this->valid_override === 1)
- return true; // 1.
+ if (isset($this->valid_override) && $this->valid_override === 1) {
+ return true;
+ } // 1.
$logs_per_day = $this->getLogPerDay();
-
- if (isset($logs_per_day)) // means that $this->log_date_end is set
- {
- $created_u = strtotime($this->created_at);
+
+ if (isset($logs_per_day)) { // means that $this->log_date_end is set
+ $created_u = strtotime($this->created_at);
$last_log_u = strtotime($this->log_date_end);
- if (abs($last_log_u - $created_u) < env('FLASHLOG_VALID_UPLOAD_DIFF_SEC', 7200)) // 2. make sure last available containing data is not more than max time away from upload date
- {
+ if (abs($last_log_u - $created_u) < env('FLASHLOG_VALID_UPLOAD_DIFF_SEC', 7200)) { // 2. make sure last available containing data is not more than max time away from upload date
$logs_per_day_perc = $this->getTimeLogPercentage();
- if ($logs_per_day_perc >= env('FLASHLOG_VALID_TIME_LOG_PERC', 90) && $logs_per_day_perc <= 101) // 3.
- return true;
+ if ($logs_per_day_perc >= env('FLASHLOG_VALID_TIME_LOG_PERC', 90) && $logs_per_day_perc <= 101) { // 3.
+ return true;
+ }
}
}
+
return false;
}
public function hasRtcBug()
{
- /* has RTC bug if:
+ /* has RTC bug if:
meta data shows more than the set interval data items (96) on a RTC month index error date
*/
- if (isset($this->meta_data['rtc_bug']))
+ if (isset($this->meta_data['rtc_bug'])) {
return $this->meta_data['rtc_bug'];
-
- else if (isset($this->meta_data['valid_data_points']))
- return $this->fixBugRtcMonthIndex(null, true); // indicate bug
+ } elseif (isset($this->meta_data['valid_data_points'])) {
+ return $this->fixBugRtcMonthIndex(null, true);
+ } // indicate bug
return false;
}
public function hasNoWeightData()
{
- // has no weight data if data_days_weight < 1
- if (isset($this->meta_data['data_days_weight']))
- return ($this->meta_data['data_days_weight'] < 1);
+ // has no weight data if data_days_weight < 1
+ if (isset($this->meta_data['data_days_weight'])) {
+ return $this->meta_data['data_days_weight'] < 1;
+ }
return false;
}
public function getHighDataDates()
{
- // has high data days if a day has more than 97 log indices:
- if (isset($this->meta_data['valid_data_points']))
- {
+ // has high data days if a day has more than 97 log indices:
+ if (isset($this->meta_data['valid_data_points'])) {
$valid_data_points = $this->meta_data['valid_data_points'];
- if (is_array($valid_data_points) && count($valid_data_points) > 0 && max($valid_data_points) > 97)
- {
+ if (is_array($valid_data_points) && count($valid_data_points) > 0 && max($valid_data_points) > 97) {
$dates = [];
- foreach ($valid_data_points as $date => $value)
- {
- if ($value > 97)
+ foreach ($valid_data_points as $date => $value) {
+ if ($value > 97) {
$dates[$date] = $value;
+ }
}
+
return $dates;
}
}
+
return [];
}
public function hasTimeErr()
{
- /* has RTC time error if:
+ /* has RTC time error if:
last port 2 message time is > now
*/
- if (isset($this->meta_data['time_err_perc']))
- return ($this->meta_data['time_err_perc'] > 0);
+ if (isset($this->meta_data['time_err_perc'])) {
+ return $this->meta_data['time_err_perc'] > 0;
+ }
return false;
}
public function hasBatErr()
{
- /* has Battery voltage issue:
+ /* has Battery voltage issue:
if voltage dropped below 2.7V
*/
- if (isset($this->meta_data['bat_low_blocks']))
- return ($this->meta_data['bat_low_blocks'] > 0);
+ if (isset($this->meta_data['bat_low_blocks'])) {
+ return $this->meta_data['bat_low_blocks'] > 0;
+ }
return false;
}
@@ -398,56 +404,58 @@ public function getFixesArray()
{
$fixes = [];
- if (isset($this->meta_data['fixBugRtcMonthIndex']) && $this->meta_data['fixBugRtcMonthIndex'] > 0)
- $fixes['fa-clock-o'] = "RTC bug fixes: ".$this->meta_data['fixBugRtcMonthIndex'];
+ if (isset($this->meta_data['fixBugRtcMonthIndex']) && $this->meta_data['fixBugRtcMonthIndex'] > 0) {
+ $fixes['fa-clock-o'] = 'RTC bug fixes: '.$this->meta_data['fixBugRtcMonthIndex'];
+ }
- if ($this->valid_override === 1)
- $fixes['fa-exclamation-triangle'] = "Manually validated";
+ if ($this->valid_override === 1) {
+ $fixes['fa-exclamation-triangle'] = 'Manually validated';
+ }
return $fixes;
}
public function getErrorsArray()
{
- $errors= [];
-
- if ($this->hasRtcBug())
+ $errors = [];
+
+ if ($this->hasRtcBug()) {
$errors['fa-clock-o'] = 'RTC bug';
+ }
- if ($this->hasTimeErr())
- {
+ if ($this->hasTimeErr()) {
$time_err = 'Time err';
- if (isset($this->meta_data['time_err_perc']))
+ if (isset($this->meta_data['time_err_perc'])) {
$time_err .= ': '.$this->meta_data['time_err_perc'].'%';
+ }
$errors['fa-calendar'] = $time_err;
}
- if ($this->hasBatErr())
- {
+ if ($this->hasBatErr()) {
$bat_low_err = '';
- if (isset($this->meta_data['bat_low_blocks']))
+ if (isset($this->meta_data['bat_low_blocks'])) {
$bat_low_err .= $this->meta_data['bat_low_blocks'].'x ';
+ }
$bat_low_err .= 'Bat low';
-
- if (isset($this->meta_data['bat_low_perc']))
+
+ if (isset($this->meta_data['bat_low_perc'])) {
$bat_low_err .= ': '.$this->meta_data['bat_low_perc'].'%';
+ }
$errors['fa-battery-quarter'] = $bat_low_err;
}
- $highDataDates = $this->getHighDataDates();
+ $highDataDates = $this->getHighDataDates();
$highDataDateCount = count($highDataDates);
- if ($highDataDateCount > 0)
- {
-
+ if ($highDataDateCount > 0) {
+
$errors['fa-plus-square'] = 'High data on '.$highDataDateCount.' days';
-
- if ($highDataDateCount <= 5)
- {
+
+ if ($highDataDateCount <= 5) {
$highDataDatesArr = [];
foreach ($highDataDates as $date => $value) {
$highDataDatesArr[] = "$date: $value values";
@@ -457,12 +465,9 @@ public function getErrorsArray()
}
$weight_kg_perc = $this->getWeightLogPercentage();
- if ($this->hasNoWeightData())
- {
+ if ($this->hasNoWeightData()) {
$errors['fa-balance-scale'] = 'No weight data';
- }
- else if ($weight_kg_perc < 90)
- {
+ } elseif ($weight_kg_perc < 90) {
$errors['fa-balance-scale'] = "Weight data: $weight_kg_perc %";
}
@@ -471,32 +476,30 @@ public function getErrorsArray()
public function getFixAndErrorHtmlIcons()
{
- $html = '';
+ $html = '';
- $errs = $this->getErrorsArray();
- if (count($errs) > 0)
- {
- foreach ($errs as $e_icon => $e_text)
- {
+ $errs = $this->getErrorsArray();
+ if (count($errs) > 0) {
+ foreach ($errs as $e_icon => $e_text) {
$color = 'red';
- if ($e_icon == 'fa-balance-scale' && intval(substr($e_text, -4, 2)) > 0)
+ if ($e_icon == 'fa-balance-scale' && intval(substr($e_text, -4, 2)) > 0) {
$color = 'orange';
+ }
$html .= ' ';
}
}
$fixes = $this->getFixesArray();
- if (count($fixes) > 0)
- {
- foreach ($fixes as $f_icon => $f_text)
- {
- $html .= ' ';
+ if (count($fixes) > 0) {
+ foreach ($fixes as $f_icon => $f_text) {
+ $html .= ' ';
}
}
+
return $html;
}
- public function getLogCacheName($fill=false, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null)
+ public function getLogCacheName($fill = false, $show = false, $matches_min_override = null, $match_props_override = null, $db_records_override = null)
{
return 'flashlog-'.$this->id.'-fill-'.$fill.'-show-'.$show.'-matches-'.$matches_min_override.'-dbrecs-'.$db_records_override; // removed -props-'.$match_props_override.'
}
@@ -504,106 +507,100 @@ public function getLogCacheName($fill=false, $show=false, $matches_min_override=
private function getTimeCorrections()
{
$time_corrections_array = [];
- if (isset($this->time_corrections) && is_array($this->time_corrections))
- {
- foreach ($this->time_corrections as $datetime => $sec_offset)
- {
- $timestamp = strtotime($datetime);
+ if (isset($this->time_corrections) && is_array($this->time_corrections)) {
+ foreach ($this->time_corrections as $datetime => $sec_offset) {
+ $timestamp = strtotime($datetime);
$time_corrections_array[$timestamp] = $sec_offset;
}
krsort($time_corrections_array, SORT_NUMERIC);
+
return $time_corrections_array;
}
+
return [];
}
// Main function that creates the array from the string FlashLog files
- public function log($data='', $log_bytes=null, $save=true, $fill=false, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null, $save_override=false, $from_cache=true, $match_days_offset=0, $add_sensordefinitions=true, $use_rtc=true, $correct_data=true)
+ public function log($data = '', $log_bytes = null, $save = true, $fill = false, $show = false, $matches_min_override = null, $match_props_override = null, $db_records_override = null, $save_override = false, $from_cache = true, $match_days_offset = 0, $add_sensordefinitions = true, $use_rtc = true, $correct_data = true)
{
- if (!isset($this->device_id) || !isset($this->device))
- return ['error'=>'No device set, cannot parse Flashlog because need device key to get data from database'];
+ if (! isset($this->device_id) || ! isset($this->device)) {
+ return ['error' => 'No device set, cannot parse Flashlog because need device key to get data from database'];
+ }
$cache_name = $this->getLogCacheName($fill, $show, $matches_min_override, $match_props_override, $db_records_override);
-
+
// get result from cache only if it contains any matches
- if ($from_cache === true && Cache::has($cache_name) && $save === false && $fill === true)
- {
+ if ($from_cache === true && Cache::has($cache_name) && $save === false && $fill === true) {
$result = Cache::get($cache_name);
- if (isset($result['log']))
- {
- foreach ($result['log'] as $block_i => $block)
- {
- if (isset($block['matches']))
- return $result; // return cache result if it has a block with matches
+ if (isset($result['log'])) {
+ foreach ($result['log'] as $block_i => $block) {
+ if (isset($block['matches'])) {
+ return $result;
+ } // return cache result if it has a block with matches
}
}
}
-
- $result = null;
- $parsed = false;
- $saved = false;
+
+ $result = null;
+ $parsed = false;
+ $saved = false;
$messages = 0;
- $out = [];
- $disk = env('FLASHLOG_STORAGE', 'public');
+ $out = [];
+ $disk = env('FLASHLOG_STORAGE', 'public');
$f_dir = 'flashlog';
- $lines = 0;
- $bytes = 0;
+ $lines = 0;
+ $bytes = 0;
$logtm = 0;
$erase = -1;
-
+
$f_log = null;
$f_str = null;
$f_par = null;
$device = $this->device;
- $sid = $this->device_id;
- $time = date("YmdHis");
+ $sid = $this->device_id;
+ $time = date('YmdHis');
$mime_t = ['mimetype' => 'text/plain'];
$mime_j = ['mimetype' => 'application/json'];
- if (empty($data)) // get data from parsed flashlog file, or unparsed log_file
- {
- if (isset($this->log_file_parsed) && $from_cache)
- {
+ if (empty($data)) { // get data from parsed flashlog file, or unparsed log_file
+ if (isset($this->log_file_parsed) && $from_cache) {
$out = json_decode($this->getFileContent('log_file_parsed'), true); // decode ar associative array
- if (isset($out) && gettype($out) == 'array')
- {
+ if (isset($out) && gettype($out) == 'array') {
$messages = count($out);
- $lines = $messages;
+ $lines = $messages;
}
}
- if (empty($out) && isset($this->log_file))
+ if (empty($out) && isset($this->log_file)) {
$data = $this->getFileContent('log_file');
+ }
}
-
+
// parse the data from the unparsed log file
- if (empty($out) && isset($data) && isset($sid))
- {
- $data = strtoupper($data);
- $data = preg_replace('/[\r\n|\r|\n]+|\)\(|FEFEFEFE/i', "\n", $data);
+ if (empty($out) && isset($data) && isset($sid)) {
+ $data = strtoupper($data);
+ $data = preg_replace('/[\r\n|\r|\n]+|\)\(|FEFEFEFE/i', "\n", $data);
// interpret every line as a standard LoRa message
- $in = explode("\n", $data);
- $lines = count($in);
- $bytes = 0;
- $alldata = "";
- foreach ($in as $line)
- {
- $lineData = substr(preg_replace('/[^A-Fa-f0-9]/', '', $line),4);
+ $in = explode("\n", $data);
+ $lines = count($in);
+ $bytes = 0;
+ $alldata = '';
+ foreach ($in as $line) {
+ $lineData = substr(preg_replace('/[^A-Fa-f0-9]/', '', $line), 4);
$alldata .= $lineData;
- $bytes += mb_strlen($lineData, 'utf-8')/2;
+ $bytes += mb_strlen($lineData, 'utf-8') / 2;
}
unset($in);
-
+
// fw 1.5.9 1st port 2 log entry
// 0100010005000902935D7C83FFFF94540E0123A76E05A5161AEE1F0000002A03091D01000F256079A4250A 03351B0CF10CEA640A0116539504020D8C081B0C0A094600140010002C0049001A0014005A001A0033002A07000000000000256079A6270A
// 01000100050009029356BAA6FFFF94540E0123FA62FD38425EEE1F0000001A03091D01000F256079A25D0A 03351B0CBF0CB5640A011386550402059D0C600C0A0946005B002E0067003C0016001000160015000F000507000000000000256079A3E00A
-
// Split data by 0A02 and 0A03 (0A03 30 1B) 0A0330
- $data = preg_replace('/0A022([A-Fa-f0-9]{1})0100/', "0A\n022\${1}0100", $alldata);
- $data = preg_replace('/0A03351B/', "0A\n03351B", $data);
+ $data = preg_replace('/0A022([A-Fa-f0-9]{1})0100/', "0A\n022\${1}0100", $alldata);
+ $data = preg_replace('/0A03351B/', "0A\n03351B", $data);
// Calculate from payload parts
// port pl_len |bat 5 bytes value |weight (1/2) 3/6 bytes value |ds18b20 (0-9) 0-20 bytes value |audio (0-12 bins) sta/sto bin 0-12 x 2 bytes |bme280 3x 2b values|time |delimiter
@@ -616,68 +613,61 @@ public function log($data='', $log_bytes=null, $save=true, $fill=false, $show=fa
// Calculate from payload min/max length
$payload = '/([A-Fa-f0-9]{4})1B([A-Fa-f0-9]{10,14})0A([A-Fa-f0-9]{77,90})0A/';
-
+
$replace = "\n\${1}1B\${2}0A0\${3}0A";
-
- $data = preg_replace($payload, $replace, $data);
+
+ $data = preg_replace($payload, $replace, $data);
// fix missing battery hex code
- $data = preg_replace('/0A03([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})0D/', "0A\n03\${1}1B0D\${2}0D", $data);
+ $data = preg_replace('/0A03([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})0D/', "0A\n03\${1}1B0D\${2}0D", $data);
// split error lines
- $data = preg_replace('/03([A-Fa-f0-9]{90,120})0A([A-Fa-f0-9]{0,4})03([A-Fa-f0-9]{90,120})0A/', "03\${1}0A\${2}\n03\${3}0A", $data);
- $data = preg_replace('/03([A-Fa-f0-9]{90,120})0A1B([A-Fa-f0-9]{90,120})0A/', "03\${1}0A\n031E1B\${2}0A", $data); // missing 031E
- $data = preg_replace('/03([A-Fa-f0-9]{2})1B0D1B0D([A-Fa-f0-9]{90,120})0A/', "03\${1}1B0D\${2}0A", $data); // Double 1B0D (fw 1.4.2)
- $data = preg_replace('/02([A-Fa-f0-9]{76})0A03([A-Fa-f0-9]{90,120})0A/', "02\${1}0A\n03\${2}0A", $data); // port 2 data
- $data = preg_replace('/([A-Fa-f0-9]{12,14})0A01([A-Fa-f0-9]{6})([A-Fa-f0-9]{1})040([A-Fa-f0-9]{70,90})0A/', "\${1}0A01\${2}040\${4}0A", $data); // 2025-06-10 PGe: fw 1.5.15: remove extra character after weight 24 bit string
+ $data = preg_replace('/03([A-Fa-f0-9]{90,120})0A([A-Fa-f0-9]{0,4})03([A-Fa-f0-9]{90,120})0A/', "03\${1}0A\${2}\n03\${3}0A", $data);
+ $data = preg_replace('/03([A-Fa-f0-9]{90,120})0A1B([A-Fa-f0-9]{90,120})0A/', "03\${1}0A\n031E1B\${2}0A", $data); // missing 031E
+ $data = preg_replace('/03([A-Fa-f0-9]{2})1B0D1B0D([A-Fa-f0-9]{90,120})0A/', '03${1}1B0D${2}0A', $data); // Double 1B0D (fw 1.4.2)
+ $data = preg_replace('/02([A-Fa-f0-9]{76})0A03([A-Fa-f0-9]{90,120})0A/', "02\${1}0A\n03\${2}0A", $data); // port 2 data
+ $data = preg_replace('/([A-Fa-f0-9]{12,14})0A01([A-Fa-f0-9]{6})([A-Fa-f0-9]{1})040([A-Fa-f0-9]{70,90})0A/', '${1}0A01${2}040${4}0A', $data); // 2025-06-10 PGe: fw 1.5.15: remove extra character after weight 24 bit string
// remove empty rows
- $data = preg_replace('/^\h*\v+/m', '', $data);
+ $data = preg_replace('/^\h*\v+/m', '', $data);
- if ($save)
- {
- $logFileName = $f_dir."/sensor_".$sid."_flash_stripped_$time.log";
+ if ($save) {
+ $logFileName = $f_dir.'/sensor_'.$sid."_flash_stripped_$time.log";
$saved = Storage::disk($disk)->put($logFileName, $data, $mime_t);
- $f_str = Storage::disk($disk)->url($logFileName);
+ $f_str = Storage::disk($disk)->url($logFileName);
}
$counter = 0;
$log_min = 0;
- $minute = 0;
- $max_time= time();
- $in = explode("\n", $data);
+ $minute = 0;
+ $max_time = time();
+ $in = explode("\n", $data);
unset($data);
- foreach ($in as $line)
- {
+ foreach ($in as $line) {
$counter++;
$data_array = $this->decode_flashlog_payload($line);
$data_array['i'] = $counter; // i is 1 based (not 0 based)
- if ($data_array['port'] == 3) // port 3 message is log message
+ if ($data_array['port'] == 3) { // port 3 message is log message
$messages++;
-
- if (isset($data_array['measurement_interval_min']))
- {
- $log_min = $data_array['measurement_interval_min'];
}
- else
- {
+
+ if (isset($data_array['measurement_interval_min'])) {
+ $log_min = $data_array['measurement_interval_min'];
+ } else {
$minute += $log_min;
$data_array['minute'] = $minute;
$data_array['minute_interval'] = $log_min;
}
// Add time if not present
- if (!isset($data_array['time']) && isset($data_array['time_device']))
- {
+ if (! isset($data_array['time']) && isset($data_array['time_device'])) {
$logtm++;
- if (!isset($data_array['time_error'])) // don't set time from time_device if too low/high
- {
+ if (! isset($data_array['time_error'])) { // don't set time from time_device if too low/high
$ts = intval($data_array['time_device']);
- if ($ts > self::$minUnixTime && $ts < $max_time) // > 2019-01-01 00:00:00 < now
- {
+ if ($ts > self::$minUnixTime && $ts < $max_time) { // > 2019-01-01 00:00:00 < now
$time_device = new Moment($ts);
$data_array['time'] = $time_device->format($this->timeFormat);
}
@@ -688,105 +678,103 @@ public function log($data='', $log_bytes=null, $save=true, $fill=false, $show=fa
}
// Save parsed flashlog
- if ($messages > 0)
- {
+ if ($messages > 0) {
$parsed = true;
-
- if ($save)
- {
+
+ if ($save) {
// Save
- try{
- $logFileName = $f_dir."/sensor_".$sid."_flash_parsed_$time.json";
+ try {
+ $logFileName = $f_dir.'/sensor_'.$sid."_flash_parsed_$time.json";
$saved = Storage::disk($disk)->put($logFileName, json_encode($out, JSON_THROW_ON_ERROR), $mime_j);
$f_par = Storage::disk($disk)->url($logFileName);
} catch (Exception $e) {
- Log::error("Flashlog.log error: ".$e->getMessage());
+ Log::error('Flashlog.log error: '.$e->getMessage());
}
}
}
}
unset($in);
- if (env('FLASHLOG_NEVER_DELETE', false) === true)
+ if (env('FLASHLOG_NEVER_DELETE', false) === true) {
$erase = false;
- else
+ } else {
$erase = $log_bytes != null && $this->diff_percentage($log_bytes, $bytes, 2) < 0.1 ? true : false;
-
+ }
+
$result = [
- 'lines_received'=>$lines,
- 'bytes_received'=>$bytes,
- 'log_size_bytes'=>$log_bytes,
- 'log_has_timestamps'=>$logtm,
- 'log_saved'=>$saved,
- 'log_parsed'=>$parsed,
- 'log_messages'=>$messages,
- 'erase_mx_flash'=>$erase ? 0 : -1,
- 'erase'=>$erase,
- 'erase_type'=>$saved ? 'fatfs' : null // fatfs, or full
+ 'lines_received' => $lines,
+ 'bytes_received' => $bytes,
+ 'log_size_bytes' => $log_bytes,
+ 'log_has_timestamps' => $logtm,
+ 'log_saved' => $saved,
+ 'log_parsed' => $parsed,
+ 'log_messages' => $messages,
+ 'erase_mx_flash' => $erase ? 0 : -1,
+ 'erase' => $erase,
+ 'erase_type' => $saved ? 'fatfs' : null, // fatfs, or full
];
- // fill time in unknown time data
+ // fill time in unknown time data
$time_percentage = $messages > 0 ? round(100 * $logtm / $messages, 2) : 0;
- if ($fill && isset($out) && gettype($out) == 'array' && count($out) > 0)
- {
+ if ($fill && isset($out) && gettype($out) == 'array' && count($out) > 0) {
$flashlog_filled = $this->fillTimeFromInflux($device, $out, $save, $show, $matches_min_override, $match_props_override, $db_records_override, $match_days_offset, $add_sensordefinitions, $use_rtc, $correct_data); // ['time_percentage'=>$time_percentage, 'records_timed'=>$records_timed, 'records_flashlog'=>$records_flashlog, 'time_insert_count'=>$setCount, 'flashlog'=>$flashlog];
unset($out);
- if ($flashlog_filled)
- {
- if (isset($flashlog_filled['log']))
+ if ($flashlog_filled) {
+ if (isset($flashlog_filled['log'])) {
$result['log'] = $flashlog_filled['log'];
+ }
- $result['matching_blocks'] = $flashlog_filled['matching_blocks'];
- $result['device'] = $device->name.' ('.$sid.')';
- $result['records_flashlog'] = $flashlog_filled['records_flashlog'];
+ $result['matching_blocks'] = $flashlog_filled['matching_blocks'];
+ $result['device'] = $device->name.' ('.$sid.')';
+ $result['records_flashlog'] = $flashlog_filled['records_flashlog'];
$result['time_insert_count'] = $flashlog_filled['time_insert_count'];
- $result['records_timed'] = $flashlog_filled['records_timed'];
- $weight_percentage = round($flashlog_filled['weight_percentage'], 2);
+ $result['records_timed'] = $flashlog_filled['records_timed'];
+ $weight_percentage = round($flashlog_filled['weight_percentage'], 2);
$result['weight_percentage'] = $weight_percentage.'%';
$result['time_insert_count'] = $flashlog_filled['time_insert_count'];
- $time_percentage = round($flashlog_filled['time_percentage'], 2);
- $result['time_percentage'] = $time_percentage.'%';
-
- if (isset($this->time_percentage) == false || (min(100, $this->time_percentage*0.9) <= $time_percentage || $save_override) || $this->time_percentage > 100)
- {
- if ( ($save || $result['matching_blocks'] > 0) && isset($flashlog_filled['flashlog']) && count($flashlog_filled['flashlog']) > 0 && $flashlog_filled['time_insert_count'] > 0)
- {
- $save = true;
- $logFileName = $f_dir."/sensor_".$sid."_flash_filled_$time.json";
- $saved = Storage::disk($disk)->put($logFileName, json_encode($flashlog_filled['flashlog']), $mime_j);
- $f_par = Storage::disk($disk)->url($logFileName);
+ $time_percentage = round($flashlog_filled['time_percentage'], 2);
+ $result['time_percentage'] = $time_percentage.'%';
+
+ if (isset($this->time_percentage) == false || (min(100, $this->time_percentage * 0.9) <= $time_percentage || $save_override) || $this->time_percentage > 100) {
+ if (($save || $result['matching_blocks'] > 0) && isset($flashlog_filled['flashlog']) && count($flashlog_filled['flashlog']) > 0 && $flashlog_filled['time_insert_count'] > 0) {
+ $save = true;
+ $logFileName = $f_dir.'/sensor_'.$sid."_flash_filled_$time.json";
+ $saved = Storage::disk($disk)->put($logFileName, json_encode($flashlog_filled['flashlog']), $mime_j);
+ $f_par = Storage::disk($disk)->url($logFileName);
}
- }
- else
- {
+ } else {
$result['time_percentage'] .= ', previous time percentage ('.$this->time_percentage.'%) > new ('.$time_percentage.'%)';
- if ($save)
+ if ($save) {
$result['time_percentage'] .= ', so filled file not saved';
+ }
$time_percentage = $this->time_percentage;
- $f_par = $this->log_file_parsed;
+ $f_par = $this->log_file_parsed;
}
}
}
// create Flashlog entity
- if ($save)
- {
- if (isset($this->log_size_bytes) == false && isset($log_bytes)) // first upload
+ if ($save) {
+ if (isset($this->log_size_bytes) == false && isset($log_bytes)) { // first upload
$this->log_size_bytes = $log_bytes;
+ }
- if (isset($this->hive_id) == false) // first upload
+ if (isset($this->hive_id) == false) { // first upload
$this->hive_id = $device->hive_id;
+ }
- if (isset($this->log_erased) == false) // first upload
+ if (isset($this->log_erased) == false) { // first upload
$this->log_erased = $erase;
+ }
- if (isset($this->log_saved) == false) // first upload
+ if (isset($this->log_saved) == false) { // first upload
$this->log_saved = $saved;
-
+ }
+
$this->bytes_received = $bytes == 0 && isset($this->bytes_received) && $this->bytes_received > 0 ? $this->bytes_received : $bytes; // only update on >0
$this->log_has_timestamps = $logtm > 0 ? true : false;
$this->log_parsed = $parsed;
@@ -797,12 +785,12 @@ public function log($data='', $log_bytes=null, $save=true, $fill=false, $show=fa
$this->save();
// if data is available, also add CSV file from log_file_parsed
- if (isset($flashlog_filled['flashlog']))
- {
+ if (isset($flashlog_filled['flashlog'])) {
$csv_saved = $this->addCsvToFlashlog($flashlog_filled['flashlog']);
- //dd($csv_saved, $this->meta_data);
- if ($csv_saved)
- $result["Meta data"] = CalculationModel::arrayToString($this->meta_data, ', ', '', ['valid_data_points','port2_times_device','firmwares','lowest_bv']);
+ // dd($csv_saved, $this->meta_data);
+ if ($csv_saved) {
+ $result['Meta data'] = CalculationModel::arrayToString($this->meta_data, ', ', '', ['valid_data_points', 'port2_times_device', 'firmwares', 'lowest_bv']);
+ }
}
}
@@ -811,51 +799,41 @@ public function log($data='', $log_bytes=null, $save=true, $fill=false, $show=fa
return $result;
}
-
// Flashlog parsing functions
// Try to make blocks of data for matching
- private function getFlashLogOnOffs($device, $flashlog, $start_index=0, $start_time='2018-01-01 00:00:00')
+ private function getFlashLogOnOffs($device, $flashlog, $start_index = 0, $start_time = '2018-01-01 00:00:00')
{
- $onoffs = [];
- $fl_index = $start_index;
- $fl_length = count($flashlog);
- $fl_index_end= $fl_length - 1;
+ $onoffs = [];
+ $fl_index = $start_index;
+ $fl_length = count($flashlog);
+ $fl_index_end = $fl_length - 1;
- $first_p3_mes= null;
+ $first_p3_mes = null;
$last_p3_mes = null;
- $p3_mes_count= 0;
- $p2_mes_count= 0;
+ $p3_mes_count = 0;
+ $p2_mes_count = 0;
$block_count = 0;
- for ($i=$fl_index; $i <= $fl_index_end; $i++)
- {
+ for ($i = $fl_index; $i <= $fl_index_end; $i++) {
$f = $flashlog[$i];
- if (isset($f['port'])) // check for port 2 messages (switch on/off) in between 'before' and 'after' matches
- {
+ if (isset($f['port'])) { // check for port 2 messages (switch on/off) in between 'before' and 'after' matches
$f_port = intval($f['port']);
- if ($f_port > 0 && isset($f['beep_base']))
- {
- if ($f_port == 2 && isset($f['firmware_version']))
- {
+ if ($f_port > 0 && isset($f['beep_base'])) {
+ if ($f_port == 2 && isset($f['firmware_version'])) {
$p2_mes_count++;
- if ($i < $fl_index_end && $flashlog[$i+1]['port'] == 3) // count a new block if the message after this port 2 is a port 3 (measurement)
- {
+ if ($i < $fl_index_end && $flashlog[$i + 1]['port'] == 3) { // count a new block if the message after this port 2 is a port 3 (measurement)
$block_count++;
$onoffs[$block_count] = $f;
$onoffs[$block_count]['block_count'] = $block_count;
}
- }
- else if ($f_port == 3)
- {
+ } elseif ($f_port == 3) {
$p3_mes_count++;
// If no blocks have been found yet
- if ($block_count == 0)
- {
+ if ($block_count == 0) {
// if device has RTC, then use first port 3 message as first block ID
- if (!isset($first_p3_mes))
- {
+ if (! isset($first_p3_mes)) {
$first_p3_mes = $f;
$block_count++;
$onoffs[$block_count] = $f;
@@ -863,9 +841,7 @@ private function getFlashLogOnOffs($device, $flashlog, $start_index=0, $start_ti
}
$last_p3_mes = $f;
- }
- else // set last index of the current port 2 block
- {
+ } else { // set last index of the current port 2 block
$onoffs[$block_count]['end_index'] = $i; // index of the flashlog item is 1 lower than the i inside the flashlog
}
}
@@ -873,152 +849,141 @@ private function getFlashLogOnOffs($device, $flashlog, $start_index=0, $start_ti
}
}
// For FlashLogs with RTC, and no blocks: check if there are port3 messages
- if (isset($first_p3_mes) && $block_count == 0 && $p3_mes_count > 10)
- {
- // if a port 2 message is missing take the firt port 3 message
+ if (isset($first_p3_mes) && $block_count == 0 && $p3_mes_count > 10) {
+ // if a port 2 message is missing take the firt port 3 message
$first_p3_mes['port'] = 2;
- $first_p3_mes_time = isset($first_p3_mes['time']) ? $first_p3_mes['time'] : 0;
- $last_p3_mes_time = isset($last_p3_mes['time']) ? $last_p3_mes['time'] : 0;
- $first_p3_mes_i = isset($first_p3_mes['i']) ? $first_p3_mes['i'] : 0;
- $last_p3_mes_i = isset($last_p3_mes['i']) ? $last_p3_mes['i'] : 0;
-
- $p3_total_indices = $last_p3_mes_i - $first_p3_mes_i;
- $time_p3_total_sec = strtotime($last_p3_mes_time) - strtotime($first_p3_mes_time);
+ $first_p3_mes_time = isset($first_p3_mes['time']) ? $first_p3_mes['time'] : 0;
+ $last_p3_mes_time = isset($last_p3_mes['time']) ? $last_p3_mes['time'] : 0;
+ $first_p3_mes_i = isset($first_p3_mes['i']) ? $first_p3_mes['i'] : 0;
+ $last_p3_mes_i = isset($last_p3_mes['i']) ? $last_p3_mes['i'] : 0;
+
+ $p3_total_indices = $last_p3_mes_i - $first_p3_mes_i;
+ $time_p3_total_sec = strtotime($last_p3_mes_time) - strtotime($first_p3_mes_time);
$first_p3_mes['measurement_interval_min'] = $time_p3_total_sec > 0 && $p3_total_indices > 0 ? ($time_p3_total_sec / 60) / $p3_total_indices : $device->measurement_interval_min;
- $first_p3_mes['i'] = max(0, $first_p3_mes['i'] - 1); // i of the faked port 2 message coming in front of the port 3 messages
+ $first_p3_mes['i'] = max(0, $first_p3_mes['i'] - 1); // i of the faked port 2 message coming in front of the port 3 messages
$first_p3_mes['end_index'] = $first_p3_mes['i'] + 1 + $p3_total_indices; // from first to last p2 message
-
+
$onoffs[0] = $first_p3_mes;
}
- //dd($onoffs);
- //Log::debug(['getFlashLogOnOffs', 'device_id'=>$device->id, 'fl_length'=>$fl_length, 'p2'=>$p2_mes_count, 'p3'=>$p3_mes_count, 'fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'onoffs'=>$onoffs]);
+ // dd($onoffs);
+ // Log::debug(['getFlashLogOnOffs', 'device_id'=>$device->id, 'fl_length'=>$fl_length, 'p2'=>$p2_mes_count, 'p3'=>$p3_mes_count, 'fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'onoffs'=>$onoffs]);
return array_values($onoffs);
}
- private function matchFlashLogTime($device, $flashlog, $matches_min=1, $match_props=9, $start_index=0, $end_index=0, $duration_hrs=0, $interval_min=15, $start_time='2018-01-01 00:00:00', $db_records=80, $show=false)
+ private function matchFlashLogTime($device, $flashlog, $matches_min = 1, $match_props = 9, $start_index = 0, $end_index = 0, $duration_hrs = 0, $interval_min = 15, $start_time = '2018-01-01 00:00:00', $db_records = 80, $show = false)
{
- $fl_index = $start_index;
- $fl_index_end= $end_index;
- $fl_items = max(0, $end_index - $start_index);
+ $fl_index = $start_index;
+ $fl_index_end = $end_index;
+ $fl_items = max(0, $end_index - $start_index);
$day_props_m = isset($interval_min) ? 24 * 60 / $interval_min : 96; // max total measurements per match prop on a full data day
$day_total_m = $match_props * $day_props_m; // max total measurements for all match_props on a full data day
-
- if ($flashlog == null || $fl_items < $matches_min)
- return ['fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'db_start_time'=>$start_time, 'db_data'=>[], 'db_data_count'=>0, 'message'=>'too few flashlog items to match: '.$fl_items];
-
+
+ if ($flashlog == null || $fl_items < $matches_min) {
+ return ['fl_index' => $fl_index, 'fl_index_end' => $fl_index_end, 'db_start_time' => $start_time, 'db_data' => [], 'db_data_count' => 0, 'message' => 'too few flashlog items to match: '.$fl_items];
+ }
+
// Check the amount of data per day over the full length of the period, check for the date with the maximum amount of measurements
- $start_mom = new Moment($start_time);
- $end_time = $start_mom->addHours(round($duration_hrs))->format($this->timeFormat);
+ $start_mom = new Moment($start_time);
+ $end_time = $start_mom->addHours(round($duration_hrs))->format($this->timeFormat);
$count_query = 'SELECT COUNT(*) FROM "sensors" WHERE '.$device->influxWhereKeys().' AND from_flashlog != \'1\' AND time >= \''.$start_time.'\' AND time <= \''.$end_time.'\' GROUP BY time(24h) ORDER BY time ASC LIMIT 500';
- $data_count = Device::getInfluxQuery($count_query, 'flashlog');
+ $data_count = Device::getInfluxQuery($count_query, 'flashlog');
$day_sum_max = 0;
- $days_valid = 0;
+ $days_valid = 0;
$db_data_cnt = 0;
- foreach ($data_count as $day_i => $count_array)
- {
- $data_date = $count_array['time'];
+ foreach ($data_count as $day_i => $count_array) {
+ $data_date = $count_array['time'];
unset($count_array['time']); // don't include time in sum
- $day_sum = array_sum($count_array);
- $day_valid = ($day_sum > 0.7*$day_total_m); // magic factor 0.7
+ $day_sum = array_sum($count_array);
+ $day_valid = ($day_sum > 0.7 * $day_total_m); // magic factor 0.7
$db_data_cnt += $day_sum; // fill db_data_cnt for providing insight in where to fill flashlog data (sum == 0)
-
- if ($day_valid && $days_valid < 2) // take the second, or first valid dates
- {
+
+ if ($day_valid && $days_valid < 2) { // take the second, or first valid dates
$start_time = $data_date;
$days_valid++;
}
}
-
- //dd($start_time, $end_time, $duration_hrs, count($data_count), $db_data_cnt);
+
+ // dd($start_time, $end_time, $duration_hrs, count($data_count), $db_data_cnt);
// get data from the day with max amount of measurements
- $query = 'SELECT * FROM "sensors" WHERE '.$device->influxWhereKeys().' AND from_flashlog != \'1\' AND time >= \''.$start_time.'\' ORDER BY time ASC LIMIT '.min(1000, max($matches_min, $db_records));
- $db_data = Device::getInfluxQuery($query, 'flashlog');
+ $query = 'SELECT * FROM "sensors" WHERE '.$device->influxWhereKeys().' AND from_flashlog != \'1\' AND time >= \''.$start_time.'\' ORDER BY time ASC LIMIT '.min(1000, max($matches_min, $db_records));
+ $db_data = Device::getInfluxQuery($query, 'flashlog');
- //die(print_r([$start_time, $db_data]));
-
- $database_log = [];
+ // die(print_r([$start_time, $db_data]));
+
+ $database_log = [];
$db_first_unix = 0;
- foreach ($db_data as $d)
- {
+ foreach ($db_data as $d) {
$clean_d = self::cleanDbDataItem($d);
- if (count($clean_d) > $match_props && array_sum(array_values($clean_d)) != 0)
- {
- if (count($database_log) == 0) // first entry
- {
- $db_first_unix = strtotime($clean_d['time']);
- $clean_d['unix'] = $db_first_unix;
+ if (count($clean_d) > $match_props && array_sum(array_values($clean_d)) != 0) {
+ if (count($database_log) == 0) { // first entry
+ $db_first_unix = strtotime($clean_d['time']);
+ $clean_d['unix'] = $db_first_unix;
$clean_d['seconds'] = 0;
}
- $clean_d['unix'] = strtotime($clean_d['time']);
+ $clean_d['unix'] = strtotime($clean_d['time']);
$clean_d['seconds'] = $clean_d['unix'] - $db_first_unix;
$database_log[] = $clean_d;
- //die(print_r([$start_time, $clean_d, count($clean_d), $db_data]));
+ // die(print_r([$start_time, $clean_d, count($clean_d), $db_data]));
}
}
$db_log_item_cnt = count($database_log);
- if ($db_log_item_cnt < $matches_min)
- return ['fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'db_start_time'=>$start_time, 'db_data_measurements'=>$db_data_cnt, 'db_data_count'=>count($database_log), 'message'=>'too few database items to match: '.count($database_log)];
+ if ($db_log_item_cnt < $matches_min) {
+ return ['fl_index' => $fl_index, 'fl_index_end' => $fl_index_end, 'db_start_time' => $start_time, 'db_data_measurements' => $db_data_cnt, 'db_data_count' => count($database_log), 'message' => 'too few database items to match: '.count($database_log)];
+ }
// look for the measurement value(s) in $database_log in the remainder of $flashlog
- $matches = [];
- $tries = 0;
- $match_count = 0;
+ $matches = [];
+ $tries = 0;
+ $match_count = 0;
$match_first_min_fl = 0;
$match_first_sec_db = 0;
- $db_log_item_index = 0;
+ $db_log_item_index = 0;
- foreach ($database_log as $d)
- {
- for ($i=$fl_index; $i < $fl_index_end; $i++)
- {
+ foreach ($database_log as $d) {
+ for ($i = $fl_index; $i < $fl_index_end; $i++) {
$f = $flashlog[$i];
- if ($f['port'] == 3) // keep looking if found matches are < min matches
- {
+ if ($f['port'] == 3) { // keep looking if found matches are < min matches
$match = array_intersect_assoc($d, $f);
- if ($match != null && count($match) >= $match_props)
- {
- if ($match_count == 0)
- {
+ if ($match != null && count($match) >= $match_props) {
+ if ($match_count == 0) {
$match_first_min_fl = $f['minute'];
$match_first_sec_db = $d['seconds'];
- }
- else if ($match_count == 1) // check the time interval of the match in 2nd match
- {
+ } elseif ($match_count == 1) { // check the time interval of the match in 2nd match
$match_increase_min = $f['minute'] - $match_first_min_fl;
- $datab_increase_min = round( ($d['seconds'] - $match_first_sec_db) / 60);
+ $datab_increase_min = round(($d['seconds'] - $match_first_sec_db) / 60);
- //print_r([$match_increase_min, $datab_increase_min, $matches]);
+ // print_r([$match_increase_min, $datab_increase_min, $matches]);
- if ($match_increase_min != $datab_increase_min) // if this does not match, remove first match and replace by this one
- {
+ if ($match_increase_min != $datab_increase_min) { // if this does not match, remove first match and replace by this one
$match_first_sec_db = $d['seconds'];
$match_first_min_fl = $f['minute'];
- $matches = [];
- $match_count = 0;
+ $matches = [];
+ $match_count = 0;
}
}
- $fl_index = $i;
- $match['time'] = $d['time'];
- $match['db_sec'] = $d['seconds'];
- $match['minute'] = $f['minute'];
- $match['minute_interval'] = $f['minute_interval'];
- $match['flashlog_index'] = $i;
- $matches[$i] = $match;
+ $fl_index = $i;
+ $match['time'] = $d['time'];
+ $match['db_sec'] = $d['seconds'];
+ $match['minute'] = $f['minute'];
+ $match['minute_interval'] = $f['minute_interval'];
+ $match['flashlog_index'] = $i;
+ $matches[$i] = $match;
$match_count++;
+
continue 2; // next foreach loop to continue with the next database item
// TODO: do not break the loop to check how many matches there are
@@ -1027,124 +992,114 @@ private function matchFlashLogTime($device, $flashlog, $matches_min=1, $match_pr
}
}
}
- //die();
- if ($match_count > $matches_min)
- return ['fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'fl_match_tries'=>$tries, 'db_start_time'=>$start_time, 'db_data_measurements'=>$db_data_cnt, 'db_data_count'=>count($database_log), 'matches'=>$matches];
+ // die();
+ if ($match_count > $matches_min) {
+ return ['fl_index' => $fl_index, 'fl_index_end' => $fl_index_end, 'fl_match_tries' => $tries, 'db_start_time' => $start_time, 'db_data_measurements' => $db_data_cnt, 'db_data_count' => count($database_log), 'matches' => $matches];
+ }
- return ['fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'fl_match_tries'=>$tries, 'db_start_time'=>$start_time, 'db_data_measurements'=>$db_data_cnt, 'db_data_count'=>count($db_data), 'message'=>'no matches found'];
+ return ['fl_index' => $fl_index, 'fl_index_end' => $fl_index_end, 'fl_match_tries' => $tries, 'db_start_time' => $start_time, 'db_data_measurements' => $db_data_cnt, 'db_data_count' => count($db_data), 'message' => 'no matches found'];
}
- private function diff_percentage($val1, $val2, $round_decimals=1)
+ private function diff_percentage($val1, $val2, $round_decimals = 1)
{
- if ($val1 === $val2)
+ if ($val1 === $val2) {
return 0;
+ }
- $rval1= round($val1,$round_decimals);
- $rval2= round($val2,$round_decimals);
+ $rval1 = round($val1, $round_decimals);
+ $rval2 = round($val2, $round_decimals);
$diff = abs($rval1 - $rval2);
- $ave = ($rval1 + $rval2) / 2;
+ $ave = ($rval1 + $rval2) / 2;
+
return $ave != 0 ? min(100, max(0, round(100 * $diff / $ave, 1))) : 0;
}
- // Set time and add weight_kg by calibration
- private function setFlashBlockTimes($match, $block_i, $startInd, $endInd, $flashlog, $device, $show=false, $sec_diff_per_index=null, $add_sensordefinitions=true, $use_device_time=false)
+ // Set time and add weight_kg by calibration
+ private function setFlashBlockTimes($match, $block_i, $startInd, $endInd, $flashlog, $device, $show = false, $sec_diff_per_index = null, $add_sensordefinitions = true, $use_device_time = false)
{
- if (isset($match) && isset($match['flashlog_index']) && (isset($match['minute_interval']) || $use_device_time) && isset($match['time'])) // set times for current block
- {
- $matchInd= $match['flashlog_index'];
- $messages= $endInd - $startInd;
- $setCount= 0;
-
- if ($messages > 0)
- {
+ if (isset($match) && isset($match['flashlog_index']) && (isset($match['minute_interval']) || $use_device_time) && isset($match['time'])) { // set times for current block
+ $matchInd = $match['flashlog_index'];
+ $messages = $endInd - $startInd;
+ $setCount = 0;
+
+ if ($messages > 0) {
$blockStaOff = $startInd - $matchInd;
$blockEndOff = $endInd - $matchInd;
- $second_intv = isset($match['minute_interval']) ? $match['minute_interval']*60 : $device->measurement_interval_min*60;
+ $second_intv = isset($match['minute_interval']) ? $match['minute_interval'] * 60 : $device->measurement_interval_min * 60;
$matchSecInt = isset($sec_diff_per_index) ? $sec_diff_per_index : $second_intv;
-
- $matchTime = $match['time'];
+
+ $matchTime = $match['time'];
$matchMoment = new Moment($matchTime);
$startMoment = new Moment($matchTime);
- $endMoment = new Moment($matchTime);
-
- $blockStart = $startMoment->addSeconds(round($blockStaOff * $matchSecInt));
- $blockStaDate= $blockStart->format($this->timeFormat);
- $blockEnd = $endMoment->addSeconds(round($blockEndOff * $matchSecInt));
- $blockEndDate= $blockEnd->format($this->timeFormat);
+ $endMoment = new Moment($matchTime);
+
+ $blockStart = $startMoment->addSeconds(round($blockStaOff * $matchSecInt));
+ $blockStaDate = $blockStart->format($this->timeFormat);
+ $blockEnd = $endMoment->addSeconds(round($blockEndOff * $matchSecInt));
+ $blockEndDate = $blockEnd->format($this->timeFormat);
// Load active weight device sensor definitions
- $weight_m_ids = Measurement::getWeightMeasurementIds();
+ $weight_m_ids = Measurement::getWeightMeasurementIds();
$sensor_defs_w = $device->activeTypeDateSensorDefinitions($weight_m_ids['input_id'], $weight_m_ids['output_id'], $blockStaDate, $blockEndDate);
$sensor_defs_c = $sensor_defs_w->count();
- $sensor_def = null;
+ $sensor_def = null;
- if ($sensor_defs_c == 1)
+ if ($sensor_defs_c == 1) {
$sensor_def = $sensor_defs_w->first();
+ }
// add time to flashlog block
- $addCounter = 0;
+ $addCounter = 0;
$blockDeviceStaDate = null;
- for ($i=$startInd; $i <= $endInd; $i++)
- {
- if (!isset($flashlog[$i]))
+ for ($i = $startInd; $i <= $endInd; $i++) {
+ if (! isset($flashlog[$i])) {
continue;
+ }
- $fl = $flashlog[$i];
+ $fl = $flashlog[$i];
$fl_time = null;
-
- if ($use_device_time)
- {
- if (isset($fl['time_device']) && !isset($fl['time_error']) && $fl['time_device'] > self::$minUnixTime)
- {
- $indexMoment= new Moment(intval($fl['time_device']));
- $fl_time = $indexMoment->format($this->timeFormat);
+
+ if ($use_device_time) {
+ if (isset($fl['time_device']) && ! isset($fl['time_error']) && $fl['time_device'] > self::$minUnixTime) {
+ $indexMoment = new Moment(intval($fl['time_device']));
+ $fl_time = $indexMoment->format($this->timeFormat);
$fl['time'] = $fl_time;
- if ($blockDeviceStaDate === null)
- {
+ if ($blockDeviceStaDate === null) {
$blockDeviceStaDate = $fl_time;
- $blockStaDate = $fl_time;
- $blockEndDate = $fl_time;
- }
- else
- {
- $blockEndDate = $fl_time;
+ $blockStaDate = $fl_time;
+ $blockEndDate = $fl_time;
+ } else {
+ $blockEndDate = $fl_time;
}
}
- }
- else
- {
- $startMoment= new Moment($blockStaDate);
- $indexMoment= $startMoment->addSeconds(round($addCounter * $matchSecInt));
- $fl_time = $indexMoment->format($this->timeFormat);
+ } else {
+ $startMoment = new Moment($blockStaDate);
+ $indexMoment = $startMoment->addSeconds(round($addCounter * $matchSecInt));
+ $fl_time = $indexMoment->format($this->timeFormat);
$fl['time'] = $fl_time;
}
- // Add sensor definition measurement if not yet present (or if input_measurement_id == output_measurement_id)
- if ($fl['port'] == 3)
- {
+ // Add sensor definition measurement if not yet present (or if input_measurement_id == output_measurement_id)
+ if ($fl['port'] == 3) {
// if (isset($fl['time_corr']) && $fl['time_corr'] == 'prev')
// dd($fl);
- if ($add_sensordefinitions && $sensor_defs_c > 0 && isset($fl_time) && isset($fl['w_v']) && !isset($fl['weight_kg']) )
- {
- if ($sensor_defs_c > 1) // select appropriate $sensor_def for multiple sensor_defs
- {
- foreach ($sensor_defs_w as $sd) // ordered descending
- {
- if ($sd->updated_at <= $fl_time) // take the first sd before the current time
- {
+ if ($add_sensordefinitions && $sensor_defs_c > 0 && isset($fl_time) && isset($fl['w_v']) && ! isset($fl['weight_kg'])) {
+ if ($sensor_defs_c > 1) { // select appropriate $sensor_def for multiple sensor_defs
+ foreach ($sensor_defs_w as $sd) { // ordered descending
+ if ($sd->updated_at <= $fl_time) { // take the first sd before the current time
$sensor_def = $sd;
break;
}
}
}
// Add calibrated weight value
- if ($sensor_def)
- {
+ if ($sensor_def) {
$calibrated_measurement_val = $sensor_def->calibrated_measurement_value($fl['w_v']);
- if ($calibrated_measurement_val !== null) // do not add sensor measurement is outside measurement min/max value
+ if ($calibrated_measurement_val !== null) { // do not add sensor measurement is outside measurement min/max value
$fl['weight_kg'] = $calibrated_measurement_val;
+ }
}
}
$setCount++;
@@ -1161,143 +1116,135 @@ private function setFlashBlockTimes($match, $block_i, $startInd, $endInd, $flash
// // add request for database values per day
// $log = ['setFlashBlockTimes', 'block_i'=>$block_i, 'time0'=>$flashlog[$startInd]['time'], 'time1'=>$flashlog[$endInd]['time'], 'bl_start_i'=>$startInd, 'bl_end_i'=>$endInd, 'match_time'=>$matchTime, 'mi'=>$matchInd, 'min_int'=>$matchMinInt, 'msg'=>$messages, 'bso'=>$blockStaOff, 'bsd'=>$blockStaDate, 'beo'=>$blockEndOff, 'bed'=>$blockEndDate,'setCount'=>$setCount];
// }
- //Log::debug(['setFlashBlockTimes', 'device_id'=>$device->id, 'bl_start_i'=>$startInd, 'bl_end_i'=>$endInd, 'match_time'=>$matchTime, 'mi'=>$matchInd, 'msg'=>$messages, 'block_i'=>$block_i, 'sensor_def'=>$sensor_def->toArray(), 'bsd'=>$blockStaDate, 'bed'=>$blockEndDate, 'setCount'=>$setCount]);
-
+ // Log::debug(['setFlashBlockTimes', 'device_id'=>$device->id, 'bl_start_i'=>$startInd, 'bl_end_i'=>$endInd, 'match_time'=>$matchTime, 'mi'=>$matchInd, 'msg'=>$messages, 'block_i'=>$block_i, 'sensor_def'=>$sensor_def->toArray(), 'bsd'=>$blockStaDate, 'bed'=>$blockEndDate, 'setCount'=>$setCount]);
+
$dbCount = $device->getMeasurementCount($blockStaDate, $blockEndDate);
+
// TODO: Add check for every timestamp in DB with matching Flashlog (for bv, w_v, (t_0, t_1, or t_i))
- return ['flashlog'=>$flashlog, 'index_start'=>$startInd, 'index_end'=>$endInd, 'time_start'=>$blockStaDate, 'time_end'=>$blockEndDate, 'setCount'=>$setCount, 'log'=>$log, 'dbCount'=>$dbCount];
+ return ['flashlog' => $flashlog, 'index_start' => $startInd, 'index_end' => $endInd, 'time_start' => $blockStaDate, 'time_end' => $blockEndDate, 'setCount' => $setCount, 'log' => $log, 'dbCount' => $dbCount];
}
}
- return ['flashlog'=>$flashlog];
+
+ return ['flashlog' => $flashlog];
}
- // Fix RTC month index rollover bug in fw 1.5.13 where the key dates are to be replaced by the value dates to reverse the RTC bug
+ // Fix RTC month index rollover bug in fw 1.5.13 where the key dates are to be replaced by the value dates to reverse the RTC bug
// Only replace if the current date if it occurs twice and the target date does not yet exist
- private function fixBugRtcMonthIndex($data_array, $return_bug_detected=false, $start_index=null, $end_index=null)
+ private function fixBugRtcMonthIndex($data_array, $return_bug_detected = false, $start_index = null, $end_index = null)
{
$primary_dates_to_replace = [
- // flashlog_date => actual date (1 2, or 3 days earlier), this includes dates where It might be possible that the RTC wasn't updated during firmware updates, in which case the date will be 1 month out of date
- "2023-05-01" => "2023-05-31",
- "2023-06-01" => "2023-05-31", // after 2023-05-30, 2023-06-01 will be written as FL date, so 2023-05-31 will not exist, and 2023-06-01 will have double data
- "2023-07-01" => "2023-07-31",
- "2023-08-01" => "2023-07-31",
- "2023-10-01" => "2023-10-31",
- "2023-11-01" => "2023-10-31",
- "2023-12-01" => "2023-12-31",
- "2024-01-01" => "2023-12-31",
- "2024-03-01" => "2024-03-30",
- "2024-03-02" => "2024-03-31",
- "2024-04-01" => "2024-03-30",
- "2024-04-02" => "2024-03-31",
- "2024-05-01" => "2024-05-31",
- "2024-06-01" => "2024-05-31",
- "2024-07-01" => "2024-07-31",
- "2024-08-01" => "2024-07-31",
- "2024-10-01" => "2024-10-31",
- "2024-11-01" => "2024-10-31",
- "2024-12-01" => "2024-12-31",
- "2025-01-01" => "2024-12-31",
- "2025-03-01" => "2025-03-29",
- "2025-03-02" => "2025-03-30",
- "2025-03-03" => "2025-03-31",
- "2025-04-01" => "2025-03-29",
- "2025-04-02" => "2025-03-30",
- "2025-04-03" => "2025-03-31",
- "2025-05-01" => "2025-05-31",
- "2025-06-01" => "2025-05-31",
- "2025-07-01" => "2025-07-31",
- "2025-08-01" => "2025-07-31",
+ // flashlog_date => actual date (1 2, or 3 days earlier), this includes dates where It might be possible that the RTC wasn't updated during firmware updates, in which case the date will be 1 month out of date
+ '2023-05-01' => '2023-05-31',
+ '2023-06-01' => '2023-05-31', // after 2023-05-30, 2023-06-01 will be written as FL date, so 2023-05-31 will not exist, and 2023-06-01 will have double data
+ '2023-07-01' => '2023-07-31',
+ '2023-08-01' => '2023-07-31',
+ '2023-10-01' => '2023-10-31',
+ '2023-11-01' => '2023-10-31',
+ '2023-12-01' => '2023-12-31',
+ '2024-01-01' => '2023-12-31',
+ '2024-03-01' => '2024-03-30',
+ '2024-03-02' => '2024-03-31',
+ '2024-04-01' => '2024-03-30',
+ '2024-04-02' => '2024-03-31',
+ '2024-05-01' => '2024-05-31',
+ '2024-06-01' => '2024-05-31',
+ '2024-07-01' => '2024-07-31',
+ '2024-08-01' => '2024-07-31',
+ '2024-10-01' => '2024-10-31',
+ '2024-11-01' => '2024-10-31',
+ '2024-12-01' => '2024-12-31',
+ '2025-01-01' => '2024-12-31',
+ '2025-03-01' => '2025-03-29',
+ '2025-03-02' => '2025-03-30',
+ '2025-03-03' => '2025-03-31',
+ '2025-04-01' => '2025-03-29',
+ '2025-04-02' => '2025-03-30',
+ '2025-04-03' => '2025-03-31',
+ '2025-05-01' => '2025-05-31',
+ '2025-06-01' => '2025-05-31',
+ '2025-07-01' => '2025-07-31',
+ '2025-08-01' => '2025-07-31',
];
// Build final dates_to_replace array based on valid_data_points
- $dates_to_replace = [];
- $min_data_points = 110;
- $saved = false;
- $meta_data = $this->meta_data;
-
- if (isset($meta_data['valid_data_points']) && is_array($meta_data['valid_data_points']))
- {
+ $dates_to_replace = [];
+ $min_data_points = 110;
+ $saved = false;
+ $meta_data = $this->meta_data;
+
+ if (isset($meta_data['valid_data_points']) && is_array($meta_data['valid_data_points'])) {
$vdp = $meta_data['valid_data_points'];
-
+
// Check primary dates
- foreach ($primary_dates_to_replace as $date => $corrected_date)
- {
+ foreach ($primary_dates_to_replace as $date => $corrected_date) {
// Only apply replacement if:
// 1. The incorrect date has sufficient data points (> min_data_points)
// 2. The corrected date doesn't already have data (to prevent overwriting valid data)
-
- if (isset($vdp[$date]) && is_numeric($vdp[$date]) && $vdp[$date] > $min_data_points)
- {
- if (!isset($vdp[$corrected_date]) || $vdp[$corrected_date] < $vdp[$date] - 96)
- {
+
+ if (isset($vdp[$date]) && is_numeric($vdp[$date]) && $vdp[$date] > $min_data_points) {
+ if (! isset($vdp[$corrected_date]) || $vdp[$corrected_date] < $vdp[$date] - 96) {
$dates_to_replace[$date] = $corrected_date;
-
- if (!$return_bug_detected)
- Log::debug("fixBugRtcMonthIndex fl=$this->id, found date to replace: $date -> $corrected_date has ".$vdp[$date]." data points");
+
+ if (! $return_bug_detected) {
+ Log::debug("fixBugRtcMonthIndex fl=$this->id, found date to replace: $date -> $corrected_date has ".$vdp[$date].' data points');
+ }
}
}
}
}
- if (count($dates_to_replace) > 0)
- {
- if ($return_bug_detected)
+ if (count($dates_to_replace) > 0) {
+ if ($return_bug_detected) {
return true;
+ }
- if (!isset($start_index))
+ if (! isset($start_index)) {
$start_index = 0;
+ }
- if (!isset($end_index))
- $end_index = count($data_array)-1;
+ if (! isset($end_index)) {
+ $end_index = count($data_array) - 1;
+ }
$replace_count = 0;
- $time_memory = 0;
- $date_memory = null; // memory for next date
+ $time_memory = 0;
+ $date_memory = null; // memory for next date
$date_replaces = 0;
- $date_changed = false;
- $dates_replaced= [];
-
- for ($index = $start_index; $index <= $end_index; $index++) // look forwards to replace the first occurence in the flashlog, because it replaces with a date for last port 3 time_device without error
- {
- if (isset($data_array[$index]['time_device']))
- {
- $time_device = intval($data_array[$index]['time_device']);
- $dtime_device = date('Y-m-d H:i:s', $time_device);
- $date_device = substr($dtime_device, 0, 10); // YYYY-MM-DD
-
- if (isset($dates_to_replace[$date_device]))
- {
- if (!in_array($date_device, $dates_replaced)) // first entry of new date, allow this whole block until date change, or time decrease
- {
+ $date_changed = false;
+ $dates_replaced = [];
+
+ for ($index = $start_index; $index <= $end_index; $index++) { // look forwards to replace the first occurence in the flashlog, because it replaces with a date for last port 3 time_device without error
+ if (isset($data_array[$index]['time_device'])) {
+ $time_device = intval($data_array[$index]['time_device']);
+ $dtime_device = date('Y-m-d H:i:s', $time_device);
+ $date_device = substr($dtime_device, 0, 10); // YYYY-MM-DD
+
+ if (isset($dates_to_replace[$date_device])) {
+ if (! in_array($date_device, $dates_replaced)) { // first entry of new date, allow this whole block until date change, or time decrease
Log::debug("fixBugRtcMonthIndex $index fl=$this->id, found new date $date_device to replace");
$dates_replaced[] = $date_device;
$date_replaces = 0;
- $date_changed = false;
+ $date_changed = false;
$time_decrease = false;
- $date_memory = $date_device;
- }
- else
- {
+ $date_memory = $date_device;
+ } else {
$time_decrease = $time_device < $time_memory ? true : false; // indicate that time increases, because at moment of decrease, replace should stop
- $time_memory = $time_device;
- $date_changed = $date_memory !== null && $date_memory != $date_device ? true : false; // true is new date
- $date_memory = $date_device;
+ $time_memory = $time_device;
+ $date_changed = $date_memory !== null && $date_memory != $date_device ? true : false; // true is new date
+ $date_memory = $date_device;
}
// replace date for incorrect RTC dates (only first encountered block)
- if ($time_decrease || $date_changed || $date_replaces == 96)
- {
+ if ($time_decrease || $date_changed || $date_replaces == 96) {
Log::debug("fixBugRtcMonthIndex $index fl=$this->id, date_device=$date_device, time_decrease=$time_decrease, date_changed=$date_changed, date_replaces=$date_replaces so do not replace anymore");
unset($dates_to_replace[$date_memory]); // skip the next block of this date, because this is the actual correct read out date that should be remained
- }
- else
- {
- $correct_date = $dates_to_replace[$date_device];
- $dtime_device = $correct_date . substr($dtime_device, 10); // corrected date + original time
+ } else {
+ $correct_date = $dates_to_replace[$date_device];
+ $dtime_device = $correct_date.substr($dtime_device, 10); // corrected date + original time
$data_array[$index]['time_device'] = strtotime($dtime_device); // correct time by $device_time
- $data_array[$index]['time'] = $dtime_device ; // correct time by $device_time
- $data_array[$index]['time_corr'] = isset($data_array[$index]['time_corr']) ? $data_array[$index]['time_corr'].' + rtc-replace' : 'rtc-replace';
-
+ $data_array[$index]['time'] = $dtime_device; // correct time by $device_time
+ $data_array[$index]['time_corr'] = isset($data_array[$index]['time_corr']) ? $data_array[$index]['time_corr'].' + rtc-replace' : 'rtc-replace';
+
$replace_count++;
$date_replaces++;
@@ -1306,89 +1253,82 @@ private function fixBugRtcMonthIndex($data_array, $return_bug_detected=false, $s
}
}
}
-
- Log::debug("fixBugRtcMonthIndex fl=$this->id, $replace_count items replaced for fl_id=$this->id start_index=$start_index, end_index=$end_index");
- if ($replace_count > 0)
- {
- $this->addMetaData($data_array, true, false, ['fixBugRtcMonthIndex'=>$replace_count], false); // Do NOT fixBugRtcMonthIndex again
-
+ Log::debug("fixBugRtcMonthIndex fl=$this->id, $replace_count items replaced for fl_id=$this->id start_index=$start_index, end_index=$end_index");
+
+ if ($replace_count > 0) {
+ $this->addMetaData($data_array, true, false, ['fixBugRtcMonthIndex' => $replace_count], false); // Do NOT fixBugRtcMonthIndex again
+
// Store corrected data_array to log_file_parsed
- $disk = env('FLASHLOG_STORAGE', 'public');
- $time = date("YmdHis");
- $logFileName = "flashlog/sensor_".$this->device_id."_flash_parsed_$time.json";
- $saved = Storage::disk($disk)->put($logFileName, json_encode($data_array), ['mimetype' => 'application/json']);
- $file_url = Storage::disk($disk)->url($logFileName);
+ $disk = env('FLASHLOG_STORAGE', 'public');
+ $time = date('YmdHis');
+ $logFileName = 'flashlog/sensor_'.$this->device_id."_flash_parsed_$time.json";
+ $saved = Storage::disk($disk)->put($logFileName, json_encode($data_array), ['mimetype' => 'application/json']);
+ $file_url = Storage::disk($disk)->url($logFileName);
$this->log_file_parsed = $file_url;
$this->save();
}
- }
- else
- {
- if ($return_bug_detected)
+ } else {
+ if ($return_bug_detected) {
return false;
+ }
- Log::debug("fixBugRtcMonthIndex fl=$this->id, no dates to replace for start_index=$start_index, end_index=$end_index");
+ Log::debug("fixBugRtcMonthIndex fl=$this->id, no dates to replace for start_index=$start_index, end_index=$end_index");
}
return $saved;
}
- private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $flashlog, $setCount, $device, $log, $db_time, $matches_min, $match_props, $db_records, $show=false, $add_sensordefinitions=true, $use_rtc=true, $last_onoff=false, $correct_data=false, $previous_offset=0)
+ private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $flashlog, $setCount, $device, $log, $db_time, $matches_min, $match_props, $db_records, $show = false, $add_sensordefinitions = true, $use_rtc = true, $last_onoff = false, $correct_data = false, $previous_offset = 0)
{
- $has_matches = false;
- $block_i = $on['i'];
- $start_index = $block_i + 1;
- $interval = isset($on['measurement_interval_min']) ? intval($on['measurement_interval_min']) : $device->measurement_interval_min; // transmission ratio is not of importance here, because log contains all measurements
- $interval_sec = $interval * 60; // transmission ratio is not of importance here, because log contains all measurements
-
- $db_moment = new Moment($db_time);
-
- $indexes = max(0, $end_index - $start_index);
- $duration_min = $interval * $indexes;
- $duration_hrs = round($duration_min / 60, 1);
- $min_timestamp = self::$minUnixTime;
- $max_timestamp = isset($this->created_at) ? strtotime($this->created_at) : time(); // PGe 20250909: used to be time(), but created_at is FL upload date, so should not go beyond that;
- // check if database query should be based on the device time, or the cached time from the
+ $has_matches = false;
+ $block_i = $on['i'];
+ $start_index = $block_i + 1;
+ $interval = isset($on['measurement_interval_min']) ? intval($on['measurement_interval_min']) : $device->measurement_interval_min; // transmission ratio is not of importance here, because log contains all measurements
+ $interval_sec = $interval * 60; // transmission ratio is not of importance here, because log contains all measurements
+
+ $db_moment = new Moment($db_time);
+
+ $indexes = max(0, $end_index - $start_index);
+ $duration_min = $interval * $indexes;
+ $duration_hrs = round($duration_min / 60, 1);
+ $min_timestamp = self::$minUnixTime;
+ $max_timestamp = isset($this->created_at) ? strtotime($this->created_at) : time(); // PGe 20250909: used to be time(), but created_at is FL upload date, so should not go beyond that;
+ // check if database query should be based on the device time, or the cached time from the
$use_device_time = false;
// get time_device start/end from block data
$time_device_start = null;
- $time_device_end = null;
- $time_start_index = $start_index;
- $time_end_index = $end_index;
- $device_time_offset= $previous_offset !== 0 ? $previous_offset : null;
- $time_device_last = 0;
- $upload_time_sec = 120; // offset seconds from last timestamp to upload
+ $time_device_end = null;
+ $time_start_index = $start_index;
+ $time_end_index = $end_index;
+ $device_time_offset = $previous_offset !== 0 ? $previous_offset : null;
+ $time_device_last = 0;
+ $upload_time_sec = 120; // offset seconds from last timestamp to upload
- $time_corrections = $this->getTimeCorrections(); // array with unix timestamps as keys and time correction seconds as values to correct flashlog data
- $time_correct_set = count($time_corrections) > 0 ? true : false;
- //dd($time_corrections);
+ $time_corrections = $this->getTimeCorrections(); // array with unix timestamps as keys and time correction seconds as values to correct flashlog data
+ $time_correct_set = count($time_corrections) > 0 ? true : false;
+ // dd($time_corrections);
// correct device time in last onoff block if it is not close to upload date, or goes beyond the $max_timestamp
- if (($correct_data || $time_correct_set) && $use_rtc)
- {
-
- for ($index=$end_index; $index >= $start_index; $index--) // look backwards for last port 3 time_device without error
- {
- if (isset($flashlog[$index]['port']) && $flashlog[$index]['port'] == 3 && isset($flashlog[$index]['time_device']))
- {
+ if (($correct_data || $time_correct_set) && $use_rtc) {
+
+ for ($index = $end_index; $index >= $start_index; $index--) { // look backwards for last port 3 time_device without error
+ if (isset($flashlog[$index]['port']) && $flashlog[$index]['port'] == 3 && isset($flashlog[$index]['time_device'])) {
$time_device = intval($flashlog[$index]['time_device']) + $previous_offset;
- if ($correct_data && $previous_offset)
- {
+ if ($correct_data && $previous_offset) {
$flashlog[$index]['time_device'] = $time_device; // correct time by $device_time_offset
- $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device); // correct time by $device_time
+ $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device); // correct time by $device_time
$flashlog[$index]['time_offset'] = $previous_offset;
- $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr'].' + prev' : 'prev';
- $use_device_time = true;
+ $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr'].' + prev' : 'prev';
+ $use_device_time = true;
}
-
+
// In last block, correct for difference with last time value and upload date ($max_timestamp)
- if ($correct_data && $last_onoff)
- {
+ if ($correct_data && $last_onoff) {
// if (!isset($flashlog[$index]['time_error']))
// {
// if ($time_device > $time_device_last)
@@ -1398,7 +1338,7 @@ private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $f
// {
// $time_device_end = $time_device;
// $time_end_index = $index;
-
+
// if (!isset($device_time_offset) && $time_device_end > $max_timestamp)
// {
// $device_time_offset = $max_timestamp - $time_device_end - $upload_time_sec; // offset negative number, minus 120 sec for upload time
@@ -1410,22 +1350,20 @@ private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $f
// }
// Correct too_high complete block offset time by interval
- if (isset($device_time_offset))
- {
- //$time_device_new = $time_device + $device_time_offset;
+ if (isset($device_time_offset)) {
+ // $time_device_new = $time_device + $device_time_offset;
$time_device_new = $max_timestamp - (($time_end_index - $index) * $interval_sec) - $upload_time_sec;
$flashlog[$index]['time_device'] = $time_device_new; // correct time by $device_time_offset
- $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device_new); // correct time by $device_time
- $flashlog[$index]['time_offset'] = $time_device_new - $time_device;
- $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr'].' + down' : 'down';
- $use_device_time = true;
- // $flashlog[$index]['time_offset'] = $device_time_offset;
+ $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device_new); // correct time by $device_time
+ $flashlog[$index]['time_offset'] = $time_device_new - $time_device;
+ $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr'].' + down' : 'down';
+ $use_device_time = true;
+ // $flashlog[$index]['time_offset'] = $device_time_offset;
unset($flashlog[$index]['time_error']);
- //dd($block_index, $start_index, $end_index, $time_device-$device_time_offset, $device_time_offset, $device_time_offset, $index, $flashlog[$index]);
+ // dd($block_index, $start_index, $end_index, $time_device-$device_time_offset, $device_time_offset, $device_time_offset, $index, $flashlog[$index]);
}
}
-
}
}
@@ -1442,7 +1380,7 @@ private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $f
// $time_device_new = intval($flashlog[$index]['time_device']) + $device_time_offset;
// $flashlog[$index]['time_device'] = $time_device_new; // correct time by $device_time_offset
// $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device_new); // correct time by $device_time
- // $flashlog[$index]['time_offset'] = $device_time_offset;
+ // $flashlog[$index]['time_offset'] = $device_time_offset;
// $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr'].' + up' : 'up';
// $use_device_time = true;
// unset($flashlog[$index]['time_error']);
@@ -1455,340 +1393,323 @@ private function matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $f
$block_time_offset = 0;
$block_manual_offset = 0;
$apply_time_shift_offset = env('FLASHLOG_FIX_TIME_JUMP', true);
- for ($index=$start_index; $index <= $end_index; $index++)
- {
- if (isset($flashlog[$index]['time_device']) && !isset($flashlog[$index]['time_error']) && $flashlog[$index]['port'] == 3)
- {
- $time_device = intval($flashlog[$index]['time_device']) + $previous_offset;
- $time_device_next = $index < $end_index && isset($flashlog[$index+1]['time_device']) ? intval($flashlog[$index+1]['time_device']) + $previous_offset : $time_device;
-
+ for ($index = $start_index; $index <= $end_index; $index++) {
+ if (isset($flashlog[$index]['time_device']) && ! isset($flashlog[$index]['time_error']) && $flashlog[$index]['port'] == 3) {
+ $time_device = intval($flashlog[$index]['time_device']) + $previous_offset;
+ $time_device_next = $index < $end_index && isset($flashlog[$index + 1]['time_device']) ? intval($flashlog[$index + 1]['time_device']) + $previous_offset : $time_device;
+
// Apply manual time corrections
- if ($time_correct_set)
- {
- foreach ($time_corrections as $timestamp => $correct_sec)
- {
- if ($timestamp <= $time_device)
- {
+ if ($time_correct_set) {
+ foreach ($time_corrections as $timestamp => $correct_sec) {
+ if ($timestamp <= $time_device) {
$block_manual_offset = $correct_sec;
break;
}
}
}
- if ($block_time_offset !== 0 || $block_manual_offset !== 0)
- {
- $corr_msg = $block_time_offset !== 0 && $block_manual_offset !== 0 ? 'corr + step' : ($block_manual_offset !== 0 ? 'corr' : 'step');
- $time_device += $block_time_offset + $block_manual_offset;
+ if ($block_time_offset !== 0 || $block_manual_offset !== 0) {
+ $corr_msg = $block_time_offset !== 0 && $block_manual_offset !== 0 ? 'corr + step' : ($block_manual_offset !== 0 ? 'corr' : 'step');
+ $time_device += $block_time_offset + $block_manual_offset;
$flashlog[$index]['time_device'] = $time_device;
$flashlog[$index]['time_offset'] = $block_time_offset;
- $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr']." + $corr_msg" : $corr_msg;
- $use_device_time = true;
-
- if ($time_device < $max_timestamp)
- $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device); // correct time by $device_time
- else
+ $flashlog[$index]['time_corr'] = isset($flashlog[$index]['time_corr']) ? $flashlog[$index]['time_corr']." + $corr_msg" : $corr_msg;
+ $use_device_time = true;
+
+ if ($time_device < $max_timestamp) {
+ $flashlog[$index]['time'] = date('Y-m-d H:i:s', $time_device);
+ } // correct time by $device_time
+ else {
$flashlog[$index]['time_error'] = 'beyond max';
+ }
}
// Detect jumps in time: if step in time it the wrong direction (down in stead of up), correct forwards for this jump
- if ($apply_time_shift_offset && $correct_data)
- {
+ if ($apply_time_shift_offset && $correct_data) {
$next_time_offset = $time_device - $time_device_next;
- if (abs($next_time_offset) > 85000 && abs($next_time_offset) < 87400 && $time_device < $max_timestamp && $time_device > self::$minUnixTime) // only detect jumps of 24h back/forward in time (fw 1.5.13 RTC readout bug)
- {
+ if (abs($next_time_offset) > 85000 && abs($next_time_offset) < 87400 && $time_device < $max_timestamp && $time_device > self::$minUnixTime) { // only detect jumps of 24h back/forward in time (fw 1.5.13 RTC readout bug)
$block_time_offset = $next_time_offset + $interval_sec - $previous_offset;
Log::debug("matchFlashLogBlock block_i=$block_index, fl_i=$fl_index, i=$index, previous_offset=$previous_offset, next_time_offset=$next_time_offset, block_time_offset=$block_time_offset");
- $device_time_offset= $block_time_offset; // make sure step time offset is pushed to the next block
+ $device_time_offset = $block_time_offset; // make sure step time offset is pushed to the next block
}
}
- }
- else
- {
+ } else {
Log::debug("matchFlashLogBlock NOT CORR block_i=$block_index, fl_i=$fl_index, i=$index, previous_offset=$previous_offset, block_time_offset=$block_time_offset");
}
}
}
-
- $firmware_version = isset($on['firmware_version']) ? $on['firmware_version'] : null;
- $transmission_ratio= isset($on['measurement_transmission_ratio']) ? $on['measurement_transmission_ratio'] : null;
+ $firmware_version = isset($on['firmware_version']) ? $on['firmware_version'] : null;
+ $transmission_ratio = isset($on['measurement_transmission_ratio']) ? $on['measurement_transmission_ratio'] : null;
// Cap start and end index by (corrected) device time
- if (!isset($time_device_start) || !isset($time_device_end))
- {
- for ($index=$start_index; $index <= $end_index; $index++)
- {
- if (isset($flashlog[$index]['time_device']) && !isset($flashlog[$index]['time_error']) && $flashlog[$index]['port'] == 3)
- {
+ if (! isset($time_device_start) || ! isset($time_device_end)) {
+ for ($index = $start_index; $index <= $end_index; $index++) {
+ if (isset($flashlog[$index]['time_device']) && ! isset($flashlog[$index]['time_error']) && $flashlog[$index]['port'] == 3) {
$time_device = intval($flashlog[$index]['time_device']);
// cap start index
- if ($time_device_start === null && $time_device > self::$minUnixTime && $time_device < $max_timestamp)
- {
+ if ($time_device_start === null && $time_device > self::$minUnixTime && $time_device < $max_timestamp) {
$time_device_start = $time_device;
- $time_start_index = $index;
+ $time_start_index = $index;
}
// cap end index
- if ($time_device_start !== null && $time_device > self::$minUnixTime && $time_device < $max_timestamp)
- {
+ if ($time_device_start !== null && $time_device > self::$minUnixTime && $time_device < $max_timestamp) {
$time_device_end = $time_device;
- $time_end_index = $index;
+ $time_end_index = $index;
}
}
}
}
- if (isset($time_device_start))
- {
- $diff_start_sec= $interval_sec * ($time_start_index - $start_index);
+ if (isset($time_device_start)) {
+ $diff_start_sec = $interval_sec * ($time_start_index - $start_index);
$device_moment = new Moment($time_device_start - $diff_start_sec);
- $device_time = $device_moment->format($this->timeFormat);
- if ($time_device_start >= strtotime($db_time) - 60) // db time should be a little later than device time, becuase of lora message delay
- {
+ $device_time = $device_moment->format($this->timeFormat);
+ if ($time_device_start >= strtotime($db_time) - 60) { // db time should be a little later than device time, becuase of lora message delay
// adjust time to use as start of block from db time to flashlog time
- $db_time = $device_time;
- $db_moment = $device_moment;
+ $db_time = $device_time;
+ $db_moment = $device_moment;
$use_device_time = true;
}
}
-
+
// if ($last_onoff)
// dd(['matchFlashLogBlock', 'use_device_time'=>$use_device_time, 'use_rtc'=>$use_rtc, 'db_time'=>$db_time, 'time_device_start'=>date('Y-m-d H:i:s', $time_device_start), 'time_device_end'=>date('Y-m-d H:i:s', $time_device_end)]);
// // If the device has an RTC, assume that all times match (if valid times)
- if ($use_rtc && $device->rtc && $use_device_time)
- {
- $end_moment = new Moment($time_device_end);
- $time_end = $end_moment->format($this->timeFormat);
- $match_first = ['flashlog_index'=>$start_index, 'minute_interval'=>$interval, 'time'=>$db_time];
- // Set time and add weight_kg by calibration
- $block = $this->setFlashBlockTimes($match_first, $block_i, $start_index, $end_index, $flashlog, $device, $show, $interval_sec, $add_sensordefinitions, $use_device_time);
- $flashlog = $block['flashlog'];
-
- if (isset($block['index_start']))
- {
- $match_feedback_arr = ['time'=>'RTC'];
-
- if ($last_onoff)
- {
- if (isset($flashlog[$end_index]['time_clock']))
+ if ($use_rtc && $device->rtc && $use_device_time) {
+ $end_moment = new Moment($time_device_end);
+ $time_end = $end_moment->format($this->timeFormat);
+ $match_first = ['flashlog_index' => $start_index, 'minute_interval' => $interval, 'time' => $db_time];
+ // Set time and add weight_kg by calibration
+ $block = $this->setFlashBlockTimes($match_first, $block_i, $start_index, $end_index, $flashlog, $device, $show, $interval_sec, $add_sensordefinitions, $use_device_time);
+ $flashlog = $block['flashlog'];
+
+ if (isset($block['index_start'])) {
+ $match_feedback_arr = ['time' => 'RTC'];
+
+ if ($last_onoff) {
+ if (isset($flashlog[$end_index]['time_clock'])) {
$match_feedback_arr['time_clock'] = $flashlog[$end_index]['time_clock'];
+ }
- if (isset($flashlog[$end_index]['time_corr']))
+ if (isset($flashlog[$end_index]['time_corr'])) {
$match_feedback_arr['time_corr'] = $flashlog[$end_index]['time_corr'];
+ }
- if ($device_time_offset !== null)
+ if ($device_time_offset !== null) {
$match_feedback_arr['offset_sec'] = $device_time_offset;
+ }
}
- $log_block = ['block'=>$block_index, 'block_i'=>$block_i, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$start_index, 'db_time'=>$db_time, 'interval_min'=>$interval, 'interval_sec'=>$interval_sec, 'index_start'=>$block['index_start'], 'index_end'=>$block['index_end'], 'time_start'=>$block['time_start'], 'time_end'=>$time_end, 'setCount'=>$block['setCount'], 'matches'=>['matches'=>array_fill(0, $matches_min, $match_feedback_arr)]];
+ $log_block = ['block' => $block_index, 'block_i' => $block_i, 'start_i' => $start_index, 'end_i' => $end_index, 'duration_hours' => $duration_hrs, 'fl_i' => $start_index, 'db_time' => $db_time, 'interval_min' => $interval, 'interval_sec' => $interval_sec, 'index_start' => $block['index_start'], 'index_end' => $block['index_end'], 'time_start' => $block['time_start'], 'time_end' => $time_end, 'setCount' => $block['setCount'], 'matches' => ['matches' => array_fill(0, $matches_min, $match_feedback_arr)]];
- if (isset($transmission_ratio))
+ if (isset($transmission_ratio)) {
$log_block['transmission_ratio'] = $transmission_ratio;
+ }
- if (isset($firmware_version))
+ if (isset($firmware_version)) {
$log_block['fw_version'] = $firmware_version;
+ }
$log[] = $log_block;
$setCount += $block['setCount'];
$fl_index = $block['index_end'];
- $db_time = $time_end;
+ $db_time = $time_end;
}
- return ['has_matches'=>true, 'flashlog'=>$flashlog, 'db_time'=>$db_time, 'log'=>$log, 'fl_index'=>$fl_index, 'setCount'=>$setCount, 'device_time_offset'=>$device_time_offset];
- }
+ return ['has_matches' => true, 'flashlog' => $flashlog, 'db_time' => $db_time, 'log' => $log, 'fl_index' => $fl_index, 'setCount' => $setCount, 'device_time_offset' => $device_time_offset];
+ }
// Disable half time checking, because will be solved in matchFlashLogTime
- // set time to 1/2 of interval if > 2 * amount of indexes
- // if ($indexes > 2 * $db_records && $use_device_time === false)
+ // set time to 1/2 of interval if > 2 * amount of indexes
+ // if ($indexes > 2 * $db_records && $use_device_time === false)
// {
// $db_q_time = $db_moment->addMinutes(round($duration_min/2))->format($this->timeFormat);
// $db_max = max($matches_min, min($db_records, $indexes/2));
// }
// else
// {
- $db_q_time = $db_time;
- $db_max = max($matches_min, min($db_records, $indexes));
+ $db_q_time = $db_time;
+ $db_max = max($matches_min, min($db_records, $indexes));
// }
// matchFlashLogTime returns: ['fl_index'=>$fl_index, 'fl_index_end'=>$fl_index_end, 'fl_match_tries'=>$tries, 'db_start_time'=>$start_time, 'db_data'=>$db_data, 'db_data_count'=>count($db_data), 'matches'=>$matches];
$matches = $this->matchFlashLogTime($device, $flashlog, $matches_min, $match_props, $start_index, $end_index, $duration_hrs, $interval, $db_q_time, $db_max, $show);
-
- if (isset($matches['matches']))
- {
+
+ if (isset($matches['matches'])) {
$matches_arr = $matches['matches'];
$match_first = reset($matches_arr); // take first match for matching the time
// Correct time based on time deviation in matches
- if (isset($match_first['flashlog_index']) && isset($match_first['time']))
- {
- $fl_index = $match_first['flashlog_index'];
+ if (isset($match_first['flashlog_index']) && isset($match_first['time'])) {
+ $fl_index = $match_first['flashlog_index'];
$match_last = end($matches_arr); // take last match
- //die(print_r($match));
+ // die(print_r($match));
- $match_first_time = $match_first['db_sec'];// 1620339094
- $match_last_time = $match_last['db_sec']; // 1620356195
- $match_total_count = count($matches_arr); // 20
- $sec_diff_per_match = ($match_last_time - $match_first_time) / ($match_total_count-1); // 900.0526315789 sec in between
- $max_sec_deviation = round($interval_sec / 10); // max 90 sec for 900 sec interval
+ $match_first_time = $match_first['db_sec']; // 1620339094
+ $match_last_time = $match_last['db_sec']; // 1620356195
+ $match_total_count = count($matches_arr); // 20
+ $sec_diff_per_match = ($match_last_time - $match_first_time) / ($match_total_count - 1); // 900.0526315789 sec in between
+ $max_sec_deviation = round($interval_sec / 10); // max 90 sec for 900 sec interval
// Set the difference per time index based on the deviation in the matches found (if smaller than $max_sec_deviation), or set it on the set interval
- if ($device->rtc) // assume that the timing is good
+ if ($device->rtc) { // assume that the timing is good
$sec_diff_per_index = $interval_sec;
- else if (abs($sec_diff_per_match - $interval_sec) < $max_sec_deviation) // deviation is within $max_sec_deviation (10%), so take $sec_diff_per_match
+ } elseif (abs($sec_diff_per_match - $interval_sec) < $max_sec_deviation) { // deviation is within $max_sec_deviation (10%), so take $sec_diff_per_match
$sec_diff_per_index = $sec_diff_per_match;
- else
+ } else {
$sec_diff_per_index = $interval_sec;
+ }
- $matches_display = array_slice($matches_arr, 0, $matches_min);
+ $matches_display = array_slice($matches_arr, 0, $matches_min);
$matches['matches'] = $matches_display;
-
- //dd([$match_first_time, $match_last_time, $sec_diff_per_index, $match_first, $match_last]);
- $block = $this->setFlashBlockTimes($match_first, $block_i, $start_index, $end_index, $flashlog, $device, $show, $sec_diff_per_index, $add_sensordefinitions);
+ // dd([$match_first_time, $match_last_time, $sec_diff_per_index, $match_first, $match_last]);
+
+ $block = $this->setFlashBlockTimes($match_first, $block_i, $start_index, $end_index, $flashlog, $device, $show, $sec_diff_per_index, $add_sensordefinitions);
$flashlog = $block['flashlog'];
- if (isset($block['index_end']))
- {
+ if (isset($block['index_end'])) {
// A match is found
$has_matches = true;
- if ($show)
- $log[] = ['block'=> $block_index, 'block_i'=>$block_i, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$fl_index, 'db_time'=>$db_time, 'fw_version'=>$firmware_version, 'interval_min'=>$interval, 'transmission_ratio'=>$transmission_ratio, 'index_start'=>$block['index_start'], 'index_end'=>$block['index_end'], 'time_start'=>$block['time_start'], 'time_end'=>$block['time_end'], 'setCount'=>$block['setCount'], 'matches'=>$matches, 'dbCount'=>$block['dbCount'], 'sec_diff_per_index'=>$sec_diff_per_index, 'match_first_db_sec'=>$match_first_time, 'match_last_db_sec'=>$match_last_time, 'match_total_count'=>$match_total_count, 'sec_diff_per_match'=>$sec_diff_per_match, 'interval_sec'=>$interval_sec];
+ if ($show) {
+ $log[] = ['block' => $block_index, 'block_i' => $block_i, 'start_i' => $start_index, 'end_i' => $end_index, 'duration_hours' => $duration_hrs, 'fl_i' => $fl_index, 'db_time' => $db_time, 'fw_version' => $firmware_version, 'interval_min' => $interval, 'transmission_ratio' => $transmission_ratio, 'index_start' => $block['index_start'], 'index_end' => $block['index_end'], 'time_start' => $block['time_start'], 'time_end' => $block['time_end'], 'setCount' => $block['setCount'], 'matches' => $matches, 'dbCount' => $block['dbCount'], 'sec_diff_per_index' => $sec_diff_per_index, 'match_first_db_sec' => $match_first_time, 'match_last_db_sec' => $match_last_time, 'match_total_count' => $match_total_count, 'sec_diff_per_match' => $sec_diff_per_match, 'interval_sec' => $interval_sec];
+ }
$setCount += $block['setCount'];
- $db_time = $block['time_end'];
+ $db_time = $block['time_end'];
$fl_index = $block['index_end'];
- }
- else
- {
- if ($show)
- $log[] = ['block'=> $block_index, 'block_i'=>$block_i, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$fl_index, 'db_time'=>$db_time, 'fw_version'=>$firmware_version, 'interval_min'=>$interval, 'transmission_ratio'=>$transmission_ratio, 'sec_diff_per_match'=>$sec_diff_per_match, 'interval_sec'=>$interval_sec];
+ } else {
+ if ($show) {
+ $log[] = ['block' => $block_index, 'block_i' => $block_i, 'start_i' => $start_index, 'end_i' => $end_index, 'duration_hours' => $duration_hrs, 'fl_i' => $fl_index, 'db_time' => $db_time, 'fw_version' => $firmware_version, 'interval_min' => $interval, 'transmission_ratio' => $transmission_ratio, 'sec_diff_per_match' => $sec_diff_per_match, 'interval_sec' => $interval_sec];
+ }
$db_time = $db_moment->addMinutes($duration_min)->format($this->timeFormat);
}
- }
- else
- {
- //die(print_r($matches));
- if ($show)
- $log[] = ['block'=> $block_index, 'block_i'=>$block_i, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$fl_index, 'db_time'=>$db_time, 'fw_version'=>$firmware_version, 'interval_min'=>$interval, 'transmission_ratio'=>$transmission_ratio, 'no_matches'=>'fl_i and time of match not set', 'match'=>$matches];
+ } else {
+ // die(print_r($matches));
+ if ($show) {
+ $log[] = ['block' => $block_index, 'block_i' => $block_i, 'start_i' => $start_index, 'end_i' => $end_index, 'duration_hours' => $duration_hrs, 'fl_i' => $fl_index, 'db_time' => $db_time, 'fw_version' => $firmware_version, 'interval_min' => $interval, 'transmission_ratio' => $transmission_ratio, 'no_matches' => 'fl_i and time of match not set', 'match' => $matches];
+ }
$db_time = $db_moment->addMinutes($duration_min)->format($this->timeFormat);
}
- }
- else
- {
- if ($show)
- $log[] = ['block'=> $block_index, 'block_i'=>$block_i, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$fl_index, 'db_time'=>$db_time, 'fw_version'=>$firmware_version, 'interval_min'=>$interval, 'transmission_ratio'=>$transmission_ratio, 'no_matches'=>$matches];
+ } else {
+ if ($show) {
+ $log[] = ['block' => $block_index, 'block_i' => $block_i, 'start_i' => $start_index, 'end_i' => $end_index, 'duration_hours' => $duration_hrs, 'fl_i' => $fl_index, 'db_time' => $db_time, 'fw_version' => $firmware_version, 'interval_min' => $interval, 'transmission_ratio' => $transmission_ratio, 'no_matches' => $matches];
+ }
$db_time = $db_moment->addMinutes($duration_min)->format($this->timeFormat);
}
- return ['has_matches'=>$has_matches, 'flashlog'=>$flashlog, 'db_time'=>$db_time, 'log'=>$log, 'fl_index'=>$fl_index, 'setCount'=>$setCount, 'device_time_offset'=>$device_time_offset];
- }
+ return ['has_matches' => $has_matches, 'flashlog' => $flashlog, 'db_time' => $db_time, 'log' => $log, 'fl_index' => $fl_index, 'setCount' => $setCount, 'device_time_offset' => $device_time_offset];
+ }
/* Flashlog data correction algorithm
1. Match time ascending database data to Flash log data of BEEP bases
2. Match a number of ($matches_min) measurements in a row with multiple ($match_props) exact matches to find the correct time of the log data
- 3. Align the Flash log time for all 'blocks' of port 3 (measurements) between port 2 (on/off) records
+ 3. Align the Flash log time for all 'blocks' of port 3 (measurements) between port 2 (on/off) records
4. Add the correct time to the Flashlog file
*/
- private function fillTimeFromInflux($device, $flashlog=null, $save=false, $show=false, $matches_min_override=null, $match_props_override=null, $db_records_override=null, $match_days_offset=0, $add_sensordefinitions=true, $use_rtc=true, $correct_data=false)
+ private function fillTimeFromInflux($device, $flashlog = null, $save = false, $show = false, $matches_min_override = null, $match_props_override = null, $db_records_override = null, $match_days_offset = 0, $add_sensordefinitions = true, $use_rtc = true, $correct_data = false)
{
- $out = [];
- $matches_min = env('FLASHLOG_MIN_MATCHES', 5); // minimum amount of inline measurements that should be matched
- $match_props = env('FLASHLOG_MATCH_PROPS', 9); // minimum amount of measurement properties that should match
- $db_records = env('FLASHLOG_DB_RECORDS', 80);// amount of DB records to fetch to match each block
+ $out = [];
+ $matches_min = env('FLASHLOG_MIN_MATCHES', 5); // minimum amount of inline measurements that should be matched
+ $match_props = env('FLASHLOG_MATCH_PROPS', 9); // minimum amount of measurement properties that should match
+ $db_records = env('FLASHLOG_DB_RECORDS', 80); // amount of DB records to fetch to match each block
- if (isset($matches_min_override))
+ if (isset($matches_min_override)) {
$matches_min = $matches_min_override;
+ }
- if (isset($match_props_override))
+ if (isset($match_props_override)) {
$match_props = $match_props_override;
+ }
- if (isset($db_records_override))
+ if (isset($db_records_override)) {
$db_records = $db_records_override;
+ }
- if ($flashlog == null || count($flashlog) < $matches_min) // reject stoo small blocks of data
+ if ($flashlog == null || count($flashlog) < $matches_min) { // reject stoo small blocks of data
return null;
+ }
$fl_index = 0;
- $db_time = '2019-01-01 00:00:00'; // start before any BEEP bases were live
+ $db_time = '2019-01-01 00:00:00'; // start before any BEEP bases were live
$setCount = 0;
- $log = [];
- $on_offs = $this->getFlashLogOnOffs($device, $flashlog, $fl_index);
- $device_id= $device->id;
- $matches = 0;
- $onoff_cnt= count($on_offs);
- $offset_s = 0;
-
- for ($on_i=0 ; $on_i <= $onoff_cnt-1 ; $on_i++) // analyse blocks forwards, to be able to match with db
- {
- $block_index = $on_i;
- $on = $on_offs[$on_i];
- $last_onoff = $block_index == $onoff_cnt-1 ? true : false;
-
- if (isset($on['end_index']))
- {
- $end_index = $on['end_index'];
+ $log = [];
+ $on_offs = $this->getFlashLogOnOffs($device, $flashlog, $fl_index);
+ $device_id = $device->id;
+ $matches = 0;
+ $onoff_cnt = count($on_offs);
+ $offset_s = 0;
+
+ for ($on_i = 0; $on_i <= $onoff_cnt - 1; $on_i++) { // analyse blocks forwards, to be able to match with db
+ $block_index = $on_i;
+ $on = $on_offs[$on_i];
+ $last_onoff = $block_index == $onoff_cnt - 1 ? true : false;
+
+ if (isset($on['end_index'])) {
+ $end_index = $on['end_index'];
// if ($start_index >= $fl_index)
// {
-
+
$matchBlockResult = $this->matchFlashLogBlock($block_index, $fl_index, $end_index, $on, $flashlog, $setCount, $device, $log, $db_time, $matches_min, $match_props, $db_records, $show, $add_sensordefinitions, $use_rtc, $last_onoff, $correct_data, $offset_s);
- $flashlog = $matchBlockResult['flashlog'];
- $offset_s = $matchBlockResult['device_time_offset'];
- $db_time = $matchBlockResult['db_time'];
- $log = $matchBlockResult['log'];
- $setCount = $matchBlockResult['setCount'];
- $fl_index = $matchBlockResult['fl_index'];
- $matches += $matchBlockResult['has_matches'] ? 1 : 0;
+ $flashlog = $matchBlockResult['flashlog'];
+ $offset_s = $matchBlockResult['device_time_offset'];
+ $db_time = $matchBlockResult['db_time'];
+ $log = $matchBlockResult['log'];
+ $setCount = $matchBlockResult['setCount'];
+ $fl_index = $matchBlockResult['fl_index'];
+ $matches += $matchBlockResult['has_matches'] ? 1 : 0;
// }
// else
// {
// if ($show)
// $log[] = ['block'=> $block_index, 'block_i'=>$block_index, 'start_i'=>$start_index, 'end_i'=>$end_index, 'duration_hours'=>$duration_hrs, 'fl_i'=>$fl_index, 'db_time'=>$db_time, 'fw_version'=>$firmware_version, 'interval_min'=>$on['measurement_interval_min'], 'transmission_ratio'=>$on['measurement_transmission_ratio'], 'no_matches'=>'start_index < fl_index'];
// }
- //Log::debug(['fillTimeFromInflux', 'device_id'=>$device->id, 'use_rtc'=>$use_rtc, 'matches'=>$matches, 'db_time'=>$db_time, 'log'=>$log]);
+ // Log::debug(['fillTimeFromInflux', 'device_id'=>$device->id, 'use_rtc'=>$use_rtc, 'matches'=>$matches, 'db_time'=>$db_time, 'log'=>$log]);
}
}
$records_flashlog = 0;
- $records_timed = 0;
- $records_weight = 0;
- foreach ($flashlog as $f)
- {
- if (isset($f['port']) && $f['port'] == 3)
- {
+ $records_timed = 0;
+ $records_weight = 0;
+ foreach ($flashlog as $f) {
+ if (isset($f['port']) && $f['port'] == 3) {
$records_flashlog++;
-
- if (isset($f['time']))
+
+ if (isset($f['time'])) {
$records_timed++;
+ }
- if (isset($f['weight_kg']) || isset($f['w_v']))
+ if (isset($f['weight_kg']) || isset($f['w_v'])) {
$records_weight++;
+ }
}
}
- $time_percentage = $records_flashlog > 0 ? min(100, 100*($records_timed/$records_flashlog)) : 0;
- $weight_percentage = $records_flashlog > 0 ? min(100, 100*($records_weight/$records_flashlog)) : 0;
- $out = ['matching_blocks'=>$matches, 'time_percentage'=>$time_percentage, 'records_timed'=>$records_timed, 'weight_percentage'=>$weight_percentage, 'records_flashlog'=>$records_flashlog, 'time_insert_count'=>$setCount, 'flashlog'=>$flashlog];
+ $time_percentage = $records_flashlog > 0 ? min(100, 100 * ($records_timed / $records_flashlog)) : 0;
+ $weight_percentage = $records_flashlog > 0 ? min(100, 100 * ($records_weight / $records_flashlog)) : 0;
+ $out = ['matching_blocks' => $matches, 'time_percentage' => $time_percentage, 'records_timed' => $records_timed, 'weight_percentage' => $weight_percentage, 'records_flashlog' => $records_flashlog, 'time_insert_count' => $setCount, 'flashlog' => $flashlog];
- if ($show)
- {
+ if ($show) {
$out['log'] = $log;
$out['matches_min'] = $matches_min;
$out['match_props'] = $match_props;
- $out['db_records'] = $db_records;
+ $out['db_records'] = $db_records;
}
return $out;
}
- public static function cleanFlashlogItem($data_array, $unset_time=true)
+ public static function cleanFlashlogItem($data_array, $unset_time = true)
{
unset(
$data_array['payload_hex'],
@@ -1805,8 +1726,8 @@ public static function cleanFlashlogItem($data_array, $unset_time=true)
$data_array['fft_start_bin'],
$data_array['fft_stop_bin']
);
-
- if ($unset_time)
+
+ if ($unset_time) {
unset(
$data_array['i'],
$data_array['minute_interval'],
@@ -1817,6 +1738,7 @@ public static function cleanFlashlogItem($data_array, $unset_time=true)
$data_array['time_corr'],
$data_array['time_offset'],
);
+ }
return $data_array;
}
@@ -1834,118 +1756,105 @@ public static function cleanDbDataItem($data_array)
$clean_d['key'],
$clean_d['snr'],
);
-
+
return $clean_d;
}
- public static function insertAt(array $array, int $position, $key, $value): array {
+ public static function insertAt(array $array, int $position, $key, $value): array
+ {
return array_slice($array, 0, $position, true)
+ [$key => $value]
+ array_slice($array, $position, null, true);
}
- public static function exportData(&$data, $name, $csv=true, $separator=',', $link_override=false, $validate_time=false, $min_unix_ts=null, $max_unix_ts=null, $csv_columns=null)
+ public static function exportData(&$data, $name, $csv = true, $separator = ',', $link_override = false, $validate_time = false, $min_unix_ts = null, $max_unix_ts = null, $csv_columns = null)
{
- $link = $link_override ? $link_override : env('FLASHLOG_EXPORT_LINK', true);
+ $link = $link_override ? $link_override : env('FLASHLOG_EXPORT_LINK', true);
$time_min = isset($min_unix_ts) ? $min_unix_ts : self::$minUnixTime;
$time_max = isset($max_unix_ts) ? $max_unix_ts : time();
- //dd($name, gettype($data));
+ // dd($name, gettype($data));
Log::debug("Export data $name csv=$csv");
-
- if ($data && gettype($data) == 'array' && count($data) > 0)
- {
- $fileBody = null;
+
+ if ($data && gettype($data) == 'array' && count($data) > 0) {
+ $fileBody = null;
$first_date = null;
- $last_date = null;
+ $last_date = null;
$data_count = count($data);
$date_times = []; // check which date times (rounded on minute) are already set
-
-
- if ($csv)
- {
+
+ if ($csv) {
// format CSV header row: time, sensor1 (unit2), sensor2 (unit2), etc. Exclude the 'sensor' and 'key' columns
- $header_arr = null;
+ $header_arr = null;
$header_count = 0;
- $csv_body = [];
+ $csv_body = [];
// create $header_arr
- if (empty($csv_columns))
- {
- foreach ($data as $key => $data_item)
- {
+ if (empty($csv_columns)) {
+ foreach ($data as $key => $data_item) {
$param_count = count($data_item);
- if ($param_count > $header_count)
- {
+ if ($param_count > $header_count) {
$header_count = $param_count;
- $header_arr = self::cleanFlashlogItem(array_keys($data_item), true);
+ $header_arr = self::cleanFlashlogItem(array_keys($data_item), true);
unset($header_arr['time']);
array_unshift($header_arr, 'time'); // put time first
}
}
- }
- else
- {
+ } else {
$header_arr = $csv_columns;
}
- Log::debug("Export CSV headers: ".implode(',', $header_arr));
-
- if (isset($header_arr) && gettype($header_arr) == 'array')
- {
- // Run backwards through the data, because time can be adjusted backwards, then the new (and correct) data if in the lower end of the file
- for ($i=$data_count-1; $i >= 0; $i--)
- {
- $data_item = $data[$i];
+ Log::debug('Export CSV headers: '.implode(',', $header_arr));
+
+ if (isset($header_arr) && gettype($header_arr) == 'array') {
+ // Run backwards through the data, because time can be adjusted backwards, then the new (and correct) data if in the lower end of the file
+ for ($i = $data_count - 1; $i >= 0; $i--) {
+ $data_item = $data[$i];
$data_item_count = count($data_item);
- if ($data_item_count > 2 && (!isset($data_item['port']) || $data_item['port'] == 3)) // min 2 data items + time, and is port defined, should be port 3
- {
- //change order of time
+ if ($data_item_count > 2 && (! isset($data_item['port']) || $data_item['port'] == 3)) { // min 2 data items + time, and is port defined, should be port 3
+ // change order of time
$data_time = null;
- $data_ts = null;
+ $data_ts = null;
$data_time_utc = '';
-
- if (isset($data_item['time']) && !isset($data_item['time_error']))
- {
+
+ if (isset($data_item['time']) && ! isset($data_item['time_error'])) {
$data_time = $data_item['time'];
- $data_ts = strtotime($data_time);
+ $data_ts = strtotime($data_time);
unset($data_item['time']);
-
+
// Make time with timezone GMT (Z) and T for time
$data_time_utc = str_replace(' ', 'T', $data_time);
- if (strlen($data_time_utc) == 19 && substr($data_time_utc, -1) != 'Z')
- $data_time_utc .= 'Z'; // Format as Influx time + UTC timezone
-
+ if (strlen($data_time_utc) == 19 && substr($data_time_utc, -1) != 'Z') {
+ $data_time_utc .= 'Z';
+ } // Format as Influx time + UTC timezone
+
// Add data point to date_arr and set frist/last data date
- if ($data_ts >= $time_min && $data_ts < $time_max) // time is set (also allow previously parsed Flashlogs without RTC), or time_device should be correctly set
- {
- if ($last_date === null)
- $last_date = $data_time; // update until last item with date
+ if ($data_ts >= $time_min && $data_ts < $time_max) { // time is set (also allow previously parsed Flashlogs without RTC), or time_device should be correctly set
+ if ($last_date === null) {
+ $last_date = $data_time;
+ } // update until last item with date
$first_date = $data_time;
}
}
-
- if ($validate_time == false || (isset($data_ts) && $data_ts >= $time_min && $data_ts < $time_max))
- {
+
+ if ($validate_time == false || (isset($data_ts) && $data_ts >= $time_min && $data_ts < $time_max)) {
$date_time_round_min = $data_ts; // Round to minute, to store only 1 value per minute: YYYY-MM-DD HH:mm (leave :ss)
- if (!in_array($date_time_round_min, $date_times))
- {
+ if (! in_array($date_time_round_min, $date_times)) {
$data_item_clean = self::cleanFlashlogItem($data_item, true);
- $data_item_clean['time'] = $data_time_utc;
+ $data_item_clean['time'] = $data_time_utc;
$data_item_clean['source'] = isset($data_item['db']) ? 'db' : 'fl';
// Write each row, aligning to predefined columns
$row = [];
- foreach ($header_arr as $m_abbr)
- {
+ foreach ($header_arr as $m_abbr) {
$row[] = isset($data_item_clean[$m_abbr]) ? $data_item_clean[$m_abbr] : ''; // fill missing with blank
}
-
+
// Add item to $csv_body
array_unshift($csv_body, implode($separator, $row)); // because of walking backwards through data, prepend to array to have the final array time ascending again
-
+
// Register data_ts in date_times to not overwrite
$date_times[] = $date_time_round_min;
}
@@ -1956,31 +1865,21 @@ public static function exportData(&$data, $name, $csv=true, $separator=',', $lin
$data_count = count($csv_body);
Log::debug("Export data count=$data_count");
-
-
// format CSV header
$csv_head_str = []; // Header names (incl. unit)
- $csv_head_row = "";
+ $csv_head_row = '';
- foreach ($header_arr as $header)
- {
- if ($header == 'time')
- {
+ foreach ($header_arr as $header) {
+ if ($header == 'time') {
$col_head = 'Time';
- }
- else if ($header == 'w_v')
- {
+ } elseif ($header == 'w_v') {
$col_head = 'Raw weight measurement (w_v)';
- }
- else if ($header == 'source')
- {
+ } elseif ($header == 'source') {
$col_head = 'Data source';
- }
- else
- {
- $meas = Measurement::where('abbreviation', $header)->first();
- $pq_unit = $meas ? $meas->pq_name_unit() : '-';
- $col_head = $pq_unit == '-' ? $header : "$pq_unit ($header)";
+ } else {
+ $meas = Measurement::where('abbreviation', $header)->first();
+ $pq_unit = $meas ? $meas->pq_name_unit() : '-';
+ $col_head = $pq_unit == '-' ? $header : "$pq_unit ($header)";
}
$csv_head_str[] = $col_head;
@@ -1989,251 +1888,247 @@ public static function exportData(&$data, $name, $csv=true, $separator=',', $lin
// Sort array by time ascending
sort($csv_body); // since time column is first, use this to sort
- Log::debug("Export data sorted ascending");
+ Log::debug('Export data sorted ascending');
// format CSV file body
$fileBody = $csv_head_row.implode("\r\n", $csv_body);
}
- }
- else
- {
+ } else {
$fileBody = $data; // return json as body
}
- //dd($name, $first_date, $last_date);
+ // dd($name, $first_date, $last_date);
unset($date_times);
- if ($link)
- {
- if (isset($fileBody) && $fileBody !== '')
- {
- $disk = env('EXPORT_STORAGE', 'public');
+ if ($link) {
+ if (isset($fileBody) && $fileBody !== '') {
+ $disk = env('EXPORT_STORAGE', 'public');
$file_ext = $csv ? '.csv' : '.json';
- $file_mime= $csv ? 'text/csv' : 'application/json';
- $file_date= (isset($first_date) ? substr($first_date, 0, 10) : '').'-'.(isset($last_date) ? substr($last_date, 0, 10) : '');
+ $file_mime = $csv ? 'text/csv' : 'application/json';
+ $file_date = (isset($first_date) ? substr($first_date, 0, 10) : '').'-'.(isset($last_date) ? substr($last_date, 0, 10) : '');
$filePath = 'exports/flashlog/beep-export-'.$name.'-'.$file_date.'-'.Str::random(10).$file_ext;
$filePath = str_replace(' ', '', $filePath);
Storage::disk($disk)->put($filePath, $fileBody, ['mimetype' => $file_mime]);
- return ['link'=>Storage::disk($disk)->url($filePath)];
+
+ return ['link' => Storage::disk($disk)->url($filePath)];
}
- }
- else
- {
+ } else {
return $fileBody;
}
}
- return ['error'=>'export_not_saved'];
+
+ return ['error' => 'export_not_saved'];
}
- public function addMetaData($data, $validate_time=false, $only_return_meta_data=false, $add_items=null, $fixBugRtcMonthIndex=true)
+ public function addMetaData($data, $validate_time = false, $only_return_meta_data = false, $add_items = null, $fixBugRtcMonthIndex = true)
{
- Log::debug("addMetaData fl=$this->id, validate_time=$validate_time, only_return_meta_data=$only_return_meta_data, fixBugRtcMonthIndex=$fixBugRtcMonthIndex, add_items=".json_encode($add_items));
+ Log::debug("addMetaData fl=$this->id, validate_time=$validate_time, only_return_meta_data=$only_return_meta_data, fixBugRtcMonthIndex=$fixBugRtcMonthIndex, add_items=".json_encode($add_items));
$saved = false;
-
- if ($data && gettype($data) == 'array' && count($data) > 0)
- {
+
+ if ($data && gettype($data) == 'array' && count($data) > 0) {
$time_min = self::$minUnixTime;
$time_max = time();
- $first_date = null;
- $last_date = null;
- $data_days = null;
- $data_days_w= null;
+ $first_date = null;
+ $last_date = null;
+ $data_days = null;
+ $data_days_w = null;
$data_count = count($data);
- $port2_msg = 0;
- $port2_dates= [];
- $port2_dts_mn= null;
- $port2_dts_mx= null;
- $port3_dts_mn= null;
- $port3_dts_mx= null;
- $port3_ts_mn= null;
- $port3_ts_mx= null;
- $port3_msg = 0;
- $firmwares = [];
- $time_errs = [];
+ $port2_msg = 0;
+ $port2_dates = [];
+ $port2_dts_mn = null;
+ $port2_dts_mx = null;
+ $port3_dts_mn = null;
+ $port3_dts_mx = null;
+ $port3_ts_mn = null;
+ $port3_ts_mx = null;
+ $port3_msg = 0;
+ $firmwares = [];
+ $time_errs = [];
$time_e_cnt = 0;
$time_clock = [];
$weight_arr = []; // array of weight measurements
- $date_arr = []; // array with date (YYYY-MM-DD) as key and amount of valid data points (timestamps with weight and time set) as value
- $date_arr_bv= []; // array with date (YYYY-MM-DD) as key and minimum battery voltage of valid data points (timestamps) as value
+ $date_arr = []; // array with date (YYYY-MM-DD) as key and amount of valid data points (timestamps with weight and time set) as value
+ $date_arr_bv = []; // array with date (YYYY-MM-DD) as key and minimum battery voltage of valid data points (timestamps) as value
$date_times = []; // check which date times (rounded on minute) are already set
- $batVoltage = null;
- $batLowCount= 0;
- $batLowBlock= 0;
+ $batVoltage = null;
+ $batLowCount = 0;
+ $batLowBlock = 0;
$batLowFlag = false;
- for ($i=$data_count-1; $i >= 0; $i--)
- {
- $data_item = $data[$i];
+ for ($i = $data_count - 1; $i >= 0; $i--) {
+ $data_item = $data[$i];
$time_device = isset($data_item['time_device']) ? intval($data_item['time_device']) : null;
- if (isset($data_item['port']))
- {
+ if (isset($data_item['port'])) {
$data_time = null;
- $data_ts = null;
-
- if (!isset($data_item['time_error']) && isset($data_item['time'])) // no error and time set
- {
+ $data_ts = null;
+
+ if (! isset($data_item['time_error']) && isset($data_item['time'])) { // no error and time set
$data_time = $data_item['time'];
- $data_ts = strtotime($data_time);
+ $data_ts = strtotime($data_time);
$data_date = substr($data_time, 0, 10);
- if (!isset($date_arr[$data_date]))
- $date_arr[$data_date] = ['t'=>0, 'w'=>0, 'bv'=>null, 'port2'=>0, 'port2_times_device'=>[]];
+ if (! isset($date_arr[$data_date])) {
+ $date_arr[$data_date] = ['t' => 0, 'w' => 0, 'bv' => null, 'port2' => 0, 'port2_times_device' => []];
+ }
}
// Log clock types
- if (isset($data_item['time_clock']))
- {
+ if (isset($data_item['time_clock'])) {
$time_clock_msg = $data_item['time_clock'];
- if (!isset($time_clock[$time_clock_msg]))
+ if (! isset($time_clock[$time_clock_msg])) {
$time_clock[$time_clock_msg] = 0;
+ }
$time_clock[$time_clock_msg]++;
}
// Log time errors
- if (isset($data_item['time_error']))
- {
+ if (isset($data_item['time_error'])) {
$time_error_msg = $data_item['time_error'];
- if (!isset($time_errs[$time_error_msg]))
+ if (! isset($time_errs[$time_error_msg])) {
$time_errs[$time_error_msg] = 0;
+ }
$time_errs[$time_error_msg]++;
}
- if ($data_item['port'] == 2)
- {
+ if ($data_item['port'] == 2) {
$port2_msg++;
// Log min time
- if (isset($time_device)){
- if ($port2_dts_mn === null)
+ if (isset($time_device)) {
+ if ($port2_dts_mn === null) {
$port2_dts_mn = $time_device;
+ }
- if ($time_device < $port2_dts_mn)
+ if ($time_device < $port2_dts_mn) {
$port2_dts_mn = $time_device;
+ }
}
// Log max time
- if (isset($time_device)){
- if ($port2_dts_mx === null)
+ if (isset($time_device)) {
+ if ($port2_dts_mx === null) {
$port2_dts_mx = $time_device;
+ }
- if ($time_device > $port2_dts_mx)
+ if ($time_device > $port2_dts_mx) {
$port2_dts_mx = $time_device;
+ }
}
- if (isset($data_date))
- {
+ if (isset($data_date)) {
$dtime_device = date('Y-m-d H:i:s', $time_device);
$date_arr[$data_date]['port2']++;
- array_unshift($date_arr[$data_date]['port2_times_device'], "[".$data_item['i']."] $time_device: $dtime_device"); // push to front of array, so it in ascending order again
+ array_unshift($date_arr[$data_date]['port2_times_device'], '['.$data_item['i']."] $time_device: $dtime_device"); // push to front of array, so it in ascending order again
}
- if (isset($data_item['firmware_version']))
- {
+ if (isset($data_item['firmware_version'])) {
$dtime_device = date('Y-m-d H:i:s', $time_device);
- $firmwares[$i] = $data_item['firmware_version'] . " @ $dtime_device";
+ $firmwares[$i] = $data_item['firmware_version']." @ $dtime_device";
}
- }
- else if ($data_item['port'] == 3)
- {
- //change order of time
+ } elseif ($data_item['port'] == 3) {
+ // change order of time
$port3_msg++;
-
+
// Log min time
- if (isset($data_ts)){
- if ($port3_ts_mn === null)
+ if (isset($data_ts)) {
+ if ($port3_ts_mn === null) {
$port3_ts_mn = $data_ts;
+ }
- if ($data_ts < $port3_ts_mn)
+ if ($data_ts < $port3_ts_mn) {
$port3_ts_mn = $data_ts;
+ }
}
// Log max time
- if (isset($data_ts)){
- if ($port3_ts_mx === null)
+ if (isset($data_ts)) {
+ if ($port3_ts_mx === null) {
$port3_ts_mx = $data_ts;
+ }
- if ($data_ts > $port3_ts_mx)
+ if ($data_ts > $port3_ts_mx) {
$port3_ts_mx = $data_ts;
+ }
}
-
+
// Log min device time
- if (isset($time_device)){
- if ($port3_dts_mn === null)
+ if (isset($time_device)) {
+ if ($port3_dts_mn === null) {
$port3_dts_mn = $time_device;
+ }
- if ($time_device < $port3_dts_mn)
+ if ($time_device < $port3_dts_mn) {
$port3_dts_mn = $time_device;
+ }
}
// Log max device time
- if (isset($time_device)){
- if ($port3_dts_mx === null)
+ if (isset($time_device)) {
+ if ($port3_dts_mx === null) {
$port3_dts_mx = $time_device;
+ }
- if ($time_device > $port3_dts_mx)
+ if ($time_device > $port3_dts_mx) {
$port3_dts_mx = $time_device;
+ }
}
// Log port 3 time errors
- if (isset($data_ts) && ($data_ts < $time_min || $data_ts > $time_max))
+ if (isset($data_ts) && ($data_ts < $time_min || $data_ts > $time_max)) {
$time_e_cnt++;
+ }
// Log battery voltage
- if (isset($data_item['bv']))
- {
+ if (isset($data_item['bv'])) {
$batVoltage = $data_item['bv'];
- if ($batVoltage < 2.7)
- {
- if (!$batLowFlag)
- $batLowBlock++; // change of flag
+ if ($batVoltage < 2.7) {
+ if (! $batLowFlag) {
+ $batLowBlock++;
+ } // change of flag
$batLowFlag = true;
$batLowCount++;
- }
- else if ($batVoltage > 2.9) // 0.2V hysteresis to avoid counting too many blocks
- {
+ } elseif ($batVoltage > 2.9) { // 0.2V hysteresis to avoid counting too many blocks
$batLowFlag = false;
}
}
- if ( $validate_time == false || (isset($data_ts) && $data_ts >= $time_min && $data_ts < $time_max))
- {
+ if ($validate_time == false || (isset($data_ts) && $data_ts >= $time_min && $data_ts < $time_max)) {
$date_time_round_min = $data_ts; // Round to minute, to store only 1 value per minute: YYYY-MM-DD HH:mm (leave :ss)
- if (!in_array($date_time_round_min, $date_times))
- {
+ if (! in_array($date_time_round_min, $date_times)) {
$weight_set = false;
-
- if (isset($data_item['weight_kg']))
- {
+
+ if (isset($data_item['weight_kg'])) {
$weight_arr[] = $data_item['weight_kg'];
- $weight_set = true; // for counting valid data points
+ $weight_set = true; // for counting valid data points
}
// Add data point to date_arr and set last/first data date
- if (isset($data_time))
- {
- if (!isset($time_device) || ($time_device >= $time_min && $time_device < $time_max)) // time is set (also allow previously parsed Flashlogs without RTC), or time_device should be correctly set
- {
- if ($last_date === null)
- $last_date = $data_time; // update until last item with date
-
+ if (isset($data_time)) {
+ if (! isset($time_device) || ($time_device >= $time_min && $time_device < $time_max)) { // time is set (also allow previously parsed Flashlogs without RTC), or time_device should be correctly set
+ if ($last_date === null) {
+ $last_date = $data_time;
+ } // update until last item with date
+
$first_date = $data_time;
}
$date_arr[$data_date]['t']++;
-
- if ($weight_set)
- $date_arr[$data_date]['w']++; // count 1 data point if weight AND time are set
- if ($date_arr[$data_date]['bv'] === null || ($batVoltage !== null && $batVoltage < $date_arr[$data_date]['bv']))
- $date_arr[$data_date]['bv'] = $batVoltage; // register lowest battery voltage of the day
- }
+ if ($weight_set) {
+ $date_arr[$data_date]['w']++;
+ } // count 1 data point if weight AND time are set
+
+ if ($date_arr[$data_date]['bv'] === null || ($batVoltage !== null && $batVoltage < $date_arr[$data_date]['bv'])) {
+ $date_arr[$data_date]['bv'] = $batVoltage;
+ } // register lowest battery voltage of the day
+ }
// Register data_ts in date_times to not overwrite
$date_times[] = $date_time_round_min;
@@ -2242,123 +2137,133 @@ public function addMetaData($data, $validate_time=false, $only_return_meta_data=
}
}
}
- if (isset($date_arr) && count($date_arr) > 0)
- {
+ if (isset($date_arr) && count($date_arr) > 0) {
// sort because keys are in reverse order by running backwards through $data
ksort($date_arr);
// count percentage of max data per day
$max_data_per_day = 96;
- $data_days = 0;
- $data_days_w = 0;
+ $data_days = 0;
+ $data_days_w = 0;
- foreach ($date_arr as $d => $date_totals)
- {
- $cnt_time_only = $date_totals['t'];
+ foreach ($date_arr as $d => $date_totals) {
+ $cnt_time_only = $date_totals['t'];
$cnt_time_weight = $date_totals['w']; // weight AND time set
- $lowest_bv = $date_totals['bv']; // lowest day battery voltage
+ $lowest_bv = $date_totals['bv']; // lowest day battery voltage
- if ($lowest_bv !== null)
+ if ($lowest_bv !== null) {
$date_arr_bv[$d] = $lowest_bv;
+ }
- $date_arr[$d] = $cnt_time_weight; // replace date array with valid values
- $day_fraction = $cnt_time_only > $max_data_per_day ? 1 : $cnt_time_only / $max_data_per_day; // 0-1
- $day_fraction_w = $cnt_time_weight > $max_data_per_day ? 1 : $cnt_time_weight / $max_data_per_day; // 0-1
- $data_days += $day_fraction;
- $data_days_w += $day_fraction_w;
+ $date_arr[$d] = $cnt_time_weight; // replace date array with valid values
+ $day_fraction = $cnt_time_only > $max_data_per_day ? 1 : $cnt_time_only / $max_data_per_day; // 0-1
+ $day_fraction_w = $cnt_time_weight > $max_data_per_day ? 1 : $cnt_time_weight / $max_data_per_day; // 0-1
+ $data_days += $day_fraction;
+ $data_days_w += $day_fraction_w;
- if ($date_totals['port2'] > 0)
+ if ($date_totals['port2'] > 0) {
$port2_dates[$d] = $date_totals['port2_times_device'];
+ }
}
}
- $batLowPerc = $batLowCount > 0 && $port3_msg > 0 ? round(100 * $batLowCount / $port3_msg, 1) : 0;
- $timeErrPerc = $time_e_cnt > 0 && $port3_msg > 0 ? round(100 * $time_e_cnt / $port3_msg, 1) : 0;
- $meta_data = [
- 'port2_msg'=>$port2_msg,
- 'port3_msg'=>$port3_msg,
- 'data_days'=>$data_days,
- 'data_days_weight'=>$data_days_w,
- 'bat_low_perc'=>$batLowPerc,
- 'bat_low_blocks'=>$batLowBlock,
- 'time_err_perc'=>$timeErrPerc
+ $batLowPerc = $batLowCount > 0 && $port3_msg > 0 ? round(100 * $batLowCount / $port3_msg, 1) : 0;
+ $timeErrPerc = $time_e_cnt > 0 && $port3_msg > 0 ? round(100 * $time_e_cnt / $port3_msg, 1) : 0;
+ $meta_data = [
+ 'port2_msg' => $port2_msg,
+ 'port3_msg' => $port3_msg,
+ 'data_days' => $data_days,
+ 'data_days_weight' => $data_days_w,
+ 'bat_low_perc' => $batLowPerc,
+ 'bat_low_blocks' => $batLowBlock,
+ 'time_err_perc' => $timeErrPerc,
];
- if (count($firmwares) > 0)
+ if (count($firmwares) > 0) {
$meta_data['firmwares'] = $firmwares;
+ }
- if (count($port2_dates) > 0)
+ if (count($port2_dates) > 0) {
$meta_data['port2_times_device'] = $port2_dates;
+ }
- if (isset($port2_dts_mn))
- $meta_data["port2_device_time_first"] = date('Y-m-d H:i:s', $port2_dts_mn);
+ if (isset($port2_dts_mn)) {
+ $meta_data['port2_device_time_first'] = date('Y-m-d H:i:s', $port2_dts_mn);
+ }
- if (isset($port2_dts_mx))
- {
- $meta_data["port2_device_time_last"] = date('Y-m-d H:i:s', $port2_dts_mx);
- if ($port2_dts_mx > $time_max)
- $meta_data["time_off"] = true;
+ if (isset($port2_dts_mx)) {
+ $meta_data['port2_device_time_last'] = date('Y-m-d H:i:s', $port2_dts_mx);
+ if ($port2_dts_mx > $time_max) {
+ $meta_data['time_off'] = true;
+ }
}
- if (isset($port3_dts_mn))
- $meta_data["port3_device_time_first"] = date('Y-m-d H:i:s', $port3_dts_mn);
+ if (isset($port3_dts_mn)) {
+ $meta_data['port3_device_time_first'] = date('Y-m-d H:i:s', $port3_dts_mn);
+ }
- if (isset($port3_dts_mx))
- $meta_data["port3_device_time_last"] = date('Y-m-d H:i:s', $port3_dts_mx);
+ if (isset($port3_dts_mx)) {
+ $meta_data['port3_device_time_last'] = date('Y-m-d H:i:s', $port3_dts_mx);
+ }
- if (isset($port3_ts_mn))
- $meta_data["port3_time_first"] = date('Y-m-d H:i:s', $port3_ts_mn);
+ if (isset($port3_ts_mn)) {
+ $meta_data['port3_time_first'] = date('Y-m-d H:i:s', $port3_ts_mn);
+ }
- if (isset($port3_ts_mx))
- $meta_data["port3_time_last"] = date('Y-m-d H:i:s', $port3_ts_mx);
+ if (isset($port3_ts_mx)) {
+ $meta_data['port3_time_last'] = date('Y-m-d H:i:s', $port3_ts_mx);
+ }
- if (count($time_clock) > 0)
- {
- foreach($time_clock as $msg => $msg_cnt)
+ if (count($time_clock) > 0) {
+ foreach ($time_clock as $msg => $msg_cnt) {
$meta_data["time_clock_$msg"] = $msg_cnt;
+ }
}
- if (count($time_errs) > 0)
- {
- foreach($time_errs as $err => $err_cnt)
+ if (count($time_errs) > 0) {
+ foreach ($time_errs as $err => $err_cnt) {
$meta_data["time_err_$err"] = $err_cnt;
+ }
}
- if (count($weight_arr) > 0)
+ if (count($weight_arr) > 0) {
$meta_data['weight_kg'] = CalculationModel::calculateBoxplot($weight_arr);
+ }
- if (count($date_arr) > 0 && array_sum($date_arr) > 0)
+ if (count($date_arr) > 0 && array_sum($date_arr) > 0) {
$meta_data['valid_data_points'] = $date_arr;
+ }
- if (count($date_arr_bv) > 0)
+ if (count($date_arr_bv) > 0) {
$meta_data['lowest_bv'] = $date_arr_bv;
+ }
- if (is_array($add_items))
- {
- foreach ($add_items as $key => $value)
+ if (is_array($add_items)) {
+ foreach ($add_items as $key => $value) {
$meta_data[$key] = $value;
+ }
}
- if ($only_return_meta_data)
- {
- return array_merge(['log_date_start'=>$first_date, 'log_date_end'=>$last_date], $meta_data);
+ if ($only_return_meta_data) {
+ return array_merge(['log_date_start' => $first_date, 'log_date_end' => $last_date], $meta_data);
}
// Default, save meta to Flashlog
- $this->log_date_start = $first_date;
- $this->log_date_end = $last_date;
- $this->meta_data = $meta_data; // first store meta data on flashlog to use in fixBugRtcMonthIndex
- $meta_data['rtc_bug'] = $this->fixBugRtcMonthIndex(null, true); // indicate bug
- $this->meta_data = $meta_data;
- $this->logs_per_day = $this->getLogPerDay();
+ $this->log_date_start = $first_date;
+ $this->log_date_end = $last_date;
+ $this->meta_data = $meta_data; // first store meta data on flashlog to use in fixBugRtcMonthIndex
+ $meta_data['rtc_bug'] = $this->fixBugRtcMonthIndex(null, true); // indicate bug
+ $this->meta_data = $meta_data;
+ $this->logs_per_day = $this->getLogPerDay();
$saved = $this->save();
-
// Fix RTC error before saving
- if ($fixBugRtcMonthIndex)
+ if ($fixBugRtcMonthIndex) {
$this->fixBugRtcMonthIndex($data);
+ }
}
+
return $saved;
}
@@ -2366,65 +2271,58 @@ public function addMetaData($data, $validate_time=false, $only_return_meta_data=
public function addMetaToFlashlog($flashlog_array = null)
{
$data_array = null;
- if (isset($flashlog_array) && is_array($flashlog_array) && count($flashlog_array) > 0)
- {
+ if (isset($flashlog_array) && is_array($flashlog_array) && count($flashlog_array) > 0) {
$data_array = $flashlog_array;
}
- if (empty($data_array) && isset($this->log_parsed)) // use parsed log file to generate CSV
- {
+ if (empty($data_array) && isset($this->log_parsed)) { // use parsed log file to generate CSV
$flashlog_parsed_text = $this->getFileContent('log_file_parsed');
- if (!empty($flashlog_parsed_text))
- {
+ if (! empty($flashlog_parsed_text)) {
$data_array = json_decode($flashlog_parsed_text, true);
}
}
- if (!empty($data_array))
- {
- // Add metadata
+ if (! empty($data_array)) {
+ // Add metadata
Log::debug("addMetaToFlashlog $this->id");
+
return $this->addMetaData($data_array, true);
}
Log::debug("addMetaToFlashlog $this->id Err: no data array");
+
return false;
}
-
// from log_file_parsed property
public function addCsvToFlashlog($flashlog_array = null)
{
$data_array = null;
- if (isset($flashlog_array) && is_array($flashlog_array) && count($flashlog_array) > 0)
- {
+ if (isset($flashlog_array) && is_array($flashlog_array) && count($flashlog_array) > 0) {
$data_array = $flashlog_array;
}
- if (!isset($data_array) && isset($this->log_parsed)) // use parsed log file to generate CSV
- {
+ if (! isset($data_array) && isset($this->log_parsed)) { // use parsed log file to generate CSV
$flashlog_parsed_text = $this->getFileContent('log_file_parsed');
- if (!empty($flashlog_parsed_text))
- {
+ if (! empty($flashlog_parsed_text)) {
$data_array = json_decode($flashlog_parsed_text, true);
}
}
- if (!empty($data_array))
- {
- // Add metadata
+ if (! empty($data_array)) {
+ // Add metadata
$this->addMetaData($data_array, true);
// Save CSV
- $csv_file_name = "flashlog-$this->id-device-id-$this->device_id-sensor-data";
- $save_output = FlashLog::exportData($data_array, $csv_file_name, true, ',', true, true); // Research data is also exported with , as separator
+ $csv_file_name = "flashlog-$this->id-device-id-$this->device_id-sensor-data";
+ $save_output = FlashLog::exportData($data_array, $csv_file_name, true, ',', true, true); // Research data is also exported with , as separator
- if (isset($save_output['link']))
- {
+ if (isset($save_output['link'])) {
$this->csv_url = $save_output['link'];
+
return $this->save();
}
}
+
return false;
}
-
}
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index 2570029e..42cb1e33 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -2,9 +2,9 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
-use App\User;
use App\Hive;
+use App\User;
+use Illuminate\Database\Eloquent\Model;
class HiveTag extends Model
{
@@ -16,10 +16,10 @@ class HiveTag extends Model
protected $table = 'hive_tags';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -28,16 +28,18 @@ class HiveTag extends Model
* @var array
*/
protected $fillable = ['user_id', 'tag', 'hive_id', 'action_id', 'router_link'];
- protected $hidden = ['id', 'created_at', 'updated_at', 'user_id'];
- protected $casts = ['router_link'=>'array'];
+
+ protected $hidden = ['id', 'created_at', 'updated_at', 'user_id'];
+
+ protected $casts = ['router_link' => 'array'];
public function hive()
{
return $this->belongsTo(Hive::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
-
}
diff --git a/app/Models/Webhook.php b/app/Models/Webhook.php
index a8a340d5..75d8972b 100644
--- a/app/Models/Webhook.php
+++ b/app/Models/Webhook.php
@@ -2,30 +2,27 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Model;
-
-use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
+use Illuminate\Database\Eloquent\Model;
class Webhook extends Model
{
- public static function sendNotification($message=null, $username='')
+ public static function sendNotification($message = null, $username = '')
{
$url = env('WEBHOOK_URL', null);
$usr = env('APP_NAME').' ('.env('APP_URL').') '.$username;
- if ($url && $message)
- {
+ if ($url && $message) {
$body = [
- "username" => $usr,
- "text" => $message,
- "icon_url" => "https://api.beep.nl/img/icons/icon_beep.png"
+ 'username' => $usr,
+ 'text' => $message,
+ 'icon_url' => 'https://api.beep.nl/img/icons/icon_beep.png',
];
- $guzzle = new Client();
- $response = $guzzle->request('POST', $url, ['body'=> json_encode($body), 'verify' => true, 'http_errors' => false]);
-
+ $guzzle = new Client;
+ $response = $guzzle->request('POST', $url, ['body' => json_encode($body), 'verify' => true, 'http_errors' => false]);
+
return $response->getStatusCode();
}
+
return null;
}
-
}
diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php
index 9f44a9fc..64d9f7c3 100644
--- a/app/Notifications/ResetPassword.php
+++ b/app/Notifications/ResetPassword.php
@@ -2,13 +2,13 @@
namespace App\Notifications;
-use Illuminate\Support\Facades\Lang;
-use Illuminate\Notifications\Notification as NotificationBase;
use Illuminate\Notifications\Messages\MailMessage;
+use Illuminate\Notifications\Notification as NotificationBase;
+use Illuminate\Support\Facades\Lang;
class ResetPassword extends NotificationBase
{
- /**
+ /**
* The password reset token.
*
* @var string
@@ -50,7 +50,6 @@ public function via($notifiable)
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
-
public function toMail($notifiable)
{
if (static::$toMailCallback) {
diff --git a/app/Notifications/VerifyEmail.php b/app/Notifications/VerifyEmail.php
index c0e3a16d..d4ab4bd2 100644
--- a/app/Notifications/VerifyEmail.php
+++ b/app/Notifications/VerifyEmail.php
@@ -7,7 +7,7 @@
class VerifyEmail extends VerifyEmailBase
{
-// use Queueable;
+ // use Queueable;
/**
* Get the verification URL for the given notifiable.
@@ -18,15 +18,15 @@ class VerifyEmail extends VerifyEmailBase
protected function verificationUrl($notifiable)
{
$temporarySignedURL = URL::temporarySignedRoute(
- 'apiverification.verify',
- now()->addMinutes(60),
+ 'apiverification.verify',
+ now()->addMinutes(60),
[
'id' => $notifiable->getKey(),
- 'hash' => sha1($notifiable->getEmailForVerification())
+ 'hash' => sha1($notifiable->getEmailForVerification()),
]
);
// I use urlencode to pass a link to my frontend.
return $temporarySignedURL;
}
-}
\ No newline at end of file
+}
diff --git a/app/Permission.php b/app/Permission.php
index 8ecaafb4..b2aa6b8d 100644
--- a/app/Permission.php
+++ b/app/Permission.php
@@ -6,173 +6,173 @@
class Permission extends LaratrustPermission
{
- public $fillable = ['name','display_name','description'];
+ public $fillable = ['name', 'display_name', 'description'];
protected $hidden = ['id', 'pivot', 'updated_at', 'created_at', 'description'];
-
+
public $guarded = [];
- public static function updatePermissions()
+ public static function updatePermissions()
{
$permission = [
- [
- 'name' => 'role-list',
- 'display_name' => 'Display role list',
- 'description' => 'View a list of roles'
- ],
- [
- 'name' => 'role-create',
- 'display_name' => 'Create role',
- 'description' => 'Create new role'
- ],
- [
- 'name' => 'role-edit',
- 'display_name' => 'Edit role',
- 'description' => 'Edit role'
- ],
- [
- 'name' => 'role-delete',
- 'display_name' => 'Delete role',
- 'description' => 'Delete role'
- ],
+ [
+ 'name' => 'role-list',
+ 'display_name' => 'Display role list',
+ 'description' => 'View a list of roles',
+ ],
+ [
+ 'name' => 'role-create',
+ 'display_name' => 'Create role',
+ 'description' => 'Create new role',
+ ],
+ [
+ 'name' => 'role-edit',
+ 'display_name' => 'Edit role',
+ 'description' => 'Edit role',
+ ],
+ [
+ 'name' => 'role-delete',
+ 'display_name' => 'Delete role',
+ 'description' => 'Delete role',
+ ],
[
'name' => 'user-list',
'display_name' => 'Display user list',
- 'description' => 'View a list of users'
+ 'description' => 'View a list of users',
],
[
'name' => 'user-create',
'display_name' => 'Create user',
- 'description' => 'Create new user'
+ 'description' => 'Create new user',
],
[
'name' => 'user-edit',
'display_name' => 'Edit user',
- 'description' => 'Edit user'
+ 'description' => 'Edit user',
],
[
'name' => 'user-delete',
'display_name' => 'Delete user',
- 'description' => 'Delete user'
- ],
- [
- 'name' => 'group-list',
- 'display_name' => 'Display group list',
- 'description' => 'View a list of groups'
- ],
- [
- 'name' => 'group-create',
- 'display_name' => 'Create group',
- 'description' => 'Create new group'
- ],
- [
- 'name' => 'group-edit',
- 'display_name' => 'Edit group',
- 'description' => 'Edit group'
- ],
- [
- 'name' => 'group-delete',
- 'display_name' => 'Delete group',
- 'description' => 'Delete group'
- ],
+ 'description' => 'Delete user',
+ ],
+ [
+ 'name' => 'group-list',
+ 'display_name' => 'Display group list',
+ 'description' => 'View a list of groups',
+ ],
+ [
+ 'name' => 'group-create',
+ 'display_name' => 'Create group',
+ 'description' => 'Create new group',
+ ],
+ [
+ 'name' => 'group-edit',
+ 'display_name' => 'Edit group',
+ 'description' => 'Edit group',
+ ],
+ [
+ 'name' => 'group-delete',
+ 'display_name' => 'Delete group',
+ 'description' => 'Delete group',
+ ],
[
'name' => 'sensor-list',
'display_name' => 'Display sensor list',
- 'description' => 'View a list of sensors'
+ 'description' => 'View a list of sensors',
],
[
'name' => 'sensor-create',
'display_name' => 'Create sensor',
- 'description' => 'Create new sensor'
+ 'description' => 'Create new sensor',
],
[
'name' => 'sensor-edit',
'display_name' => 'Edit sensor',
- 'description' => 'Edit sensor'
+ 'description' => 'Edit sensor',
],
[
'name' => 'sensor-delete',
'display_name' => 'Delete sensor',
- 'description' => 'Delete sensor'
+ 'description' => 'Delete sensor',
],
[
'name' => 'taxonomy-list',
'display_name' => 'Display taxonomy list',
- 'description' => 'View a list of the taxonomy'
+ 'description' => 'View a list of the taxonomy',
],
[
'name' => 'taxonomy-create',
'display_name' => 'Create taxonomy',
- 'description' => 'Create new taxonomy items'
+ 'description' => 'Create new taxonomy items',
],
[
'name' => 'taxonomy-edit',
'display_name' => 'Edit taxonomy',
- 'description' => 'Edit taxonomy items'
+ 'description' => 'Edit taxonomy items',
],
[
'name' => 'taxonomy-delete',
'display_name' => 'Delete taxonomy',
- 'description' => 'Delete taxonomy items'
+ 'description' => 'Delete taxonomy items',
],
[
'name' => 'language-list',
'display_name' => 'Display language list',
- 'description' => 'View a list of the language'
+ 'description' => 'View a list of the language',
],
[
'name' => 'language-create',
'display_name' => 'Create language',
- 'description' => 'Create new language items'
+ 'description' => 'Create new language items',
],
[
'name' => 'language-edit',
'display_name' => 'Edit language',
- 'description' => 'Edit language items'
+ 'description' => 'Edit language items',
],
[
'name' => 'language-delete',
'display_name' => 'Delete language',
- 'description' => 'Delete language items'
+ 'description' => 'Delete language items',
],
[
'name' => 'translation-list',
'display_name' => 'Display translation list',
- 'description' => 'View a list of the translation'
+ 'description' => 'View a list of the translation',
],
[
'name' => 'translation-create',
'display_name' => 'Create translation',
- 'description' => 'Create new translation items'
+ 'description' => 'Create new translation items',
],
[
'name' => 'translation-edit',
'display_name' => 'Edit translation',
- 'description' => 'Edit translation items'
+ 'description' => 'Edit translation items',
],
[
'name' => 'translation-delete',
'display_name' => 'Delete translation',
- 'description' => 'Delete translation items'
- ]
+ 'description' => 'Delete translation items',
+ ],
];
- foreach ($permission as $key => $value)
- {
- //print("Checking permission $key: ".$value['display_name']."\r\n");
+ foreach ($permission as $key => $value) {
+ // print("Checking permission $key: ".$value['display_name']."\r\n");
- if (Permission::where('name', $value['name'])->count() > 0)
+ if (Permission::where('name', $value['name'])->count() > 0) {
continue;
-
+ }
+
$p = Permission::create($value);
- //die(print_r($p->toArray()));
+ // die(print_r($p->toArray()));
- // if (Role::where('name', 'superadmin')->count() == 1)
- // {
- // Role::where('name', 'superadmin')->first()->attachPermissions([$p]);
- // }
- print("Added permission ".$value['display_name']."\r\n");
+ // if (Role::where('name', 'superadmin')->count() == 1)
+ // {
+ // Role::where('name', 'superadmin')->first()->attachPermissions([$p]);
+ // }
+ echo 'Added permission '.$value['display_name']."\r\n";
}
}
diff --git a/app/PhysicalQuantity.php b/app/PhysicalQuantity.php
index 94fe6b3d..86a4969f 100644
--- a/app/PhysicalQuantity.php
+++ b/app/PhysicalQuantity.php
@@ -2,17 +2,18 @@
namespace App;
-use Illuminate\Database\Eloquent\Model;
use Cache;
use DB;
+use Illuminate\Database\Eloquent\Model;
use LaravelLocalization;
class PhysicalQuantity extends Model
{
- protected $table = 'physical_quantities';
- protected $appends = ['trans'];
+ protected $table = 'physical_quantities';
+
+ protected $appends = ['trans'];
- public $fillable = ['name','unit','abbreviation','low_value','high_value'];
+ public $fillable = ['name', 'unit', 'abbreviation', 'low_value', 'high_value'];
public $timestamps = false;
@@ -20,23 +21,19 @@ public static function boot()
{
parent::boot();
- static::created(function($p)
- {
+ static::created(function ($p) {
$p->forgetCache();
});
- static::updated(function($p)
- {
+ static::updated(function ($p) {
$p->forgetCache();
});
- static::deleted(function($p)
- {
+ static::deleted(function ($p) {
$p->forgetCache();
});
}
-
public function forgetCache()
{
Cache::forget('measurements-pq-abbr');
@@ -45,8 +42,9 @@ public function forgetCache()
Cache::forget('pq-'.$this->id.'-measurements-abbr-use-in-alerts-1');
$locales = array_keys(config('laravellocalization.supportedLocales'));
- foreach ($locales as $locale)
+ foreach ($locales as $locale) {
Cache::forget('pq-trans-'.$this->id.'-'.$locale.'-name');
+ }
Category::forgetTaxonomyListCache();
}
@@ -64,62 +62,65 @@ public function measurements()
public function getUnitAttribute()
{
- return !empty($this->attributes['unit']) ? $this->attributes['unit'] : '';
+ return ! empty($this->attributes['unit']) ? $this->attributes['unit'] : '';
}
public function pq_name_unit()
{
- if (isset($this->unit))
+ if (isset($this->unit)) {
return $this->name.' ('.$this->unit.')';
+ }
return $this->name;
}
public function trans($locale = null)
{
- //$trans = Translation::where('name', $this->name)->with('language')->get()->pluck('translation','language.lang');
+ // $trans = Translation::where('name', $this->name)->with('language')->get()->pluck('translation','language.lang');
$out = Cache::rememberForever('pq-'.$this->id.'-trans-'.$this->abbreviation, function () {
$trans = DB::table('translations')
- ->join('languages', 'translations.language_id', '=', 'languages.id')
- ->where('translations.type', 'physical_quantity')
- ->where('translations.name', $this->abbreviation)
- ->select('translations.translation', 'languages.twochar')
- ->get();
-
- if ($trans)
- {
+ ->join('languages', 'translations.language_id', '=', 'languages.id')
+ ->where('translations.type', 'physical_quantity')
+ ->where('translations.name', $this->abbreviation)
+ ->select('translations.translation', 'languages.twochar')
+ ->get();
+
+ if ($trans) {
$out = [];
- foreach($trans as $item)
- {
- if (isset($locale) && $item->twochar == $locale)
+ foreach ($trans as $item) {
+ if (isset($locale) && $item->twochar == $locale) {
return $item->translation;
-
- $out[$item->twochar] = $item->translation;
+ }
+
+ $out[$item->twochar] = $item->translation;
}
+
return $out;
}
});
- if ($out)
+ if ($out) {
return $out;
+ }
return null;
}
public function transName($locale = null)
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
-
- return Cache::rememberForever('pq-trans-'.$this->id.'-'.$locale.'-name', function () use ($locale){
+ }
+
+ return Cache::rememberForever('pq-trans-'.$this->id.'-'.$locale.'-name', function () use ($locale) {
$trans = $this->trans();
+
return isset($trans[$locale]) ? $trans[$locale] : $this->name;
});
}
-
public function getTransAttribute()
{
return $this->trans();
@@ -127,19 +128,20 @@ public function getTransAttribute()
public static function selectList()
{
- $list = [];
- $list[''] = '-';
+ $list = [];
+ $list[''] = '-';
- foreach(PhysicalQuantity::orderBy('name')->get() as $q)
- {
+ foreach (PhysicalQuantity::orderBy('name')->get() as $q) {
$id = $q->id;
$label = $q->name.' ('.$q->unit.')';
- if (isset($q->abbreviation))
- $label .= ' - '.$q->abbreviation;
+ if (isset($q->abbreviation)) {
+ $label .= ' - '.$q->abbreviation;
+ }
$list[$id] = $label;
- }
+ }
+
return $list;
}
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index e849222c..ac87aa8c 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -2,12 +2,11 @@
namespace App\Providers;
-use Illuminate\Support\ServiceProvider;
-use Illuminate\Support\Collection;
-use Illuminate\Pagination\LengthAwarePaginator;
-
-use App\HiveFactory;
use App\ChecklistFactory;
+use App\HiveFactory;
+use Illuminate\Pagination\LengthAwarePaginator;
+use Illuminate\Support\Collection;
+use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@@ -21,19 +20,20 @@ public function boot()
/**
* Paginate a standard Laravel Collection.
*
- * @param int $perPage
- * @param int $total
- * @param int $page
- * @param string $pageName
+ * @param int $perPage
+ * @param int $total
+ * @param int $page
+ * @param string $pageName
* @return array
*/
- Collection::macro('paginate', function($perPage, $page = null, $output_array=false, $total = null, $pageName = 'page') {
+ Collection::macro('paginate', function ($perPage, $page = null, $output_array = false, $total = null, $pageName = 'page') {
$page = $page ?: LengthAwarePaginator::resolveCurrentPage($pageName);
- $items = $this->forPage($page, $perPage);
-
- if ($output_array) // make sure no start indexes > 0 are provided, so output is not rendered as object, but as array of objects
- $items = Collection::make(array_values($items->toArray()));
+ $items = $this->forPage($page, $perPage);
+
+ if ($output_array) { // make sure no start indexes > 0 are provided, so output is not rendered as object, but as array of objects
+ $items = Collection::make(array_values($items->toArray()));
+ }
$paginator = new LengthAwarePaginator(
$items,
@@ -57,20 +57,16 @@ public function boot()
*/
public function register()
{
- $this->app->singleton(HiveFactory::class, function()
- {
- return new HiveFactory();
+ $this->app->singleton(HiveFactory::class, function () {
+ return new HiveFactory;
});
- $this->app->singleton(ChecklistFactory::class, function()
- {
- return new ChecklistFactory();
+ $this->app->singleton(ChecklistFactory::class, function () {
+ return new ChecklistFactory;
});
- if ($this->app->environment() == 'local')
- {
+ if ($this->app->environment() == 'local') {
$this->app->register('Appzcoder\CrudGenerator\CrudGeneratorServiceProvider');
}
}
-
}
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 9784b1a3..9e68caa6 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -2,7 +2,6 @@
namespace App\Providers;
-use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php
index 1dcf8d28..dc3007b5 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 e9dc124a..09701c34 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -2,10 +2,10 @@
namespace App\Providers;
-use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
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 87ffb05a..b6fba644 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/Queen.php b/app/Queen.php
index ad643000..d949bd19 100644
--- a/app/Queen.php
+++ b/app/Queen.php
@@ -2,20 +2,23 @@
namespace App;
+use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use Cache;
class Queen extends Model
{
- use SoftDeletes, CascadeSoftDeletes;
+ use CascadeSoftDeletes, SoftDeletes;
protected $fillable = ['hive_id', 'created_at', 'race_id', 'quality', 'color', 'name', 'fertilized', 'clipped', 'fertilizing_location', 'origin', 'tree', 'line', 'mother_id', 'marker', 'goal', 'description', 'birth_date'];
- protected $guarded = ['id'];
- protected $hidden = ['fertilizing_location', 'marker', 'goal', 'deleted_at', 'laravel_through_key', 'created_at'];
- protected $appends = ['race'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['fertilizing_location', 'marker', 'goal', 'deleted_at', 'laravel_through_key', 'created_at'];
+
+ protected $appends = ['race'];
public $timestamps = false;
@@ -38,23 +41,24 @@ public static function boot()
}
// Cache functions
- public function empty_cache($clear_hive=true)
+ public function empty_cache($clear_hive = true)
{
Log::debug("Queen ID $this->id cache emptied");
- if ($clear_hive)
+ if ($clear_hive) {
$this->hive->empty_cache();
+ }
}
// Relations
public function getRaceAttribute()
{
- if (isset($this->race_id) && $this->race_id != '')
- {
+ if (isset($this->race_id) && $this->race_id != '') {
return Cache::rememberForever("queen-race-$this->race_id-name", function () {
return Category::find($this->race_id)->name;
});
}
+
return '';
}
@@ -63,7 +67,7 @@ public function getMotherAttribute()
return isset($this->mother_id) ? Queen::find($this->mother_id)->name : '';
}
- public function hive()
+ public function hive()
{
return $this->belongsTo(Hive::class);
}
@@ -80,6 +84,6 @@ public function mother()
public static function selectList()
{
- return Queen::orderBy('name')->pluck('name','id');
+ return Queen::orderBy('name')->pluck('name', 'id');
}
}
diff --git a/app/Research.php b/app/Research.php
index c90f539f..fe09e630 100644
--- a/app/Research.php
+++ b/app/Research.php
@@ -2,10 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Model;
-use App\Image;
use Auth;
use DB;
+use Illuminate\Database\Eloquent\Model;
class Research extends Model
{
@@ -17,10 +16,10 @@ class Research extends Model
protected $table = 'researches';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -29,11 +28,13 @@ class Research extends Model
* @var array
*/
protected $fillable = ['description', 'name', 'url', 'image_id', 'type', 'institution', 'type_of_data_used', 'start_date', 'end_date', 'user_id', 'default_user_ids', 'visible', 'on_invite_only'];
- protected $hidden = ['users', 'deleted_at', 'user_id', 'owner', 'viewers', 'visible'];
- protected $appends = ['consent', 'consent_history', 'checklist_names', 'thumb_url'];
- protected $casts = [
- 'default_user_ids' => 'array'
+ protected $hidden = ['users', 'deleted_at', 'user_id', 'owner', 'viewers', 'visible'];
+
+ protected $appends = ['consent', 'consent_history', 'checklist_names', 'thumb_url'];
+
+ protected $casts = [
+ 'default_user_ids' => 'array',
];
public static $pictureType = 'research';
@@ -45,17 +46,18 @@ public static function storeImage($requestData)
public function getConsentAttribute()
{
- $consent = DB::table('research_user')->where('research_id', $this->id)->where('user_id', Auth::user()->id)->orderBy('updated_at','desc')->limit(1)->value('consent');
+ $consent = DB::table('research_user')->where('research_id', $this->id)->where('user_id', Auth::user()->id)->orderBy('updated_at', 'desc')->limit(1)->value('consent');
- if ($consent === 1)
+ if ($consent === 1) {
return true;
+ }
return false;
}
public function getConsentHistoryAttribute()
{
- return DB::table('research_user')->where('research_id', $this->id)->where('user_id', Auth::user()->id)->orderBy('updated_at','desc')->get();
+ return DB::table('research_user')->where('research_id', $this->id)->where('user_id', Auth::user()->id)->orderBy('updated_at', 'desc')->get();
}
public function getChecklistNamesAttribute()
@@ -65,12 +67,13 @@ public function getChecklistNamesAttribute()
public function getThumbUrlAttribute()
{
- if (isset($this->image_id))
+ if (isset($this->image_id)) {
return isset($this->image->thumb_url) ? $this->image->thumb_url : null;
+ }
return null;
}
-
+
public function owner()
{
return $this->belongsTo(User::class);
@@ -95,15 +98,15 @@ public function image()
{
return $this->belongsTo(Image::class);
}
-
+
public function delete()
{
- // delete image
- if(isset($this->image_id))
+ // delete image
+ if (isset($this->image_id)) {
$this->image()->delete();
+ }
// delete the research
return parent::delete();
}
-
}
diff --git a/app/Role.php b/app/Role.php
index 3c0a4a0f..d37663c7 100644
--- a/app/Role.php
+++ b/app/Role.php
@@ -6,109 +6,103 @@
class Role extends LaratrustRole
{
- public $fillable = ['name','display_name','description'];
+ public $fillable = ['name', 'display_name', 'description'];
- public $guarded = [];
+ public $guarded = [];
- public static function updateRoles()
+ public static function updateRoles()
{
// FIRST CREATE PERMISSIONS
Permission::updatePermissions();
$perm_super = Permission::all();
-
- $perm_admin = Permission::where('name','role-list')
- ->orWhere('name','user-list')
- ->orWhere('name','user-create')
- ->orWhere('name','user-edit')
- ->orWhere('name','user-delete')
- ->orWhere('name','group-list')
- ->orWhere('name','group-create')
- ->orWhere('name','group-edit')
- ->orWhere('name','group-delete')
- ->orWhere('name','sensor-list')
- ->orWhere('name','sensor-create')
- ->orWhere('name','sensor-edit')
- ->orWhere('name','sensor-delete')
- ->orWhere('name','taxonomy-list')
- ->orWhere('name','taxonomy-create')
- ->orWhere('name','taxonomy-edit')
- ->orWhere('name','taxonomy-delete')
- ->get();
-
- $perm_manag = Permission::where('name','role-list')
- ->orWhere('name','user-list')
- ->orWhere('name','group-list')
- ->orWhere('name','group-create')
- ->orWhere('name','group-edit')
- ->orWhere('name','group-delete')
- ->orWhere('name','sensor-list')
- ->orWhere('name','sensor-create')
- ->orWhere('name','sensor-edit')
- ->get();
- $perm_taxonomy_editor = Permission::where('name','taxonomy-list')
- ->orWhere('name','taxonomy-create')
- ->orWhere('name','taxonomy-edit')
- ->get();
+ $perm_admin = Permission::where('name', 'role-list')
+ ->orWhere('name', 'user-list')
+ ->orWhere('name', 'user-create')
+ ->orWhere('name', 'user-edit')
+ ->orWhere('name', 'user-delete')
+ ->orWhere('name', 'group-list')
+ ->orWhere('name', 'group-create')
+ ->orWhere('name', 'group-edit')
+ ->orWhere('name', 'group-delete')
+ ->orWhere('name', 'sensor-list')
+ ->orWhere('name', 'sensor-create')
+ ->orWhere('name', 'sensor-edit')
+ ->orWhere('name', 'sensor-delete')
+ ->orWhere('name', 'taxonomy-list')
+ ->orWhere('name', 'taxonomy-create')
+ ->orWhere('name', 'taxonomy-edit')
+ ->orWhere('name', 'taxonomy-delete')
+ ->get();
- $perm_language_editor = Permission::where('name','language-list')
- ->orWhere('name','language-create')
- ->orWhere('name','translation-list')
- ->orWhere('name','translation-create')
- ->orWhere('name','translation-edit')
- ->get();
-
+ $perm_manag = Permission::where('name', 'role-list')
+ ->orWhere('name', 'user-list')
+ ->orWhere('name', 'group-list')
+ ->orWhere('name', 'group-create')
+ ->orWhere('name', 'group-edit')
+ ->orWhere('name', 'group-delete')
+ ->orWhere('name', 'sensor-list')
+ ->orWhere('name', 'sensor-create')
+ ->orWhere('name', 'sensor-edit')
+ ->get();
+
+ $perm_taxonomy_editor = Permission::where('name', 'taxonomy-list')
+ ->orWhere('name', 'taxonomy-create')
+ ->orWhere('name', 'taxonomy-edit')
+ ->get();
+
+ $perm_language_editor = Permission::where('name', 'language-list')
+ ->orWhere('name', 'language-create')
+ ->orWhere('name', 'translation-list')
+ ->orWhere('name', 'translation-create')
+ ->orWhere('name', 'translation-edit')
+ ->get();
// Roles
- if (Role::where('name', 'superadmin')->count() == 0)
- {
- $super = new Role();
- $super->name = 'superadmin';
- $super->display_name = 'Super administrator'; // optional
- $super->description = 'User is the master of the system, and can edit everything'; // optional
- $super->save();
- $super->attachPermissions($perm_super); // all roles
+ if (Role::where('name', 'superadmin')->count() == 0) {
+ $super = new Role;
+ $super->name = 'superadmin';
+ $super->display_name = 'Super administrator'; // optional
+ $super->description = 'User is the master of the system, and can edit everything'; // optional
+ $super->save();
+ $super->attachPermissions($perm_super); // all roles
}
- if (Role::where('name', 'admin')->count() == 0)
- {
- $admin = new Role();
- $admin->name = 'admin';
- $admin->display_name = 'Administrator'; // optional
- $admin->description = 'User is allowed to manage users, groups and sensors'; // optional
- $admin->save();
- $admin->attachPermissions($perm_admin);
+ if (Role::where('name', 'admin')->count() == 0) {
+ $admin = new Role;
+ $admin->name = 'admin';
+ $admin->display_name = 'Administrator'; // optional
+ $admin->description = 'User is allowed to manage users, groups and sensors'; // optional
+ $admin->save();
+ $admin->attachPermissions($perm_admin);
}
- if (Role::where('name', 'manager')->count() == 0)
- {
- $manag = new Role();
- $manag->name = 'manager';
- $manag->display_name = 'Sensor manager'; // optional
- $manag->description = 'User is allowed to manage groups and sensors'; // optional
- $manag->save();
- $manag->attachPermissions($perm_manag);
+ if (Role::where('name', 'manager')->count() == 0) {
+ $manag = new Role;
+ $manag->name = 'manager';
+ $manag->display_name = 'Sensor manager'; // optional
+ $manag->description = 'User is allowed to manage groups and sensors'; // optional
+ $manag->save();
+ $manag->attachPermissions($perm_manag);
}
- if (Role::where('name', 'taxonomy')->count() == 0)
- {
- $taxon = new Role();
- $taxon->name = 'taxonomy';
- $taxon->display_name = 'Taxonomy editor'; // optional
- $taxon->description = 'User is allowed to create and edit taxonomy items'; // optional
- $taxon->save();
- $taxon->attachPermissions($perm_taxonomy_editor);
+ if (Role::where('name', 'taxonomy')->count() == 0) {
+ $taxon = new Role;
+ $taxon->name = 'taxonomy';
+ $taxon->display_name = 'Taxonomy editor'; // optional
+ $taxon->description = 'User is allowed to create and edit taxonomy items'; // optional
+ $taxon->save();
+ $taxon->attachPermissions($perm_taxonomy_editor);
}
- if (Role::where('name', 'translator')->count() == 0)
- {
- $trans = new Role();
- $trans->name = 'translator';
- $trans->display_name = 'Translation editor'; // optional
- $trans->description = 'User is allowed to create languages and edit translations'; // optional
- $trans->save();
- $trans->attachPermissions($perm_language_editor);
+ if (Role::where('name', 'translator')->count() == 0) {
+ $trans = new Role;
+ $trans->name = 'translator';
+ $trans->display_name = 'Translation editor'; // optional
+ $trans->description = 'User is allowed to create languages and edit translations'; // optional
+ $trans->save();
+ $trans->attachPermissions($perm_language_editor);
}
}
}
diff --git a/app/SampleCode.php b/app/SampleCode.php
index 65b6e64a..eb7e92b6 100644
--- a/app/SampleCode.php
+++ b/app/SampleCode.php
@@ -14,10 +14,10 @@ class SampleCode extends Model
protected $table = 'sample_codes';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -31,40 +31,42 @@ public function hive()
{
return $this->belongsTo(Hive::class);
}
+
public function user()
{
return $this->belongsTo(User::class);
}
+
public function queen()
{
return $this->belongsTo(Queen::class);
}
-
+
public static function generate_code()
{
$code = null;
- while ($code == null || SampleCode::where('sample_code', $code)->count() > 0)
+ while ($code == null || SampleCode::where('sample_code', $code)->count() > 0) {
$code = SampleCode::readable_random_string();
+ }
return $code;
}
- public static function readable_random_string($length = 8)
- {
- $string = '';
- $letters = array(
- 'a', 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm',
- 'n', 'p', 'r', 's', 't', 'u', 'x', 'y', 'z'
- );
+ public static function readable_random_string($length = 8)
+ {
+ $string = '';
+ $letters = [
+ 'a', 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm',
+ 'n', 'p', 'r', 's', 't', 'u', 'x', 'y', 'z',
+ ];
// Seed it
- srand((double) microtime() * 1000000);
+ srand((float) microtime() * 1000000);
$cnt = count($letters);
- for ($i = 0; $i < $length; $i++)
- {
- $string .= $letters[rand(0,$cnt-1)];
+ for ($i = 0; $i < $length; $i++) {
+ $string .= $letters[rand(0, $cnt - 1)];
}
return strtoupper($string);
diff --git a/app/SensorDefinition.php b/app/SensorDefinition.php
index 8a369a1c..a6e67375 100644
--- a/app/SensorDefinition.php
+++ b/app/SensorDefinition.php
@@ -2,11 +2,9 @@
namespace App;
+use Cache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
-use App\Measurement;
-use Cache;
-
use Illuminate\Support\Facades\Log;
class SensorDefinition extends Model
@@ -21,10 +19,10 @@ class SensorDefinition extends Model
protected $table = 'sensor_definitions';
/**
- * The database primary key value.
- *
- * @var string
- */
+ * The database primary key value.
+ *
+ * @var string
+ */
protected $primaryKey = 'id';
/**
@@ -34,9 +32,11 @@ class SensorDefinition extends Model
*/
// recalculate: true => on the fly correction + at sensor value storage, false (default) => only calculate at sensor value storage
- protected $fillable = ['name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id', 'updated_at', 'recalculate'];
- protected $appends = ['input_abbr', 'output_abbr'];
- protected $hidden = ['input_measurement', 'output_measurement', 'deleted_at'];
+ protected $fillable = ['name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id', 'updated_at', 'recalculate'];
+
+ protected $appends = ['input_abbr', 'output_abbr'];
+
+ protected $hidden = ['input_measurement', 'output_measurement', 'deleted_at'];
public static function boot()
{
@@ -63,34 +63,37 @@ public function forgetCache()
public function getInputAbbrAttribute()
{
- if ($this->input_measurement_id != null)
- return Cache::rememberForever('meas-id-'.$this->input_measurement_id.'-abbr', function (){
+ if ($this->input_measurement_id != null) {
+ return Cache::rememberForever('meas-id-'.$this->input_measurement_id.'-abbr', function () {
return $this->input_measurement->abbreviation;
});
+ }
return null;
}
public function getOutputAbbrAttribute()
{
- if ($this->output_measurement_id != null)
- return Cache::rememberForever('meas-id-'.$this->output_measurement_id.'-abbr', function (){
+ if ($this->output_measurement_id != null) {
+ return Cache::rememberForever('meas-id-'.$this->output_measurement_id.'-abbr', function () {
return $this->output_measurement->abbreviation;
});
+ }
// Fallback
if ($this->input_measurement_id != null) {
return $this->getInputAbbrAttribute();
- }
+ }
return null;
}
- // transform bool output into real boolean value
+ // transform bool output into real boolean value
public function getInsideAttribute($value)
{
- if (isset($value))
+ if (isset($value)) {
return $value == 1 ? true : false;
+ }
return null;
}
@@ -99,10 +102,12 @@ public function input_measurement()
{
return $this->belongsTo(Measurement::class);
}
+
public function output_measurement()
{
return $this->belongsTo(Measurement::class);
}
+
public function device()
{
return $this->belongsTo(Device::class);
@@ -112,40 +117,40 @@ public function calibrated_measurement_value($inputValue)
{
$outputValue = $inputValue;
- if( (!empty($this->offset) || !empty($this->multiplier)) && isset($this->input_measurement_id) && isset($this->output_measurement_id))
- {
- $offset = !empty($this->offset) ? floatval($this->offset) : 0;
- $multi = !empty($this->multiplier) ? floatval($this->multiplier) : 1;
+ if ((! empty($this->offset) || ! empty($this->multiplier)) && isset($this->input_measurement_id) && isset($this->output_measurement_id)) {
+ $offset = ! empty($this->offset) ? floatval($this->offset) : 0;
+ $multi = ! empty($this->multiplier) ? floatval($this->multiplier) : 1;
$outputValue = (floatval($inputValue) - $offset) * $multi;
$outAbbr = $this->output_abbr;
- if (isset($outAbbr))
- {
- $mima = Measurement::minMaxValuesArray();
+ if (isset($outAbbr)) {
+ $mima = Measurement::minMaxValuesArray();
$om_min = $mima[$outAbbr]['min'];
$om_max = $mima[$outAbbr]['max'];
- //die(print_r(['in'=>$inputValue, 'out'=>$outputValue, 'min'=>$om_min, 'max'=>$om_max]));
+ // die(print_r(['in'=>$inputValue, 'out'=>$outputValue, 'min'=>$om_min, 'max'=>$om_max]));
- if (isset($om_min) && $outputValue < $om_min)
+ if (isset($om_min) && $outputValue < $om_min) {
return null;
+ }
- if (isset($om_max) && $outputValue > $om_max)
+ if (isset($om_max) && $outputValue > $om_max) {
return null;
-
+ }
+
}
}
return $outputValue;
}
- public static function addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr=null)
+ public static function addDeviceMeasurementCalibrations($device, $data_array, $calibration_m_abbr = null)
{
/** $calibration_m_abbr:
- ['w_v' =>
+ ['w_v' =>
[
- 1743801780 =>
+ 1743801780 =>
[
'id' => 1338,
'output_abbr' => 'weight_kg',
@@ -155,22 +160,22 @@ public static function addDeviceMeasurementCalibrations($device, $data_array, $c
]
]
ordered in ascending updated order
- **/
-
- if ($calibration_m_abbr === null)
+ **/
+ if ($calibration_m_abbr === null) {
$calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(false);
+ }
if (is_array($calibration_m_abbr) && count($calibration_m_abbr) > 0) {
-
- //Log::debug($calibration_m_abbr);
-
+
+ // Log::debug($calibration_m_abbr);
+
$measurement_min_max = Measurement::minMaxValuesArray();
$data_meas = array_keys($data_array);
$cali_meas = array_keys($calibration_m_abbr);
$cali_match = array_intersect($cali_meas, $data_meas);
-
- //Log::debug(['data'=>$data_array, 'cali'=>$cali_meas, 'match'=>$cali_match]);
-
+
+ // Log::debug(['data'=>$data_array, 'cali'=>$cali_meas, 'match'=>$cali_match]);
+
if (isset($data_array['time']) && count($cali_match) > 0) {
foreach ($cali_match as $m_in_abbr) {
$data_value = $data_array[$m_in_abbr];
@@ -179,13 +184,13 @@ public static function addDeviceMeasurementCalibrations($device, $data_array, $c
continue;
} // only calibrate existing values
- $calis = $calibration_m_abbr[$m_in_abbr];
- $time = $data_array['time'];
+ $calis = $calibration_m_abbr[$m_in_abbr];
+ $time = $data_array['time'];
$unix_d = strtotime($time);
$unixes = array_keys($calis); // unix timestamps
$length = count($unixes);
- //Log::debug(['time'=>$time, 'unix_d'=>$unix_d, 'length'=>$length]);
+ // Log::debug(['time'=>$time, 'unix_d'=>$unix_d, 'length'=>$length]);
for ($i = 0; $i < $length; $i++) {
$unix_curr = $unixes[$i];
@@ -202,7 +207,7 @@ public static function addDeviceMeasurementCalibrations($device, $data_array, $c
// Calibrate value
$data_array[$cali_output.'_raw'] = $data_value;
- $calibrated_value = ($data_value - $cali_offset) * $cali_multi;
+ $calibrated_value = ($data_value - $cali_offset) * $cali_multi;
// Hide values outside value min/max
if (isset($meas_min) && $calibrated_value < $meas_min) {
@@ -251,14 +256,11 @@ public static function addDeviceMeasurementCalibrations($device, $data_array, $c
}
}
}
- }
- else
- {
- Log::debug(json_encode(['error'=>'no_match_or_time', 'data'=>$data_array, 'cali'=>$cali_meas, 'match'=>$cali_match]));
+ } else {
+ Log::debug(json_encode(['error' => 'no_match_or_time', 'data' => $data_array, 'cali' => $cali_meas, 'match' => $cali_match]));
}
}
return $data_array;
}
-
}
diff --git a/app/Setting.php b/app/Setting.php
index bcbb9fe8..d6cfb3be 100644
--- a/app/Setting.php
+++ b/app/Setting.php
@@ -6,10 +6,12 @@
class Setting extends Model
{
- protected $fillable = ['user_id', 'category_id', 'name', 'value', 'number'];
- protected $guarded = ['id'];
- protected $hidden = ['user_id', 'category_id', 'id', 'deleted_at'];
- //protected $appends = ['type'];
+ protected $fillable = ['user_id', 'category_id', 'name', 'value', 'number'];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['user_id', 'category_id', 'id', 'deleted_at'];
+ // protected $appends = ['type'];
public $timestamps = false;
@@ -18,8 +20,8 @@ public function getTypeAttribute()
{
return Category::find($this->category_id)->name;
}
-
- public function user()
+
+ public function user()
{
return $this->belongsTo(User::class);
}
diff --git a/app/Taxonomy.php b/app/Taxonomy.php
index 390cc4fd..f1f64a09 100644
--- a/app/Taxonomy.php
+++ b/app/Taxonomy.php
@@ -3,9 +3,9 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Facades\DB;
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
-use Illuminate\Support\Facades\DB;
class Taxonomy extends Model
{
@@ -13,48 +13,49 @@ class Taxonomy extends Model
use NodeTrait;
- protected $table = 'categories';
+ protected $table = 'categories';
protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type'];
- protected $guarded = ['id'];
-
- protected $hidden = ['created_at','updated_at', 'category_input_id', 'physical_quantity_id','_lft','_rgt','pivot','old_id','description','type','input_type','options','parent_id', 'source','name','required'];
-
- protected $appends = ['icon','text'];
-
- public static $types=
- [
- 'checklist' => 'Hive checklist item',
- 'research' => 'Research specific item',
- 'system' => 'System (required for interface)',
- ];
-
- public static $hive_type_sizes =
- [
- 'bs_improved_national' => ['fr_width_cm'=>35.6, 'fr_height_cm'=>21.5, 'bb_width_cm'=>46, 'bb_depth_cm'=>46, 'bb_height_cm'=>22.5],
- 'dadant' => ['fr_width_cm'=>42, 'fr_height_cm'=>26, 'bb_width_cm'=>47, 'bb_depth_cm'=>47, 'bb_height_cm'=>30],
- 'deutsch_normalmass_1_5' => ['fr_width_cm'=>35, 'fr_height_cm'=>31.5, 'bb_width_cm'=>0, 'bb_depth_cm'=>0, 'bb_height_cm'=>0],
- 'deutsch_normalmass' => ['fr_width_cm'=>35, 'fr_height_cm'=>20, 'bb_width_cm'=>42.6, 'bb_depth_cm'=>50.9, 'bb_height_cm'=>23.2],
- 'einraumbeute' => ['fr_width_cm'=>26.1, 'fr_height_cm'=>44, 'bb_width_cm'=>0, 'bb_depth_cm'=>0, 'bb_height_cm'=>0],
- 'golzbeute' => ['fr_width_cm'=>23, 'fr_height_cm'=>31, 'bb_width_cm'=>62, 'bb_depth_cm'=>59.4, 'bb_height_cm'=>37],
- 'langstroth' => ['fr_width_cm'=>42.8, 'fr_height_cm'=>20.3, 'bb_width_cm'=>65, 'bb_depth_cm'=>50.5, 'bb_height_cm'=>24.5],
- 'segeberger' => ['fr_width_cm'=>37, 'fr_height_cm'=>22.3, 'bb_width_cm'=>50, 'bb_depth_cm'=>50, 'bb_height_cm'=>25],
- 'spaarkast' => ['fr_width_cm'=>34, 'fr_height_cm'=>19.8, 'bb_width_cm'=>47.3, 'bb_depth_cm'=>42.1, 'bb_height_cm'=>22.8],
- 'zander' => ['fr_width_cm'=>40, 'fr_height_cm'=>19.1, 'bb_width_cm'=>0, 'bb_depth_cm'=>0, 'bb_height_cm'=>0],
- ];
+
+ protected $guarded = ['id'];
+
+ protected $hidden = ['created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'old_id', 'description', 'type', 'input_type', 'options', 'parent_id', 'source', 'name', 'required'];
+
+ protected $appends = ['icon', 'text'];
+
+ public static $types =
+ [
+ 'checklist' => 'Hive checklist item',
+ 'research' => 'Research specific item',
+ 'system' => 'System (required for interface)',
+ ];
+
+ public static $hive_type_sizes =
+ [
+ 'bs_improved_national' => ['fr_width_cm' => 35.6, 'fr_height_cm' => 21.5, 'bb_width_cm' => 46, 'bb_depth_cm' => 46, 'bb_height_cm' => 22.5],
+ 'dadant' => ['fr_width_cm' => 42, 'fr_height_cm' => 26, 'bb_width_cm' => 47, 'bb_depth_cm' => 47, 'bb_height_cm' => 30],
+ 'deutsch_normalmass_1_5' => ['fr_width_cm' => 35, 'fr_height_cm' => 31.5, 'bb_width_cm' => 0, 'bb_depth_cm' => 0, 'bb_height_cm' => 0],
+ 'deutsch_normalmass' => ['fr_width_cm' => 35, 'fr_height_cm' => 20, 'bb_width_cm' => 42.6, 'bb_depth_cm' => 50.9, 'bb_height_cm' => 23.2],
+ 'einraumbeute' => ['fr_width_cm' => 26.1, 'fr_height_cm' => 44, 'bb_width_cm' => 0, 'bb_depth_cm' => 0, 'bb_height_cm' => 0],
+ 'golzbeute' => ['fr_width_cm' => 23, 'fr_height_cm' => 31, 'bb_width_cm' => 62, 'bb_depth_cm' => 59.4, 'bb_height_cm' => 37],
+ 'langstroth' => ['fr_width_cm' => 42.8, 'fr_height_cm' => 20.3, 'bb_width_cm' => 65, 'bb_depth_cm' => 50.5, 'bb_height_cm' => 24.5],
+ 'segeberger' => ['fr_width_cm' => 37, 'fr_height_cm' => 22.3, 'bb_width_cm' => 50, 'bb_depth_cm' => 50, 'bb_height_cm' => 25],
+ 'spaarkast' => ['fr_width_cm' => 34, 'fr_height_cm' => 19.8, 'bb_width_cm' => 47.3, 'bb_depth_cm' => 42.1, 'bb_height_cm' => 22.8],
+ 'zander' => ['fr_width_cm' => 40, 'fr_height_cm' => 19.1, 'bb_width_cm' => 0, 'bb_depth_cm' => 0, 'bb_height_cm' => 0],
+ ];
// Relations
public function getIconAttribute()
{
- if ($this->category_input_id != null)
- {
+ if ($this->category_input_id != null) {
$catInput = CategoryInput::where('id', $this->category_input_id)->first();
- if ($catInput)
- {
+ if ($catInput) {
$icon = $catInput->glyphIcon();
+
return "glyphicon glyphicon-$icon";
}
}
+
return null;
}
@@ -66,6 +67,7 @@ public function getTranslationsAttribute()
public function getTextAttribute()
{
$req = ($this->required) ? ' *' : '';
+
return $this->transName().$req;
}
@@ -81,15 +83,16 @@ public function getTransAttribute()
public function getUnitAttribute()
{
- if ($this->physical_quantity_id != null)
- {
+ if ($this->physical_quantity_id != null) {
$unit = $this->physicalQuantity()->value('abbreviation');
- if ($unit)
+ if ($unit) {
return $unit;
+ }
}
+
return null;
}
-
+
public function physicalQuantity()
{
return $this->hasOne(PhysicalQuantity::class, 'id', 'physical_quantity_id');
@@ -105,16 +108,17 @@ public function inputType()
return $this->hasOne(CategoryInput::class, 'id', 'category_input_id');
}
-
public function isSystem()
{
- if ($this->type == 'system')
+ if ($this->type == 'system') {
return true;
+ }
$ancTypeArr = $this->ancestors->pluck('type')->toArray();
- if (in_array('system', $ancTypeArr))
+ if (in_array('system', $ancTypeArr)) {
return true;
+ }
return false;
}
@@ -122,8 +126,9 @@ public function isSystem()
public function physicalQuantityId()
{
$quan = $this->physicalQuantity;
- if (isset($quan))
+ if (isset($quan)) {
return $quan->id;
+ }
return null;
}
@@ -131,8 +136,9 @@ public function physicalQuantityId()
public function inputTypeName()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->name;
+ }
return '';
}
@@ -140,8 +146,9 @@ public function inputTypeName()
public function inputTypeType()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->type;
+ }
return '';
}
@@ -149,8 +156,9 @@ public function inputTypeType()
public function inputTypeIcon()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->glyphIcon();
+ }
return '';
}
@@ -158,8 +166,9 @@ public function inputTypeIcon()
public function inputTypeId()
{
$type = $this->inputType;
- if (isset($type))
+ if (isset($type)) {
return $type->id;
+ }
return null;
}
@@ -167,59 +176,64 @@ public function inputTypeId()
public function translation($language_abbr)
{
$lang_id = Language::where('abbreviation', $language_abbr)->pluck('id');
- if ($lang_id)
+ if ($lang_id) {
return Translation::where('language_id', $lang_id)->where('name', $this->name)->value('translation');
-
+ }
+
return $this->name;
}
public function translations()
{
- $trans = Translation::where('name', $this->name)->pluck('translation','language_id');
- if ($trans)
+ $trans = Translation::where('name', $this->name)->pluck('translation', 'language_id');
+ if ($trans) {
return $trans;
-
- return [['translation'=>$this->name, 'language_id'=>0]];
+ }
+
+ return [['translation' => $this->name, 'language_id' => 0]];
}
public function trans()
{
$trans = DB::table('translations')
- ->join('languages', 'translations.language_id', '=', 'languages.id')
- ->where('translations.name', $this->name)
- ->select('translations.translation', 'languages.twochar')
- ->get();
+ ->join('languages', 'translations.language_id', '=', 'languages.id')
+ ->where('translations.name', $this->name)
+ ->select('translations.translation', 'languages.twochar')
+ ->get();
- if ($trans)
- {
+ if ($trans) {
$out = [];
- foreach($trans as $item)
- {
- $out[$item->twochar] = $item->translation;
+ foreach ($trans as $item) {
+ $out[$item->twochar] = $item->translation;
}
+
return $out;
}
-
+
return null;
}
public function transName($locale = null)
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
-
+ }
+
$trans = $this->trans;
+
return isset($trans[$locale]) ? $trans[$locale] : $this->name;
}
public function ancName($locale = null)
{
- if ($locale == null)
+ if ($locale == null) {
$locale = LaravelLocalization::getCurrentLocale();
-
- $ancest = $this->getAncestors()->map(function($item,$key) use ($locale){
+ }
+
+ $ancest = $this->getAncestors()->map(function ($item, $key) use ($locale) {
return $item->transName($locale).' > ';
});
+
return $ancest->implode('');
}
@@ -231,88 +245,96 @@ public function useAmount()
$l = Location::where('category_id', $this->id)->get()->count();
$s = Device::where('category_id', $this->id)->get()->count();
- $total_usage = $i+$h+$f+$l+$s;
+ $total_usage = $i + $h + $f + $l + $s;
return $total_usage;
}
- public static function descendentsByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function descendentsByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
$category = Taxonomy::findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn);
- //die(print_r($category->toArray()));
- if (isset($category))
+ // die(print_r($category->toArray()));
+ if (isset($category)) {
return Taxonomy::whereDescendantOf($category)->get();
+ }
return [];
}
- public static function findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
- $root = Taxonomy::whereIsRoot()->where('name', $root_name)->first();
+ $root = Taxonomy::whereIsRoot()->where('name', $root_name)->first();
$parent = Taxonomy::descendantsAndSelf($root)->whereIn('type', $whereTypeIn)->where('name', $parent_name)->first();
- if (isset($parent))
+ if (isset($parent)) {
return $parent->children()->where('name', $name)->first();
+ }
return new Taxonomy;
}
- public static function findCategoryIdByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn=['system'])
+ public static function findCategoryIdByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn = ['system'])
{
$cat = Taxonomy::findCategoryByRootParentAndName($root_name, $parent_name, $name, $whereTypeIn);
- if (isset($cat))
+ if (isset($cat)) {
return $cat->id;
+ }
return null;
}
- public static function getRootIds($order=true)
+ public static function getRootIds($order = true)
{
$locale = LaravelLocalization::getCurrentLocale();
- if ($order)
- return Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->pluck('id')->toArray();
+ if ($order) {
+ return Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->pluck('id')->toArray();
+ }
return Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->pluck('id')->toArray();
}
// Defines JSON tree for JSTree. See: https://www.jstree.com/docs/json/
- public static function getTaxonomy($rootNodes=null, $order=true, $flat=false)
+ public static function getTaxonomy($rootNodes = null, $order = true, $flat = false)
{
$locale = LaravelLocalization::getCurrentLocale();
- if (gettype($rootNodes) !== 'array' || count($rootNodes) == 0)
- {
- if ($order === true)
- $rootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->pluck('id');
- else
+ if (gettype($rootNodes) !== 'array' || count($rootNodes) == 0) {
+ if ($order === true) {
+ $rootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->get()->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->pluck('id');
+ } else {
$rootNodes = Taxonomy::whereIsRoot()->whereNotIn('type', ['system'])->pluck('id');
+ }
}
-
- $taxonomy = collect();
- foreach ($rootNodes as $node)
- {
- if ($flat == true && $order === false)
- $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node) );
- else if ($flat == true && $order === true)
- $taxonomy = $taxonomy->merge(Category::whereNotIn('type', ['system'])->descendantsAndSelf($node)->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE) );
- else if ($flat == false && $order === false)
- $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node)->toTree() );
- else if ($flat == false)
- {
- if (gettype($order) == 'array' && count($order) > 0)
+
+ $taxonomy = collect();
+ foreach ($rootNodes as $node) {
+ if ($flat == true && $order === false) {
+ $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node));
+ } elseif ($flat == true && $order === true) {
+ $taxonomy = $taxonomy->merge(Category::whereNotIn('type', ['system'])->descendantsAndSelf($node)->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE));
+ } elseif ($flat == false && $order === false) {
+ $taxonomy = $taxonomy->merge(Taxonomy::whereNotIn('type', ['system'])->descendantsAndSelf($node)->toTree());
+ } elseif ($flat == false) {
+ if (gettype($order) == 'array' && count($order) > 0) {
$taxonomy = $taxonomy
->merge(Taxonomy::descendantsAndSelf($node)
- ->whereNotIn('type', ['system'])
- ->map(function($cat, $key) use ($order) { $selected = in_array($cat->id, $order); $cat->state = ['selected'=>$selected, 'opened'=>$selected, 'cat'=>$cat->id, 'disabled'=>$cat->required]; return $cat; })
- ->sortBy(function($cat, $key) use ($order) { return array_search($cat->id, $order); })
- ->toTree());
- else
- $taxonomy = $taxonomy->merge(Taxonomy::descendantsAndSelf($node)->whereNotIn('type', ['system'])->sortBy("trans.$locale", SORT_NATURAL|SORT_FLAG_CASE)->toTree());
+ ->whereNotIn('type', ['system'])
+ ->map(function ($cat, $key) use ($order) {
+ $selected = in_array($cat->id, $order);
+ $cat->state = ['selected' => $selected, 'opened' => $selected, 'cat' => $cat->id, 'disabled' => $cat->required];
+
+ return $cat;
+ })
+ ->sortBy(function ($cat, $key) use ($order) {
+ return array_search($cat->id, $order);
+ })
+ ->toTree());
+ } else {
+ $taxonomy = $taxonomy->merge(Taxonomy::descendantsAndSelf($node)->whereNotIn('type', ['system'])->sortBy("trans.$locale", SORT_NATURAL | SORT_FLAG_CASE)->toTree());
+ }
}
}
return $taxonomy;
}
-
-
}
diff --git a/app/Traits/MeasurementLegacyCalculationsTrait.php b/app/Traits/MeasurementLegacyCalculationsTrait.php
index 5ffa5610..4e9698a1 100644
--- a/app/Traits/MeasurementLegacyCalculationsTrait.php
+++ b/app/Traits/MeasurementLegacyCalculationsTrait.php
@@ -1,16 +1,13 @@
1)
+ if (strpos($data_string, '|') !== false) {
+ $arr = explode('|', $data_string);
+ foreach ($arr as $str) {
+ $str_arr = explode(':', $str);
+ if (count($str_arr) > 1) {
$out[$str_arr[0]] = $str_arr[1];
+ }
}
}
+
return $out;
}
protected function calculateWeightKg($device, $data_array)
{
- $totalWeight = 0;
- $use_separate = false;
+ $totalWeight = 0;
+ $use_separate = false;
$separate_names = ['w_fl', 'w_fr', 'w_bl', 'w_br'];
- foreach ($separate_names as $name)
- {
- if (isset($data_array[$name]) && $data_array[$name] > 0)
+ foreach ($separate_names as $name) {
+ if (isset($data_array[$name]) && $data_array[$name] > 0) {
$use_separate = true;
+ }
}
-
- foreach($data_array as $name => $value)
- {
- if (($use_separate && in_array($name, $separate_names)) || (!$use_separate && $name == 'w_v')) // 4 names w_fl, w_fr, w_bl, w_br || 1 combined name w_v
- {
+
+ foreach ($data_array as $name => $value) {
+ if (($use_separate && in_array($name, $separate_names)) || (! $use_separate && $name == 'w_v')) { // 4 names w_fl, w_fr, w_bl, w_br || 1 combined name w_v
// TODO: Make dependent of SensorDefinition
$name_offset = $device->last_sensor_measurement_time_value($name.'_offset');
$name_factor = $device->last_sensor_measurement_time_value($name.'_kg_per_val');
-
- if ($name_factor === 0)
- {
+
+ if ($name_factor === 0) {
// exclude from calculation
- }
- else if ($name_factor !== null) // factor available
- {
+ } elseif ($name_factor !== null) { // factor available
$offset = isset($name_offset) ? floatval($name_offset) : 0;
$factor = floatval($name_factor);
$weight = $factor * (floatval($value) - $offset);
$totalWeight += $weight;
-
- //die("offset=$offset factor=$factor weight=$weight totalWeight=$totalWeight");
- }
- else
- {
+
+ // die("offset=$offset factor=$factor weight=$weight totalWeight=$totalWeight");
+ } else {
$totalWeight += floatval($value);
}
}
}
- //die(print_r($log));
+
+ // die(print_r($log));
return $totalWeight;
}
private function floatify_sensor_val($arr, $key)
{
- if (isset($arr[$key]))
- {
+ if (isset($arr[$key])) {
$value = $arr[$key];
- if ($value == 0)
- {
+ if ($value == 0) {
unset($arr[$key]);
- }
- else
- {
- switch($key)
- {
+ } else {
+ switch ($key) {
case 't':
case 't_i':
$arr[$key] = ($value / 5) - 10; // de-tempfy
@@ -119,84 +104,84 @@ private function floatify_sensor_val($arr, $key)
return $arr;
}
-
- private function calibrate_weight_sensors($device, $weight_kg, $next_measurement=true, $data_array=null)
+ private function calibrate_weight_sensors($device, $weight_kg, $next_measurement = true, $data_array = null)
{
- if ($weight_kg == 0)
+ if ($weight_kg == 0) {
return 'no-calibration-weight-error';
+ }
- if ($next_measurement)
- {
- $store = ['calibrating_weight'=>$weight_kg];
- //die(print_r($store));
+ if ($next_measurement) {
+ $store = ['calibrating_weight' => $weight_kg];
+ // die(print_r($store));
$stored = $this->storeInfluxData($store, $device, time());
- if ($stored)
+ if ($stored) {
return true;
- }
- else
- {
- $search_for = ['w_fl'=>0, 'w_fr'=>0, 'w_bl'=>0, 'w_br'=>0, 'w_v'=>0];
- $calibrate = [];
+ }
+ } else {
+ $search_for = ['w_fl' => 0, 'w_fr' => 0, 'w_bl' => 0, 'w_br' => 0, 'w_v' => 0];
+ $calibrate = [];
$value_counter = 0;
// set and count values to use
- foreach ($search_for as $sens => $value)
- {
+ foreach ($search_for as $sens => $value) {
$last_value = 0;
- if (isset($data_array[$sens]))
+ if (isset($data_array[$sens])) {
$last_value = $data_array[$sens];
- else
+ } else {
$last_value = $device->last_sensor_measurement_time_value($sens);
-
+ }
+
$sens_offset = floatval($device->last_sensor_measurement_time_value($sens.'_offset'));
$last_value = $last_value - $sens_offset;
- if (isset($last_value) && $last_value > 1)
- {
+ if (isset($last_value) && $last_value > 1) {
$calibrate[$sens.'_kg_per_val'] = $last_value;
- $search_for[$sens] = $last_value;
- if ($sens != 'w_v')
+ $search_for[$sens] = $last_value;
+ if ($sens != 'w_v') {
$value_counter++;
- }
- else
- {
+ }
+ } else {
$calibrate[$sens.'_kg_per_val'] = 0;
}
}
- if (count($calibrate) == 0)
+ if (count($calibrate) == 0) {
return 'no-weight-values-error';
+ }
$weight_part = $weight_kg / max(1, $value_counter);
- foreach ($calibrate as $sens => $value)
+ foreach ($calibrate as $sens => $value) {
$calibrate[$sens] = $value != 0 ? $weight_part / $value : 0;
+ }
// check if w_v should be added
$combined_value = 0;
- if (isset($data_array['w_v']))
+ if (isset($data_array['w_v'])) {
$combined_value = $data_array['w_v'];
- else
+ } else {
$combined_value = $device->last_sensor_measurement_time_value('w_v');
+ }
- if ($combined_value > 0)
- {
- if (isset($calibrate['w_v_kg_per_val']))
+ if ($combined_value > 0) {
+ if (isset($calibrate['w_v_kg_per_val'])) {
$this->createOrUpdateDefinition($device, 'w_v', 'weight_kg', null, $calibrate['w_v_kg_per_val']);
- else
+ } else {
$calibrate['w_v_kg_per_val'] = $weight_kg / $combined_value;
+ }
}
// switch 'off' calibrating mode
$calibrate['calibrating_weight'] = 0;
- //die(print_r(['weight_kg'=>$weight_kg, 'values'=>$search_for, 'cal'=>$calibrate,'key'=>$device->key]));
+ // die(print_r(['weight_kg'=>$weight_kg, 'values'=>$search_for, 'cal'=>$calibrate,'key'=>$device->key]));
$stored = $this->storeInfluxData($calibrate, $device, time());
- if ($stored)
+ if ($stored) {
return true;
+ }
}
return 'calibrate-error';
@@ -204,146 +189,148 @@ private function calibrate_weight_sensors($device, $weight_kg, $next_measurement
private function offset_weight_sensors($device)
{
- $search_for = ['w_fl', 'w_fr', 'w_bl', 'w_br', 'w_v'];
- $offset = [];
-
- foreach ($search_for as $key)
- {
+ $search_for = ['w_fl', 'w_fr', 'w_bl', 'w_br', 'w_v'];
+ $offset = [];
+
+ foreach ($search_for as $key) {
$value = $device->last_sensor_measurement_time_value($key);
- if ($value != null)
+ if ($value != null) {
$offset[$key.'_offset'] = $value;
+ }
}
- if (count($offset) == 0)
+ if (count($offset) == 0) {
return 'no-weight-values-error';
+ }
- //die(print_r(['cal'=>$offset,'key'=>$device->key]));
+ // die(print_r(['cal'=>$offset,'key'=>$device->key]));
// create or update the new SensorDefinition
- if (isset($offset['w_v_offset']))
+ if (isset($offset['w_v_offset'])) {
$this->createOrUpdateDefinition($device, 'w_v', 'weight_kg', $offset['w_v_offset']);
-
+ }
+
$stored = $this->storeInfluxData($offset, $device, time());
- if ($stored)
+ if ($stored) {
return true;
+ }
return 'offset-error';
}
-
private function add_weight_kg_corrected_with_temperature($device, $data_array)
{
- if (isset($data_array['t']))
- {
- $sensor_names = ['w_fl', 'w_fr', 'w_bl', 'w_br'];
+ if (isset($data_array['t'])) {
+ $sensor_names = ['w_fl', 'w_fr', 'w_bl', 'w_br'];
$temp_weight_arr = [];
- foreach ($sensor_names as $key)
- {
- if(isset($data_array[$key]))
- {
+ foreach ($sensor_names as $key) {
+ if (isset($data_array[$key])) {
$temp_weight_arr[$key] = $data_array[$key];
}
}
-
- if (count($temp_weight_arr) == 0) // no value available, so do not add
- return $data_array;
+
+ if (count($temp_weight_arr) == 0) { // no value available, so do not add
+ return $data_array;
+ }
$diff_arr = $this->last_sensor_increment_values($device, $data_array);
- if (!isset($diff_arr['t']) || $data_array['weight_kg'] == 0)
+ if (! isset($diff_arr['t']) || $data_array['weight_kg'] == 0) {
return $data_array;
+ }
$diff_temp = $diff_arr['t'];
-
+
// temp -> raw weight value correlation is 2 -> 1 = 0.5 W/T
// So apply '- diff_arr['t'] * 0.5' to raw values and then calculate the total weight again (incl. offset and factor)
$weight_per_temp = 0.35;
-
- // foreach ($temp_weight_arr as $sens => $val)
+
+ // foreach ($temp_weight_arr as $sens => $val)
// {
// if (isset($diff_arr[$sens]))
// {
// // check if the value is dependent in the same direction, otherwise do not correct
- // $sign = (($diff_temp >= 0 && $diff_arr[$sens] >= 0) || ($diff_temp < 0 && $diff_arr[$sens] < 0)) ? -1 : 0;
+ // $sign = (($diff_temp >= 0 && $diff_arr[$sens] >= 0) || ($diff_temp < 0 && $diff_arr[$sens] < 0)) ? -1 : 0;
// $temp_weight_arr[$sens] = $val + ($sign * $weight_per_temp * $diff_temp);
// }
// }
// // calculate corrected total weight
// $temp_corr_weight = $this->calculateWeightKg($device, $temp_weight_arr);;
- //die(print_r(['tw'=>$temp_weight_arr, 'diff'=>$diff_arr, 'corr'=>$temp_corr_weight,'uncorr'=>$data_array['weight_kg']]));
+ // die(print_r(['tw'=>$temp_weight_arr, 'diff'=>$diff_arr, 'corr'=>$temp_corr_weight,'uncorr'=>$data_array['weight_kg']]));
- $sign = (($diff_temp >= 0 && $diff_arr['weight_kg'] >= 0) || ($diff_temp < 0 && $diff_arr['weight_kg'] < 0)) ? -1 : 0;
+ $sign = (($diff_temp >= 0 && $diff_arr['weight_kg'] >= 0) || ($diff_temp < 0 && $diff_arr['weight_kg'] < 0)) ? -1 : 0;
$temp_corr_weight = $data_array['weight_kg'] + ($sign * $weight_per_temp * $diff_temp);
- if ($temp_corr_weight > 0)
+ if ($temp_corr_weight > 0) {
$data_array['weight_kg_corrected'] = $temp_corr_weight;
+ }
}
+
return $data_array;
}
-
// Public functions
/**
- * api/sensors/calibrateweight
- * Legacy method, used by legacy webapp to store weight calibration value e.g.[w_v_kg_per_val] in Influx database, to lookup and calculate [weight_kg] at incoming measurement value storage
- *
- * At the next measurement coming in, calibrate each weight sensor with it's part of a given weight.
- * Because the measurements can come in only each hour/ 3hrs, set a value to trigger the calculation on next measurement
- *
- * 1. If $next_measurement == true: save 'calibrating' = true in Influx with the sensor key
- * 2. If $next_measurement == false: save 'calibrating' = false in Influx with the sensor key and...
- * 3. Get the last measured weight values for this sensor key,
- * Divide the given weight (in kg) with the amount of sensor values > 1.0 (assuming the weight is evenly distributed)
- * Calculate the multiplier per sensor by dividing the multiplier = weight_part / (value - offset)
- * Save the multiplier as $device_name.'_kg_per_val' in Influx
- */
+ * api/sensors/calibrateweight
+ * Legacy method, used by legacy webapp to store weight calibration value e.g.[w_v_kg_per_val] in Influx database, to lookup and calculate [weight_kg] at incoming measurement value storage
+ *
+ * At the next measurement coming in, calibrate each weight sensor with it's part of a given weight.
+ * Because the measurements can come in only each hour/ 3hrs, set a value to trigger the calculation on next measurement
+ *
+ * 1. If $next_measurement == true: save 'calibrating' = true in Influx with the sensor key
+ * 2. If $next_measurement == false: save 'calibrating' = false in Influx with the sensor key and...
+ * 3. Get the last measured weight values for this sensor key,
+ * Divide the given weight (in kg) with the amount of sensor values > 1.0 (assuming the weight is evenly distributed)
+ * Calculate the multiplier per sensor by dividing the multiplier = weight_part / (value - offset)
+ * Save the multiplier as $device_name.'_kg_per_val' in Influx
+ */
public function calibrateweight(Request $request)
{
$validator = Validator::make($request->all(), [
'next_measurement' => 'nullable|boolean',
- 'weight_kg' => 'numeric|required_if:next_measurement,true',
+ 'weight_kg' => 'numeric|required_if:next_measurement,true',
]);
- if ($validator->fails())
+ if ($validator->fails()) {
return Response::json('validation-error', 500);
+ }
- $device = $this->get_user_device($request, true); // requires id, key, hive_id, or nothing (if only one sensor) to be set
+ $device = $this->get_user_device($request, true); // requires id, key, hive_id, or nothing (if only one sensor) to be set
$calibrated = false;
- if ($device)
- {
+ if ($device) {
$next_measurement = $request->filled('next_measurement') ? $request->input('next_measurement') : true;
- $weight_kg = floatval($request->filled('weight_kg') ? $request->input('weight_kg') : $device->last_sensor_measurement_time_value('calibrating_weight'));
- $calibrated = $this->calibrate_weight_sensors($device, $weight_kg, $next_measurement);
- }
- else
- {
+ $weight_kg = floatval($request->filled('weight_kg') ? $request->input('weight_kg') : $device->last_sensor_measurement_time_value('calibrating_weight'));
+ $calibrated = $this->calibrate_weight_sensors($device, $weight_kg, $next_measurement);
+ } else {
$calibrated = 'no_device_found';
}
- if($calibrated === true)
- {
- if ($next_measurement)
- return Response::json("calibrating_weight", 200);
- else
- return Response::json("calibrated_weight", 201);
+ if ($calibrated === true) {
+ if ($next_measurement) {
+ return Response::json('calibrating_weight', 200);
+ } else {
+ return Response::json('calibrated_weight', 201);
+ }
}
-
+
return Response::json($calibrated, 500);
}
public function offsetweight(Request $request)
{
$device = $this->get_user_device($request, true); // requires id, key, hive_id, or nothing (if only one sensor) to be set
-
- if ($device)
+
+ if ($device) {
$offset = $this->offset_weight_sensors($device);
- else
+ } else {
$offset = 'no_device_found';
+ }
+
+ if ($offset === true) {
+ return Response::json('offset_weight', 201);
+ }
- if($offset === true)
- return Response::json("offset_weight", 201);
-
return Response::json($offset, 500);
}
@@ -354,23 +341,24 @@ public function offsetweight(Request $request)
@bodyParam key string DEV EUI to look up the sensor (Device)
@bodyParam id integer ID to look up the sensor (Device)
@bodyParam hive_id integer Hive ID to look up the sensor (Device)
- */
+ */
public function lastweight(Request $request)
{
$weight = ['w_fl', 'w_fr', 'w_bl', 'w_br', 'w_v', 'weight_kg', 'weight_kg_corrected', 'calibrating_weight', 'w_v_offset', 'w_v_kg_per_val', 'w_fl_offset', 'w_fr_offset', 'w_bl_offset', 'w_br_offset'];
$device = $this->get_user_device($request);
- if ($device)
- $output = $device->last_sensor_values_array(implode('","',$weight));
- else
+ if ($device) {
+ $output = $device->last_sensor_values_array(implode('","', $weight));
+ } else {
$output = false;
+ }
- if ($output === false)
+ if ($output === false) {
return Response::json('sensor-get-error', 500);
- else if ($output !== null)
+ } elseif ($output !== null) {
return Response::json($output);
-
+ }
+
return Response::json('error', 404);
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Traits/MeasurementLoRaDecoderTrait.php b/app/Traits/MeasurementLoRaDecoderTrait.php
index a4bbe1ac..d9d94f7f 100644
--- a/app/Traits/MeasurementLoRaDecoderTrait.php
+++ b/app/Traits/MeasurementLoRaDecoderTrait.php
@@ -1,10 +1,9 @@
decode_beep_payload($payload, $port);
// add meta data
$data_array['port'] = $port;
- if (isset($data['hardware_serial']) && !isset($data_array['key']))
- $data_array['key'] = $data['hardware_serial']; // LoRa WAN == Device EUI
- if (isset($data['device_id']) && !isset($data_array['key']))
- $data_array['key'] = $data['device_id']; // hardware ID is "device_id" in TTN v3 downlink
- if (isset($data['metadata']['gateways'][0]['rssi']))
+ if (isset($data['hardware_serial']) && ! isset($data_array['key'])) {
+ $data_array['key'] = $data['hardware_serial'];
+ } // LoRa WAN == Device EUI
+ if (isset($data['device_id']) && ! isset($data_array['key'])) {
+ $data_array['key'] = $data['device_id'];
+ } // hardware ID is "device_id" in TTN v3 downlink
+ if (isset($data['metadata']['gateways'][0]['rssi'])) {
$data_array['rssi'] = $data['metadata']['gateways'][0]['rssi'];
- if (isset($data['metadata']['gateways'][0]['snr']))
+ }
+ if (isset($data['metadata']['gateways'][0]['snr'])) {
$data_array['snr'] = $data['metadata']['gateways'][0]['snr'];
- if (isset($data['metadata']['gateways'][0]['channel']))
+ }
+ if (isset($data['metadata']['gateways'][0]['channel'])) {
$data_array['lora_channel'] = $data['metadata']['gateways'][0]['channel'];
- if (isset($data['metadata']['data_rate']))
+ }
+ if (isset($data['metadata']['data_rate'])) {
$data_array['data_rate'] = $data['metadata']['data_rate'];
- if (isset($data['downlink_url']))
+ }
+ if (isset($data['downlink_url'])) {
$data_array['downlink_url'] = $data['downlink_url'];
+ }
+ } elseif (isset($data['f_port']) && ($data['f_port'] == 6)) { // TTN v3 downlink
+ Log::info('TTN downlink received:', $data);
- }
- else if(isset($data['f_port']) && ($data['f_port'] == 6)) // TTN v3 downlink
- {
- Log::info('TTN downlink received:', $data);
-
- $payload = bin2hex(base64_decode($data['frm_payload']));
- Log::info('$payload from downlink:', $payload);
+ $payload = bin2hex(base64_decode($data['frm_payload']));
+ Log::info('$payload from downlink:', $payload);
- // $data_array = $this->decode_beep_payload($payload, $port);
+ // $data_array = $this->decode_beep_payload($payload, $port);
- $data_array['port'] = $data['f_port'];
- $data_array['key'] = $data['end_device_ids']['dev_eui'];
+ $data_array['port'] = $data['f_port'];
+ $data_array['key'] = $data['end_device_ids']['dev_eui'];
- Log::info('full $data_array from downlink:', $data_array);
- Log::info('dev_eui:', $data['end_device_ids']['dev_eui']);
+ Log::info('full $data_array from downlink:', $data_array);
+ Log::info('dev_eui:', $data['end_device_ids']['dev_eui']);
- return $data_array;
- }
- else if (isset($data['end_device_ids']['dev_eui']) && isset($data['end_device_ids']['device_id']) && isset($data['join_accept']['received_at'])) // TTN v3 Join accept
- {
+ return $data_array;
+ } elseif (isset($data['end_device_ids']['dev_eui']) && isset($data['end_device_ids']['device_id']) && isset($data['join_accept']['received_at'])) { // TTN v3 Join accept
$data_array['hardware_id'] = $data['end_device_ids']['device_id'];
$data_array['key'] = $data['end_device_ids']['dev_eui'];
- if (isset($data['end_device_ids']['application_ids']['application_id']) && $data['end_device_ids']['application_ids']['application_id'] == 'beep-base-production')
+ if (isset($data['end_device_ids']['application_ids']['application_id']) && $data['end_device_ids']['application_ids']['application_id'] == 'beep-base-production') {
$data_array['beep_base'] = true;
+ }
- }
+ } elseif (isset($data['end_device_ids']['dev_eui']) && isset($data['uplink_message']['frm_payload']) || isset($data['downlink_message']['frm_payload']) && isset($data['uplink_message']['f_port']) || isset($data['downlink_message']['f_port'])) { // ttn v3 uplink or downlink
+ if (isset($data['uplink_message'])) {
+ $port = $data['uplink_message']['f_port'];
+ }
- else if (isset($data['end_device_ids']['dev_eui']) && isset($data['uplink_message']['frm_payload']) || isset($data['downlink_message']['frm_payload']) && isset($data['uplink_message']['f_port']) || isset($data['downlink_message']['f_port']) ) // ttn v3 uplink or downlink
- {
- if(isset($data['uplink_message']))
- $port = $data['uplink_message']['f_port'];
-
- if(isset($data['downlink_message']))
- $port = $data['downlink_message']['f_port'];
-
- if(isset($data['uplink_message']['decoded_payload']) && (isset($data['uplink_message']['decoded_payload']['payload_fields']) || count($data['uplink_message']['decoded_payload']) > 2)) // uplink: at least has payload fields, or 3 decoded payload fields (not only ['bytes'])
- {
- if (isset($data['uplink_message']['decoded_payload']['payload_fields']))
- $data_array = $data['uplink_message']['decoded_payload']['payload_fields']; // TTN v3 with defined payload_fields (using decoder)
- else
- $data_array = $data['uplink_message']['decoded_payload'];
+ if (isset($data['downlink_message'])) {
+ $port = $data['downlink_message']['f_port'];
}
-
- else
- {
- $payload = bin2hex(base64_decode($data['uplink_message']['frm_payload'])); // TTN v3 uplink with BEEP base payload
+ if (isset($data['uplink_message']['decoded_payload']) && (isset($data['uplink_message']['decoded_payload']['payload_fields']) || count($data['uplink_message']['decoded_payload']) > 2)) { // uplink: at least has payload fields, or 3 decoded payload fields (not only ['bytes'])
+ if (isset($data['uplink_message']['decoded_payload']['payload_fields'])) {
+ $data_array = $data['uplink_message']['decoded_payload']['payload_fields'];
+ } // TTN v3 with defined payload_fields (using decoder)
+ else {
+ $data_array = $data['uplink_message']['decoded_payload'];
+ }
+ } else {
+ $payload = bin2hex(base64_decode($data['uplink_message']['frm_payload'])); // TTN v3 uplink with BEEP base payload
$data_array = $this->decode_beep_payload($payload, $port);
}
- $data_array['port'] = $port;
- $data_array['key'] = $data['end_device_ids']['dev_eui'];
+ $data_array['port'] = $port;
+ $data_array['key'] = $data['end_device_ids']['dev_eui'];
- //die(print_r($data_array));
+ // die(print_r($data_array));
// add meta data
- if (isset($data['end_device_ids']['device_id']) && !isset($data_array['key']))
- $data_array['key'] = $data['end_device_ids']['device_id']; // LoRa WAN == Device EUI
+ if (isset($data['end_device_ids']['device_id']) && ! isset($data_array['key'])) {
+ $data_array['key'] = $data['end_device_ids']['device_id'];
+ } // LoRa WAN == Device EUI
- if (isset($data['uplink_message']['f_cnt']))
+ if (isset($data['uplink_message']['f_cnt'])) {
$data_array['f_cnt'] = $data['uplink_message']['f_cnt'];
+ }
- if (isset($data['uplink_message']['rx_metadata'][0]['rssi']))
+ if (isset($data['uplink_message']['rx_metadata'][0]['rssi'])) {
$data_array['rssi'] = $data['uplink_message']['rx_metadata'][0]['rssi'];
+ }
- if (isset($data['uplink_message']['rx_metadata'][0]['snr']))
+ if (isset($data['uplink_message']['rx_metadata'][0]['snr'])) {
$data_array['snr'] = $data['uplink_message']['rx_metadata'][0]['snr'];
+ }
- if (isset($data['uplink_message']['rx_metadata'][0]['location']['longitude']))
+ if (isset($data['uplink_message']['rx_metadata'][0]['location']['longitude'])) {
$data_array['lon'] = $data['uplink_message']['rx_metadata'][0]['location']['longitude'];
+ }
- if (isset($data['uplink_message']['rx_metadata'][0]['location']['latitude']))
+ if (isset($data['uplink_message']['rx_metadata'][0]['location']['latitude'])) {
$data_array['lat'] = $data['uplink_message']['rx_metadata'][0]['location']['latitude'];
+ }
- if (isset($data['uplink_message']['settings']['data_rate']['lora']['bandwidth']))
+ if (isset($data['uplink_message']['settings']['data_rate']['lora']['bandwidth'])) {
$data_array['lora_bandwidth'] = $data['uplink_message']['settings']['data_rate']['lora']['bandwidth'];
+ }
- if (isset($data['uplink_message']['settings']['data_rate']['lora']['spreading_factor']))
+ if (isset($data['uplink_message']['settings']['data_rate']['lora']['spreading_factor'])) {
$data_array['lora_spf'] = $data['uplink_message']['settings']['data_rate']['lora']['spreading_factor'];
+ }
- if (isset($data['uplink_message']['settings']['data_rate_index']))
+ if (isset($data['uplink_message']['settings']['data_rate_index'])) {
$data_array['lora_data_rate'] = $data['uplink_message']['settings']['data_rate_index'];
+ }
- if (isset($data['uplink_message']['settings']['frequency']))
+ if (isset($data['uplink_message']['settings']['frequency'])) {
$data_array['lora_frequency'] = $data['uplink_message']['settings']['frequency'];
+ }
- if (isset($data['uplink_message']['locations']['user']['latitude']))
+ if (isset($data['uplink_message']['locations']['user']['latitude'])) {
$data_array['lat'] = $data['uplink_message']['locations']['user']['latitude'];
+ }
- if (isset($data['uplink_message']['locations']['user']['longitude']))
+ if (isset($data['uplink_message']['locations']['user']['longitude'])) {
$data_array['lon'] = $data['uplink_message']['locations']['user']['longitude'];
+ }
- if (isset($data['uplink_message']['locations']['user']['altitude']))
+ if (isset($data['uplink_message']['locations']['user']['altitude'])) {
$data_array['alt'] = $data['uplink_message']['locations']['user']['altitude'];
+ }
- //die(print_r($data_array));
+ // die(print_r($data_array));
}
@@ -147,12 +156,13 @@ private function decode_ttn_payload($data)
private function decode_simpoint_payload($data)
{
$data_array = [];
-
- if (!isset($data['payload_hex']) || !isset($data['FPort']))
+
+ if (! isset($data['payload_hex']) || ! isset($data['FPort'])) {
return $data_array;
+ }
$payload = $data['payload_hex'];
- $port = $data['FPort'];
+ $port = $data['FPort'];
return $this->decode_beep_payload($payload, $port);
}
@@ -161,11 +171,12 @@ private function decode_kpnthings_payload($data)
{
$data_array = [];
- if (!isset($data['payload']) || !isset($data['port']))
+ if (! isset($data['payload']) || ! isset($data['port'])) {
return $data_array;
-
- $payload = $data['payload'];
- $port = $data['port'];
+ }
+
+ $payload = $data['payload'];
+ $port = $data['port'];
return $this->decode_beep_payload($payload, $port);
}
@@ -174,11 +185,12 @@ private function decode_helium_payload($data)
{
$data_array = [];
- if (!isset($data['payload']) || !isset($data['port']))
+ if (! isset($data['payload']) || ! isset($data['port'])) {
return $data_array;
+ }
$payload = bin2hex(base64_decode($data['payload']));
- $port = $data['port'];
+ $port = $data['port'];
return $this->decode_beep_payload($payload, $port);
}
@@ -186,35 +198,34 @@ private function decode_helium_payload($data)
private function decode_swisscom_payload($data)
{
$data_array = [];
-
- if (!isset($data['payload']) || !isset($data['port']))
+
+ if (! isset($data['payload']) || ! isset($data['port'])) {
return $data_array;
+ }
$payload = $data['payload'];
- $port = $data['port'];
+ $port = $data['port'];
return $this->decode_beep_payload($payload, $port);
}
-
// 03 31 1b0bf10bea64 0a01019889 0400 0c0a00ff008e001d0010000f000e000c000b000900090008 070849160703f8 25 5f5b73d2 0a
// type length (49 bytes) payload(78)
// bat weight temo fft bme280 time unixts \n
- private function decode_flashlog_payload($flashlog_line, $show=false)
+ private function decode_flashlog_payload($flashlog_line, $show = false)
{
- $p = strtolower($flashlog_line);
- $port = hexdec(substr($p, 0, 2));
+ $p = strtolower($flashlog_line);
+ $port = hexdec(substr($p, 0, 2));
$length = hexdec(substr($p, 2, 2));
- $payload= substr($flashlog_line, 4);
+ $payload = substr($flashlog_line, 4);
$parsed = $this->decode_beep_payload($payload, $port);
$parsed['port'] = $port;
-
- if ($show)
- {
- $parsed['len'] = $length;
- $parsed['pl'] = $payload;
- $parsed['pl_bytes']= strlen($payload)/2;
+
+ if ($show) {
+ $parsed['len'] = $length;
+ $parsed['pl'] = $payload;
+ $parsed['pl_bytes'] = strlen($payload) / 2;
}
return $parsed;
@@ -225,43 +236,41 @@ private function hexdecs($hex)
{
// ignore non hex characters
$hex = preg_replace('/[^0-9A-Fa-f]/', '', $hex);
-
+
// converted decimal value:
$dec = hexdec($hex);
-
+
// maximum decimal value based on length of hex + 1:
// number of bits in hex number is 8 bits for each 2 hex -> max = 2^n
// use 'pow(2,n)' since '1 << n' is only for integers and therefore limited to integer size.
$max = pow(2, 4 * (strlen($hex) + (strlen($hex) % 2)));
-
+
// complement = maximum - converted hex:
$_dec = $max - $dec;
-
+
// if dec value is larger than its complement we have a negative value (first bit is set)
return $dec > $_dec ? -$_dec : $dec;
}
- private function createOrUpdateDefinition($device, $abbr_in, $abbr_out, $offset=null, $multiplier=null)
+ private function createOrUpdateDefinition($device, $abbr_in, $abbr_out, $offset = null, $multiplier = null)
{
- $measurement_in = Measurement::where('abbreviation',$abbr_in)->first();
- $measurement_out = Measurement::where('abbreviation',$abbr_out)->first();
+ $measurement_in = Measurement::where('abbreviation', $abbr_in)->first();
+ $measurement_out = Measurement::where('abbreviation', $abbr_out)->first();
- if ($measurement_in && $measurement_out)
- {
+ if ($measurement_in && $measurement_out) {
$def = $device->sensorDefinitions->where('input_measurement_id', $measurement_in->id)->where('output_measurement_id', $measurement_out->id)->last();
- if ($def && (isset($offset) || isset($multiplier)) )
- {
- if (isset($offset))
+ if ($def && (isset($offset) || isset($multiplier))) {
+ if (isset($offset)) {
$def->offset = $offset;
+ }
- if (isset($multiplier))
+ if (isset($multiplier)) {
$def->multiplier = $multiplier;
+ }
$def->save();
- }
- else
- {
- $device->sensorDefinitions()->create(['input_measurement_id'=>$measurement_in->id, 'output_measurement_id'=>$measurement_out->id, 'offset'=>$offset, 'multiplier'=>$multiplier]);
+ } else {
+ $device->sensorDefinitions()->create(['input_measurement_id' => $measurement_in->id, 'output_measurement_id' => $measurement_out->id, 'offset' => $offset, 'multiplier' => $multiplier]);
}
}
}
@@ -271,16 +280,13 @@ private function decode_beep_payload($payload, $port)
$out = [];
$out['payload_hex'] = $payload;
// distighuish BEEP base v2 and v3 payload
-
- if ($port != 1) // BEEP base v3 firmware
- {
- $p = strtolower($payload);
+
+ if ($port != 1) { // BEEP base v3 firmware
+ $p = strtolower($payload);
$pu = strtoupper($payload);
-
- if ($port == 2)
- {
- if (substr($p, 0, 2) == '01' && (strlen($p) == 52 || strlen($p) == 60 || strlen($p) == 70 || strlen($p) == 76 || strlen($p) == 80 || strlen($p) == 86 || strlen($p) == 96)) // BEEP base fw 1.3.3+ start-up message)
- {
+
+ if ($port == 2) {
+ if (substr($p, 0, 2) == '01' && (strlen($p) == 52 || strlen($p) == 60 || strlen($p) == 70 || strlen($p) == 76 || strlen($p) == 80 || strlen($p) == 86 || strlen($p) == 96)) { // BEEP base fw 1.3.3+ start-up message)
$out['beep_base'] = true;
// 0100010003000502935cbdd3ffff94540e0123af9aed3527beee1d000001 (60)
// 0100010003000402935685E6FFFF94540E01237A26A67D24D8EE1D000001 (60)
@@ -291,41 +297,37 @@ private function decode_beep_payload($payload, $port)
// 010001000800000200030004038a645c0e0123450e2bc68559ee1d01000f2d6960d7432b00000004 (80) fw 1.8.0+, incl. reset reason 4
// 0e01236dada5c40a28ee
- // 01 00 01 00 03 00 04 02 93 56 85 E6 FF FF 94 54 0E 01 23 7A 26 A6 7D 24 D8 EE 1D 00 00 01 25 60 70 61 A9
+ // 01 00 01 00 03 00 04 02 93 56 85 E6 FF FF 94 54 0E 01 23 7A 26 A6 7D 24 D8 EE 1D 00 00 01 25 60 70 61 A9
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 (length == 35 bytes = 70 char)
// pl fw version hw version ATTEC ID (14) app config Time
+ if (substr($p, 0, 2) == '01') {
+ $out['firmware_version'] = hexdec(substr($p, 2, 4)).'.'.hexdec(substr($p, 6, 4)).'.'.hexdec(substr($p, 10, 4));
+ } // 2-13
+
+ if (substr($p, 14, 2) == '02') {
+ $out['hardware_version'] = hexdec(substr($p, 16, 4)).'.'.hexdec(substr($p, 20, 4)).' ID:'.hexdec(substr($p, 24, 8));
+ } // 16-32
- if (substr($p, 0, 2) == '01')
- $out['firmware_version'] = hexdec(substr($p, 2, 4)).'.'.hexdec(substr($p, 6, 4)).'.'.hexdec(substr($p, 10, 4)); // 2-13
-
- if (substr($p, 14, 2) == '02')
- $out['hardware_version'] = hexdec(substr($p, 16, 4)).'.'.hexdec(substr($p, 20, 4)).' ID:'.hexdec(substr($p, 24, 8)); // 16-32
-
- if (substr($p, 32, 2) == '0e')
- $out['hardware_id'] = substr($p, 34, 18); // 34-51
-
-
- if (strlen($p) == 60 || strlen($p) == 70 || strlen($p) == 80)
- {
- if (substr($p, 52, 2) == "1d")
- {
- $out['measurement_transmission_ratio'] = hexdec(substr($p, 54, 2));
- $out['measurement_interval_min'] = hexdec(substr($p, 56, 4));
+ if (substr($p, 32, 2) == '0e') {
+ $out['hardware_id'] = substr($p, 34, 18);
+ } // 34-51
+
+ if (strlen($p) == 60 || strlen($p) == 70 || strlen($p) == 80) {
+ if (substr($p, 52, 2) == '1d') {
+ $out['measurement_transmission_ratio'] = hexdec(substr($p, 54, 2));
+ $out['measurement_interval_min'] = hexdec(substr($p, 56, 4));
}
// From 1.5.9 time is added to startup message
- if (strlen($p) > 60)
- {
- $time_id = substr($pu, 60, 2);
+ if (strlen($p) > 60) {
+ $time_id = substr($pu, 60, 2);
$time_available = $time_id == '25' || $time_id == '26' || $time_id == '2D' ? true : false;
- if ($time_available)
- {
+ if ($time_available) {
$unixts = hexdec(substr($p, 62, 8));
- if ($unixts)
- {
+ if ($unixts) {
- $out['time_clock'] = $time_id == '26' || $time_id == '2D' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
+ $out['time_clock'] = $time_id == '26' || $time_id == '2D' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
$out['time_device'] = $unixts;
}
}
@@ -342,41 +344,35 @@ private function decode_beep_payload($payload, $port)
- 0x00080000 — NFC
- 0x00100000 — VBUS (USB VBUS)
*/
- if (strlen($p) == 80)
- {
- if (substr($p, 70, 2) == "2b")
- {
+ if (strlen($p) == 80) {
+ if (substr($p, 70, 2) == '2b') {
$out['reset_reason'] = hexdec(substr($p, 72, 8));
}
}
}
- }
- else if (strlen($p) > 70) // 71 - 86
- {
- if (substr($p, 52, 2) == "1f") // 52-62
- $out['boot_count'] = hexdec(substr($p, 54, 8));
-
- if (substr($p, 62, 2) == "03") // 62-66
- $out['ds18b20_state'] = hexdec(substr($p, 64, 2));
-
- if (substr($p, 66, 2) == "1d") // 66-74
- {
- $out['measurement_transmission_ratio'] = hexdec(substr($p, 68, 2));
- $out['measurement_interval_min'] = hexdec(substr($p, 70, 4));
+ } elseif (strlen($p) > 70) { // 71 - 86
+ if (substr($p, 52, 2) == '1f') { // 52-62
+ $out['boot_count'] = hexdec(substr($p, 54, 8));
+ }
+
+ if (substr($p, 62, 2) == '03') { // 62-66
+ $out['ds18b20_state'] = hexdec(substr($p, 64, 2));
+ }
+
+ if (substr($p, 66, 2) == '1d') { // 66-74
+ $out['measurement_transmission_ratio'] = hexdec(substr($p, 68, 2));
+ $out['measurement_interval_min'] = hexdec(substr($p, 70, 4));
}
// From fw 1.5.9 time is added to startup message
- if (strlen($p) == 86 || strlen($p) == 96)
- {
- $time_id = substr($pu, 74, 2);
+ if (strlen($p) == 86 || strlen($p) == 96) {
+ $time_id = substr($pu, 74, 2);
$time_available = $time_id == '25' || $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? true : false;
- if ($time_available)
- {
+ if ($time_available) {
$unixts = hexdec(substr($p, 76, 8));
- if ($unixts)
- {
- $out['time_clock'] = $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
+ if ($unixts) {
+ $out['time_clock'] = $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
$out['time_device'] = $unixts; // This sets $device->datetime and $device->datetime_offset_sec in MeasurementController::addDeviceMeta();
}
}
@@ -394,21 +390,16 @@ private function decode_beep_payload($payload, $port)
- 0x00080000 — NFC
- 0x00100000 — VBUS (USB VBUS)
*/
- if (strlen($p) == 96)
- {
- if (substr($p, 86, 2) == "2b")
- {
+ if (strlen($p) == 96) {
+ if (substr($p, 86, 2) == '2b') {
$out['reset_reason'] = hexdec(substr($p, 88, 8));
}
}
}
}
}
- }
- else if ($port == 3 || $port == 4)
- {
- if (($port == 3 && substr($pu, 0, 2) == '1B') || ($port == 4 && substr($pu, 2, 2) == '1B')) // BEEP base fw 1.2.0+ measurement message, and alarm message starts with battery voltage (1B)
- {
+ } elseif ($port == 3 || $port == 4) {
+ if (($port == 3 && substr($pu, 0, 2) == '1B') || ($port == 4 && substr($pu, 2, 2) == '1B')) { // BEEP base fw 1.2.0+ measurement message, and alarm message starts with battery voltage (1B)
$out['beep_base'] = true;
// Value Batt (1B) Weight (0A) Temp (04) FFT (0C) BME280 (07) Device time (25)
@@ -419,9 +410,9 @@ private function decode_beep_payload($payload, $port)
// raw pl 1B 0C 4B 0C 44 64 0A 01 01 2D 2D 04 01 07 D6
// Flashlog: 1B 0D 2D 0D 2F 64 0A001 0F D2 1D 04 02 07 7E 06 2D 0C 0A 00 FF 00 6C 00 18 00 28 00 0E 00 0B 00 0A 00 0B 00 1B 00 0A 00 07 07 00 00 00 00 00 00 0A
// Flashlog: 1B 0D 2A 0D 1C 64 0A001 13 8A CB 04 02 0D 99 06 07 0C 0A 09 46 00 C9 01 67 00 30 00 6F 00 87 00 49 00 67 00 2C 00 23 00 0C 07 00 00 00 00 00 00 0A
- // Flashlog: 1B 0D 21 0D 1B 64 0A001 13 8B 09 04 02 0D 93 05 EE
+ // Flashlog: 1B 0D 21 0D 1B 64 0A001 13 8B 09 04 02 0D 93 05 EE
// Flashlog: 1B 0D 67 0D 59 64 0A001 FF FB EB 04 01 08 34 0C 0A 09 46 00 0C 00 07 00 06 00 04 00 02 00 03 00 03 00 02 00 03 00 00 07 00 00 00 00 00 00 25 60 AD 41 03 0A
-
+
// <1.5.11:0333 1B 0C 9E 0C 9B 64 0A 01 02 0D 3F 04 01 07 D6 0C 0A 09 46 00 0A 00 06 00 05 00 05 00 03 00 04 00 05 00 04 00 03 00 01 07 00 00 00 00 00 00 25 60 22 AB E9 0A
// >1.5.11:0333 1B 0D C1 0D BC 64 0A001 00 25 64 04 01 09 7F 0C 0A 09 46 00 0B 00 07 00 06 00 15 00 05 00 06 00 0A 00 06 00 05 00 01 07 00 00 00 00 00 00 25 61 2C A9 0B 0A
@@ -439,224 +430,191 @@ private function decode_beep_payload($payload, $port)
$sb = $port == 4 ? 2 : 0; // start byte
// Battery: 0x1B
- if (substr($pu, $sb+6, 4) == '640A') // missing bv
- {
- $out['vcc'] = hexdec(substr($p, $sb+2, 4))/1000;
- $out['bv'] = $out['vcc'];
- $out['bat_perc'] = hexdec(substr($p, $sb+6, 2));
+ if (substr($pu, $sb + 6, 4) == '640A') { // missing bv
+ $out['vcc'] = hexdec(substr($p, $sb + 2, 4)) / 1000;
+ $out['bv'] = $out['vcc'];
+ $out['bat_perc'] = hexdec(substr($p, $sb + 6, 2));
+
+ $sb = $sb + 8;
+ } else {
+ $out['vcc'] = hexdec(substr($p, $sb + 2, 4)) / 1000;
+ $out['bv'] = hexdec(substr($p, $sb + 6, 4)) / 1000;
+ $out['bat_perc'] = hexdec(substr($p, $sb + 10, 2));
- $sb = $sb+8;
- }
- else
- {
- $out['vcc'] = hexdec(substr($p, $sb+2, 4))/1000;
- $out['bv'] = hexdec(substr($p, $sb+6, 4))/1000;
- $out['bat_perc'] = hexdec(substr($p, $sb+10, 2));
-
// Weight (0 - 2): 0x0A
- if (substr($pu, $sb+12, 2) == '0A')
- $sb = $sb+12; // normal payload
- elseif (substr($pu, $sb+16, 2) == '0A')
- $sb = $sb+16; // fw 1.3.4 flashlog payload
+ if (substr($pu, $sb + 12, 2) == '0A') {
+ $sb = $sb + 12;
+ } // normal payload
+ elseif (substr($pu, $sb + 16, 2) == '0A') {
+ $sb = $sb + 16;
+ } // fw 1.3.4 flashlog payload
}
// Weight: 0x0A
- $weight_amount = hexdec(substr($p, $sb+2, 2));
+ $weight_amount = hexdec(substr($p, $sb + 2, 2));
$out['weight_sensor_amount'] = $weight_amount;
- $weight_val_len = $weight_amount * 6;
-
+ $weight_val_len = $weight_amount * 6;
+
// fix Flashlog extra 0 error by removing it from the payload: 0A001 -> 0A01
- if ($weight_amount == 0 && substr($pu, $sb, 5) == '0A001')
- {
- $replace_index = $sb+2; // 0A 0 01 -> 0A 01
- $p = substr_replace($p, '', $replace_index, 1);
- $pu = substr_replace($pu, '', $replace_index, 1);
- $payload = substr_replace($payload, '', $replace_index, 1);
+ if ($weight_amount == 0 && substr($pu, $sb, 5) == '0A001') {
+ $replace_index = $sb + 2; // 0A 0 01 -> 0A 01
+ $p = substr_replace($p, '', $replace_index, 1);
+ $pu = substr_replace($pu, '', $replace_index, 1);
+ $payload = substr_replace($payload, '', $replace_index, 1);
$out['payload_hex'] = substr_replace($out['payload_hex'], '', $replace_index, 1);
// update weight amount
- $weight_amount = hexdec(substr($p, $sb+2, 2));
+ $weight_amount = hexdec(substr($p, $sb + 2, 2));
$out['weight_sensor_amount'] = $weight_amount;
- $weight_val_len = $weight_amount * 6;
+ $weight_val_len = $weight_amount * 6;
}
- if (substr($pu, $sb, 2) == '0A')
- {
- if ($weight_amount > 0 && $weight_amount < 3)
- {
- if ($weight_amount == 1)
- {
- $out['w_v'] = self::hexdecs(substr($p, $sb+4, 6));
- }
- else if ($weight_amount > 1)
- {
- for ($i=0; $i < $weight_amount; $i++)
- {
- $out['w_v_'.($i+1)] = self::hexdecs(substr($p, $sb+4+($i*6), 6)); // w_v_1, w_v_2, etc
+ if (substr($pu, $sb, 2) == '0A') {
+ if ($weight_amount > 0 && $weight_amount < 3) {
+ if ($weight_amount == 1) {
+ $out['w_v'] = self::hexdecs(substr($p, $sb + 4, 6));
+ } elseif ($weight_amount > 1) {
+ for ($i = 0; $i < $weight_amount; $i++) {
+ $out['w_v_'.($i + 1)] = self::hexdecs(substr($p, $sb + 4 + ($i * 6), 6)); // w_v_1, w_v_2, etc
}
}
}
- }
- else
- {
+ } else {
unset($out['weight_sensor_amount']);
}
// Temperature 1-10x DS18b20: 0x04
- $sb = $sb + 4 + $weight_val_len;
- $temp_amount = hexdec(substr($p, $sb+2, 2));
+ $sb = $sb + 4 + $weight_val_len;
+ $temp_amount = hexdec(substr($p, $sb + 2, 2));
$out['ds18b20_sensor_amount'] = $temp_amount;
-
- if (substr($pu, $sb, 2) == '04' && $temp_amount > 0)
- {
- if ($temp_amount == 1)
- {
- $out['t_i'] = self::hexdecs(substr($p, $sb+4, 4))/100;
- }
- else if ($temp_amount > 1 && $temp_amount < 11)
- {
- for ($i=0; $i < $temp_amount; $i++)
- {
- $out['t_'.$i] = self::hexdecs(substr($p, $sb+4+($i*4), 4))/100;
+
+ if (substr($pu, $sb, 2) == '04' && $temp_amount > 0) {
+ if ($temp_amount == 1) {
+ $out['t_i'] = self::hexdecs(substr($p, $sb + 4, 4)) / 100;
+ } elseif ($temp_amount > 1 && $temp_amount < 11) {
+ for ($i = 0; $i < $temp_amount; $i++) {
+ $out['t_'.$i] = self::hexdecs(substr($p, $sb + 4 + ($i * 4), 4)) / 100;
}
}
}
// Audio FFT: 0x0C
- $sb = $sb + 4 + $temp_amount * 4;
- $fft_char_len = 4;
- $fft_bin_amount = hexdec(substr($p, $sb+2, 2));
- $fft_bin_freq = 3.937752016; // = about 2000 / 510
- $fft_start_bin = hexdec(substr($p, $sb+4, 2));
- $fft_stop_bin = hexdec(substr($p, $sb+6, 2));
- $fft_bin_total = $fft_stop_bin - $fft_start_bin;
- $out['fft_bin_amount'] = $fft_bin_amount;
- $out['fft_start_bin'] = $fft_start_bin;
- $out['fft_stop_bin'] = $fft_stop_bin;
- $fft_sb = $sb + 8;
-
- if (substr($pu, $sb, 2) == '0C' && $fft_bin_amount > 0 && $fft_bin_amount < 13 && $fft_bin_total)
- {
- $summed_bins = ceil($fft_bin_total * 2 / $fft_bin_amount) ;
-
- for ($i=0; $i < $fft_bin_amount; $i++)
- {
- $fftValueIndex = $fft_sb + ($i * $fft_char_len);
- $fftValue = hexdec(substr($p, $fftValueIndex, $fft_char_len));
-
- $start_freq = round( ( ($fft_start_bin * 2) + $i * $summed_bins) * $fft_bin_freq);
- $stop_freq = round( ( ($fft_start_bin * 2) + ($i+1) * $summed_bins) * $fft_bin_freq);
-
- //$out['s_bin_'.$i] = [$start_freq, $stop_freq, $fftValue];
+ $sb = $sb + 4 + $temp_amount * 4;
+ $fft_char_len = 4;
+ $fft_bin_amount = hexdec(substr($p, $sb + 2, 2));
+ $fft_bin_freq = 3.937752016; // = about 2000 / 510
+ $fft_start_bin = hexdec(substr($p, $sb + 4, 2));
+ $fft_stop_bin = hexdec(substr($p, $sb + 6, 2));
+ $fft_bin_total = $fft_stop_bin - $fft_start_bin;
+ $out['fft_bin_amount'] = $fft_bin_amount;
+ $out['fft_start_bin'] = $fft_start_bin;
+ $out['fft_stop_bin'] = $fft_stop_bin;
+ $fft_sb = $sb + 8;
+
+ if (substr($pu, $sb, 2) == '0C' && $fft_bin_amount > 0 && $fft_bin_amount < 13 && $fft_bin_total) {
+ $summed_bins = ceil($fft_bin_total * 2 / $fft_bin_amount);
+
+ for ($i = 0; $i < $fft_bin_amount; $i++) {
+ $fftValueIndex = $fft_sb + ($i * $fft_char_len);
+ $fftValue = hexdec(substr($p, $fftValueIndex, $fft_char_len));
+
+ $start_freq = round((($fft_start_bin * 2) + $i * $summed_bins) * $fft_bin_freq);
+ $stop_freq = round((($fft_start_bin * 2) + ($i + 1) * $summed_bins) * $fft_bin_freq);
+
+ // $out['s_bin_'.$i] = [$start_freq, $stop_freq, $fftValue];
$out['s_bin_'.$start_freq.'_'.$stop_freq] = $fftValue;
}
}
// BME280: 0x07
- $sb = $fft_sb + $fft_bin_amount * $fft_char_len;
- $bme_start = $sb+2;
-
- if (strlen($pu) > $sb && substr($pu, $sb, 2) == '07')
- {
- $bme280_t = self::hexdecs(substr($p, $bme_start, 4)); // signed int
- $bme280_h = hexdec(substr($p, $bme_start+4, 4));
- $bme280_p = hexdec(substr($p, $bme_start+8, 4));
- if (($bme280_t + $bme280_h + $bme280_p) != 0)
- {
- $out['t'] = $bme280_t/100;
- $out['h'] = $bme280_h/100;
- $out['p'] = $bme280_p;
- }
+ $sb = $fft_sb + $fft_bin_amount * $fft_char_len;
+ $bme_start = $sb + 2;
+
+ if (strlen($pu) > $sb && substr($pu, $sb, 2) == '07') {
+ $bme280_t = self::hexdecs(substr($p, $bme_start, 4)); // signed int
+ $bme280_h = hexdec(substr($p, $bme_start + 4, 4));
+ $bme280_p = hexdec(substr($p, $bme_start + 8, 4));
+ if (($bme280_t + $bme280_h + $bme280_p) != 0) {
+ $out['t'] = $bme280_t / 100;
+ $out['h'] = $bme280_h / 100;
+ $out['p'] = $bme280_p;
+ }
}
// Get time from payload (flash log)
// 1b0bf10bea64 0a01019889 0400 0c0a00ff008e001d0010000f000e000c000b000900090008 070849160703f8 25 5f5b73d2 0a
// bat weight temo fft bme280 time unixts \n
- $sb = $sb+14;
- if (strlen($pu) > $sb)
- {
- $time_id = substr($pu, $sb, 2);
+ $sb = $sb + 14;
+ if (strlen($pu) > $sb) {
+ $time_id = substr($pu, $sb, 2);
$time_available = $time_id == '25' || $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? true : false;
- if ($time_available)
- {
- $time_start = $sb+2;
- $max_time = time();
- $unixts = hexdec(substr($p, $time_start, 8));
-
- if ($unixts) // unix timestamp > Tue Jan 01 2019 00:00:00 GMT+0000
- {
- $out['time_clock'] = $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
+ if ($time_available) {
+ $time_start = $sb + 2;
+ $max_time = time();
+ $unixts = hexdec(substr($p, $time_start, 8));
+
+ if ($unixts) { // unix timestamp > Tue Jan 01 2019 00:00:00 GMT+0000
+ $out['time_clock'] = $time_id == '26' || $time_id == '2D' || $time_id == '2E' ? 'rtc' : 'mcu'; // 2023-08-16 added to FW 1.5.14+: 25 == PCB clock. 26/2D == RTC clock
$out['time_device'] = $unixts; // This sets $device->datetime and $device->datetime_offset_sec in MeasurementController::addDeviceMeta();
-
- if ($unixts < 1546300800)
+
+ if ($unixts < 1546300800) {
$out['time_error'] = 'too_low';
- else if ($unixts > $max_time)
+ } elseif ($unixts > $max_time) {
$out['time_error'] = 'too_high';
+ }
}
}
}
}
}
- }
- else // BEEP base v2 firmware (fport == 1)
- {
+ } else { // BEEP base v2 firmware (fport == 1)
$beep_sensors = [
- 't' , // 0
- 'h' , // 1
- 'w_v',
- 't_i',
- 'a_i',
- 'bv' ,
- 's_tot',
- 's_fan_4',
- 's_fan_6',
- 's_fan_9',
- 's_fly_a',
- 'w_fl_hb',
- 'w_fl_lb',
- 'w_fr_hb',
- 'w_fr_lb',
- 'w_bl_hb',
- 'w_bl_lb',
- 'w_br_hb',
- 'w_br_lb', // 18
- ];
-
- $minLength = min(strlen($payload)/2, count($beep_sensors));
-
- for ($i=0; $i < $minLength; $i++)
- {
- if (strlen($payload) > count($beep_sensors)*2)
- {
- $index = $i * 4 + 2;
- }
- else
- {
+ 't', // 0
+ 'h', // 1
+ 'w_v',
+ 't_i',
+ 'a_i',
+ 'bv',
+ 's_tot',
+ 's_fan_4',
+ 's_fan_6',
+ 's_fan_9',
+ 's_fly_a',
+ 'w_fl_hb',
+ 'w_fl_lb',
+ 'w_fr_hb',
+ 'w_fr_lb',
+ 'w_bl_hb',
+ 'w_bl_lb',
+ 'w_br_hb',
+ 'w_br_lb', // 18
+ ];
+
+ $minLength = min(strlen($payload) / 2, count($beep_sensors));
+
+ for ($i = 0; $i < $minLength; $i++) {
+ if (strlen($payload) > count($beep_sensors) * 2) {
+ $index = $i * 4 + 2;
+ } else {
$index = $i * 2;
}
$sensor = $beep_sensors[$i];
$hexval = substr($payload, $index, 2);
- if (strpos($sensor, '_hb') !== false) // step 1 of 2 byte value
- {
+ if (strpos($sensor, '_hb') !== false) { // step 1 of 2 byte value
$sensor = substr($sensor, 0, strpos($sensor, '_hb'));
$out[$sensor] = $hexval;
- }
- else if (strpos($sensor, '_lb') !== false) // step 2 of 2 byte value
- {
+ } elseif (strpos($sensor, '_lb') !== false) { // step 2 of 2 byte value
$sensor = substr($sensor, 0, strpos($sensor, '_lb'));
- $totalHexVal = $out[$sensor].$hexval;
+ $totalHexVal = $out[$sensor].$hexval;
$out[$sensor] = hexdec($totalHexVal);
- }
- else
- {
+ } else {
$out[$sensor] = hexdec($hexval);
}
}
}
- //die(print_r($out));
+
+ // die(print_r($out));
return $out;
}
-
-
}
diff --git a/app/Transformer/HighWeightFix.php b/app/Transformer/HighWeightFix.php
index 51c9f92a..746d4d6b 100644
--- a/app/Transformer/HighWeightFix.php
+++ b/app/Transformer/HighWeightFix.php
@@ -1,42 +1,41 @@
$value)
- {
- if (in_array($key, $valid_sensor_keys) )
- {
- array_push($points,
+ foreach ($data_array as $key => $value) {
+ if (in_array($key, $valid_sensor_keys)) {
+ array_push($points,
new InfluxDB\Point(
'sensors', // name of the measurement
null, // the measurement value
@@ -47,110 +46,103 @@ private static function storeInfluxData($data_array, $dev_eui, $unix_timestamp,
);
}
}
- //die(print_r($points));
+ // die(print_r($points));
$stored = false;
- if (count($points) > 0)
- {
- try
- {
+ if (count($points) > 0) {
+ try {
HighWeightFix::cacheRequestRate('influx-write');
$stored = $client::writePoints($points, InfluxDB\Database::PRECISION_SECONDS);
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
// gracefully do nothing
}
}
+
return $stored;
}
public static function getInfluxQuery($query)
{
- $client = new \Influx;
- $options = ['precision'=> 's', 'epoch'=>'s'];
- $values = [];
+ $client = new \Influx;
+ $options = ['precision' => 's', 'epoch' => 's'];
+ $values = [];
- try{
+ try {
HighWeightFixcacheRequestRate('influx-get');
HighWeightFixcacheRequestRate('influx-weight');
- $result = $client::query($query, $options);
- $values = $result->getPoints();
+ $result = $client::query($query, $options);
+ $values = $result->getPoints();
} catch (InfluxDB\Exception $e) {
// return Response::json('influx-group-by-query-error', 500);
}
+
return $values;
}
- public static function fix($device_key=null, $values_per_device=10)
+ public static function fix($device_key = null, $values_per_device = 10)
{
- $cor_cnt= 0;
+ $cor_cnt = 0;
date_default_timezone_set('UTC');
- $start = '2021-06-02 00:00:00';
- $end = '2021-06-18 18:00:00';
- $where = '"w_v" = "weight_kg" AND "w_v" > 0';
+ $start = '2021-06-02 00:00:00';
+ $end = '2021-06-18 18:00:00';
+ $where = '"w_v" = "weight_kg" AND "w_v" > 0';
$where .= $device_key != null ? ' AND ("key" = \''.$device_key.'\' OR "key" = \''.strtolower($device_key).'\' OR "key" = \''.strtoupper($device_key).'\')' : '';
- $limit = ' LIMIT 1';
- $query = 'SELECT * FROM "sensors" WHERE '.$where.' AND time >= \''.$start.'\' AND time < \''.$end.'\' GROUP BY "key" ORDER BY time ASC'.$limit;
+ $limit = ' LIMIT 1';
+ $query = 'SELECT * FROM "sensors" WHERE '.$where.' AND time >= \''.$start.'\' AND time < \''.$end.'\' GROUP BY "key" ORDER BY time ASC'.$limit;
$result = HighWeightFix::getInfluxQuery($query);
- $keys = [];
-
- foreach ($result as $values)
- {
- if(isset($values['key']))
+ $keys = [];
+
+ foreach ($result as $values) {
+ if (isset($values['key'])) {
$keys[] = strtolower($values['key']);
- }
+ }
+ }
- $all_devices = Device::whereIn('key',$keys)->get();
+ $all_devices = Device::whereIn('key', $keys)->get();
- foreach ($all_devices as $d)
- {
+ foreach ($all_devices as $d) {
$key = $d->key;
- if ($device_key == null || strtolower($device_key) == strtolower($key))
- {
+ if ($device_key == null || strtolower($device_key) == strtolower($key)) {
$sensor_def_count = $d->sensorDefinitions->where('input_measurement_id', 7)->where('output_measurement_id', 20)->count();
- if ($sensor_def_count > 0)
- {
- $where = '"w_v" = "weight_kg" AND "w_v" > 0';
+ if ($sensor_def_count > 0) {
+ $where = '"w_v" = "weight_kg" AND "w_v" > 0';
$where .= ' AND ("key" = \''.$key.'\' OR "key" = \''.strtolower($key).'\' OR "key" = \''.strtoupper($key).'\')';
- $limit = $values_per_device != null ? ' LIMIT '.$values_per_device : '';
- $query = 'SELECT * FROM "sensors" WHERE '.$where.' AND time >= \''.$start.'\' AND time < \''.$end.'\' GROUP BY "key" ORDER BY time ASC'.$limit;
+ $limit = $values_per_device != null ? ' LIMIT '.$values_per_device : '';
+ $query = 'SELECT * FROM "sensors" WHERE '.$where.' AND time >= \''.$start.'\' AND time < \''.$end.'\' GROUP BY "key" ORDER BY time ASC'.$limit;
- $valid_sensors = Measurement::getValidMeasurements();
+ $valid_sensors = Measurement::getValidMeasurements();
$data = HighWeightFix::getInfluxQuery($query);
- foreach ($data as $v)
- {
- $v = array_filter($v, function($value) { return !is_null($value) && $value !== ''; }); // filter out empty values
-
+ foreach ($data as $v) {
+ $v = array_filter($v, function ($value) {
+ return ! is_null($value) && $value !== '';
+ }); // filter out empty values
+
$time = $v['time'];
$date = date('Y-m-d H:i:s', $time);
- $v = $d->addSensorDefinitionMeasurements($v, $v['w_v'], 7, $date);
+ $v = $d->addSensorDefinitionMeasurements($v, $v['w_v'], 7, $date);
// store corrected value (+ other unchanged values)
- if (isset($v['weight_kg']) && $v['weight_kg'] != null && $v['w_v'] != $v['weight_kg'])
- {
+ if (isset($v['weight_kg']) && $v['weight_kg'] != null && $v['w_v'] != $v['weight_kg']) {
print_r('device '.$key.' corrected weight_kg from '.$v['w_v'].' to '.$v['weight_kg']." @ $date ($time) \n");
$stored = HighWeightFix::storeInfluxData($v, $key, $time, $valid_sensors);
- if ($stored)
+ if ($stored) {
$cor_cnt++;
- }
- else
- {
- print_r('device '.$key." Not saving weight_kg value: ".(isset($v['weight_kg']) ? $v['weight_kg'] : 'null')."\n");
+ }
+ } else {
+ print_r('device '.$key.' Not saving weight_kg value: '.(isset($v['weight_kg']) ? $v['weight_kg'] : 'null')."\n");
}
}
- }
- else
- {
+ } else {
print_r('device '.$key." has $sensor_def_count weight sensorDefinitions.\n");
}
}
}
+
return "Corrected $cor_cnt weight_kg values";
}
-}
\ No newline at end of file
+}
diff --git a/app/Transformer/SensorTransformer.php b/app/Transformer/SensorTransformer.php
index b3e5964d..1b6688cc 100644
--- a/app/Transformer/SensorTransformer.php
+++ b/app/Transformer/SensorTransformer.php
@@ -1,45 +1,43 @@
['name'=>'temperature', 'unit'=>'°C'],
- 'h' => ['name'=>'humidity', 'unit'=>'%RV'],
- 'p' => ['name'=>'air_pressure', 'unit'=>'mbar'],
- 'w' => ['name'=>'weight_sum', 'unit'=>''],
- 'l' => ['name'=>'light', 'unit'=>'lux'],
- 'bv' => ['name'=>'bat_volt', 'unit'=>'mV'],
- 'weight_kg' => ['name'=>'weight_kg', 'unit'=>'Kg'],
- 'weight_kg_corrected' => ['name'=>'weight_kg_corrected', 'unit'=>'Kg'],
- 'w_o' => ['name'=>'weight_offset', 'unit'=>'Kg'],
- 's_fan_4' => ['name'=>'sound_fanning_4days', 'unit'=>''],
- 's_fan_6' => ['name'=>'sound_fanning_6days', 'unit'=>''],
- 's_fan_9' => ['name'=>'sound_fanning_9days', 'unit'=>''],
- 's_fly_a' => ['name'=>'sound_flying_adult', 'unit'=>''],
- 's_tot' => ['name'=>'sound_total', 'unit'=>''],
- 'bc_i' => ['name'=>'bee_count_in', 'unit'=>'#'],
- 'bc_o' => ['name'=>'bee_count_out', 'unit'=>'#'],
- 't_i' => ['name'=>'t_i', 'unit'=>'°C'],
- 'snr' => ['name'=>'snr', 'unit'=>'dB'],
- 'rssi' => ['name'=>'rssi', 'unit'=>'dBm'],
- ];
+ $valid_sensors = [
+ 't' => ['name' => 'temperature', 'unit' => '°C'],
+ 'h' => ['name' => 'humidity', 'unit' => '%RV'],
+ 'p' => ['name' => 'air_pressure', 'unit' => 'mbar'],
+ 'w' => ['name' => 'weight_sum', 'unit' => ''],
+ 'l' => ['name' => 'light', 'unit' => 'lux'],
+ 'bv' => ['name' => 'bat_volt', 'unit' => 'mV'],
+ 'weight_kg' => ['name' => 'weight_kg', 'unit' => 'Kg'],
+ 'weight_kg_corrected' => ['name' => 'weight_kg_corrected', 'unit' => 'Kg'],
+ 'w_o' => ['name' => 'weight_offset', 'unit' => 'Kg'],
+ 's_fan_4' => ['name' => 'sound_fanning_4days', 'unit' => ''],
+ 's_fan_6' => ['name' => 'sound_fanning_6days', 'unit' => ''],
+ 's_fan_9' => ['name' => 'sound_fanning_9days', 'unit' => ''],
+ 's_fly_a' => ['name' => 'sound_flying_adult', 'unit' => ''],
+ 's_tot' => ['name' => 'sound_total', 'unit' => ''],
+ 'bc_i' => ['name' => 'bee_count_in', 'unit' => '#'],
+ 'bc_o' => ['name' => 'bee_count_out', 'unit' => '#'],
+ 't_i' => ['name' => 't_i', 'unit' => '°C'],
+ 'snr' => ['name' => 'snr', 'unit' => 'dB'],
+ 'rssi' => ['name' => 'rssi', 'unit' => 'dBm'],
+ ];
- $name = $sensor['name'];
- $valid= in_array($name, array_keys($valid_sensors));
-
- return [
- 'name' => $valid ? $valid_sensors[$name]['name'] : $sensor['name'],
- 'value' => isset($sensor['value']) ? $sensor['value'] : "",
- 'unit' => $valid ? $valid_sensors[$name]['unit'] : "",
- 'time' => isset($sensor['time']) ? $sensor['time'] : 0,
- //'key' => isset($sensor['key']) ? $sensor['key'] : ""
+ $name = $sensor['name'];
+ $valid = in_array($name, array_keys($valid_sensors));
+
+ return [
+ 'name' => $valid ? $valid_sensors[$name]['name'] : $sensor['name'],
+ 'value' => isset($sensor['value']) ? $sensor['value'] : '',
+ 'unit' => $valid ? $valid_sensors[$name]['unit'] : '',
+ 'time' => isset($sensor['time']) ? $sensor['time'] : 0,
+ // 'key' => isset($sensor['key']) ? $sensor['key'] : ""
];
-
- }
-
-}
\ No newline at end of file
+
+ }
+}
diff --git a/app/Transformer/UserTransformer.php b/app/Transformer/UserTransformer.php
index 79ea1dcc..bd12c9fd 100644
--- a/app/Transformer/UserTransformer.php
+++ b/app/Transformer/UserTransformer.php
@@ -1,16 +1,16 @@
$user->id,
- 'name' => $user->name,
- 'email' => $user->email,
- 'created' => $user->created_at
+ 'id' => $user->id,
+ 'name' => $user->name,
+ 'email' => $user->email,
+ 'created' => $user->created_at,
];
}
-
-}
\ No newline at end of file
+}
diff --git a/app/Translation.php b/app/Translation.php
index 3dc4996a..a3d8a1ad 100644
--- a/app/Translation.php
+++ b/app/Translation.php
@@ -8,7 +8,7 @@
class Translation extends Model
{
- public $fillable = ['name','language_id','type','translation'];
+ public $fillable = ['name', 'language_id', 'type', 'translation'];
public $timestamps = false;
@@ -16,18 +16,15 @@ public static function boot()
{
parent::boot();
- static::created(function($t)
- {
+ static::created(function ($t) {
$t->forgetCache();
});
- static::updated(function($t)
- {
+ static::updated(function ($t) {
$t->forgetCache();
});
- static::deleted(function($t)
- {
+ static::deleted(function ($t) {
$t->forgetCache();
});
}
@@ -44,36 +41,37 @@ public function language()
return $this->hasOne(Language::class, 'id', 'language_id');
}
-
// static functions
- public static function translate($name, $locale=null, $array=false, $type='category')
+ public static function translate($name, $locale = null, $array = false, $type = 'category')
{
- if ($locale == null && $array == false)
+ if ($locale == null && $array == false) {
$locale = LaravelLocalization::getCurrentLocale();
+ }
$trans = DB::table('translations')
- ->join('languages', 'translations.language_id', '=', 'languages.id')
- ->where('translations.type', $type)
- ->where('translations.name', $name)
- ->select('translations.translation', 'languages.twochar')
- ->get();
-
- if ($trans)
- {
+ ->join('languages', 'translations.language_id', '=', 'languages.id')
+ ->where('translations.type', $type)
+ ->where('translations.name', $name)
+ ->select('translations.translation', 'languages.twochar')
+ ->get();
+
+ if ($trans) {
$out = [];
- foreach($trans as $item)
- {
- if ($array == false && isset($locale) && $item->twochar == $locale)
+ foreach ($trans as $item) {
+ if ($array == false && isset($locale) && $item->twochar == $locale) {
return $item->translation;
+ }
- $out[$item->twochar] = $item->translation;
+ $out[$item->twochar] = $item->translation;
}
-
- if ($array == false)
+
+ if ($array == false) {
return ucfirst(str_replace('_', ' ', $name));
- else
+ } else {
return $out;
+ }
}
+
return null;
}
@@ -84,45 +82,45 @@ public static function translateArray($name)
public static function saveText($language_abbr, $name, $type, $text)
{
- if (isset($text))
- {
- $lang_id = Language::where('abbreviation', $language_abbr)->value('id');
-
- if (!isset($lang_id) || $lang_id == null)
- return false;
-
- $count = Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->count();
-
- if ($count > 0)
- {
- if (Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->value('translation') == $text)
- return false;
-
- $trans = Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->update(['translation' => $text]);
- }
- else
- {
- $trans = new Translation;
- $trans->language_id = $lang_id;
- $trans->name = $name;
- $trans->type = $type;
- $trans->translation = $text;
- $trans->save();
- }
- return true;
- }
- return false;
+ if (isset($text)) {
+ $lang_id = Language::where('abbreviation', $language_abbr)->value('id');
+
+ if (! isset($lang_id) || $lang_id == null) {
+ return false;
+ }
+
+ $count = Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->count();
+
+ if ($count > 0) {
+ if (Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->value('translation') == $text) {
+ return false;
+ }
+
+ $trans = Translation::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->update(['translation' => $text]);
+ } else {
+ $trans = new Translation;
+ $trans->language_id = $lang_id;
+ $trans->name = $name;
+ $trans->type = $type;
+ $trans->translation = $text;
+ $trans->save();
+ }
+
+ return true;
+ }
+
+ return false;
}
public static function get($locale, $name, $type)
{
$lang_id = Language::where('twochar', strtolower($locale))->value('id');
- //dd($lang_id, $locale, $name, $type);
- if (empty($lang_id))
+ // dd($lang_id, $locale, $name, $type);
+ if (empty($lang_id)) {
return '';
+ }
- return Cache::remember('trans-lang-'.$locale.'-type-'.$type.'-name-'.$name, env('CACHE_TIMEOUT_LONG'), function () use ($name, $type, $lang_id)
- {
+ return Cache::remember('trans-lang-'.$locale.'-type-'.$type.'-name-'.$name, env('CACHE_TIMEOUT_LONG'), function () use ($name, $type, $lang_id) {
return self::where('name', $name)->where('type', $type)->where('language_id', $lang_id)->value('translation');
});
}
@@ -132,12 +130,10 @@ public static function createTranslations($name, $type)
$trans = ucfirst(str_replace('_', ' ', $name));
$count = 0;
- foreach (Language::all()->pluck('abbreviation') as $abbr)
- {
+ foreach (Language::all()->pluck('abbreviation') as $abbr) {
$lang_id = Language::where('abbreviation', $abbr)->value('id');
- if (Translation::where('name',$name)->where('type','category')->where('language_id',$lang_id)->count() == 0)
- {
- Translation::create(['language_id'=>$lang_id, 'name'=>$name, 'type'=>'category', 'translation'=>$trans]);
+ if (Translation::where('name', $name)->where('type', 'category')->where('language_id', $lang_id)->count() == 0) {
+ Translation::create(['language_id' => $lang_id, 'name' => $name, 'type' => 'category', 'translation' => $trans]);
$count++;
}
}
diff --git a/app/User.php b/app/User.php
index 051648b3..f4d13790 100644
--- a/app/User.php
+++ b/app/User.php
@@ -2,62 +2,56 @@
namespace App;
-use Illuminate\Notifications\Notifiable;
-use Illuminate\Auth\MustVerifyEmail;
-use Illuminate\Foundation\Auth\User as Authenticatable;
-use Illuminate\Support\Facades\Log;
-use Laratrust\Traits\LaratrustUserTrait;
-
-use App\Notifications\VerifyEmail;
-use App\Notifications\ResetPassword;
-
-use App\Models\DashboardGroup;
-use App\Models\HiveTag;
-use App\Models\FlashLog;
use App\Models\Alert;
use App\Models\AlertRule;
use App\Models\ChecklistSvg;
-
-use DB;
+use App\Models\DashboardGroup;
+use App\Models\FlashLog;
+use App\Models\HiveTag;
+use App\Notifications\ResetPassword;
+use App\Notifications\VerifyEmail;
use Auth;
use Cache;
+use DB;
+use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\Notifiable;
+use Illuminate\Support\Facades\Log;
+use Laratrust\Traits\LaratrustUserTrait;
class User extends Authenticatable
{
- use Notifiable;
use LaratrustUserTrait;
+ use Notifiable;
protected $fillable = ['name', 'email', 'password', 'api_token', 'last_login', 'policy_accepted', 'locale', 'avatar', 'rate_limit_per_min'];
protected $hidden = ['password', 'remember_token', 'researchesVisible', 'researchesOwned'];
- protected $guarded = ['id'];
-
- //protected $cascadeDeletes = ['hives','checklists','inspections','locations','sensors']; // for soft deletes
+ protected $guarded = ['id'];
- protected $appends = ['app_debug', 'admin', 'permissions'];
+ // protected $cascadeDeletes = ['hives','checklists','inspections','locations','sensors']; // for soft deletes
+ protected $appends = ['app_debug', 'admin', 'permissions'];
- // Fix for Trebol\Entrust permissions that do not check
+ // Fix for Trebol\Entrust permissions that do not check
// public function can($permission, $arguments=[])
// {
// return $this->cans(explode('|', $permission), true);
// }
- public function emptyCache($type=null)
+ public function emptyCache($type = null)
{
self::emptyIdCache($this->id, $type);
}
- public static function emptyIdCache($user_id, $type=null)
+ public static function emptyIdCache($user_id, $type = null)
{
- //Log::debug("empty_cache user $user_id");
+ // Log::debug("empty_cache user $user_id");
Cache::forget('user-'.$user_id.'-is-admin');
Cache::forget('user-'.$user_id.'-permissions');
- if ($type == null || $type == 'device')
- {
+ if ($type == null || $type == 'device') {
Cache::forget('user-'.$user_id.'-all-device-ids');
Cache::forget('user-'.$user_id.'-all-device-ids-editable');
}
@@ -69,15 +63,13 @@ public static function emptyIdCache($user_id, $type=null)
// Cache::forget('user-'.$user_id.'-all-location-research-ids');
// Cache::forget('user-'.$user_id.'-all-location-area-ids');
- if ($type == null || $type == 'inspection')
- {
+ if ($type == null || $type == 'inspection') {
Cache::forget('user-'.$user_id.'-all-inspection-ids');
Cache::forget('user-'.$user_id.'-all-editable-inspection-ids');
Cache::forget('user-'.$user_id.'-apiaries'); // clear cached apiaries, for last inspection on hive
}
- if ($type == null || $type == 'apiary')
- {
+ if ($type == null || $type == 'apiary') {
Cache::forget('user-'.$user_id.'-all-location-ids');
Cache::forget('user-'.$user_id.'-all-my-location-ids');
Cache::forget('user-'.$user_id.'-all-hive-ids');
@@ -86,8 +78,7 @@ public static function emptyIdCache($user_id, $type=null)
Cache::forget('locations-user-'.$user_id);
}
- if ($type == null || $type == 'group')
- {
+ if ($type == null || $type == 'group') {
Cache::forget('user-'.$user_id.'-group-hive-ids');
Cache::forget('user-'.$user_id.'-group-hive-ids-editable');
Cache::forget('user-'.$user_id.'-groups-and-invites');
@@ -98,16 +89,17 @@ public static function emptyIdCache($user_id, $type=null)
public function getAvatarAttribute()
{
- return !empty($this->attributes['avatar']) && substr($this->attributes['avatar'], 0, 8) == 'https://' ? $this->attributes['avatar'] : env('AWS_URL').'avatars/default.jpg';
+ return ! empty($this->attributes['avatar']) && substr($this->attributes['avatar'], 0, 8) == 'https://' ? $this->attributes['avatar'] : env('AWS_URL').'avatars/default.jpg';
}
public function getGlobalRateLimitPerMinAttribute()
{
return env('API_GLOBAL_RATE_LIMIT', 60); // rate for all app calls together
}
+
public function getGlobalRateLimitPerMinSensorsAttribute()
{
- return !empty($this->attributes['rate_limit_per_min']) ? $this->attributes['rate_limit_per_min'] : env('API_GLOBAL_RATE_LIMIT_SENSOR_DATA', 10); // rate limit for only authenticated sensor data post
+ return ! empty($this->attributes['rate_limit_per_min']) ? $this->attributes['rate_limit_per_min'] : env('API_GLOBAL_RATE_LIMIT_SENSOR_DATA', 10); // rate limit for only authenticated sensor data post
}
public function getAppDebugAttribute()
@@ -138,7 +130,6 @@ public function getPermissionsAttribute()
});
}
-
// links
public function images()
{
@@ -153,23 +144,26 @@ public function hives()
public function groupHiveIds($editable = false)
{
$cache_name = 'user-'.$this->id.'-group-hive-ids'.($editable ? '-editable' : '');
- $hive_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable){
-
+ $hive_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable) {
+
$group_ids = $this->groups->pluck('id')->toArray();
- $hive_ids = [];
- if ($editable)
- $hive_ids = DB::table('group_hive')->where('edit_hive', 1)->whereIn('group_id',$group_ids)->distinct('hive_id')->pluck('hive_id')->toArray();
- else
- $hive_ids = DB::table('group_hive')->whereIn('group_id',$group_ids)->distinct('hive_id')->pluck('hive_id')->toArray();
- //die(print_r(['group_ids'=>$group_ids,'hive_ids'=>$hive_ids]));
+ $hive_ids = [];
+ if ($editable) {
+ $hive_ids = DB::table('group_hive')->where('edit_hive', 1)->whereIn('group_id', $group_ids)->distinct('hive_id')->pluck('hive_id')->toArray();
+ } else {
+ $hive_ids = DB::table('group_hive')->whereIn('group_id', $group_ids)->distinct('hive_id')->pluck('hive_id')->toArray();
+ }
+
+ // die(print_r(['group_ids'=>$group_ids,'hive_ids'=>$hive_ids]));
return $hive_ids;
});
+
return $hive_ids;
}
public function groupHives($editable = false)
{
- return Hive::whereIn('id',$this->groupHiveIds($editable));
+ return Hive::whereIn('id', $this->groupHiveIds($editable));
}
public function allHives($editable = false) // Including Group hives
@@ -179,11 +173,12 @@ public function allHives($editable = false) // Including Group hives
$own_ids = $this->hives()->pluck('id');
$hiv_ids = $this->groupHiveIds($editable);
$all_ids = $own_ids->merge($hiv_ids);
+
return $all_ids;
});
- return Hive::whereIn('id',$all_ids);
- }
+ return Hive::whereIn('id', $all_ids);
+ }
public function hive_tags()
{
@@ -202,22 +197,24 @@ public function inspections()
public function allInspections($editable = false) // Including Group hive locations
{
- $cache_name = 'user-'.$this->id.'-all'.($editable?'-editable':'').'-inspection-ids';
- $all_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable){
+ $cache_name = 'user-'.$this->id.'-all'.($editable ? '-editable' : '').'-inspection-ids';
+ $all_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable) {
$own_ids = $this->inspections()->pluck('id');
$hiv_ids = $this->groupHiveIds($editable);
- $ins_ids = DB::table('inspection_hive')->whereIn('hive_id',$hiv_ids)->distinct('inspection_id')->pluck('inspection_id')->toArray();
+ $ins_ids = DB::table('inspection_hive')->whereIn('hive_id', $hiv_ids)->distinct('inspection_id')->pluck('inspection_id')->toArray();
$all_ids = $own_ids->merge($ins_ids);
+
return $all_ids;
});
- return Inspection::whereIn('id',$all_ids);
+
+ return Inspection::whereIn('id', $all_ids);
}
public function researches()
{
return $this->belongsToMany(Research::class, 'research_user');
}
-
+
public function researchesOwned()
{
return $this->hasMany(Research::class);
@@ -232,27 +229,30 @@ public function allFlashlogs($editable = true) // Including (only) editable grou
{
$own_ids = $this->flashlogs()->pluck('id');
$hiv_ids = $this->groupHives($editable)->pluck('id');
- $fla_ids = DB::table('flash_logs')->whereIn('hive_id',$hiv_ids)->pluck('id');
+ $fla_ids = DB::table('flash_logs')->whereIn('hive_id', $hiv_ids)->pluck('id');
$all_ids = $own_ids->merge($fla_ids);
- return FlashLog::whereIn('id',$all_ids);
+
+ return FlashLog::whereIn('id', $all_ids);
}
public function researchesVisible()
{
return $this->belongsToMany(Research::class, 'research_viewer');
}
-
public function researchMenuOption()
{
- if ($this->hasRole('superadmin'))
+ if ($this->hasRole('superadmin')) {
return true;
-
- if ($this->researchesOwned && $this->researchesOwned->count() > 0)
+ }
+
+ if ($this->researchesOwned && $this->researchesOwned->count() > 0) {
return true;
+ }
- if ($this->researchesVisible && $this->researchesVisible->count() > 0)
+ if ($this->researchesVisible && $this->researchesVisible->count() > 0) {
return true;
+ }
return false;
}
@@ -262,7 +262,8 @@ public function allResearches() // all Researches visible
$own_ids = $this->researchesOwned()->pluck('id');
$vis_ids = $this->researchesVisible()->pluck('research_id');
$all_ids = $own_ids->merge($vis_ids);
- return Research::whereIn('id',$all_ids);
+
+ return Research::whereIn('id', $all_ids);
}
public function devices()
@@ -273,14 +274,16 @@ public function devices()
public function allDevices($editable = false) // Including Group hive locations
{
$cache_name = 'user-'.$this->id.'-all-device-ids'.($editable ? '-editable' : '');
- $all_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable) {
+ $all_ids = Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($editable) {
$own_ids = $this->devices()->pluck('id');
$hiv_ids = $this->groupHiveIds($editable);
- $sen_ids = DB::table('sensors')->whereIn('hive_id',$hiv_ids)->distinct('hive_id')->pluck('id')->toArray();
+ $sen_ids = DB::table('sensors')->whereIn('hive_id', $hiv_ids)->distinct('hive_id')->pluck('id')->toArray();
$all_ids = $own_ids->merge($sen_ids);
+
return $all_ids;
});
- return Device::whereIn('id',$all_ids);
+
+ return Device::whereIn('id', $all_ids);
}
public function groups()
@@ -317,21 +320,21 @@ public function researchChecklists()
{
$research_ids = $this->researches->pluck('id')->toArray();
- $checklist_ids = DB::table('checklist_research')->whereIn('research_id',$research_ids)->distinct('checklist_id')->pluck('checklist_id')->toArray();
- //die(print_r(['group_ids'=>$group_ids,'checklist_ids'=>$checklist_ids]));
- return Checklist::whereIn('id',$checklist_ids);
+ $checklist_ids = DB::table('checklist_research')->whereIn('research_id', $research_ids)->distinct('checklist_id')->pluck('checklist_id')->toArray();
+
+ // die(print_r(['group_ids'=>$group_ids,'checklist_ids'=>$checklist_ids]));
+ return Checklist::whereIn('id', $checklist_ids);
}
public function allChecklists()
{
$own_checklists = $this->checklists()->pluck('id');
- $research_cl = $this->researchChecklists()->pluck('id');
- $checklist_ids = $own_checklists->merge($research_cl);
-
+ $research_cl = $this->researchChecklists()->pluck('id');
+ $checklist_ids = $own_checklists->merge($research_cl);
+
return Checklist::whereIn('id', $checklist_ids);
}
-
public function locations()
{
return $this->hasMany(Location::class);
@@ -339,12 +342,14 @@ public function locations()
public function all_location_ids($mine = false) // Including rental locations
{
- $cache_name = 'user-'.$this->id.'-all'.($mine?'-my':'').'-location-ids';
- return Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($mine){
+ $cache_name = 'user-'.$this->id.'-all'.($mine ? '-my' : '').'-location-ids';
+
+ return Cache::remember($cache_name, env('CACHE_TIMEOUT_LONG'), function () use ($mine) {
$own_ids = $this->locations()->pluck('id');
$hiv_ids = $this->groupHives($mine)->pluck('id');
- $loc_ids = DB::table('hives')->whereIn('id',$hiv_ids)->distinct('hive_id')->pluck('location_id')->toArray();
+ $loc_ids = DB::table('hives')->whereIn('id', $hiv_ids)->distinct('hive_id')->pluck('location_id')->toArray();
$all_ids = $own_ids->merge($loc_ids);
+
return $all_ids;
});
}
@@ -352,10 +357,12 @@ public function all_location_ids($mine = false) // Including rental locations
public function allLocations($mine = false) // Including rental locations
{
$all_ids = $this->all_location_ids($mine);
+
return Location::whereIn('id', $all_ids);
}
- public function allApiaries(){
+ public function allApiaries()
+ {
return Cache::remember('user-'.$this->id.'-apiaries', env('CACHE_TIMEOUT_LONG'), function () {
return $this->locations()->with(['hives.layers', 'hives.queen'])->get();
});
@@ -364,15 +371,16 @@ public function allApiaries(){
public function groupInvitations()
{
$user_id = $this->id;
- return $this->belongsToMany(Group::class, 'group_user')->whereNotNull('invited')->whereNull('accepted')->whereNull('declined')->get()->map(function ($item, $key) use ($user_id)
- {
- $invite = $item->only(['id','name','description','color']);
- $groupUserArray = $item->users->firstWhere('id',$user_id);
- $invite['invited'] = (isset($groupUserArray['invited'])) ? $groupUserArray['invited'] : null;
- $invite['token'] = (isset($groupUserArray['token'])) && $user_id == Auth::user()->id ? $groupUserArray['token'] : null; // only if yourself, add tokens to accept group invites
+
+ return $this->belongsToMany(Group::class, 'group_user')->whereNotNull('invited')->whereNull('accepted')->whereNull('declined')->get()->map(function ($item, $key) use ($user_id) {
+ $invite = $item->only(['id', 'name', 'description', 'color']);
+ $groupUserArray = $item->users->firstWhere('id', $user_id);
+ $invite['invited'] = (isset($groupUserArray['invited'])) ? $groupUserArray['invited'] : null;
+ $invite['token'] = (isset($groupUserArray['token'])) && $user_id == Auth::user()->id ? $groupUserArray['token'] : null; // only if yourself, add tokens to accept group invites
$invite['hivecount'] = $item->hives->count();
$invite['usercount'] = $item->users->whereNotNull('accepted')->count();
- return $invite;
+
+ return $invite;
});
}
@@ -381,8 +389,9 @@ public function groupsAndInvites()
return Cache::remember('user-'.$this->id.'-groups-and-invites', env('CACHE_TIMEOUT_LONG'), function () {
$groups = $this->groups()->orderBy('name')->get();
$invite = $this->groupInvitations();
- $date = date('Y-m-d H:i:s');
- return ['invitations'=>$invite, 'groups'=>$groups, 'cache_date'=>$date];
+ $date = date('Y-m-d H:i:s');
+
+ return ['invitations' => $invite, 'groups' => $groups, 'cache_date' => $date];
});
}
@@ -400,23 +409,22 @@ public function inspectionDates()
{
$inspections = 0;
- if (count($this->hives) > 0)
- {
- foreach($this->hives as $hive)
- {
+ if (count($this->hives) > 0) {
+ foreach ($this->hives as $hive) {
$inspections += $hive->inspectionDates()->count();
}
}
+
return $inspections;
}
public function delete()
{
- // delete all related items
+ // delete all related items
$this->settings()->delete();
$this->images()->delete();
$this->devices()->delete();
- $this->locations()->delete(); //including $cascadeDeletes = ['hives', 'inspections']; // including $cascadeDeletes = ['queen','inspections','layers','frames','productions'];
+ $this->locations()->delete(); // including $cascadeDeletes = ['hives', 'inspections']; // including $cascadeDeletes = ['queen','inspections','layers','frames','productions'];
$this->checklists()->delete();
$this->alert_rules()->delete();
$this->alerts()->delete();
@@ -435,22 +443,22 @@ public function sendPasswordResetNotification($token)
$this->notify(new ResetPassword($token)); // my notification
}
- public static function selectList($index='id')
+ public static function selectList($index = 'id')
{
- if (Auth::user()->hasRole('superadmin'))
- {
+ if (Auth::user()->hasRole('superadmin')) {
$users = User::orderBy('name')->get();
$array = [];
- foreach ($users as $u)
- {
- if ($u->name != $u->email)
+ foreach ($users as $u) {
+ if ($u->name != $u->email) {
$array[$u[$index]] = $u->name.' ('.$u->email.')';
- else
+ } else {
$array[$u[$index]] = $u->email;
+ }
}
+
return $array;
}
-
+
return Auth::user()->pluck('name','id');
}
}
diff --git a/app/Weather.php b/app/Weather.php
index 961395ea..ab679348 100644
--- a/app/Weather.php
+++ b/app/Weather.php
@@ -2,31 +2,29 @@
namespace App;
+use Cache;
+use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
-use App\Location;
-use App\Controllers\Api\MeasurementController;
-use Storage;
use InfluxDB;
use LaravelLocalization;
-use GuzzleHttp\Exception\GuzzleException;
-use GuzzleHttp\Client;
-use Cache;
+use Storage;
class Weather extends Model
{
public static function cacheRequestRate($name)
{
- Cache::remember($name.'-time', 86400, function () use ($name)
- {
- Cache::forget($name.'-count');
- return time();
+ Cache::remember($name.'-time', 86400, function () use ($name) {
+ Cache::forget($name.'-count');
+
+ return time();
});
- if (Cache::has($name.'-count'))
+ if (Cache::has($name.'-count')) {
Cache::increment($name.'-count');
- else
+ } else {
Cache::put($name.'-count', 1);
+ }
}
@@ -41,7 +39,7 @@ public static function cacheRequestRate($name)
"pressure": 1040,
"humidity": 10
},
-
+
Old (Darksky)
summary: Any summaries containing temperature or snow accumulation units will have their values in degrees Celsius or in centimeters (respectively).
nearestStormDistance: Kilometers.
@@ -60,82 +58,72 @@ public static function cacheRequestRate($name)
*/
- public static function callApi($location=null, $lat=null, $lon=null)
+ public static function callApi($location = null, $lat = null, $lon = null)
{
$result = null;
- if ($lat == null || $lon == null)
- {
- if ($location && isset($location->coordinate_lat) && isset($location->coordinate_lon))
- {
+ if ($lat == null || $lon == null) {
+ if ($location && isset($location->coordinate_lat) && isset($location->coordinate_lon)) {
$lat = $location->coordinate_lat;
$lon = $location->coordinate_lon;
- }
- else
- {
- return ['error'=>['msg'=>'no_coordinates','code'=>500]];
+ } else {
+ return ['error' => ['msg' => 'no_coordinates', 'code' => 500]];
}
}
- $disk = 'public';
+ $disk = 'public';
$filename = 'weather/lat_'.$lat.'_lon_'.$lon.'.json';
- if (Storage::disk($disk)->exists($filename))
- {
- $seconds = env('OPENWEATHER_API_CHECK_MINUTES', 10)*60;
+ if (Storage::disk($disk)->exists($filename)) {
+ $seconds = env('OPENWEATHER_API_CHECK_MINUTES', 10) * 60;
$now_sec = time();
$lst_sec = Storage::disk($disk)->exists($filename) ? Storage::disk($disk)->lastModified($filename) : 0;
$dif_sec = $now_sec - $lst_sec;
- if ($dif_sec < $seconds) // check if cached file should be displayed
- {
- if ($location)
- {
+ if ($dif_sec < $seconds) { // check if cached file should be displayed
+ if ($location) {
$location->last_weather_time = date('Y-m-d H:i:s', $lst_sec);
$location->save();
}
+
return Storage::disk($disk)->get($filename);
}
}
-
+
// file not found yet
- $result = null;
- $lang = LaravelLocalization::getCurrentLocale();
- $units = env('OPENWEATHER_API_UNITS', 'metric');
- $url = env('OPENWEATHER_API_URL').'&lat='.$lat.'&lon='.$lon.'&units='.$units;
-
- try
- {
- $guzzle = new Client();
+ $result = null;
+ $lang = LaravelLocalization::getCurrentLocale();
+ $units = env('OPENWEATHER_API_UNITS', 'metric');
+ $url = env('OPENWEATHER_API_URL').'&lat='.$lat.'&lon='.$lon.'&units='.$units;
+
+ try {
+ $guzzle = new Client;
$response = $guzzle->request('GET', $url, ['verify' => true, 'http_errors' => false]);
- if ($response->getStatusCode() == 200)
- $result = json_decode($response->getBody());
- }
- catch(\Exception $e)
- {
+ if ($response->getStatusCode() == 200) {
+ $result = json_decode($response->getBody());
+ }
+ } catch (\Exception $e) {
// gracefully do nothing
}
-
- if ($result)
- {
+
+ if ($result) {
$out = json_encode($result);
Storage::disk($disk)->put($filename, $out);
// save data to Influx by lat/lon
- if (isset($result->main))
- {
+ if (isset($result->main)) {
Weather::storeDataToInflux($result);
}
- if ($location)
- {
+ if ($location) {
$location->last_weather_time = date('Y-m-d H:i:s');
$location->save();
}
+
return $out;
}
- return ['error'=>['msg'=>'no_data','code'=>500]];
+ return ['error' => ['msg' => 'no_data', 'code' => 500]];
}
public static function updateLocations()
@@ -143,22 +131,22 @@ public static function updateLocations()
$locations = Location::where('coordinate_lat', '!=', null)->where('coordinate_lon', '!=', null)->get();
$count = 0;
- $time = time();
+ $time = time();
Log::info('Weather::updateLocations()');
- foreach ($locations as $loc)
- {
- if ($loc->device_count() > 0)
- {
+ foreach ($locations as $loc) {
+ if ($loc->device_count() > 0) {
$result = Weather::callApi($loc);
- if (gettype($result) == 'string') // array is error
+ if (gettype($result) == 'string') { // array is error
$count++;
+ }
}
}
$secs = time() - $time;
- $msg = "Weather::updateLocations() updated $count locations in $secs sec";
+ $msg = "Weather::updateLocations() updated $count locations in $secs sec";
Log::info($msg);
+
return $msg;
}
@@ -221,64 +209,94 @@ public static function updateLocations()
*/
private static function storeDataToInflux($result) // store posted data
{
- $client = new \Influx;
- $points = [];
+ $client = new \Influx;
+ $points = [];
$data_array = [];
$valid_sens = Measurement::all()->pluck('pq', 'abbreviation')->toArray();
- $unix_time = isset($result->dt) ? intval($result->dt) : time();
- $lat = isset($result->coord->lat) ? floatval($result->coord->lat) : null;
- $lon = isset($result->coord->lon) ? floatval($result->coord->lon) : null;
+ $unix_time = isset($result->dt) ? intval($result->dt) : time();
+ $lat = isset($result->coord->lat) ? floatval($result->coord->lat) : null;
+ $lon = isset($result->coord->lon) ? floatval($result->coord->lon) : null;
- if (isset($lat) && isset($lon))
- {
- foreach ($result as $key => $value)
- {
- switch($key)
- {
+ if (isset($lat) && isset($lon)) {
+ foreach ($result as $key => $value) {
+ switch ($key) {
case 'weather':
- if (isset($value->id)){ $data_array['weather_id'] = $value->id; };
- if (isset($value->icon)){ $data_array['weather_icon'] = $value->icon; };
- if (isset($value->main)){ $data_array['weather_name'] = $value->main; };
- if (isset($value->description)){ $data_array['weather_description'] = $value->description; };
+ if (isset($value->id)) {
+ $data_array['weather_id'] = $value->id;
+ }
+ if (isset($value->icon)) {
+ $data_array['weather_icon'] = $value->icon;
+ }
+ if (isset($value->main)) {
+ $data_array['weather_name'] = $value->main;
+ }
+ if (isset($value->description)) {
+ $data_array['weather_description'] = $value->description;
+ }
break;
case 'main':
- if (isset($value->temp)){ $data_array['temperature'] = $value->temp; };
- if (isset($value->temp_min)){ $data_array['temperatureMin'] = $value->temp_min; };
- if (isset($value->temp_max)){ $data_array['temperatureMax'] = $value->temp_max; };
- if (isset($value->feels_like)){ $data_array['apparentTemperature'] = $value->feels_like; };
- if (isset($value->pressure)){ $data_array['pressure'] = $value->pressure; };
- if (isset($value->sea_level)){ $data_array['pressure'] = $value->sea_level; };
- if (isset($value->grnd_level)){ $data_array['pressure'] = $value->grnd_level; };
- if (isset($value->humidity)){ $data_array['humidity'] = $value->humidity; };
+ if (isset($value->temp)) {
+ $data_array['temperature'] = $value->temp;
+ }
+ if (isset($value->temp_min)) {
+ $data_array['temperatureMin'] = $value->temp_min;
+ }
+ if (isset($value->temp_max)) {
+ $data_array['temperatureMax'] = $value->temp_max;
+ }
+ if (isset($value->feels_like)) {
+ $data_array['apparentTemperature'] = $value->feels_like;
+ }
+ if (isset($value->pressure)) {
+ $data_array['pressure'] = $value->pressure;
+ }
+ if (isset($value->sea_level)) {
+ $data_array['pressure'] = $value->sea_level;
+ }
+ if (isset($value->grnd_level)) {
+ $data_array['pressure'] = $value->grnd_level;
+ }
+ if (isset($value->humidity)) {
+ $data_array['humidity'] = $value->humidity;
+ }
break;
case 'visibility':
$data_array['visibility'] = $value;
break;
case 'clouds':
- if (isset($value->all)){ $data_array['cloudiness'] = $value->all; };
+ if (isset($value->all)) {
+ $data_array['cloudiness'] = $value->all;
+ }
break;
case 'wind':
- if (isset($value->speed)){ $data_array['windSpeed'] = $value->speed; };
- if (isset($value->deg)){ $data_array['windBearing'] = $value->deg; };
- if (isset($value->gust)){ $data_array['windGust'] = $value->gust; };
+ if (isset($value->speed)) {
+ $data_array['windSpeed'] = $value->speed;
+ }
+ if (isset($value->deg)) {
+ $data_array['windBearing'] = $value->deg;
+ }
+ if (isset($value->gust)) {
+ $data_array['windGust'] = $value->gust;
+ }
break;
case 'rain':
case 'snow':
- if (isset($value->{'1h'})){ $data_array['precipIntensity'] = $value->{'1h'}; };
- if (isset($value->{'3h'})){ $data_array[$key.'_3h'] = $value->{'3h'}; };
+ if (isset($value->{'1h'})) {
+ $data_array['precipIntensity'] = $value->{'1h'};
+ }
+ if (isset($value->{'3h'})) {
+ $data_array[$key.'_3h'] = $value->{'3h'};
+ }
break;
default:
// no action
}
}
- //die(print_r($data_array));
- foreach ($data_array as $key => $value)
- {
- if (in_array($key, array_keys($valid_sens)) )
- {
- switch($key)
- {
+ // die(print_r($data_array));
+ foreach ($data_array as $key => $value) {
+ if (in_array($key, array_keys($valid_sens))) {
+ switch ($key) {
case 'weather_name':
case 'weather_icon':
case 'weather_description':
@@ -288,11 +306,11 @@ private static function storeDataToInflux($result) // store posted data
$val = floatval($value);
}
- array_push($points,
+ array_push($points,
new InfluxDB\Point(
'weather', // name of the measurement
null, // the measurement value
- ['lat'=>$lat, 'lon'=>$lon], // optional tags
+ ['lat' => $lat, 'lon' => $lon], // optional tags
["$key" => $val], // key value pairs
$unix_time // Time precision has to be set to InfluxDB\Database::PRECISION_SECONDS!
)
@@ -300,21 +318,18 @@ private static function storeDataToInflux($result) // store posted data
}
}
}
- //die(print_r($points));
+ // die(print_r($points));
$stored = false;
- if (count($points) > 0)
- {
+ if (count($points) > 0) {
Weather::cacheRequestRate('influx-write');
- try
- {
+ try {
$stored = $client::writePoints($points, InfluxDB\Database::PRECISION_SECONDS);
- }
- catch(\Exception $e)
- {
+ } catch (\Exception $e) {
// gracefully do nothing
Log::error($e);
}
}
+
return $stored;
}
}
diff --git a/config/apidoc.php b/config/apidoc.php
index 56f83d32..dbc56f29 100644
--- a/config/apidoc.php
+++ b/config/apidoc.php
@@ -12,7 +12,7 @@
/*
* Static output folder: HTML documentation and assets will be generated in this folder.
*/
- 'output_folder' => 'public/docs',
+ 'output_folder' => 'public/docs',
/*
* Settings for `laravel` type output.
diff --git a/config/app.php b/config/app.php
index eecb5acf..f0dd4130 100644
--- a/config/app.php
+++ b/config/app.php
@@ -12,7 +12,7 @@
| any other location as required by the application or its packages.
*/
- 'name' =>env('APP_NAME', 'Beep'),
+ 'name' => env('APP_NAME', 'Beep'),
/*
|--------------------------------------------------------------------------
@@ -108,7 +108,7 @@
*/
'faker_locale' => 'en_GB',
-
+
/*
|--------------------------------------------------------------------------
| Encryption Key
@@ -119,7 +119,7 @@
| will not be safe. Please do this before deploying an application!
|
*/
-
+
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
@@ -233,7 +233,7 @@
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
'InterventionImage' => Intervention\Image\Facades\Image::class,
- 'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
+ 'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
'Influx' => TrayLabs\InfluxDB\Facades\InfluxDB::class,
// 'Debugbar' => Barryvdh\Debugbar\Facade::class,
],
diff --git a/config/crudgenerator.php b/config/crudgenerator.php
index bbe0b7e3..6d8a8aef 100644
--- a/config/crudgenerator.php
+++ b/config/crudgenerator.php
@@ -64,7 +64,6 @@
* Add new stubs templates here if you need to, like action, datatable...
* custom_template needs to be activated for this to work
*/
- ]
-
+ ],
];
diff --git a/config/database.php b/config/database.php
index d5d6f4e6..f7bd4327 100644
--- a/config/database.php
+++ b/config/database.php
@@ -58,7 +58,7 @@
'prefix_indexes' => true,
'strict' => true,
'modes' => [
- //'ONLY_FULL_GROUP_BY',
+ // 'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
@@ -84,7 +84,7 @@
'prefix_indexes' => true,
'strict' => true,
'modes' => [
- //'ONLY_FULL_GROUP_BY',
+ // 'ONLY_FULL_GROUP_BY',
'STRICT_TRANS_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
@@ -148,9 +148,9 @@
*/
'redis' => [
-
+
'client' => env('REDIS_CLIENT', 'predis'),
-
+
'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
diff --git a/config/debugbar.php b/config/debugbar.php
index 0fb450fd..5ab0877c 100644
--- a/config/debugbar.php
+++ b/config/debugbar.php
@@ -27,11 +27,11 @@
|
*/
'storage' => [
- 'enabled' => true,
- 'driver' => 'file', // redis, file, pdo, custom
- 'path' => storage_path('debugbar'), // For file driver
+ 'enabled' => true,
+ 'driver' => 'file', // redis, file, pdo, custom
+ 'path' => storage_path('debugbar'), // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO)
- 'provider' => '' // Instance of StorageInterface for custom driver
+ 'provider' => '', // Instance of StorageInterface for custom driver
],
/*
@@ -74,7 +74,7 @@
|
*/
'error_handler' => false,
-
+
/*
|--------------------------------------------------------------------------
| Clockwork integration
@@ -96,26 +96,26 @@
*/
'collectors' => [
- 'phpinfo' => true, // Php version
- 'messages' => true, // Messages
- 'time' => true, // Time Datalogger
- 'memory' => true, // Memory usage
- 'exceptions' => true, // Exception displayer
- 'log' => true, // Logs from Monolog (merged in messages if enabled)
- 'db' => true, // Show database (PDO) queries and bindings
- 'views' => true, // Views with their data
- 'route' => true, // Current route information
- 'auth' => true, // Display Laravel authentication status
- 'gate' => true, // Display Laravel Gate checks
- 'session' => true, // Display session data
+ 'phpinfo' => true, // Php version
+ 'messages' => true, // Messages
+ 'time' => true, // Time Datalogger
+ 'memory' => true, // Memory usage
+ 'exceptions' => true, // Exception displayer
+ 'log' => true, // Logs from Monolog (merged in messages if enabled)
+ 'db' => true, // Show database (PDO) queries and bindings
+ 'views' => true, // Views with their data
+ 'route' => true, // Current route information
+ 'auth' => true, // Display Laravel authentication status
+ 'gate' => true, // Display Laravel Gate checks
+ 'session' => true, // Display session data
'symfony_request' => true, // Only one can be enabled..
- 'mail' => true, // Catch mail messages
- 'laravel' => false, // Laravel version and environment
- 'events' => false, // All events fired
+ 'mail' => true, // Catch mail messages
+ 'laravel' => false, // Laravel version and environment
+ 'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger
- 'logs' => false, // Add the latest log messages
- 'files' => false, // Show the included files
- 'config' => false, // Display config settings
+ 'logs' => false, // Add the latest log messages
+ 'files' => false, // Show the included files
+ 'config' => false, // Display config settings
],
/*
@@ -132,26 +132,26 @@
'show_name' => true, // Also show the users name/email in the debugbar
],
'db' => [
- 'with_params' => true, // Render SQL with the parameters substituted
- 'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
- 'timeline' => false, // Add the queries to the timeline
+ 'with_params' => true, // Render SQL with the parameters substituted
+ 'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
+ 'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT'], // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
],
- 'hints' => true, // Show hints for common mistakes
+ 'hints' => true, // Show hints for common mistakes
],
'mail' => [
- 'full_log' => false
+ 'full_log' => false,
],
'views' => [
- 'data' => false, //Note: Can slow down the application, because the data can be quite large..
+ 'data' => false, // Note: Can slow down the application, because the data can be quite large..
],
'route' => [
- 'label' => true // show complete route on bar
+ 'label' => true, // show complete route on bar
],
'logs' => [
- 'file' => null
+ 'file' => null,
],
],
diff --git a/config/entrust.php b/config/entrust.php
index 730f8a64..bd1a5b06 100644
--- a/config/entrust.php
+++ b/config/entrust.php
@@ -5,7 +5,6 @@
* a role & permission management solution for Laravel.
*
* @license MIT
- * @package Trebol\Entrust
*/
return [
@@ -131,5 +130,5 @@
'permission_foreign_key' => 'permission_id',
'type' => 'web',
- 'response-error' => 'Unauthorized'
+ 'response-error' => 'Unauthorized',
];
diff --git a/config/hashing.php b/config/hashing.php
index bc5da3a6..84257708 100644
--- a/config/hashing.php
+++ b/config/hashing.php
@@ -49,4 +49,4 @@
'time' => 2,
],
-];
\ No newline at end of file
+];
diff --git a/config/image.php b/config/image.php
index b106809e..67983819 100644
--- a/config/image.php
+++ b/config/image.php
@@ -1,6 +1,6 @@
'gd'
+ 'driver' => 'gd',
-);
+];
diff --git a/config/influxdb.php b/config/influxdb.php
index 58acd0af..a2e8c491 100644
--- a/config/influxdb.php
+++ b/config/influxdb.php
@@ -11,6 +11,6 @@
'dbname' => env('INFLUXDB_DBNAME', ''),
'udp' => [
'enabled' => env('INFLUXDB_UDP_ENABLED', false),
- 'port' => env('INFLUXDB_UDP_PORT', 8086),
+ 'port' => env('INFLUXDB_UDP_PORT', 8086),
],
];
diff --git a/config/laratrust.php b/config/laratrust.php
index 7493118d..b89c6ec5 100644
--- a/config/laratrust.php
+++ b/config/laratrust.php
@@ -184,7 +184,7 @@
*/
'abort' => [
'code' => 403,
- 'message' => 'User does not have any of the necessary access rights.'
+ 'message' => 'User does not have any of the necessary access rights.',
],
/**
@@ -197,10 +197,10 @@
'url' => '/home',
'message' => [
'key' => 'error',
- 'content' => ''
- ]
- ]
- ]
+ 'content' => '',
+ ],
+ ],
+ ],
],
'teams' => [
@@ -340,5 +340,5 @@
// The user won't be able to delete the role.
'not_deletable' => [],
],
- ]
+ ],
];
diff --git a/config/laravellocalization.php b/config/laravellocalization.php
index 856eefab..8e75be47 100644
--- a/config/laravellocalization.php
+++ b/config/laravellocalization.php
@@ -6,295 +6,295 @@
// These are sorted by the native name, which is the order you might show them in a language selector.
// Regional languages are sorted by their base language, so "British English" sorts as "English, British"
'supportedLocales' => [
- //'ace' => ['name' => 'Achinese', 'script' => 'Latn', 'native' => 'Aceh', 'regional' => ''],
- //'af' => ['name' => 'Afrikaans', 'script' => 'Latn', 'native' => 'Afrikaans', 'regional' => 'af_ZA'],
- //'agq' => ['name' => 'Aghem', 'script' => 'Latn', 'native' => 'Aghem', 'regional' => ''],
- //'ak' => ['name' => 'Akan', 'script' => 'Latn', 'native' => 'Akan', 'regional' => 'ak_GH'],
- //'an' => ['name' => 'Aragonese', 'script' => 'Latn', 'native' => 'aragonés', 'regional' => 'an_ES'],
- //'cch' => ['name' => 'Atsam', 'script' => 'Latn', 'native' => 'Atsam', 'regional' => ''],
- //'gn' => ['name' => 'Guaraní', 'script' => 'Latn', 'native' => 'Avañe’ẽ', 'regional' => ''],
- //'ae' => ['name' => 'Avestan', 'script' => 'Latn', 'native' => 'avesta', 'regional' => ''],
- //'ay' => ['name' => 'Aymara', 'script' => 'Latn', 'native' => 'aymar aru', 'regional' => 'ay_PE'],
- //'az' => ['name' => 'Azerbaijani (Latin)', 'script' => 'Latn', 'native' => 'azərbaycanca', 'regional' => 'az_AZ'],
- //'id' => ['name' => 'Indonesian', 'script' => 'Latn', 'native' => 'Bahasa Indonesia', 'regional' => 'id_ID'],
- //'ms' => ['name' => 'Malay', 'script' => 'Latn', 'native' => 'Bahasa Melayu', 'regional' => 'ms_MY'],
- //'bm' => ['name' => 'Bambara', 'script' => 'Latn', 'native' => 'bamanakan', 'regional' => ''],
- //'jv' => ['name' => 'Javanese (Latin)', 'script' => 'Latn', 'native' => 'Basa Jawa', 'regional' => ''],
- //'su' => ['name' => 'Sundanese', 'script' => 'Latn', 'native' => 'Basa Sunda', 'regional' => ''],
- //'bh' => ['name' => 'Bihari', 'script' => 'Latn', 'native' => 'Bihari', 'regional' => ''],
- //'bi' => ['name' => 'Bislama', 'script' => 'Latn', 'native' => 'Bislama', 'regional' => ''],
- 'nb' => ['name' => 'Norwegian Bokmål', 'script' => 'Latn', 'native' => 'Bokmål', 'regional' => 'nb_NO'],
- //'bs' => ['name' => 'Bosnian', 'script' => 'Latn', 'native' => 'bosanski', 'regional' => 'bs_BA'],
- //'br' => ['name' => 'Breton', 'script' => 'Latn', 'native' => 'brezhoneg', 'regional' => 'br_FR'],
- //'ca' => ['name' => 'Catalan', 'script' => 'Latn', 'native' => 'català', 'regional' => 'ca_ES'],
- //'ch' => ['name' => 'Chamorro', 'script' => 'Latn', 'native' => 'Chamoru', 'regional' => ''],
- //'ny' => ['name' => 'Chewa', 'script' => 'Latn', 'native' => 'chiCheŵa', 'regional' => ''],
- //'kde' => ['name' => 'Makonde', 'script' => 'Latn', 'native' => 'Chimakonde', 'regional' => ''],
- //'sn' => ['name' => 'Shona', 'script' => 'Latn', 'native' => 'chiShona', 'regional' => ''],
- //'co' => ['name' => 'Corsican', 'script' => 'Latn', 'native' => 'corsu', 'regional' => ''],
- //'cy' => ['name' => 'Welsh', 'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'],
- 'da' => ['name' => 'Danish', 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'],
- //'se' => ['name' => 'Northern Sami', 'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'],
- 'de' => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'],
- //'luo' => ['name' => 'Luo', 'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''],
- //'nv' => ['name' => 'Navajo', 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''],
- //'dua' => ['name' => 'Duala', 'script' => 'Latn', 'native' => 'duálá', 'regional' => ''],
- //'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
- //'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
- //'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
- 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
- //'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
- //'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
- //'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
- 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
- //'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
- //'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
- //'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
- //'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''],
- //'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'],
- 'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'],
- //'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'],
- //'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'],
- //'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'],
- //'fo' => ['name' => 'Faroese', 'script' => 'Latn', 'native' => 'føroyskt', 'regional' => 'fo_FO'],
- //'gaa' => ['name' => 'Ga', 'script' => 'Latn', 'native' => 'Ga', 'regional' => ''],
- //'ga' => ['name' => 'Irish', 'script' => 'Latn', 'native' => 'Gaeilge', 'regional' => 'ga_IE'],
- //'gv' => ['name' => 'Manx', 'script' => 'Latn', 'native' => 'Gaelg', 'regional' => 'gv_GB'],
- //'sm' => ['name' => 'Samoan', 'script' => 'Latn', 'native' => 'Gagana fa’a Sāmoa', 'regional' => ''],
- //'gl' => ['name' => 'Galician', 'script' => 'Latn', 'native' => 'galego', 'regional' => 'gl_ES'],
- //'ki' => ['name' => 'Kikuyu', 'script' => 'Latn', 'native' => 'Gikuyu', 'regional' => ''],
- //'gd' => ['name' => 'Scottish Gaelic', 'script' => 'Latn', 'native' => 'Gàidhlig', 'regional' => 'gd_GB'],
- //'ha' => ['name' => 'Hausa', 'script' => 'Latn', 'native' => 'Hausa', 'regional' => 'ha_NG'],
- //'bez' => ['name' => 'Bena', 'script' => 'Latn', 'native' => 'Hibena', 'regional' => ''],
- //'ho' => ['name' => 'Hiri Motu', 'script' => 'Latn', 'native' => 'Hiri Motu', 'regional' => ''],
- //'hr' => ['name' => 'Croatian', 'script' => 'Latn', 'native' => 'hrvatski', 'regional' => 'hr_HR'],
- //'bem' => ['name' => 'Bemba', 'script' => 'Latn', 'native' => 'Ichibemba', 'regional' => 'bem_ZM'],
- //'io' => ['name' => 'Ido', 'script' => 'Latn', 'native' => 'Ido', 'regional' => ''],
- //'ig' => ['name' => 'Igbo', 'script' => 'Latn', 'native' => 'Igbo', 'regional' => 'ig_NG'],
- //'rn' => ['name' => 'Rundi', 'script' => 'Latn', 'native' => 'Ikirundi', 'regional' => ''],
- //'ia' => ['name' => 'Interlingua', 'script' => 'Latn', 'native' => 'interlingua', 'regional' => 'ia_FR'],
- //'iu-Latn' => ['name' => 'Inuktitut (Latin)', 'script' => 'Latn', 'native' => 'Inuktitut', 'regional' => 'iu_CA'],
- //'sbp' => ['name' => 'Sileibi', 'script' => 'Latn', 'native' => 'Ishisangu', 'regional' => ''],
- //'nd' => ['name' => 'North Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => ''],
- //'nr' => ['name' => 'South Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => 'nr_ZA'],
- //'xh' => ['name' => 'Xhosa', 'script' => 'Latn', 'native' => 'isiXhosa', 'regional' => 'xh_ZA'],
- //'zu' => ['name' => 'Zulu', 'script' => 'Latn', 'native' => 'isiZulu', 'regional' => 'zu_ZA'],
- 'it' => ['name' => 'Italian', 'script' => 'Latn', 'native' => 'italiano', 'regional' => 'it_IT'],
- //'ik' => ['name' => 'Inupiaq', 'script' => 'Latn', 'native' => 'Iñupiaq', 'regional' => 'ik_CA'],
- //'dyo' => ['name' => 'Jola-Fonyi', 'script' => 'Latn', 'native' => 'joola', 'regional' => ''],
- //'kea' => ['name' => 'Kabuverdianu', 'script' => 'Latn', 'native' => 'kabuverdianu', 'regional' => ''],
- //'kaj' => ['name' => 'Jju', 'script' => 'Latn', 'native' => 'Kaje', 'regional' => ''],
- //'mh' => ['name' => 'Marshallese', 'script' => 'Latn', 'native' => 'Kajin M̧ajeļ', 'regional' => 'mh_MH'],
- //'kl' => ['name' => 'Kalaallisut', 'script' => 'Latn', 'native' => 'kalaallisut', 'regional' => 'kl_GL'],
- //'kln' => ['name' => 'Kalenjin', 'script' => 'Latn', 'native' => 'Kalenjin', 'regional' => ''],
- //'kr' => ['name' => 'Kanuri', 'script' => 'Latn', 'native' => 'Kanuri', 'regional' => ''],
- //'kcg' => ['name' => 'Tyap', 'script' => 'Latn', 'native' => 'Katab', 'regional' => ''],
- //'kw' => ['name' => 'Cornish', 'script' => 'Latn', 'native' => 'kernewek', 'regional' => 'kw_GB'],
- //'naq' => ['name' => 'Nama', 'script' => 'Latn', 'native' => 'Khoekhoegowab', 'regional' => ''],
- //'rof' => ['name' => 'Rombo', 'script' => 'Latn', 'native' => 'Kihorombo', 'regional' => ''],
- //'kam' => ['name' => 'Kamba', 'script' => 'Latn', 'native' => 'Kikamba', 'regional' => ''],
- //'kg' => ['name' => 'Kongo', 'script' => 'Latn', 'native' => 'Kikongo', 'regional' => ''],
- //'jmc' => ['name' => 'Machame', 'script' => 'Latn', 'native' => 'Kimachame', 'regional' => ''],
- //'rw' => ['name' => 'Kinyarwanda', 'script' => 'Latn', 'native' => 'Kinyarwanda', 'regional' => 'rw_RW'],
- //'asa' => ['name' => 'Kipare', 'script' => 'Latn', 'native' => 'Kipare', 'regional' => ''],
- //'rwk' => ['name' => 'Rwa', 'script' => 'Latn', 'native' => 'Kiruwa', 'regional' => ''],
- //'saq' => ['name' => 'Samburu', 'script' => 'Latn', 'native' => 'Kisampur', 'regional' => ''],
- //'ksb' => ['name' => 'Shambala', 'script' => 'Latn', 'native' => 'Kishambaa', 'regional' => ''],
- //'swc' => ['name' => 'Congo Swahili', 'script' => 'Latn', 'native' => 'Kiswahili ya Kongo', 'regional' => ''],
- //'sw' => ['name' => 'Swahili', 'script' => 'Latn', 'native' => 'Kiswahili', 'regional' => 'sw_KE'],
- //'dav' => ['name' => 'Dawida', 'script' => 'Latn', 'native' => 'Kitaita', 'regional' => ''],
- //'teo' => ['name' => 'Teso', 'script' => 'Latn', 'native' => 'Kiteso', 'regional' => ''],
- //'khq' => ['name' => 'Koyra Chiini', 'script' => 'Latn', 'native' => 'Koyra ciini', 'regional' => ''],
- //'ses' => ['name' => 'Songhay', 'script' => 'Latn', 'native' => 'Koyraboro senni', 'regional' => ''],
- //'mfe' => ['name' => 'Morisyen', 'script' => 'Latn', 'native' => 'kreol morisien', 'regional' => ''],
- //'ht' => ['name' => 'Haitian', 'script' => 'Latn', 'native' => 'Kreyòl ayisyen', 'regional' => 'ht_HT'],
- //'kj' => ['name' => 'Kuanyama', 'script' => 'Latn', 'native' => 'Kwanyama', 'regional' => ''],
- //'ksh' => ['name' => 'Kölsch', 'script' => 'Latn', 'native' => 'Kölsch', 'regional' => ''],
- //'ebu' => ['name' => 'Kiembu', 'script' => 'Latn', 'native' => 'Kĩembu', 'regional' => ''],
- //'mer' => ['name' => 'Kimîîru', 'script' => 'Latn', 'native' => 'Kĩmĩrũ', 'regional' => ''],
- //'lag' => ['name' => 'Langi', 'script' => 'Latn', 'native' => 'Kɨlaangi', 'regional' => ''],
- //'lah' => ['name' => 'Lahnda', 'script' => 'Latn', 'native' => 'Lahnda', 'regional' => ''],
- //'la' => ['name' => 'Latin', 'script' => 'Latn', 'native' => 'latine', 'regional' => ''],
- //'lv' => ['name' => 'Latvian', 'script' => 'Latn', 'native' => 'latviešu', 'regional' => 'lv_LV'],
- //'to' => ['name' => 'Tongan', 'script' => 'Latn', 'native' => 'lea fakatonga', 'regional' => ''],
- //'lt' => ['name' => 'Lithuanian', 'script' => 'Latn', 'native' => 'lietuvių', 'regional' => 'lt_LT'],
- //'li' => ['name' => 'Limburgish', 'script' => 'Latn', 'native' => 'Limburgs', 'regional' => 'li_BE'],
- //'ln' => ['name' => 'Lingala', 'script' => 'Latn', 'native' => 'lingála', 'regional' => ''],
- //'lg' => ['name' => 'Ganda', 'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'],
- //'luy' => ['name' => 'Oluluyia', 'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''],
- //'lb' => ['name' => 'Luxembourgish', 'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'],
- //'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
- //'mgh' => ['name' => 'Makhuwa-Meetto', 'script' => 'Latn', 'native' => 'Makua', 'regional' => ''],
- //'mg' => ['name' => 'Malagasy', 'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'],
- //'mt' => ['name' => 'Maltese', 'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'],
- //'mtr' => ['name' => 'Mewari', 'script' => 'Latn', 'native' => 'Mewari', 'regional' => ''],
- //'mua' => ['name' => 'Mundang', 'script' => 'Latn', 'native' => 'Mundang', 'regional' => ''],
- //'mi' => ['name' => 'Māori', 'script' => 'Latn', 'native' => 'Māori', 'regional' => 'mi_NZ'],
- 'nl' => ['name' => 'Dutch', 'script' => 'Latn', 'native' => 'Nederlands', 'regional' => 'nl_NL'],
- //'nmg' => ['name' => 'Kwasio', 'script' => 'Latn', 'native' => 'ngumba', 'regional' => ''],
- //'yav' => ['name' => 'Yangben', 'script' => 'Latn', 'native' => 'nuasue', 'regional' => ''],
- 'nn' => ['name' => 'Norwegian Nynorsk', 'script' => 'Latn', 'native' => 'nynorsk', 'regional' => 'nn_NO'],
- //'oc' => ['name' => 'Occitan', 'script' => 'Latn', 'native' => 'occitan', 'regional' => 'oc_FR'],
- //'ang' => ['name' => 'Old English', 'script' => 'Runr', 'native' => 'Old English', 'regional' => ''],
- //'xog' => ['name' => 'Soga', 'script' => 'Latn', 'native' => 'Olusoga', 'regional' => ''],
- //'om' => ['name' => 'Oromo', 'script' => 'Latn', 'native' => 'Oromoo', 'regional' => 'om_ET'],
- //'ng' => ['name' => 'Ndonga', 'script' => 'Latn', 'native' => 'OshiNdonga', 'regional' => ''],
- //'hz' => ['name' => 'Herero', 'script' => 'Latn', 'native' => 'Otjiherero', 'regional' => ''],
- //'uz-Latn' => ['name' => 'Uzbek (Latin)', 'script' => 'Latn', 'native' => 'oʼzbekcha', 'regional' => 'uz_UZ'],
- //'nds' => ['name' => 'Low German', 'script' => 'Latn', 'native' => 'Plattdüütsch', 'regional' => 'nds_DE'],
- 'pl' => ['name' => 'Polish', 'script' => 'Latn', 'native' => 'polski', 'regional' => 'pl_PL'],
- 'pt' => ['name' => 'Portuguese', 'script' => 'Latn', 'native' => 'português', 'regional' => 'pt_PT'],
- //'pt-BR' => ['name' => 'Brazilian Portuguese', 'script' => 'Latn', 'native' => 'português do Brasil', 'regional' => 'pt_BR'],
- //'ff' => ['name' => 'Fulah', 'script' => 'Latn', 'native' => 'Pulaar', 'regional' => 'ff_SN'],
- //'pi' => ['name' => 'Pahari-Potwari', 'script' => 'Latn', 'native' => 'Pāli', 'regional' => ''],
- //'aa' => ['name' => 'Afar', 'script' => 'Latn', 'native' => 'Qafar', 'regional' => 'aa_ER'],
- //'ty' => ['name' => 'Tahitian', 'script' => 'Latn', 'native' => 'Reo Māohi', 'regional' => ''],
- //'ksf' => ['name' => 'Bafia', 'script' => 'Latn', 'native' => 'rikpa', 'regional' => ''],
- 'ro' => ['name' => 'Romanian', 'script' => 'Latn', 'native' => 'română', 'regional' => 'ro_RO'],
- //'cgg' => ['name' => 'Chiga', 'script' => 'Latn', 'native' => 'Rukiga', 'regional' => ''],
- //'rm' => ['name' => 'Romansh', 'script' => 'Latn', 'native' => 'rumantsch', 'regional' => ''],
- //'qu' => ['name' => 'Quechua', 'script' => 'Latn', 'native' => 'Runa Simi', 'regional' => ''],
- //'nyn' => ['name' => 'Nyankole', 'script' => 'Latn', 'native' => 'Runyankore', 'regional' => ''],
- //'ssy' => ['name' => 'Saho', 'script' => 'Latn', 'native' => 'Saho', 'regional' => ''],
- //'sc' => ['name' => 'Sardinian', 'script' => 'Latn', 'native' => 'sardu', 'regional' => 'sc_IT'],
- //'de-CH' => ['name' => 'Swiss High German', 'script' => 'Latn', 'native' => 'Schweizer Hochdeutsch', 'regional' => 'de_CH'],
- //'gsw' => ['name' => 'Swiss German', 'script' => 'Latn', 'native' => 'Schwiizertüütsch', 'regional' => ''],
- //'trv' => ['name' => 'Taroko', 'script' => 'Latn', 'native' => 'Seediq', 'regional' => ''],
- //'seh' => ['name' => 'Sena', 'script' => 'Latn', 'native' => 'sena', 'regional' => ''],
- //'nso' => ['name' => 'Northern Sotho', 'script' => 'Latn', 'native' => 'Sesotho sa Leboa', 'regional' => 'nso_ZA'],
- //'st' => ['name' => 'Southern Sotho', 'script' => 'Latn', 'native' => 'Sesotho', 'regional' => 'st_ZA'],
- //'tn' => ['name' => 'Tswana', 'script' => 'Latn', 'native' => 'Setswana', 'regional' => 'tn_ZA'],
- //'sq' => ['name' => 'Albanian', 'script' => 'Latn', 'native' => 'shqip', 'regional' => 'sq_AL'],
- //'sid' => ['name' => 'Sidamo', 'script' => 'Latn', 'native' => 'Sidaamu Afo', 'regional' => 'sid_ET'],
- //'ss' => ['name' => 'Swati', 'script' => 'Latn', 'native' => 'Siswati', 'regional' => 'ss_ZA'],
- //'sk' => ['name' => 'Slovak', 'script' => 'Latn', 'native' => 'slovenčina', 'regional' => 'sk_SK'],
- //'sl' => ['name' => 'Slovene', 'script' => 'Latn', 'native' => 'slovenščina', 'regional' => 'sl_SI'],
- //'so' => ['name' => 'Somali', 'script' => 'Latn', 'native' => 'Soomaali', 'regional' => 'so_SO'],
- //'sr-Latn' => ['name' => 'Serbian (Latin)', 'script' => 'Latn', 'native' => 'Srpski', 'regional' => 'sr_RS'],
- //'sh' => ['name' => 'Serbo-Croatian', 'script' => 'Latn', 'native' => 'srpskohrvatski', 'regional' => ''],
- 'fi' => ['name' => 'Finnish', 'script' => 'Latn', 'native' => 'suomi', 'regional' => 'fi_FI'],
- 'sv' => ['name' => 'Swedish', 'script' => 'Latn', 'native' => 'svenska', 'regional' => 'sv_SE'],
- //'sg' => ['name' => 'Sango', 'script' => 'Latn', 'native' => 'Sängö', 'regional' => ''],
- //'tl' => ['name' => 'Tagalog', 'script' => 'Latn', 'native' => 'Tagalog', 'regional' => 'tl_PH'],
- //'tzm-Latn' => ['name' => 'Central Atlas Tamazight (Latin)', 'script' => 'Latn', 'native' => 'Tamazight', 'regional' => ''],
- //'kab' => ['name' => 'Kabyle', 'script' => 'Latn', 'native' => 'Taqbaylit', 'regional' => 'kab_DZ'],
- //'twq' => ['name' => 'Tasawaq', 'script' => 'Latn', 'native' => 'Tasawaq senni', 'regional' => ''],
- //'shi' => ['name' => 'Tachelhit (Latin)', 'script' => 'Latn', 'native' => 'Tashelhit', 'regional' => ''],
- //'nus' => ['name' => 'Nuer', 'script' => 'Latn', 'native' => 'Thok Nath', 'regional' => ''],
- //'vi' => ['name' => 'Vietnamese', 'script' => 'Latn', 'native' => 'Tiếng Việt', 'regional' => 'vi_VN'],
- //'tg-Latn' => ['name' => 'Tajik (Latin)', 'script' => 'Latn', 'native' => 'tojikī', 'regional' => 'tg_TJ'],
- //'lu' => ['name' => 'Luba-Katanga', 'script' => 'Latn', 'native' => 'Tshiluba', 'regional' => 've_ZA'],
- //'ve' => ['name' => 'Venda', 'script' => 'Latn', 'native' => 'Tshivenḓa', 'regional' => ''],
- //'tw' => ['name' => 'Twi', 'script' => 'Latn', 'native' => 'Twi', 'regional' => ''],
- //'tr' => ['name' => 'Turkish', 'script' => 'Latn', 'native' => 'Türkçe', 'regional' => 'tr_TR'],
- //'ale' => ['name' => 'Aleut', 'script' => 'Latn', 'native' => 'Unangax tunuu', 'regional' => ''],
- //'ca-valencia' => ['name' => 'Valencian', 'script' => 'Latn', 'native' => 'valencià', 'regional' => ''],
- //'vai-Latn' => ['name' => 'Vai (Latin)', 'script' => 'Latn', 'native' => 'Viyamíĩ', 'regional' => ''],
- //'vo' => ['name' => 'Volapük', 'script' => 'Latn', 'native' => 'Volapük', 'regional' => ''],
- //'fj' => ['name' => 'Fijian', 'script' => 'Latn', 'native' => 'vosa Vakaviti', 'regional' => ''],
- //'wa' => ['name' => 'Walloon', 'script' => 'Latn', 'native' => 'Walon', 'regional' => 'wa_BE'],
- //'wae' => ['name' => 'Walser', 'script' => 'Latn', 'native' => 'Walser', 'regional' => 'wae_CH'],
- //'wen' => ['name' => 'Sorbian', 'script' => 'Latn', 'native' => 'Wendic', 'regional' => ''],
- //'wo' => ['name' => 'Wolof', 'script' => 'Latn', 'native' => 'Wolof', 'regional' => 'wo_SN'],
- //'ts' => ['name' => 'Tsonga', 'script' => 'Latn', 'native' => 'Xitsonga', 'regional' => 'ts_ZA'],
- //'dje' => ['name' => 'Zarma', 'script' => 'Latn', 'native' => 'Zarmaciine', 'regional' => ''],
- //'yo' => ['name' => 'Yoruba', 'script' => 'Latn', 'native' => 'Èdè Yorùbá', 'regional' => 'yo_NG'],
- //'de-AT' => ['name' => 'Austrian German', 'script' => 'Latn', 'native' => 'Österreichisches Deutsch', 'regional' => 'de_AT'],
- //'is' => ['name' => 'Icelandic', 'script' => 'Latn', 'native' => 'íslenska', 'regional' => 'is_IS'],
- //'cs' => ['name' => 'Czech', 'script' => 'Latn', 'native' => 'čeština', 'regional' => 'cs_CZ'],
- //'bas' => ['name' => 'Basa', 'script' => 'Latn', 'native' => 'Ɓàsàa', 'regional' => ''],
- //'mas' => ['name' => 'Masai', 'script' => 'Latn', 'native' => 'ɔl-Maa', 'regional' => ''],
- //'haw' => ['name' => 'Hawaiian', 'script' => 'Latn', 'native' => 'ʻŌlelo Hawaiʻi', 'regional' => ''],
- 'el' => ['name' => 'Greek', 'script' => 'Grek', 'native' => 'Ελληνικά', 'regional' => 'el_GR'],
- //'uz' => ['name' => 'Uzbek (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Ўзбек', 'regional' => 'uz_UZ'],
- //'az-Cyrl' => ['name' => 'Azerbaijani (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Азәрбајҹан', 'regional' => 'uz_UZ'],
- //'ab' => ['name' => 'Abkhazian', 'script' => 'Cyrl', 'native' => 'Аҧсуа', 'regional' => ''],
- //'os' => ['name' => 'Ossetic', 'script' => 'Cyrl', 'native' => 'Ирон', 'regional' => 'os_RU'],
- //'ky' => ['name' => 'Kyrgyz', 'script' => 'Cyrl', 'native' => 'Кыргыз', 'regional' => 'ky_KG'],
- //'sr' => ['name' => 'Serbian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Српски', 'regional' => 'sr_RS'],
- //'av' => ['name' => 'Avaric', 'script' => 'Cyrl', 'native' => 'авар мацӀ', 'regional' => ''],
- //'ady' => ['name' => 'Adyghe', 'script' => 'Cyrl', 'native' => 'адыгэбзэ', 'regional' => ''],
- //'ba' => ['name' => 'Bashkir', 'script' => 'Cyrl', 'native' => 'башҡорт теле', 'regional' => ''],
- //'be' => ['name' => 'Belarusian', 'script' => 'Cyrl', 'native' => 'беларуская', 'regional' => 'be_BY'],
- 'bg' => ['name' => 'Bulgarian', 'script' => 'Cyrl', 'native' => 'български', 'regional' => 'bg_BG'],
- //'kv' => ['name' => 'Komi', 'script' => 'Cyrl', 'native' => 'коми кыв', 'regional' => ''],
- //'mk' => ['name' => 'Macedonian', 'script' => 'Cyrl', 'native' => 'македонски', 'regional' => 'mk_MK'],
- //'mn' => ['name' => 'Mongolian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'монгол', 'regional' => 'mn_MN'],
- //'ce' => ['name' => 'Chechen', 'script' => 'Cyrl', 'native' => 'нохчийн мотт', 'regional' => 'ce_RU'],
- //'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'],
- //'sah' => ['name' => 'Yakut', 'script' => 'Cyrl', 'native' => 'саха тыла', 'regional' => ''],
- //'tt' => ['name' => 'Tatar', 'script' => 'Cyrl', 'native' => 'татар теле', 'regional' => 'tt_RU'],
- //'tg' => ['name' => 'Tajik (Cyrillic)', 'script' => 'Cyrl', 'native' => 'тоҷикӣ', 'regional' => 'tg_TJ'],
- //'tk' => ['name' => 'Turkmen', 'script' => 'Cyrl', 'native' => 'түркменче', 'regional' => 'tk_TM'],
- //'uk' => ['name' => 'Ukrainian', 'script' => 'Cyrl', 'native' => 'українська', 'regional' => 'uk_UA'],
- //'cv' => ['name' => 'Chuvash', 'script' => 'Cyrl', 'native' => 'чӑваш чӗлхи', 'regional' => 'cv_RU'],
- //'cu' => ['name' => 'Church Slavic', 'script' => 'Cyrl', 'native' => 'ѩзыкъ словѣньскъ', 'regional' => ''],
- //'kk' => ['name' => 'Kazakh', 'script' => 'Cyrl', 'native' => 'қазақ тілі', 'regional' => 'kk_KZ'],
- //'hy' => ['name' => 'Armenian', 'script' => 'Armn', 'native' => 'Հայերէն', 'regional' => 'hy_AM'],
- //'yi' => ['name' => 'Yiddish', 'script' => 'Hebr', 'native' => 'ייִדיש', 'regional' => 'yi_US'],
- //'he' => ['name' => 'Hebrew', 'script' => 'Hebr', 'native' => 'עברית', 'regional' => 'he_IL'],
- //'ug' => ['name' => 'Uyghur', 'script' => 'Arab', 'native' => 'ئۇيغۇرچە', 'regional' => 'ug_CN'],
- //'ur' => ['name' => 'Urdu', 'script' => 'Arab', 'native' => 'اردو', 'regional' => 'ur_PK'],
- 'ar' => ['name' => 'Arabic', 'script' => 'Arab', 'native' => 'العربية', 'regional' => 'ar_AE'],
- //'uz-Arab' => ['name' => 'Uzbek (Arabic)', 'script' => 'Arab', 'native' => 'اۉزبېک', 'regional' => ''],
- //'tg-Arab' => ['name' => 'Tajik (Arabic)', 'script' => 'Arab', 'native' => 'تاجیکی', 'regional' => 'tg_TJ'],
- //'sd' => ['name' => 'Sindhi', 'script' => 'Arab', 'native' => 'سنڌي', 'regional' => 'sd_IN'],
- //'fa' => ['name' => 'Persian', 'script' => 'Arab', 'native' => 'فارسی', 'regional' => 'fa_IR'],
- //'pa-Arab' => ['name' => 'Punjabi (Arabic)', 'script' => 'Arab', 'native' => 'پنجاب', 'regional' => 'pa_IN'],
- //'ps' => ['name' => 'Pashto', 'script' => 'Arab', 'native' => 'پښتو', 'regional' => 'ps_AF'],
- //'ks' => ['name' => 'Kashmiri (Arabic)', 'script' => 'Arab', 'native' => 'کأشُر', 'regional' => 'ks_IN'],
- //'ku' => ['name' => 'Kurdish', 'script' => 'Arab', 'native' => 'کوردی', 'regional' => 'ku_TR'],
- //'dv' => ['name' => 'Divehi', 'script' => 'Thaa', 'native' => 'ދިވެހިބަސް', 'regional' => 'dv_MV'],
- //'ks-Deva' => ['name' => 'Kashmiri (Devaganari)', 'script' => 'Deva', 'native' => 'कॉशुर', 'regional' => 'ks_IN'],
- //'kok' => ['name' => 'Konkani', 'script' => 'Deva', 'native' => 'कोंकणी', 'regional' => 'kok_IN'],
- //'doi' => ['name' => 'Dogri', 'script' => 'Deva', 'native' => 'डोगरी', 'regional' => 'doi_IN'],
- //'ne' => ['name' => 'Nepali', 'script' => 'Deva', 'native' => 'नेपाली', 'regional' => ''],
- //'pra' => ['name' => 'Prakrit', 'script' => 'Deva', 'native' => 'प्राकृत', 'regional' => ''],
- //'brx' => ['name' => 'Bodo', 'script' => 'Deva', 'native' => 'बड़ो', 'regional' => 'brx_IN'],
- //'bra' => ['name' => 'Braj', 'script' => 'Deva', 'native' => 'ब्रज भाषा', 'regional' => ''],
- //'mr' => ['name' => 'Marathi', 'script' => 'Deva', 'native' => 'मराठी', 'regional' => 'mr_IN'],
- //'mai' => ['name' => 'Maithili', 'script' => 'Tirh', 'native' => 'मैथिली', 'regional' => 'mai_IN'],
- //'raj' => ['name' => 'Rajasthani', 'script' => 'Deva', 'native' => 'राजस्थानी', 'regional' => ''],
- //'sa' => ['name' => 'Sanskrit', 'script' => 'Deva', 'native' => 'संस्कृतम्', 'regional' => 'sa_IN'],
- //'hi' => ['name' => 'Hindi', 'script' => 'Deva', 'native' => 'हिन्दी', 'regional' => 'hi_IN'],
- //'as' => ['name' => 'Assamese', 'script' => 'Beng', 'native' => 'অসমীয়া', 'regional' => 'as_IN'],
- //'bn' => ['name' => 'Bengali', 'script' => 'Beng', 'native' => 'বাংলা', 'regional' => 'bn_BD'],
- //'mni' => ['name' => 'Manipuri', 'script' => 'Beng', 'native' => 'মৈতৈ', 'regional' => 'mni_IN'],
- //'pa' => ['name' => 'Punjabi (Gurmukhi)', 'script' => 'Guru', 'native' => 'ਪੰਜਾਬੀ', 'regional' => 'pa_IN'],
- //'gu' => ['name' => 'Gujarati', 'script' => 'Gujr', 'native' => 'ગુજરાતી', 'regional' => 'gu_IN'],
- //'or' => ['name' => 'Oriya', 'script' => 'Orya', 'native' => 'ଓଡ଼ିଆ', 'regional' => 'or_IN'],
- //'ta' => ['name' => 'Tamil', 'script' => 'Taml', 'native' => 'தமிழ்', 'regional' => 'ta_IN'],
- //'te' => ['name' => 'Telugu', 'script' => 'Telu', 'native' => 'తెలుగు', 'regional' => 'te_IN'],
- //'kn' => ['name' => 'Kannada', 'script' => 'Knda', 'native' => 'ಕನ್ನಡ', 'regional' => 'kn_IN'],
- //'ml' => ['name' => 'Malayalam', 'script' => 'Mlym', 'native' => 'മലയാളം', 'regional' => 'ml_IN'],
- //'si' => ['name' => 'Sinhala', 'script' => 'Sinh', 'native' => 'සිංහල', 'regional' => 'si_LK'],
- //'th' => ['name' => 'Thai', 'script' => 'Thai', 'native' => 'ไทย', 'regional' => 'th_TH'],
- //'lo' => ['name' => 'Lao', 'script' => 'Laoo', 'native' => 'ລາວ', 'regional' => 'lo_LA'],
- //'bo' => ['name' => 'Tibetan', 'script' => 'Tibt', 'native' => 'པོད་སྐད་', 'regional' => 'bo_IN'],
- //'dz' => ['name' => 'Dzongkha', 'script' => 'Tibt', 'native' => 'རྫོང་ཁ', 'regional' => 'dz_BT'],
- //'my' => ['name' => 'Burmese', 'script' => 'Mymr', 'native' => 'မြန်မာဘာသာ', 'regional' => 'my_MM'],
- //'ka' => ['name' => 'Georgian', 'script' => 'Geor', 'native' => 'ქართული', 'regional' => 'ka_GE'],
- //'byn' => ['name' => 'Blin', 'script' => 'Ethi', 'native' => 'ብሊን', 'regional' => 'byn_ER'],
- //'tig' => ['name' => 'Tigre', 'script' => 'Ethi', 'native' => 'ትግረ', 'regional' => 'tig_ER'],
- //'ti' => ['name' => 'Tigrinya', 'script' => 'Ethi', 'native' => 'ትግርኛ', 'regional' => 'ti_ET'],
- //'am' => ['name' => 'Amharic', 'script' => 'Ethi', 'native' => 'አማርኛ', 'regional' => 'am_ET'],
- //'wal' => ['name' => 'Wolaytta', 'script' => 'Ethi', 'native' => 'ወላይታቱ', 'regional' => 'wal_ET'],
- //'chr' => ['name' => 'Cherokee', 'script' => 'Cher', 'native' => 'ᏣᎳᎩ', 'regional' => ''],
- //'iu' => ['name' => 'Inuktitut (Canadian Aboriginal Syllabics)', 'script' => 'Cans', 'native' => 'ᐃᓄᒃᑎᑐᑦ', 'regional' => 'iu_CA'],
- //'oj' => ['name' => 'Ojibwa', 'script' => 'Cans', 'native' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'regional' => ''],
- //'cr' => ['name' => 'Cree', 'script' => 'Cans', 'native' => 'ᓀᐦᐃᔭᐍᐏᐣ', 'regional' => ''],
- //'km' => ['name' => 'Khmer', 'script' => 'Khmr', 'native' => 'ភាសាខ្មែរ', 'regional' => 'km_KH'],
- //'mn-Mong' => ['name' => 'Mongolian (Mongolian)', 'script' => 'Mong', 'native' => 'ᠮᠣᠨᠭᠭᠣᠯ ᠬᠡᠯᠡ', 'regional' => 'mn_MN'],
- //'shi-Tfng' => ['name' => 'Tachelhit (Tifinagh)', 'script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
- //'tzm' => ['name' => 'Central Atlas Tamazight (Tifinagh)','script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
- //'yue' => ['name' => 'Yue', 'script' => 'Hant', 'native' => '廣州話', 'regional' => 'yue_HK'],
- //'ja' => ['name' => 'Japanese', 'script' => 'Jpan', 'native' => '日本語', 'regional' => 'ja_JP'],
- //'zh' => ['name' => 'Chinese (Simplified)', 'script' => 'Hans', 'native' => '简体中文', 'regional' => 'zh_CN'],
- //'zh-Hant' => ['name' => 'Chinese (Traditional)', 'script' => 'Hant', 'native' => '繁體中文', 'regional' => 'zh_CN'],
- //'ii' => ['name' => 'Sichuan Yi', 'script' => 'Yiii', 'native' => 'ꆈꌠꉙ', 'regional' => ''],
- //'vai' => ['name' => 'Vai (Vai)', 'script' => 'Vaii', 'native' => 'ꕙꔤ', 'regional' => ''],
- //'jv-Java' => ['name' => 'Javanese (Javanese)', 'script' => 'Java', 'native' => 'ꦧꦱꦗꦮ', 'regional' => ''],
- //'ko' => ['name' => 'Korean', 'script' => 'Hang', 'native' => '한국어', 'regional' => 'ko_KR'],
+ // 'ace' => ['name' => 'Achinese', 'script' => 'Latn', 'native' => 'Aceh', 'regional' => ''],
+ // 'af' => ['name' => 'Afrikaans', 'script' => 'Latn', 'native' => 'Afrikaans', 'regional' => 'af_ZA'],
+ // 'agq' => ['name' => 'Aghem', 'script' => 'Latn', 'native' => 'Aghem', 'regional' => ''],
+ // 'ak' => ['name' => 'Akan', 'script' => 'Latn', 'native' => 'Akan', 'regional' => 'ak_GH'],
+ // 'an' => ['name' => 'Aragonese', 'script' => 'Latn', 'native' => 'aragonés', 'regional' => 'an_ES'],
+ // 'cch' => ['name' => 'Atsam', 'script' => 'Latn', 'native' => 'Atsam', 'regional' => ''],
+ // 'gn' => ['name' => 'Guaraní', 'script' => 'Latn', 'native' => 'Avañe’ẽ', 'regional' => ''],
+ // 'ae' => ['name' => 'Avestan', 'script' => 'Latn', 'native' => 'avesta', 'regional' => ''],
+ // 'ay' => ['name' => 'Aymara', 'script' => 'Latn', 'native' => 'aymar aru', 'regional' => 'ay_PE'],
+ // 'az' => ['name' => 'Azerbaijani (Latin)', 'script' => 'Latn', 'native' => 'azərbaycanca', 'regional' => 'az_AZ'],
+ // 'id' => ['name' => 'Indonesian', 'script' => 'Latn', 'native' => 'Bahasa Indonesia', 'regional' => 'id_ID'],
+ // 'ms' => ['name' => 'Malay', 'script' => 'Latn', 'native' => 'Bahasa Melayu', 'regional' => 'ms_MY'],
+ // 'bm' => ['name' => 'Bambara', 'script' => 'Latn', 'native' => 'bamanakan', 'regional' => ''],
+ // 'jv' => ['name' => 'Javanese (Latin)', 'script' => 'Latn', 'native' => 'Basa Jawa', 'regional' => ''],
+ // 'su' => ['name' => 'Sundanese', 'script' => 'Latn', 'native' => 'Basa Sunda', 'regional' => ''],
+ // 'bh' => ['name' => 'Bihari', 'script' => 'Latn', 'native' => 'Bihari', 'regional' => ''],
+ // 'bi' => ['name' => 'Bislama', 'script' => 'Latn', 'native' => 'Bislama', 'regional' => ''],
+ 'nb' => ['name' => 'Norwegian Bokmål', 'script' => 'Latn', 'native' => 'Bokmål', 'regional' => 'nb_NO'],
+ // 'bs' => ['name' => 'Bosnian', 'script' => 'Latn', 'native' => 'bosanski', 'regional' => 'bs_BA'],
+ // 'br' => ['name' => 'Breton', 'script' => 'Latn', 'native' => 'brezhoneg', 'regional' => 'br_FR'],
+ // 'ca' => ['name' => 'Catalan', 'script' => 'Latn', 'native' => 'català', 'regional' => 'ca_ES'],
+ // 'ch' => ['name' => 'Chamorro', 'script' => 'Latn', 'native' => 'Chamoru', 'regional' => ''],
+ // 'ny' => ['name' => 'Chewa', 'script' => 'Latn', 'native' => 'chiCheŵa', 'regional' => ''],
+ // 'kde' => ['name' => 'Makonde', 'script' => 'Latn', 'native' => 'Chimakonde', 'regional' => ''],
+ // 'sn' => ['name' => 'Shona', 'script' => 'Latn', 'native' => 'chiShona', 'regional' => ''],
+ // 'co' => ['name' => 'Corsican', 'script' => 'Latn', 'native' => 'corsu', 'regional' => ''],
+ // 'cy' => ['name' => 'Welsh', 'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'],
+ 'da' => ['name' => 'Danish', 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'],
+ // 'se' => ['name' => 'Northern Sami', 'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'],
+ 'de' => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'],
+ // 'luo' => ['name' => 'Luo', 'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''],
+ // 'nv' => ['name' => 'Navajo', 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''],
+ // 'dua' => ['name' => 'Duala', 'script' => 'Latn', 'native' => 'duálá', 'regional' => ''],
+ // 'et' => ['name' => 'Estonian', 'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
+ // 'na' => ['name' => 'Nauru', 'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
+ // 'guz' => ['name' => 'Ekegusii', 'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
+ 'en' => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
+ // 'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
+ // 'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
+ // 'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
+ 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
+ // 'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
+ // 'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
+ // 'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
+ // 'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''],
+ // 'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'],
+ 'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'],
+ // 'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'],
+ // 'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'],
+ // 'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'],
+ // 'fo' => ['name' => 'Faroese', 'script' => 'Latn', 'native' => 'føroyskt', 'regional' => 'fo_FO'],
+ // 'gaa' => ['name' => 'Ga', 'script' => 'Latn', 'native' => 'Ga', 'regional' => ''],
+ // 'ga' => ['name' => 'Irish', 'script' => 'Latn', 'native' => 'Gaeilge', 'regional' => 'ga_IE'],
+ // 'gv' => ['name' => 'Manx', 'script' => 'Latn', 'native' => 'Gaelg', 'regional' => 'gv_GB'],
+ // 'sm' => ['name' => 'Samoan', 'script' => 'Latn', 'native' => 'Gagana fa’a Sāmoa', 'regional' => ''],
+ // 'gl' => ['name' => 'Galician', 'script' => 'Latn', 'native' => 'galego', 'regional' => 'gl_ES'],
+ // 'ki' => ['name' => 'Kikuyu', 'script' => 'Latn', 'native' => 'Gikuyu', 'regional' => ''],
+ // 'gd' => ['name' => 'Scottish Gaelic', 'script' => 'Latn', 'native' => 'Gàidhlig', 'regional' => 'gd_GB'],
+ // 'ha' => ['name' => 'Hausa', 'script' => 'Latn', 'native' => 'Hausa', 'regional' => 'ha_NG'],
+ // 'bez' => ['name' => 'Bena', 'script' => 'Latn', 'native' => 'Hibena', 'regional' => ''],
+ // 'ho' => ['name' => 'Hiri Motu', 'script' => 'Latn', 'native' => 'Hiri Motu', 'regional' => ''],
+ // 'hr' => ['name' => 'Croatian', 'script' => 'Latn', 'native' => 'hrvatski', 'regional' => 'hr_HR'],
+ // 'bem' => ['name' => 'Bemba', 'script' => 'Latn', 'native' => 'Ichibemba', 'regional' => 'bem_ZM'],
+ // 'io' => ['name' => 'Ido', 'script' => 'Latn', 'native' => 'Ido', 'regional' => ''],
+ // 'ig' => ['name' => 'Igbo', 'script' => 'Latn', 'native' => 'Igbo', 'regional' => 'ig_NG'],
+ // 'rn' => ['name' => 'Rundi', 'script' => 'Latn', 'native' => 'Ikirundi', 'regional' => ''],
+ // 'ia' => ['name' => 'Interlingua', 'script' => 'Latn', 'native' => 'interlingua', 'regional' => 'ia_FR'],
+ // 'iu-Latn' => ['name' => 'Inuktitut (Latin)', 'script' => 'Latn', 'native' => 'Inuktitut', 'regional' => 'iu_CA'],
+ // 'sbp' => ['name' => 'Sileibi', 'script' => 'Latn', 'native' => 'Ishisangu', 'regional' => ''],
+ // 'nd' => ['name' => 'North Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => ''],
+ // 'nr' => ['name' => 'South Ndebele', 'script' => 'Latn', 'native' => 'isiNdebele', 'regional' => 'nr_ZA'],
+ // 'xh' => ['name' => 'Xhosa', 'script' => 'Latn', 'native' => 'isiXhosa', 'regional' => 'xh_ZA'],
+ // 'zu' => ['name' => 'Zulu', 'script' => 'Latn', 'native' => 'isiZulu', 'regional' => 'zu_ZA'],
+ 'it' => ['name' => 'Italian', 'script' => 'Latn', 'native' => 'italiano', 'regional' => 'it_IT'],
+ // 'ik' => ['name' => 'Inupiaq', 'script' => 'Latn', 'native' => 'Iñupiaq', 'regional' => 'ik_CA'],
+ // 'dyo' => ['name' => 'Jola-Fonyi', 'script' => 'Latn', 'native' => 'joola', 'regional' => ''],
+ // 'kea' => ['name' => 'Kabuverdianu', 'script' => 'Latn', 'native' => 'kabuverdianu', 'regional' => ''],
+ // 'kaj' => ['name' => 'Jju', 'script' => 'Latn', 'native' => 'Kaje', 'regional' => ''],
+ // 'mh' => ['name' => 'Marshallese', 'script' => 'Latn', 'native' => 'Kajin M̧ajeļ', 'regional' => 'mh_MH'],
+ // 'kl' => ['name' => 'Kalaallisut', 'script' => 'Latn', 'native' => 'kalaallisut', 'regional' => 'kl_GL'],
+ // 'kln' => ['name' => 'Kalenjin', 'script' => 'Latn', 'native' => 'Kalenjin', 'regional' => ''],
+ // 'kr' => ['name' => 'Kanuri', 'script' => 'Latn', 'native' => 'Kanuri', 'regional' => ''],
+ // 'kcg' => ['name' => 'Tyap', 'script' => 'Latn', 'native' => 'Katab', 'regional' => ''],
+ // 'kw' => ['name' => 'Cornish', 'script' => 'Latn', 'native' => 'kernewek', 'regional' => 'kw_GB'],
+ // 'naq' => ['name' => 'Nama', 'script' => 'Latn', 'native' => 'Khoekhoegowab', 'regional' => ''],
+ // 'rof' => ['name' => 'Rombo', 'script' => 'Latn', 'native' => 'Kihorombo', 'regional' => ''],
+ // 'kam' => ['name' => 'Kamba', 'script' => 'Latn', 'native' => 'Kikamba', 'regional' => ''],
+ // 'kg' => ['name' => 'Kongo', 'script' => 'Latn', 'native' => 'Kikongo', 'regional' => ''],
+ // 'jmc' => ['name' => 'Machame', 'script' => 'Latn', 'native' => 'Kimachame', 'regional' => ''],
+ // 'rw' => ['name' => 'Kinyarwanda', 'script' => 'Latn', 'native' => 'Kinyarwanda', 'regional' => 'rw_RW'],
+ // 'asa' => ['name' => 'Kipare', 'script' => 'Latn', 'native' => 'Kipare', 'regional' => ''],
+ // 'rwk' => ['name' => 'Rwa', 'script' => 'Latn', 'native' => 'Kiruwa', 'regional' => ''],
+ // 'saq' => ['name' => 'Samburu', 'script' => 'Latn', 'native' => 'Kisampur', 'regional' => ''],
+ // 'ksb' => ['name' => 'Shambala', 'script' => 'Latn', 'native' => 'Kishambaa', 'regional' => ''],
+ // 'swc' => ['name' => 'Congo Swahili', 'script' => 'Latn', 'native' => 'Kiswahili ya Kongo', 'regional' => ''],
+ // 'sw' => ['name' => 'Swahili', 'script' => 'Latn', 'native' => 'Kiswahili', 'regional' => 'sw_KE'],
+ // 'dav' => ['name' => 'Dawida', 'script' => 'Latn', 'native' => 'Kitaita', 'regional' => ''],
+ // 'teo' => ['name' => 'Teso', 'script' => 'Latn', 'native' => 'Kiteso', 'regional' => ''],
+ // 'khq' => ['name' => 'Koyra Chiini', 'script' => 'Latn', 'native' => 'Koyra ciini', 'regional' => ''],
+ // 'ses' => ['name' => 'Songhay', 'script' => 'Latn', 'native' => 'Koyraboro senni', 'regional' => ''],
+ // 'mfe' => ['name' => 'Morisyen', 'script' => 'Latn', 'native' => 'kreol morisien', 'regional' => ''],
+ // 'ht' => ['name' => 'Haitian', 'script' => 'Latn', 'native' => 'Kreyòl ayisyen', 'regional' => 'ht_HT'],
+ // 'kj' => ['name' => 'Kuanyama', 'script' => 'Latn', 'native' => 'Kwanyama', 'regional' => ''],
+ // 'ksh' => ['name' => 'Kölsch', 'script' => 'Latn', 'native' => 'Kölsch', 'regional' => ''],
+ // 'ebu' => ['name' => 'Kiembu', 'script' => 'Latn', 'native' => 'Kĩembu', 'regional' => ''],
+ // 'mer' => ['name' => 'Kimîîru', 'script' => 'Latn', 'native' => 'Kĩmĩrũ', 'regional' => ''],
+ // 'lag' => ['name' => 'Langi', 'script' => 'Latn', 'native' => 'Kɨlaangi', 'regional' => ''],
+ // 'lah' => ['name' => 'Lahnda', 'script' => 'Latn', 'native' => 'Lahnda', 'regional' => ''],
+ // 'la' => ['name' => 'Latin', 'script' => 'Latn', 'native' => 'latine', 'regional' => ''],
+ // 'lv' => ['name' => 'Latvian', 'script' => 'Latn', 'native' => 'latviešu', 'regional' => 'lv_LV'],
+ // 'to' => ['name' => 'Tongan', 'script' => 'Latn', 'native' => 'lea fakatonga', 'regional' => ''],
+ // 'lt' => ['name' => 'Lithuanian', 'script' => 'Latn', 'native' => 'lietuvių', 'regional' => 'lt_LT'],
+ // 'li' => ['name' => 'Limburgish', 'script' => 'Latn', 'native' => 'Limburgs', 'regional' => 'li_BE'],
+ // 'ln' => ['name' => 'Lingala', 'script' => 'Latn', 'native' => 'lingála', 'regional' => ''],
+ // 'lg' => ['name' => 'Ganda', 'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'],
+ // 'luy' => ['name' => 'Oluluyia', 'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''],
+ // 'lb' => ['name' => 'Luxembourgish', 'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'],
+ // 'hu' => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
+ // 'mgh' => ['name' => 'Makhuwa-Meetto', 'script' => 'Latn', 'native' => 'Makua', 'regional' => ''],
+ // 'mg' => ['name' => 'Malagasy', 'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'],
+ // 'mt' => ['name' => 'Maltese', 'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'],
+ // 'mtr' => ['name' => 'Mewari', 'script' => 'Latn', 'native' => 'Mewari', 'regional' => ''],
+ // 'mua' => ['name' => 'Mundang', 'script' => 'Latn', 'native' => 'Mundang', 'regional' => ''],
+ // 'mi' => ['name' => 'Māori', 'script' => 'Latn', 'native' => 'Māori', 'regional' => 'mi_NZ'],
+ 'nl' => ['name' => 'Dutch', 'script' => 'Latn', 'native' => 'Nederlands', 'regional' => 'nl_NL'],
+ // 'nmg' => ['name' => 'Kwasio', 'script' => 'Latn', 'native' => 'ngumba', 'regional' => ''],
+ // 'yav' => ['name' => 'Yangben', 'script' => 'Latn', 'native' => 'nuasue', 'regional' => ''],
+ 'nn' => ['name' => 'Norwegian Nynorsk', 'script' => 'Latn', 'native' => 'nynorsk', 'regional' => 'nn_NO'],
+ // 'oc' => ['name' => 'Occitan', 'script' => 'Latn', 'native' => 'occitan', 'regional' => 'oc_FR'],
+ // 'ang' => ['name' => 'Old English', 'script' => 'Runr', 'native' => 'Old English', 'regional' => ''],
+ // 'xog' => ['name' => 'Soga', 'script' => 'Latn', 'native' => 'Olusoga', 'regional' => ''],
+ // 'om' => ['name' => 'Oromo', 'script' => 'Latn', 'native' => 'Oromoo', 'regional' => 'om_ET'],
+ // 'ng' => ['name' => 'Ndonga', 'script' => 'Latn', 'native' => 'OshiNdonga', 'regional' => ''],
+ // 'hz' => ['name' => 'Herero', 'script' => 'Latn', 'native' => 'Otjiherero', 'regional' => ''],
+ // 'uz-Latn' => ['name' => 'Uzbek (Latin)', 'script' => 'Latn', 'native' => 'oʼzbekcha', 'regional' => 'uz_UZ'],
+ // 'nds' => ['name' => 'Low German', 'script' => 'Latn', 'native' => 'Plattdüütsch', 'regional' => 'nds_DE'],
+ 'pl' => ['name' => 'Polish', 'script' => 'Latn', 'native' => 'polski', 'regional' => 'pl_PL'],
+ 'pt' => ['name' => 'Portuguese', 'script' => 'Latn', 'native' => 'português', 'regional' => 'pt_PT'],
+ // 'pt-BR' => ['name' => 'Brazilian Portuguese', 'script' => 'Latn', 'native' => 'português do Brasil', 'regional' => 'pt_BR'],
+ // 'ff' => ['name' => 'Fulah', 'script' => 'Latn', 'native' => 'Pulaar', 'regional' => 'ff_SN'],
+ // 'pi' => ['name' => 'Pahari-Potwari', 'script' => 'Latn', 'native' => 'Pāli', 'regional' => ''],
+ // 'aa' => ['name' => 'Afar', 'script' => 'Latn', 'native' => 'Qafar', 'regional' => 'aa_ER'],
+ // 'ty' => ['name' => 'Tahitian', 'script' => 'Latn', 'native' => 'Reo Māohi', 'regional' => ''],
+ // 'ksf' => ['name' => 'Bafia', 'script' => 'Latn', 'native' => 'rikpa', 'regional' => ''],
+ 'ro' => ['name' => 'Romanian', 'script' => 'Latn', 'native' => 'română', 'regional' => 'ro_RO'],
+ // 'cgg' => ['name' => 'Chiga', 'script' => 'Latn', 'native' => 'Rukiga', 'regional' => ''],
+ // 'rm' => ['name' => 'Romansh', 'script' => 'Latn', 'native' => 'rumantsch', 'regional' => ''],
+ // 'qu' => ['name' => 'Quechua', 'script' => 'Latn', 'native' => 'Runa Simi', 'regional' => ''],
+ // 'nyn' => ['name' => 'Nyankole', 'script' => 'Latn', 'native' => 'Runyankore', 'regional' => ''],
+ // 'ssy' => ['name' => 'Saho', 'script' => 'Latn', 'native' => 'Saho', 'regional' => ''],
+ // 'sc' => ['name' => 'Sardinian', 'script' => 'Latn', 'native' => 'sardu', 'regional' => 'sc_IT'],
+ // 'de-CH' => ['name' => 'Swiss High German', 'script' => 'Latn', 'native' => 'Schweizer Hochdeutsch', 'regional' => 'de_CH'],
+ // 'gsw' => ['name' => 'Swiss German', 'script' => 'Latn', 'native' => 'Schwiizertüütsch', 'regional' => ''],
+ // 'trv' => ['name' => 'Taroko', 'script' => 'Latn', 'native' => 'Seediq', 'regional' => ''],
+ // 'seh' => ['name' => 'Sena', 'script' => 'Latn', 'native' => 'sena', 'regional' => ''],
+ // 'nso' => ['name' => 'Northern Sotho', 'script' => 'Latn', 'native' => 'Sesotho sa Leboa', 'regional' => 'nso_ZA'],
+ // 'st' => ['name' => 'Southern Sotho', 'script' => 'Latn', 'native' => 'Sesotho', 'regional' => 'st_ZA'],
+ // 'tn' => ['name' => 'Tswana', 'script' => 'Latn', 'native' => 'Setswana', 'regional' => 'tn_ZA'],
+ // 'sq' => ['name' => 'Albanian', 'script' => 'Latn', 'native' => 'shqip', 'regional' => 'sq_AL'],
+ // 'sid' => ['name' => 'Sidamo', 'script' => 'Latn', 'native' => 'Sidaamu Afo', 'regional' => 'sid_ET'],
+ // 'ss' => ['name' => 'Swati', 'script' => 'Latn', 'native' => 'Siswati', 'regional' => 'ss_ZA'],
+ // 'sk' => ['name' => 'Slovak', 'script' => 'Latn', 'native' => 'slovenčina', 'regional' => 'sk_SK'],
+ // 'sl' => ['name' => 'Slovene', 'script' => 'Latn', 'native' => 'slovenščina', 'regional' => 'sl_SI'],
+ // 'so' => ['name' => 'Somali', 'script' => 'Latn', 'native' => 'Soomaali', 'regional' => 'so_SO'],
+ // 'sr-Latn' => ['name' => 'Serbian (Latin)', 'script' => 'Latn', 'native' => 'Srpski', 'regional' => 'sr_RS'],
+ // 'sh' => ['name' => 'Serbo-Croatian', 'script' => 'Latn', 'native' => 'srpskohrvatski', 'regional' => ''],
+ 'fi' => ['name' => 'Finnish', 'script' => 'Latn', 'native' => 'suomi', 'regional' => 'fi_FI'],
+ 'sv' => ['name' => 'Swedish', 'script' => 'Latn', 'native' => 'svenska', 'regional' => 'sv_SE'],
+ // 'sg' => ['name' => 'Sango', 'script' => 'Latn', 'native' => 'Sängö', 'regional' => ''],
+ // 'tl' => ['name' => 'Tagalog', 'script' => 'Latn', 'native' => 'Tagalog', 'regional' => 'tl_PH'],
+ // 'tzm-Latn' => ['name' => 'Central Atlas Tamazight (Latin)', 'script' => 'Latn', 'native' => 'Tamazight', 'regional' => ''],
+ // 'kab' => ['name' => 'Kabyle', 'script' => 'Latn', 'native' => 'Taqbaylit', 'regional' => 'kab_DZ'],
+ // 'twq' => ['name' => 'Tasawaq', 'script' => 'Latn', 'native' => 'Tasawaq senni', 'regional' => ''],
+ // 'shi' => ['name' => 'Tachelhit (Latin)', 'script' => 'Latn', 'native' => 'Tashelhit', 'regional' => ''],
+ // 'nus' => ['name' => 'Nuer', 'script' => 'Latn', 'native' => 'Thok Nath', 'regional' => ''],
+ // 'vi' => ['name' => 'Vietnamese', 'script' => 'Latn', 'native' => 'Tiếng Việt', 'regional' => 'vi_VN'],
+ // 'tg-Latn' => ['name' => 'Tajik (Latin)', 'script' => 'Latn', 'native' => 'tojikī', 'regional' => 'tg_TJ'],
+ // 'lu' => ['name' => 'Luba-Katanga', 'script' => 'Latn', 'native' => 'Tshiluba', 'regional' => 've_ZA'],
+ // 've' => ['name' => 'Venda', 'script' => 'Latn', 'native' => 'Tshivenḓa', 'regional' => ''],
+ // 'tw' => ['name' => 'Twi', 'script' => 'Latn', 'native' => 'Twi', 'regional' => ''],
+ // 'tr' => ['name' => 'Turkish', 'script' => 'Latn', 'native' => 'Türkçe', 'regional' => 'tr_TR'],
+ // 'ale' => ['name' => 'Aleut', 'script' => 'Latn', 'native' => 'Unangax tunuu', 'regional' => ''],
+ // 'ca-valencia' => ['name' => 'Valencian', 'script' => 'Latn', 'native' => 'valencià', 'regional' => ''],
+ // 'vai-Latn' => ['name' => 'Vai (Latin)', 'script' => 'Latn', 'native' => 'Viyamíĩ', 'regional' => ''],
+ // 'vo' => ['name' => 'Volapük', 'script' => 'Latn', 'native' => 'Volapük', 'regional' => ''],
+ // 'fj' => ['name' => 'Fijian', 'script' => 'Latn', 'native' => 'vosa Vakaviti', 'regional' => ''],
+ // 'wa' => ['name' => 'Walloon', 'script' => 'Latn', 'native' => 'Walon', 'regional' => 'wa_BE'],
+ // 'wae' => ['name' => 'Walser', 'script' => 'Latn', 'native' => 'Walser', 'regional' => 'wae_CH'],
+ // 'wen' => ['name' => 'Sorbian', 'script' => 'Latn', 'native' => 'Wendic', 'regional' => ''],
+ // 'wo' => ['name' => 'Wolof', 'script' => 'Latn', 'native' => 'Wolof', 'regional' => 'wo_SN'],
+ // 'ts' => ['name' => 'Tsonga', 'script' => 'Latn', 'native' => 'Xitsonga', 'regional' => 'ts_ZA'],
+ // 'dje' => ['name' => 'Zarma', 'script' => 'Latn', 'native' => 'Zarmaciine', 'regional' => ''],
+ // 'yo' => ['name' => 'Yoruba', 'script' => 'Latn', 'native' => 'Èdè Yorùbá', 'regional' => 'yo_NG'],
+ // 'de-AT' => ['name' => 'Austrian German', 'script' => 'Latn', 'native' => 'Österreichisches Deutsch', 'regional' => 'de_AT'],
+ // 'is' => ['name' => 'Icelandic', 'script' => 'Latn', 'native' => 'íslenska', 'regional' => 'is_IS'],
+ // 'cs' => ['name' => 'Czech', 'script' => 'Latn', 'native' => 'čeština', 'regional' => 'cs_CZ'],
+ // 'bas' => ['name' => 'Basa', 'script' => 'Latn', 'native' => 'Ɓàsàa', 'regional' => ''],
+ // 'mas' => ['name' => 'Masai', 'script' => 'Latn', 'native' => 'ɔl-Maa', 'regional' => ''],
+ // 'haw' => ['name' => 'Hawaiian', 'script' => 'Latn', 'native' => 'ʻŌlelo Hawaiʻi', 'regional' => ''],
+ 'el' => ['name' => 'Greek', 'script' => 'Grek', 'native' => 'Ελληνικά', 'regional' => 'el_GR'],
+ // 'uz' => ['name' => 'Uzbek (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Ўзбек', 'regional' => 'uz_UZ'],
+ // 'az-Cyrl' => ['name' => 'Azerbaijani (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Азәрбајҹан', 'regional' => 'uz_UZ'],
+ // 'ab' => ['name' => 'Abkhazian', 'script' => 'Cyrl', 'native' => 'Аҧсуа', 'regional' => ''],
+ // 'os' => ['name' => 'Ossetic', 'script' => 'Cyrl', 'native' => 'Ирон', 'regional' => 'os_RU'],
+ // 'ky' => ['name' => 'Kyrgyz', 'script' => 'Cyrl', 'native' => 'Кыргыз', 'regional' => 'ky_KG'],
+ // 'sr' => ['name' => 'Serbian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'Српски', 'regional' => 'sr_RS'],
+ // 'av' => ['name' => 'Avaric', 'script' => 'Cyrl', 'native' => 'авар мацӀ', 'regional' => ''],
+ // 'ady' => ['name' => 'Adyghe', 'script' => 'Cyrl', 'native' => 'адыгэбзэ', 'regional' => ''],
+ // 'ba' => ['name' => 'Bashkir', 'script' => 'Cyrl', 'native' => 'башҡорт теле', 'regional' => ''],
+ // 'be' => ['name' => 'Belarusian', 'script' => 'Cyrl', 'native' => 'беларуская', 'regional' => 'be_BY'],
+ 'bg' => ['name' => 'Bulgarian', 'script' => 'Cyrl', 'native' => 'български', 'regional' => 'bg_BG'],
+ // 'kv' => ['name' => 'Komi', 'script' => 'Cyrl', 'native' => 'коми кыв', 'regional' => ''],
+ // 'mk' => ['name' => 'Macedonian', 'script' => 'Cyrl', 'native' => 'македонски', 'regional' => 'mk_MK'],
+ // 'mn' => ['name' => 'Mongolian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'монгол', 'regional' => 'mn_MN'],
+ // 'ce' => ['name' => 'Chechen', 'script' => 'Cyrl', 'native' => 'нохчийн мотт', 'regional' => 'ce_RU'],
+ // 'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'],
+ // 'sah' => ['name' => 'Yakut', 'script' => 'Cyrl', 'native' => 'саха тыла', 'regional' => ''],
+ // 'tt' => ['name' => 'Tatar', 'script' => 'Cyrl', 'native' => 'татар теле', 'regional' => 'tt_RU'],
+ // 'tg' => ['name' => 'Tajik (Cyrillic)', 'script' => 'Cyrl', 'native' => 'тоҷикӣ', 'regional' => 'tg_TJ'],
+ // 'tk' => ['name' => 'Turkmen', 'script' => 'Cyrl', 'native' => 'түркменче', 'regional' => 'tk_TM'],
+ // 'uk' => ['name' => 'Ukrainian', 'script' => 'Cyrl', 'native' => 'українська', 'regional' => 'uk_UA'],
+ // 'cv' => ['name' => 'Chuvash', 'script' => 'Cyrl', 'native' => 'чӑваш чӗлхи', 'regional' => 'cv_RU'],
+ // 'cu' => ['name' => 'Church Slavic', 'script' => 'Cyrl', 'native' => 'ѩзыкъ словѣньскъ', 'regional' => ''],
+ // 'kk' => ['name' => 'Kazakh', 'script' => 'Cyrl', 'native' => 'қазақ тілі', 'regional' => 'kk_KZ'],
+ // 'hy' => ['name' => 'Armenian', 'script' => 'Armn', 'native' => 'Հայերէն', 'regional' => 'hy_AM'],
+ // 'yi' => ['name' => 'Yiddish', 'script' => 'Hebr', 'native' => 'ייִדיש', 'regional' => 'yi_US'],
+ // 'he' => ['name' => 'Hebrew', 'script' => 'Hebr', 'native' => 'עברית', 'regional' => 'he_IL'],
+ // 'ug' => ['name' => 'Uyghur', 'script' => 'Arab', 'native' => 'ئۇيغۇرچە', 'regional' => 'ug_CN'],
+ // 'ur' => ['name' => 'Urdu', 'script' => 'Arab', 'native' => 'اردو', 'regional' => 'ur_PK'],
+ 'ar' => ['name' => 'Arabic', 'script' => 'Arab', 'native' => 'العربية', 'regional' => 'ar_AE'],
+ // 'uz-Arab' => ['name' => 'Uzbek (Arabic)', 'script' => 'Arab', 'native' => 'اۉزبېک', 'regional' => ''],
+ // 'tg-Arab' => ['name' => 'Tajik (Arabic)', 'script' => 'Arab', 'native' => 'تاجیکی', 'regional' => 'tg_TJ'],
+ // 'sd' => ['name' => 'Sindhi', 'script' => 'Arab', 'native' => 'سنڌي', 'regional' => 'sd_IN'],
+ // 'fa' => ['name' => 'Persian', 'script' => 'Arab', 'native' => 'فارسی', 'regional' => 'fa_IR'],
+ // 'pa-Arab' => ['name' => 'Punjabi (Arabic)', 'script' => 'Arab', 'native' => 'پنجاب', 'regional' => 'pa_IN'],
+ // 'ps' => ['name' => 'Pashto', 'script' => 'Arab', 'native' => 'پښتو', 'regional' => 'ps_AF'],
+ // 'ks' => ['name' => 'Kashmiri (Arabic)', 'script' => 'Arab', 'native' => 'کأشُر', 'regional' => 'ks_IN'],
+ // 'ku' => ['name' => 'Kurdish', 'script' => 'Arab', 'native' => 'کوردی', 'regional' => 'ku_TR'],
+ // 'dv' => ['name' => 'Divehi', 'script' => 'Thaa', 'native' => 'ދިވެހިބަސް', 'regional' => 'dv_MV'],
+ // 'ks-Deva' => ['name' => 'Kashmiri (Devaganari)', 'script' => 'Deva', 'native' => 'कॉशुर', 'regional' => 'ks_IN'],
+ // 'kok' => ['name' => 'Konkani', 'script' => 'Deva', 'native' => 'कोंकणी', 'regional' => 'kok_IN'],
+ // 'doi' => ['name' => 'Dogri', 'script' => 'Deva', 'native' => 'डोगरी', 'regional' => 'doi_IN'],
+ // 'ne' => ['name' => 'Nepali', 'script' => 'Deva', 'native' => 'नेपाली', 'regional' => ''],
+ // 'pra' => ['name' => 'Prakrit', 'script' => 'Deva', 'native' => 'प्राकृत', 'regional' => ''],
+ // 'brx' => ['name' => 'Bodo', 'script' => 'Deva', 'native' => 'बड़ो', 'regional' => 'brx_IN'],
+ // 'bra' => ['name' => 'Braj', 'script' => 'Deva', 'native' => 'ब्रज भाषा', 'regional' => ''],
+ // 'mr' => ['name' => 'Marathi', 'script' => 'Deva', 'native' => 'मराठी', 'regional' => 'mr_IN'],
+ // 'mai' => ['name' => 'Maithili', 'script' => 'Tirh', 'native' => 'मैथिली', 'regional' => 'mai_IN'],
+ // 'raj' => ['name' => 'Rajasthani', 'script' => 'Deva', 'native' => 'राजस्थानी', 'regional' => ''],
+ // 'sa' => ['name' => 'Sanskrit', 'script' => 'Deva', 'native' => 'संस्कृतम्', 'regional' => 'sa_IN'],
+ // 'hi' => ['name' => 'Hindi', 'script' => 'Deva', 'native' => 'हिन्दी', 'regional' => 'hi_IN'],
+ // 'as' => ['name' => 'Assamese', 'script' => 'Beng', 'native' => 'অসমীয়া', 'regional' => 'as_IN'],
+ // 'bn' => ['name' => 'Bengali', 'script' => 'Beng', 'native' => 'বাংলা', 'regional' => 'bn_BD'],
+ // 'mni' => ['name' => 'Manipuri', 'script' => 'Beng', 'native' => 'মৈতৈ', 'regional' => 'mni_IN'],
+ // 'pa' => ['name' => 'Punjabi (Gurmukhi)', 'script' => 'Guru', 'native' => 'ਪੰਜਾਬੀ', 'regional' => 'pa_IN'],
+ // 'gu' => ['name' => 'Gujarati', 'script' => 'Gujr', 'native' => 'ગુજરાતી', 'regional' => 'gu_IN'],
+ // 'or' => ['name' => 'Oriya', 'script' => 'Orya', 'native' => 'ଓଡ଼ିଆ', 'regional' => 'or_IN'],
+ // 'ta' => ['name' => 'Tamil', 'script' => 'Taml', 'native' => 'தமிழ்', 'regional' => 'ta_IN'],
+ // 'te' => ['name' => 'Telugu', 'script' => 'Telu', 'native' => 'తెలుగు', 'regional' => 'te_IN'],
+ // 'kn' => ['name' => 'Kannada', 'script' => 'Knda', 'native' => 'ಕನ್ನಡ', 'regional' => 'kn_IN'],
+ // 'ml' => ['name' => 'Malayalam', 'script' => 'Mlym', 'native' => 'മലയാളം', 'regional' => 'ml_IN'],
+ // 'si' => ['name' => 'Sinhala', 'script' => 'Sinh', 'native' => 'සිංහල', 'regional' => 'si_LK'],
+ // 'th' => ['name' => 'Thai', 'script' => 'Thai', 'native' => 'ไทย', 'regional' => 'th_TH'],
+ // 'lo' => ['name' => 'Lao', 'script' => 'Laoo', 'native' => 'ລາວ', 'regional' => 'lo_LA'],
+ // 'bo' => ['name' => 'Tibetan', 'script' => 'Tibt', 'native' => 'པོད་སྐད་', 'regional' => 'bo_IN'],
+ // 'dz' => ['name' => 'Dzongkha', 'script' => 'Tibt', 'native' => 'རྫོང་ཁ', 'regional' => 'dz_BT'],
+ // 'my' => ['name' => 'Burmese', 'script' => 'Mymr', 'native' => 'မြန်မာဘာသာ', 'regional' => 'my_MM'],
+ // 'ka' => ['name' => 'Georgian', 'script' => 'Geor', 'native' => 'ქართული', 'regional' => 'ka_GE'],
+ // 'byn' => ['name' => 'Blin', 'script' => 'Ethi', 'native' => 'ብሊን', 'regional' => 'byn_ER'],
+ // 'tig' => ['name' => 'Tigre', 'script' => 'Ethi', 'native' => 'ትግረ', 'regional' => 'tig_ER'],
+ // 'ti' => ['name' => 'Tigrinya', 'script' => 'Ethi', 'native' => 'ትግርኛ', 'regional' => 'ti_ET'],
+ // 'am' => ['name' => 'Amharic', 'script' => 'Ethi', 'native' => 'አማርኛ', 'regional' => 'am_ET'],
+ // 'wal' => ['name' => 'Wolaytta', 'script' => 'Ethi', 'native' => 'ወላይታቱ', 'regional' => 'wal_ET'],
+ // 'chr' => ['name' => 'Cherokee', 'script' => 'Cher', 'native' => 'ᏣᎳᎩ', 'regional' => ''],
+ // 'iu' => ['name' => 'Inuktitut (Canadian Aboriginal Syllabics)', 'script' => 'Cans', 'native' => 'ᐃᓄᒃᑎᑐᑦ', 'regional' => 'iu_CA'],
+ // 'oj' => ['name' => 'Ojibwa', 'script' => 'Cans', 'native' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'regional' => ''],
+ // 'cr' => ['name' => 'Cree', 'script' => 'Cans', 'native' => 'ᓀᐦᐃᔭᐍᐏᐣ', 'regional' => ''],
+ // 'km' => ['name' => 'Khmer', 'script' => 'Khmr', 'native' => 'ភាសាខ្មែរ', 'regional' => 'km_KH'],
+ // 'mn-Mong' => ['name' => 'Mongolian (Mongolian)', 'script' => 'Mong', 'native' => 'ᠮᠣᠨᠭᠭᠣᠯ ᠬᠡᠯᠡ', 'regional' => 'mn_MN'],
+ // 'shi-Tfng' => ['name' => 'Tachelhit (Tifinagh)', 'script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
+ // 'tzm' => ['name' => 'Central Atlas Tamazight (Tifinagh)','script' => 'Tfng', 'native' => 'ⵜⴰⵎⴰⵣⵉⵖⵜ', 'regional' => ''],
+ // 'yue' => ['name' => 'Yue', 'script' => 'Hant', 'native' => '廣州話', 'regional' => 'yue_HK'],
+ // 'ja' => ['name' => 'Japanese', 'script' => 'Jpan', 'native' => '日本語', 'regional' => 'ja_JP'],
+ // 'zh' => ['name' => 'Chinese (Simplified)', 'script' => 'Hans', 'native' => '简体中文', 'regional' => 'zh_CN'],
+ // 'zh-Hant' => ['name' => 'Chinese (Traditional)', 'script' => 'Hant', 'native' => '繁體中文', 'regional' => 'zh_CN'],
+ // 'ii' => ['name' => 'Sichuan Yi', 'script' => 'Yiii', 'native' => 'ꆈꌠꉙ', 'regional' => ''],
+ // 'vai' => ['name' => 'Vai (Vai)', 'script' => 'Vaii', 'native' => 'ꕙꔤ', 'regional' => ''],
+ // 'jv-Java' => ['name' => 'Javanese (Javanese)', 'script' => 'Java', 'native' => 'ꦧꦱꦗꦮ', 'regional' => ''],
+ // 'ko' => ['name' => 'Korean', 'script' => 'Hang', 'native' => '한국어', 'regional' => 'ko_KR'],
],
// Negotiate for the user locale using the Accept-Language header if it's not defined in the URL?
@@ -309,9 +309,9 @@
//
'hideDefaultLocaleInURL' => false,
- // If you want to display the locales in particular order in the language selector you should write the order here.
- //CAUTION: Please consider using the appropriate locale code otherwise it will not work
- //Example: 'localesOrder' => ['es','en'],
- //'localesOrder' => ['nl','en','de','da','fr'],
+ // If you want to display the locales in particular order in the language selector you should write the order here.
+ // CAUTION: Please consider using the appropriate locale code otherwise it will not work
+ // Example: 'localesOrder' => ['es','en'],
+ // 'localesOrder' => ['nl','en','de','da','fr'],
];
diff --git a/config/logging.php b/config/logging.php
index fc80b0a6..691eb56c 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -36,7 +36,7 @@
'channels' => [
'stack' => [
'driver' => 'stack',
- 'channels' => ['daily','slack'],
+ 'channels' => ['daily', 'slack'],
'ignore_exceptions' => false,
],
@@ -91,4 +91,4 @@
],
],
-];
\ No newline at end of file
+];
diff --git a/config/mail.php b/config/mail.php
index f3da3dea..f4006459 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -133,4 +133,4 @@
'log_channel' => env('MAIL_LOG_CHANNEL'),
-];
\ No newline at end of file
+];
diff --git a/config/queue.php b/config/queue.php
index e1af9967..1765e11c 100644
--- a/config/queue.php
+++ b/config/queue.php
@@ -83,4 +83,4 @@
'table' => 'failed_jobs',
],
-];
\ No newline at end of file
+];
diff --git a/config/scribe.php b/config/scribe.php
index f89ae358..62f51ae1 100644
--- a/config/scribe.php
+++ b/config/scribe.php
@@ -62,7 +62,7 @@
* The route can be referenced by name or path here. Wildcards are supported.
*/
'exclude' => [
- 'api/user', 'api/register', 'api/user/*', 'api/email/*', 'api/password/*', 'api/weather', 'api/queens', 'api/queens/*', 'api/settings'
+ 'api/user', 'api/register', 'api/user/*', 'api/email/*', 'api/password/*', 'api/weather', 'api/queens', 'api/queens/*', 'api/settings',
],
/*
@@ -254,7 +254,7 @@
/*
* Text to place in the "Introduction" section, right after the `description`. Markdown and HTML are supported.
*/
- 'intro_text' => << <<<'INTRO'
This documentation aims to provide all the information you need to work with our API.
As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
@@ -387,5 +387,5 @@
* Tell Scribe which connections should be transacted here.
* If you only use one db connection, you can leave this as is.
*/
- 'database_connections_to_transact' => [config('database.default')]
+ 'database_connections_to_transact' => [config('database.default')],
];
diff --git a/config/webapp.php b/config/webapp.php
index 8aa2514f..c5947ef9 100644
--- a/config/webapp.php
+++ b/config/webapp.php
@@ -2,8 +2,8 @@
return [
- 'url' => env('WEBAPP_URL', 'https://app.beep.nl/'),
- 'email_verify_url' => env('WEBAPP_EMAIL_VERIFY_URL', 'login'),
+ 'url' => env('WEBAPP_URL', 'https://app.beep.nl/'),
+ 'email_verify_url' => env('WEBAPP_EMAIL_VERIFY_URL', 'login'),
'password_reset_url' => env('WEBAPP_PASSWORD_RESET_URL', 'password-reset'),
-
-];
\ No newline at end of file
+
+];
diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php
index 63c43f7c..d3000757 100644
--- a/database/factories/ModelFactory.php
+++ b/database/factories/ModelFactory.php
@@ -27,26 +27,26 @@
$factory->define(App\Location::class, function (Faker\Generator $faker) {
return [
- 'user_id' => 1,
- 'continent_id' => 4, // eu
- 'category_id' => 36, // fixed
- 'name' => $faker->name,
- 'coordinate_lat' => $faker->latitude,
- 'coordinate_lon' => $faker->longitude,
- 'street' => $faker->streetName,
- 'street_no' => $faker->numberBetween($min=1, $max=99),
- 'postal_code' => $faker->postcode,
- 'country_code' => $faker->country,
+ 'user_id' => 1,
+ 'continent_id' => 4, // eu
+ 'category_id' => 36, // fixed
+ 'name' => $faker->name,
+ 'coordinate_lat' => $faker->latitude,
+ 'coordinate_lon' => $faker->longitude,
+ 'street' => $faker->streetName,
+ 'street_no' => $faker->numberBetween($min = 1, $max = 99),
+ 'postal_code' => $faker->postcode,
+ 'country_code' => $faker->country,
];
});
$factory->define(App\Hive::class, function (Faker\Generator $faker) {
return [
- 'user_id' => 1,
- 'location_id' => 1,
- 'hive_type_id' => 1,
- 'color' => $faker->hexcolor,
+ 'user_id' => 1,
+ 'location_id' => 1,
+ 'hive_type_id' => 1,
+ 'color' => $faker->hexcolor,
'name' => $faker->name,
];
});
@@ -54,10 +54,10 @@
$factory->define(App\HiveLayer::class, function (Faker\Generator $faker) {
return [
- 'hive_id' => 1,
- 'category_id' => 26,
- 'order' => $faker->numberBetween($min=1, $max=99),
- 'color' => $faker->hexcolor,
+ 'hive_id' => 1,
+ 'category_id' => 26,
+ 'order' => $faker->numberBetween($min = 1, $max = 99),
+ 'color' => $faker->hexcolor,
];
});
@@ -76,9 +76,9 @@
$factory->define(App\HiveLayerFrame::class, function (Faker\Generator $faker) {
return [
- 'layer_id' => 1,
+ 'layer_id' => 1,
'category_id' => 29, // wax
- 'order' => $faker->numberBetween($min=1, $max=99),
- 'present' => true,
+ 'order' => $faker->numberBetween($min = 1, $max = 99),
+ 'present' => true,
];
-});
\ No newline at end of file
+});
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index bbc7729a..d5560e46 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -1,8 +1,8 @@
increments('id')->index();
$table->integer('parent_id')->unsigned()->nullable();
$table->foreign('parent_id')->references('id')->on('categories')->onUpdate('cascade')->onDelete('cascade');
diff --git a/database/migrations/2016_04_14_174603_create-location-table.php b/database/migrations/2016_04_14_174603_create-location-table.php
index 6c23ecce..44cbc6bc 100644
--- a/database/migrations/2016_04_14_174603_create-location-table.php
+++ b/database/migrations/2016_04_14_174603_create-location-table.php
@@ -1,8 +1,8 @@
increments('id')->index();
$table->text('name')->nullable();
$table->char('abbr', 2)->nullable();
});
- Schema::create('locations', function (Blueprint $table)
- {
+ Schema::create('locations', function (Blueprint $table) {
$table->increments('id')->index();
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
@@ -49,8 +47,7 @@ public function up()
*/
public function down()
{
- Schema::table('locations', function(Blueprint $table)
- {
+ Schema::table('locations', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['continent_id']);
$table->dropForeign(['category_id']);
diff --git a/database/migrations/2016_12_20_121758_create_settings.php b/database/migrations/2016_12_20_121758_create_settings.php
index 6f62b5de..fac90160 100644
--- a/database/migrations/2016_12_20_121758_create_settings.php
+++ b/database/migrations/2016_12_20_121758_create_settings.php
@@ -1,8 +1,8 @@
integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
$table->integer('category_id')->unsigned();
- //$table->foreign('category_id')->references('id')->on('categories')->onUpdate('cascade');
+ // $table->foreign('category_id')->references('id')->on('categories')->onUpdate('cascade');
$table->string('name')->nullable();
$table->string('value')->nullable();
$table->integer('number')->nullable();
@@ -36,10 +36,9 @@ public function up()
*/
public function down()
{
- Schema::table('settings', function(Blueprint $table)
- {
+ Schema::table('settings', function (Blueprint $table) {
$table->dropForeign(['user_id']);
- //$table->dropForeignIfExists(['category_id']);
+ // $table->dropForeignIfExists(['category_id']);
});
Schema::dropIfExists('settings');
diff --git a/database/migrations/2016_12_20_121819_create-hive-table.php b/database/migrations/2016_12_20_121819_create-hive-table.php
index c420e7e1..8371204c 100644
--- a/database/migrations/2016_12_20_121819_create-hive-table.php
+++ b/database/migrations/2016_12_20_121819_create-hive-table.php
@@ -1,8 +1,8 @@
dropForeign(['layer_id']);
});
- Schema::table('hive_layers', function(Blueprint $table)
- {
+ Schema::table('hive_layers', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
$table->dropForeign(['category_id']);
});
- Schema::table('hives', function(Blueprint $table)
- {
+ Schema::table('hives', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['location_id']);
$table->dropForeign(['hive_type_id']);
diff --git a/database/migrations/2016_12_21_174159_create-sensor-table.php b/database/migrations/2016_12_21_174159_create-sensor-table.php
index f9e7e9ff..e40bd6cd 100644
--- a/database/migrations/2016_12_21_174159_create-sensor-table.php
+++ b/database/migrations/2016_12_21_174159_create-sensor-table.php
@@ -1,8 +1,8 @@
dropForeign(['user_id']);
$table->dropForeign(['hive_id']);
$table->dropForeign(['category_id']);
});
-
+
Schema::dropIfExists('sensor_user');
Schema::dropIfExists('sensors');
}
diff --git a/database/migrations/2017_03_21_114148_create_groups_table.php b/database/migrations/2017_03_21_114148_create_groups_table.php
index c7b8286a..42efdf3e 100644
--- a/database/migrations/2017_03_21_114148_create_groups_table.php
+++ b/database/migrations/2017_03_21_114148_create_groups_table.php
@@ -1,8 +1,8 @@
timestamps();
$table->softDeletes();
});
-
+
Schema::create('queens', function (Blueprint $table) {
$table->increments('id')->index();
$table->integer('hive_id')->unsigned();
@@ -30,7 +30,7 @@ public function up()
$table->integer('race_id')->unsigned();
$table->foreign('race_id')->references('id')->on('bee_races')->onUpdate('cascade');
$table->string('name')->nullable();
- $table->tinyInteger('quality')->nullable();
+ $table->tinyInteger('quality')->nullable();
$table->boolean('fertilized')->defalut(false);
$table->boolean('clipped')->defalut(false);
$table->string('fertilizing_location')->nullable();
@@ -53,7 +53,7 @@ public function up()
*/
public function down()
{
- Schema::table('queens', function(Blueprint $table){
+ Schema::table('queens', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
$table->dropForeign(['race_id']);
});
diff --git a/database/migrations/2017_04_14_175022_create-production-table.php b/database/migrations/2017_04_14_175022_create-production-table.php
index e71e10cf..ffc60ba5 100644
--- a/database/migrations/2017_04_14_175022_create-production-table.php
+++ b/database/migrations/2017_04_14_175022_create-production-table.php
@@ -1,8 +1,8 @@
tinyInteger('brood_perc_queen')->nullable();
$table->tinyInteger('brood_perc_drone')->nullable();
$table->tinyInteger('brood_perc_worker')->nullable();
- $table->tinyInteger('pattern_score')->nullable();
+ $table->tinyInteger('pattern_score')->nullable();
$table->timestamp('created_at')->useCurrent();
$table->softDeletes();
});
@@ -47,8 +47,7 @@ public function up()
*/
public function down()
{
- Schema::table('productions', function(Blueprint $table)
- {
+ Schema::table('productions', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
$table->dropForeign(['frame_id']);
$table->dropForeign(['category_id']);
diff --git a/database/migrations/2017_07_17_095406_add_users_last_login.php b/database/migrations/2017_07_17_095406_add_users_last_login.php
index 75c8d8d5..0bd54842 100644
--- a/database/migrations/2017_07_17_095406_add_users_last_login.php
+++ b/database/migrations/2017_07_17_095406_add_users_last_login.php
@@ -1,8 +1,8 @@
timestamp('last_login')->nullable();
});
}
@@ -26,8 +25,7 @@ public function up()
*/
public function down()
{
- Schema::table('users', function (Blueprint $table)
- {
+ Schema::table('users', function (Blueprint $table) {
$table->dropColumn('last_login');
});
}
diff --git a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
index b11ec4d2..66952f92 100644
--- a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
+++ b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
@@ -1,8 +1,8 @@
unsignedInteger(NestedSet::LFT)->default(0);
$table->unsignedInteger(NestedSet::RGT)->default(0);
$table->index(NestedSet::getDefaultColumns()); // assuming parent_id is already there
@@ -32,8 +30,7 @@ public function up()
*/
public function down()
{
- Schema::table('categories', function (Blueprint $table)
- {
+ Schema::table('categories', function (Blueprint $table) {
$table->dropForeign(['parent_id']);
NestedSet::dropColumns($table);
});
diff --git a/database/migrations/2018_01_31_174432_create_category_input.php b/database/migrations/2018_01_31_174432_create_category_input.php
index 19e7dfca..1b83f6e8 100644
--- a/database/migrations/2018_01_31_174432_create_category_input.php
+++ b/database/migrations/2018_01_31_174432_create_category_input.php
@@ -1,8 +1,8 @@
increments('id')->index();
$table->string('name')->index();
$table->string('type');
@@ -27,10 +25,8 @@ public function up()
});
}
- if (!Schema::hasTable('physical_quantities'))
- {
- Schema::create('physical_quantities', function (Blueprint $table)
- {
+ if (! Schema::hasTable('physical_quantities')) {
+ Schema::create('physical_quantities', function (Blueprint $table) {
$table->increments('id')->index();
$table->string('name')->index();
$table->string('unit');
@@ -38,10 +34,8 @@ public function up()
});
}
- if (!Schema::hasTable('languages'))
- {
- Schema::create('languages', function (Blueprint $table)
- {
+ if (! Schema::hasTable('languages')) {
+ Schema::create('languages', function (Blueprint $table) {
$table->increments('id')->index();
$table->string('abbreviation')->index();
$table->string('name')->index();
@@ -51,10 +45,8 @@ public function up()
});
}
- if (!Schema::hasTable('translations'))
- {
- Schema::create('translations', function (Blueprint $table)
- {
+ if (! Schema::hasTable('translations')) {
+ Schema::create('translations', function (Blueprint $table) {
$table->increments('id')->index();
$table->string('name')->index();
$table->string('type')->nullable();
@@ -64,10 +56,8 @@ public function up()
});
}
- Schema::table('categories', function (Blueprint $table)
- {
- if (Schema::hasColumn('categories','icon') == false)
- {
+ Schema::table('categories', function (Blueprint $table) {
+ if (Schema::hasColumn('categories', 'icon') == false) {
$table->string('icon')->nullable();
$table->text('source')->nullable();
$table->text('description')->nullable();
@@ -77,7 +67,6 @@ public function up()
$table->integer('physical_quantity_id')->unsigned()->nullable();
$table->foreign('physical_quantity_id')->references('id')->on('physical_quantities')->onUpdate('cascade');
-
}
});
}
@@ -89,8 +78,7 @@ public function up()
*/
public function down()
{
- Schema::table('categories', function (Blueprint $table)
- {
+ Schema::table('categories', function (Blueprint $table) {
$table->dropForeign(['category_input_id']);
$table->dropForeign(['physical_quantity_id']);
@@ -102,8 +90,7 @@ public function down()
$table->dropColumn('icon');
});
- Schema::table('translations', function(Blueprint $table)
- {
+ Schema::table('translations', function (Blueprint $table) {
$table->dropForeign(['language_id']);
});
diff --git a/database/migrations/2018_02_20_161831_add_category_old_id.php b/database/migrations/2018_02_20_161831_add_category_old_id.php
index 5b8c1df3..82705ef1 100644
--- a/database/migrations/2018_02_20_161831_add_category_old_id.php
+++ b/database/migrations/2018_02_20_161831_add_category_old_id.php
@@ -1,8 +1,8 @@
string('old_id', 30)->nullable();
+ }
});
}
@@ -28,8 +28,7 @@ public function up()
*/
public function down()
{
- Schema::table('categories', function (Blueprint $table)
- {
+ Schema::table('categories', function (Blueprint $table) {
$table->dropColumn('old_id');
});
}
diff --git a/database/migrations/2018_03_12_223732_create-checklists-table.php b/database/migrations/2018_03_12_223732_create-checklists-table.php
index aff836c5..079a053d 100644
--- a/database/migrations/2018_03_12_223732_create-checklists-table.php
+++ b/database/migrations/2018_03_12_223732_create-checklists-table.php
@@ -1,8 +1,8 @@
increments('id')->index();
$table->string('type')->nullable();
@@ -26,8 +25,7 @@ public function up()
}
// Create table for associating checklists to category items (Many-to-Many)
- if (!Schema::hasTable('checklist_category'))
- {
+ if (! Schema::hasTable('checklist_category')) {
Schema::create('checklist_category', function (Blueprint $table) {
$table->integer('category_id')->unsigned();
$table->integer('checklist_id')->unsigned();
@@ -42,8 +40,7 @@ public function up()
}
// Create table for associating checklists to hives (Many-to-Many)
- if (!Schema::hasTable('checklist_hive'))
- {
+ if (! Schema::hasTable('checklist_hive')) {
Schema::create('checklist_hive', function (Blueprint $table) {
$table->integer('hive_id')->unsigned();
$table->integer('checklist_id')->unsigned();
@@ -58,8 +55,7 @@ public function up()
}
// Create table for associating checklists to users (Many-to-Many)
- if (!Schema::hasTable('checklist_user'))
- {
+ if (! Schema::hasTable('checklist_user')) {
Schema::create('checklist_user', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('checklist_id')->unsigned();
@@ -81,25 +77,19 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('checklist_user'))
- {
- Schema::table('checklist_user', function(Blueprint $table)
- {
- $table->dropForeign(['checklist_id','user_id']);
+ if (Schema::hasTable('checklist_user')) {
+ Schema::table('checklist_user', function (Blueprint $table) {
+ $table->dropForeign(['checklist_id', 'user_id']);
});
}
- if (Schema::hasTable('checklist_hive'))
- {
- Schema::table('checklist_hive', function(Blueprint $table)
- {
- $table->dropForeign(['checklist_id','hive_id']);
+ if (Schema::hasTable('checklist_hive')) {
+ Schema::table('checklist_hive', function (Blueprint $table) {
+ $table->dropForeign(['checklist_id', 'hive_id']);
});
}
- if (Schema::hasTable('checklist_category'))
- {
- Schema::table('checklist_category', function(Blueprint $table)
- {
- $table->dropForeign(['checklist_id','category_id']);
+ if (Schema::hasTable('checklist_category')) {
+ Schema::table('checklist_category', function (Blueprint $table) {
+ $table->dropForeign(['checklist_id', 'category_id']);
});
}
diff --git a/database/migrations/2018_04_03_110731_create_inspections_table.php b/database/migrations/2018_04_03_110731_create_inspections_table.php
index 6655935e..eb62821d 100644
--- a/database/migrations/2018_04_03_110731_create_inspections_table.php
+++ b/database/migrations/2018_04_03_110731_create_inspections_table.php
@@ -12,10 +12,8 @@ class CreateInspectionsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('inspections'))
- {
- Schema::create('inspections', function (Blueprint $table)
- {
+ if (! Schema::hasTable('inspections')) {
+ Schema::create('inspections', function (Blueprint $table) {
$table->increments('id')->index();
$table->text('notes', 300)->nullable();
$table->text('reminder', 100)->nullable();
@@ -28,8 +26,7 @@ public function up()
}
// Create table for associating inspections to hives (Many-to-Many)
- if (!Schema::hasTable('inspection_hive'))
- {
+ if (! Schema::hasTable('inspection_hive')) {
Schema::create('inspection_hive', function (Blueprint $table) {
$table->integer('hive_id')->unsigned();
$table->integer('inspection_id')->unsigned();
@@ -44,8 +41,7 @@ public function up()
}
// Create table for associating inspections to location (Many-to-Many)
- if (!Schema::hasTable('inspection_location'))
- {
+ if (! Schema::hasTable('inspection_location')) {
Schema::create('inspection_location', function (Blueprint $table) {
$table->integer('location_id')->unsigned();
$table->integer('inspection_id')->unsigned();
@@ -60,8 +56,7 @@ public function up()
}
// Create table for associating inspections to users (Many-to-Many)
- if (!Schema::hasTable('inspection_user'))
- {
+ if (! Schema::hasTable('inspection_user')) {
Schema::create('inspection_user', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('inspection_id')->unsigned();
@@ -83,28 +78,22 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('inspection_user'))
- {
- Schema::table('inspection_user', function(Blueprint $table)
- {
+ if (Schema::hasTable('inspection_user')) {
+ Schema::table('inspection_user', function (Blueprint $table) {
$table->dropForeign(['inspection_id']);
$table->dropForeign(['user_id']);
});
}
- if (Schema::hasTable('inspection_location'))
- {
- Schema::table('inspection_location', function(Blueprint $table)
- {
+ if (Schema::hasTable('inspection_location')) {
+ Schema::table('inspection_location', function (Blueprint $table) {
$table->dropForeign(['inspection_id']);
$table->dropForeign(['location_id']);
});
}
- if (Schema::hasTable('inspection_hive'))
- {
- Schema::table('inspection_hive', function(Blueprint $table)
- {
+ if (Schema::hasTable('inspection_hive')) {
+ Schema::table('inspection_hive', function (Blueprint $table) {
$table->dropForeign(['inspection_id']);
$table->dropForeign(['hive_id']);
});
diff --git a/database/migrations/2018_04_03_112937_create_inspection_items_table.php b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
index c2278cf8..45c866ea 100644
--- a/database/migrations/2018_04_03_112937_create_inspection_items_table.php
+++ b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
@@ -12,10 +12,8 @@ class CreateInspectionItemsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('inspection_items'))
- {
- Schema::create('inspection_items', function (Blueprint $table)
- {
+ if (! Schema::hasTable('inspection_items')) {
+ Schema::create('inspection_items', function (Blueprint $table) {
$table->increments('id');
$table->string('value')->nullable();
$table->integer('inspection_id')->unsigned();
@@ -34,10 +32,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('inspection_items'))
- {
- Schema::table('inspection_items', function(Blueprint $table)
- {
+ if (Schema::hasTable('inspection_items')) {
+ Schema::table('inspection_items', function (Blueprint $table) {
$table->dropForeign(['inspection_id']);
$table->dropForeign(['category_id']);
});
diff --git a/database/migrations/2018_04_03_115056_add_checklist_category_order.php b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
index b0411657..73b07825 100644
--- a/database/migrations/2018_04_03_115056_add_checklist_category_order.php
+++ b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
@@ -1,8 +1,8 @@
integer('order')->unsigned()->nullable();
+ }
});
}
@@ -31,10 +30,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('checklist_category'))
- {
- Schema::table('checklist_category', function (Blueprint $table)
- {
+ if (Schema::hasTable('checklist_category')) {
+ Schema::table('checklist_category', function (Blueprint $table) {
$table->dropColumn('order');
});
}
diff --git a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
index 59c6d20f..57860dac 100644
--- a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
+++ b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
@@ -1,8 +1,8 @@
index('type');
+ }
});
}
@@ -31,12 +30,11 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('categories'))
- {
- Schema::table('categories', function (Blueprint $table)
- {
- if (Schema::hasColumn('categories','type'))
+ if (Schema::hasTable('categories')) {
+ Schema::table('categories', function (Blueprint $table) {
+ if (Schema::hasColumn('categories', 'type')) {
$table->dropIndex('categories_type_index');
+ }
});
}
}
diff --git a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
index 638c89ab..96dfecaa 100644
--- a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
+++ b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
@@ -1,8 +1,7 @@
string('twochar', 2)->nullable();
+ }
});
$languages = Language::all();
- foreach ($languages as $l)
- {
- if ($l->twochar == null)
- {
+ foreach ($languages as $l) {
+ if ($l->twochar == null) {
$l->twochar = substr($l->abbreviation, 0, 2);
$l->save();
}
@@ -39,8 +36,9 @@ public function up()
public function down()
{
Schema::table('languages', function ($table) {
- if (Schema::hasColumn('languages','twochar'))
+ if (Schema::hasColumn('languages', 'twochar')) {
$table->dropColumn('twochar');
+ }
});
}
}
diff --git a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
index bdf7195e..3c48b139 100644
--- a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
+++ b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
@@ -1,12 +1,12 @@
checklistFactory = new ChecklistFactory;
$this->debug = false;
}
-
public function up()
{
- if (Schema::hasTable('categories'))
- {
- echo("ConvertInspectionsToTaxonomy disableForeignKeyConstraints...\r\n");
+ if (Schema::hasTable('categories')) {
+ echo "ConvertInspectionsToTaxonomy disableForeignKeyConstraints...\r\n";
Schema::disableForeignKeyConstraints();
- if (Schema::hasTable('inspections') == false || Inspection::all()->count() == 0)
- {
+ if (Schema::hasTable('inspections') == false || Inspection::all()->count() == 0) {
$sql = Storage::get('new_taxonomy_tables.sql');
- if ($sql)
- {
+ if ($sql) {
// Replace tables
- echo("ConvertInspectionsToTaxonomy replacing new db-tables with test.beep db tables...\r\n");
- echo(DB::unprepared($sql)."\r\n");
- }
- else
- {
- echo("ConvertInspectionsToTaxonomy - ERROR - No SQL found, NOT replaced new db-tables\r\n");
+ echo "ConvertInspectionsToTaxonomy replacing new db-tables with test.beep db tables...\r\n";
+ echo DB::unprepared($sql)."\r\n";
+ } else {
+ echo "ConvertInspectionsToTaxonomy - ERROR - No SQL found, NOT replaced new db-tables\r\n";
}
- }
- else
- {
- echo("ConvertInspectionsToTaxonomy already replaced db tables...\r\n");
+ } else {
+ echo "ConvertInspectionsToTaxonomy already replaced db tables...\r\n";
}
// add missing roles and permissions
Role::updateRoles();
// do the magic
- if (Schema::hasTable('actions') && Schema::hasTable('conditions'))
- {
+ if (Schema::hasTable('actions') && Schema::hasTable('conditions')) {
// Convert old category_ids
- echo("ConvertInspectionsToTaxonomy converting user data...\r\n");
-
- if ($this->debug)
- {
- $users = User::where('id','<=', 2)->get(); //User::all();
- }
- else
- {
- $users = User::all();
+ echo "ConvertInspectionsToTaxonomy converting user data...\r\n";
+
+ if ($this->debug) {
+ $users = User::where('id', '<=', 2)->get(); // User::all();
+ } else {
+ $users = User::all();
}
$this->checklistFactory->convertUsersChecklists($users, $this->debug);
-
- if($this->debug == false)
- {
+
+ if ($this->debug == false) {
Schema::dropIfExists('actions');
Schema::dropIfExists('conditions');
}
- }
- else
- {
- echo("ConvertInspectionsToTaxonomy - ERROR - No table \'categories\' found!");
+ } else {
+ echo "ConvertInspectionsToTaxonomy - ERROR - No table \'categories\' found!";
}
// Create new foreign id's
- if (Schema::hasTable('hive_types'))
- {
- Schema::table('hives', function (Blueprint $table)
- {
+ if (Schema::hasTable('hive_types')) {
+ Schema::table('hives', function (Blueprint $table) {
$table->dropForeign(['hive_type_id']);
$table->foreign('hive_type_id')->references('id')->on('categories')->onUpdate('cascade');
Schema::dropIfExists('hive_types');
});
}
- if (Schema::hasTable('bee_races'))
- {
- Schema::table('queens', function (Blueprint $table)
- {
+ if (Schema::hasTable('bee_races')) {
+ Schema::table('queens', function (Blueprint $table) {
$table->dropForeign(['race_id']);
$table->foreign('race_id')->references('id')->on('categories')->onUpdate('cascade');
Schema::dropIfExists('bee_races');
});
}
- echo("ConvertInspectionsToTaxonomy enableForeignKeyConstraints...\r\n");
+ echo "ConvertInspectionsToTaxonomy enableForeignKeyConstraints...\r\n";
Schema::enableForeignKeyConstraints();
- }
- else
- {
- echo("ConvertInspectionsToTaxonomy - ERROR - table actions, conditions, or categories not available (already migrated)\r\n");
+ } else {
+ echo "ConvertInspectionsToTaxonomy - ERROR - table actions, conditions, or categories not available (already migrated)\r\n";
}
}
diff --git a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
index fa57a314..990cd02b 100644
--- a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
+++ b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
@@ -1,8 +1,8 @@
timestamp('email_verified_at')->nullable();
+ }
});
}
@@ -27,10 +27,10 @@ public function up()
*/
public function down()
{
- Schema::table('users', function (Blueprint $table)
- {
- if (Schema::hasColumn('users','email_verified_at'))
+ Schema::table('users', function (Blueprint $table) {
+ if (Schema::hasColumn('users', 'email_verified_at')) {
$table->dropColumn('email_verified_at');
+ }
});
}
}
diff --git a/database/migrations/2019_01_08_101831_add_category_required.php b/database/migrations/2019_01_08_101831_add_category_required.php
index 1f876755..c0e2d560 100644
--- a/database/migrations/2019_01_08_101831_add_category_required.php
+++ b/database/migrations/2019_01_08_101831_add_category_required.php
@@ -1,8 +1,8 @@
boolean('required')->default(false);
+ }
});
}
@@ -28,10 +28,10 @@ public function up()
*/
public function down()
{
- Schema::table('categories', function (Blueprint $table)
- {
- if (Schema::hasColumn('categories','required') == true)
+ Schema::table('categories', function (Blueprint $table) {
+ if (Schema::hasColumn('categories', 'required') == true) {
$table->dropColumn('required');
+ }
});
}
}
diff --git a/database/migrations/2019_01_14_114237_add_group_extras.php b/database/migrations/2019_01_14_114237_add_group_extras.php
index da44f1cf..8d5553cd 100644
--- a/database/migrations/2019_01_14_114237_add_group_extras.php
+++ b/database/migrations/2019_01_14_114237_add_group_extras.php
@@ -1,8 +1,8 @@
text('description')->nullable();
$table->string('icon')->nullable();
- $table->string('hex_color',7)->nullable();
+ $table->string('hex_color', 7)->nullable();
});
}
diff --git a/database/migrations/2019_01_14_114804_create_group_hive.php b/database/migrations/2019_01_14_114804_create_group_hive.php
index 2132cd52..9877b49f 100644
--- a/database/migrations/2019_01_14_114804_create_group_hive.php
+++ b/database/migrations/2019_01_14_114804_create_group_hive.php
@@ -1,8 +1,8 @@
increments('id');
$table->integer('hive_id')->unsigned();
@@ -39,10 +38,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('group_hive'))
- {
- Schema::table('group_hive', function(Blueprint $table)
- {
+ if (Schema::hasTable('group_hive')) {
+ Schema::table('group_hive', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
$table->dropForeign(['group_id']);
});
diff --git a/database/migrations/2019_01_14_143937_add_group_user_admin.php b/database/migrations/2019_01_14_143937_add_group_user_admin.php
index 9c918fe4..f00da88e 100644
--- a/database/migrations/2019_01_14_143937_add_group_user_admin.php
+++ b/database/migrations/2019_01_14_143937_add_group_user_admin.php
@@ -1,8 +1,8 @@
timestamp('invited')->nullable();
$table->timestamp('accepted')->nullable();
$table->timestamp('declined')->nullable();
- $table->string('token',100)->nullable();
+ $table->string('token', 100)->nullable();
});
}
diff --git a/database/migrations/2019_01_28_104628_create_measurements_table.php b/database/migrations/2019_01_28_104628_create_measurements_table.php
index 5850fb7c..8f72c18c 100644
--- a/database/migrations/2019_01_28_104628_create_measurements_table.php
+++ b/database/migrations/2019_01_28_104628_create_measurements_table.php
@@ -12,10 +12,8 @@ class CreateMeasurementsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('measurements'))
- {
- Schema::create('measurements', function (Blueprint $table)
- {
+ if (! Schema::hasTable('measurements')) {
+ Schema::create('measurements', function (Blueprint $table) {
$table->increments('id');
$table->string('abbreviation');
$table->boolean('show_in_charts')->default(true);
@@ -37,13 +35,11 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('measurements'))
- {
- Schema::table('measurements', function(Blueprint $table)
- {
+ if (Schema::hasTable('measurements')) {
+ Schema::table('measurements', function (Blueprint $table) {
$table->dropForeign(['physical_quantity_id']);
});
-
+
Schema::drop('measurements');
}
diff --git a/database/migrations/2019_01_28_223610_add_min_max_values.php b/database/migrations/2019_01_28_223610_add_min_max_values.php
index c0f5bc2d..b213b50c 100644
--- a/database/migrations/2019_01_28_223610_add_min_max_values.php
+++ b/database/migrations/2019_01_28_223610_add_min_max_values.php
@@ -1,8 +1,8 @@
float('min_value')->nullable();
- if (!Schema::hasColumn('measurements','max_value'))
+ }
+ if (! Schema::hasColumn('measurements', 'max_value')) {
$table->float('max_value')->nullable();
- if (!Schema::hasColumn('measurements','hex_color'))
+ }
+ if (! Schema::hasColumn('measurements', 'hex_color')) {
$table->string('hex_color', 6)->nullable()->default('333333');
+ }
});
}
@@ -31,15 +34,18 @@ public function up()
public function down()
{
Schema::table('measurements', function (Blueprint $table) {
- if (Schema::hasColumn('measurements','min_value'))
+ if (Schema::hasColumn('measurements', 'min_value')) {
$table->dropColumn('min_value');
+ }
- if (Schema::hasColumn('measurements','max_value'))
+ if (Schema::hasColumn('measurements', 'max_value')) {
$table->dropColumn('max_value');
+ }
- if (Schema::hasColumn('measurements','hex_color'))
+ if (Schema::hasColumn('measurements', 'hex_color')) {
$table->dropColumn('hex_color');
-
+ }
+
});
}
}
diff --git a/database/migrations/2019_01_28_223654_add_high_low_values.php b/database/migrations/2019_01_28_223654_add_high_low_values.php
index 242f5422..19500428 100644
--- a/database/migrations/2019_01_28_223654_add_high_low_values.php
+++ b/database/migrations/2019_01_28_223654_add_high_low_values.php
@@ -1,8 +1,8 @@
float('low_value')->nullable();
+ }
- if (!Schema::hasColumn('physical_quantities','high_value'))
+ if (! Schema::hasColumn('physical_quantities', 'high_value')) {
$table->float('high_value')->nullable();
+ }
});
}
@@ -30,13 +31,14 @@ public function up()
*/
public function down()
{
- Schema::table('physical_quantities', function (Blueprint $table)
- {
- if (Schema::hasColumn('physical_quantities','low_value'))
+ Schema::table('physical_quantities', function (Blueprint $table) {
+ if (Schema::hasColumn('physical_quantities', 'low_value')) {
$table->dropColumn('low_value');
+ }
- if (Schema::hasColumn('physical_quantities','high_value'))
+ if (Schema::hasColumn('physical_quantities', 'high_value')) {
$table->dropColumn('high_value');
+ }
});
}
}
diff --git a/database/migrations/2019_11_21_153657_add_location_roofed.php b/database/migrations/2019_11_21_153657_add_location_roofed.php
index ea058538..11820220 100644
--- a/database/migrations/2019_11_21_153657_add_location_roofed.php
+++ b/database/migrations/2019_11_21_153657_add_location_roofed.php
@@ -1,8 +1,8 @@
boolean('roofed')->nullable();
+ Schema::table('locations', function (Blueprint $table) {
+ if (! Schema::hasColumn('locations', 'roofed')) {
+ $table->boolean('roofed')->nullable();
+ }
});
}
@@ -27,10 +27,10 @@ public function up()
*/
public function down()
{
- Schema::table('locations', function (Blueprint $table)
- {
- if (Schema::hasColumn('locations','roofed'))
- $table->dropColumn('roofed');
+ Schema::table('locations', function (Blueprint $table) {
+ if (Schema::hasColumn('locations', 'roofed')) {
+ $table->dropColumn('roofed');
+ }
});
}
}
diff --git a/database/migrations/2019_11_21_204213_create_researches_table.php b/database/migrations/2019_11_21_204213_create_researches_table.php
index ed429089..8d8dc197 100644
--- a/database/migrations/2019_11_21_204213_create_researches_table.php
+++ b/database/migrations/2019_11_21_204213_create_researches_table.php
@@ -12,26 +12,24 @@ class CreateResearchesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('researches'))
- {
+ if (! Schema::hasTable('researches')) {
Schema::create('researches', function (Blueprint $table) {
- $table->increments('id');
- $table->timestamps();
- $table->string('name');
- $table->string('url')->nullable();
- $table->string('image')->nullable();
- $table->text('description')->nullable();
- $table->string('type')->nullable();
- $table->string('institution')->nullable();
- $table->string('type_of_data_used')->nullable();
- $table->timestamp('start_date')->nullable();
- $table->timestamp('end_date')->nullable();
- $table->softDeletes();
+ $table->increments('id');
+ $table->timestamps();
+ $table->string('name');
+ $table->string('url')->nullable();
+ $table->string('image')->nullable();
+ $table->text('description')->nullable();
+ $table->string('type')->nullable();
+ $table->string('institution')->nullable();
+ $table->string('type_of_data_used')->nullable();
+ $table->timestamp('start_date')->nullable();
+ $table->timestamp('end_date')->nullable();
+ $table->softDeletes();
});
}
- if (!Schema::hasTable('research_user'))
- {
+ if (! Schema::hasTable('research_user')) {
Schema::create('research_user', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -49,8 +47,7 @@ public function up()
});
}
- if (!Schema::hasTable('checklist_research'))
- {
+ if (! Schema::hasTable('checklist_research')) {
Schema::create('checklist_research', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -72,31 +69,24 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('research_user'))
- {
- Schema::table('research_user', function (Blueprint $table)
- {
+ if (Schema::hasTable('research_user')) {
+ Schema::table('research_user', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['research_id']);
$table->drop();
});
}
- if (Schema::hasTable('checklist_research'))
- {
- Schema::table('checklist_research', function (Blueprint $table)
- {
+ if (Schema::hasTable('checklist_research')) {
+ Schema::table('checklist_research', function (Blueprint $table) {
$table->dropForeign(['checklist_id']);
$table->dropForeign(['research_id']);
$table->drop();
});
}
- if (Schema::hasTable('researches'))
- {
+ if (Schema::hasTable('researches')) {
Schema::drop('researches');
}
}
}
-
-
diff --git a/database/migrations/2019_12_27_172844_create_images_table.php b/database/migrations/2019_12_27_172844_create_images_table.php
index e1c496a5..9b7e9713 100644
--- a/database/migrations/2019_12_27_172844_create_images_table.php
+++ b/database/migrations/2019_12_27_172844_create_images_table.php
@@ -30,16 +30,16 @@ public function up()
$table->integer('inspection_id')->unsigned()->nullable();
$table->foreign('user_id')->references('id')->on('users')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('hive_id')->references('id')->on('hives')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('category_id')->references('id')->on('categories')
- ->onUpdate('cascade');
+ ->onUpdate('cascade');
$table->foreign('inspection_id')->references('id')->on('inspections')
- ->onUpdate('cascade');
+ ->onUpdate('cascade');
});
}
@@ -50,10 +50,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('images'))
- {
- Schema::table('images', function (Blueprint $table)
- {
+ if (Schema::hasTable('images')) {
+ Schema::table('images', function (Blueprint $table) {
$table->dropForeign(['inspection_id']);
$table->dropForeign(['category_id']);
$table->dropForeign(['hive_id']);
diff --git a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
index f3217c40..10fdf790 100644
--- a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
+++ b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
@@ -1,8 +1,8 @@
integer('checklist_id')->unsigned()->nullable();
$table->foreign('checklist_id')->references('id')->on('checklists')
->onUpdate('cascade');
@@ -32,12 +30,10 @@ public function up()
*/
public function down()
{
- Schema::table('inspections', function (Blueprint $table)
- {
- if (Schema::hasColumn('inspections','checklist_id'))
- {
+ Schema::table('inspections', function (Blueprint $table) {
+ if (Schema::hasColumn('inspections', 'checklist_id')) {
$table->dropForeign(['checklist_id']);
- $table->dropColumn('checklist_id');
+ $table->dropColumn('checklist_id');
}
});
}
diff --git a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
index bdb08e57..325b3d62 100644
--- a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
+++ b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
@@ -1,8 +1,8 @@
integer('hive_id')->unsigned()->nullable()->change();;
+ if (Schema::hasColumn('sensors', 'hive_id')) {
+ $table->integer('hive_id')->unsigned()->nullable()->change();
}
});
}
@@ -29,9 +28,8 @@ public function up()
public function down()
{
Schema::table('sensors', function (Blueprint $table) {
- if (Schema::hasColumn('sensors','hive_id'))
- {
- $table->integer('hive_id')->unsigned()->change();;
+ if (Schema::hasColumn('sensors', 'hive_id')) {
+ $table->integer('hive_id')->unsigned()->change();
}
});
}
diff --git a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
index 9b90ba52..f8d5669f 100644
--- a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
+++ b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
@@ -1,8 +1,8 @@
integer('input_measurement_id')->unsigned()->nullable();
$table->integer('output_measurement_id')->unsigned()->nullable();
$table->integer('device_id')->unsigned();
-
+
$table->foreign('input_measurement_id')->references('id')->on('measurements')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('output_measurement_id')->references('id')->on('measurements')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('device_id')->references('id')->on('sensors')
- ->onUpdate('cascade');
+ ->onUpdate('cascade');
});
}
@@ -41,10 +41,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('sensor_definitions'))
- {
- Schema::table('sensor_definitions', function (Blueprint $table)
- {
+ if (Schema::hasTable('sensor_definitions')) {
+ Schema::table('sensor_definitions', function (Blueprint $table) {
$table->dropForeign(['device_id']);
$table->dropForeign(['output_measurement_id']);
$table->dropForeign(['input_measurement_id']);
diff --git a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
index 0418e198..9270d300 100644
--- a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
+++ b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
@@ -1,8 +1,8 @@
integer('queen_id')->unsigned()->nullable();
$table->foreign('user_id')->references('id')->on('users')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('hive_id')->references('id')->on('hives')
- ->onUpdate('cascade')->onDelete('cascade');
+ ->onUpdate('cascade')->onDelete('cascade');
$table->foreign('queen_id')->references('id')->on('queens')
- ->onUpdate('cascade');
- }
+ ->onUpdate('cascade');
+ }
);
}
@@ -45,10 +45,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('sample_codes'))
- {
- Schema::table('sample_codes', function (Blueprint $table)
- {
+ if (Schema::hasTable('sample_codes')) {
+ Schema::table('sample_codes', function (Blueprint $table) {
$table->dropForeign(['queen_id']);
$table->dropForeign(['hive_id']);
$table->dropForeign(['user_id']);
diff --git a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
index 60f4d0f9..93bad7c1 100644
--- a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
+++ b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
@@ -1,8 +1,8 @@
integer('user_id')->unsigned()->nullable();
});
}
- if (!Schema::hasTable('research_viewer'))
- {
- Schema::create('research_viewer', function (Blueprint $table)
- {
+ if (! Schema::hasTable('research_viewer')) {
+ Schema::create('research_viewer', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('user_id')->unsigned();
$table->integer('research_id')->unsigned();
-
+
$table->foreign('user_id')->references('id')->on('users')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('research_id')->references('id')->on('researches')
@@ -40,24 +36,18 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('research_viewer'))
- {
- Schema::table('research_viewer', function (Blueprint $table)
- {
+ if (Schema::hasTable('research_viewer')) {
+ Schema::table('research_viewer', function (Blueprint $table) {
$table->dropForeign(['user_id']);
$table->dropForeign(['research_id']);
$table->drop();
});
}
- if (Schema::hasTable('researches'))
- {
- Schema::table('researches', function (Blueprint $table)
- {
+ if (Schema::hasTable('researches')) {
+ Schema::table('researches', function (Blueprint $table) {
$table->dropColumn('user_id');
});
}
}
}
-
-
diff --git a/database/migrations/2021_02_09_170632_create_alerts_table.php b/database/migrations/2021_02_09_170632_create_alerts_table.php
index ce4c3737..a038fe8c 100644
--- a/database/migrations/2021_02_09_170632_create_alerts_table.php
+++ b/database/migrations/2021_02_09_170632_create_alerts_table.php
@@ -12,8 +12,7 @@ class CreateAlertsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('alerts'))
- {
+ if (! Schema::hasTable('alerts')) {
Schema::create('alerts', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -40,8 +39,7 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('alerts'))
- {
+ if (Schema::hasTable('alerts')) {
Schema::drop('alerts');
}
}
diff --git a/database/migrations/2021_02_09_170935_create_alert_rules_table.php b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
index f011f759..41788c61 100644
--- a/database/migrations/2021_02_09_170935_create_alert_rules_table.php
+++ b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
@@ -12,8 +12,7 @@ class CreateAlertRulesTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('alert_rules'))
- {
+ if (! Schema::hasTable('alert_rules')) {
Schema::create('alert_rules', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -43,8 +42,7 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('alert_rules'))
- {
+ if (Schema::hasTable('alert_rules')) {
Schema::drop('alert_rules');
}
}
diff --git a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
index 2d092266..51271f1d 100644
--- a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
+++ b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
@@ -1,8 +1,8 @@
string('exclude_hive_ids')->nullable();
$table->integer('calculation_minutes')->unsigned()->nullable()->change();
@@ -29,8 +28,7 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('alert_rules'))
- {
+ if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
$table->dropColumn('exclude_hive_ids');
});
diff --git a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
index 244d08f6..fe127afa 100644
--- a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
+++ b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
@@ -1,8 +1,8 @@
timestamp('last_calculated_at')->nullable();
$table->string('timezone')->default('Europe/Amsterdam');
});
@@ -30,10 +28,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('alert_rules'))
- {
- Schema::table('alert_rules', function (Blueprint $table)
- {
+ if (Schema::hasTable('alert_rules')) {
+ Schema::table('alert_rules', function (Blueprint $table) {
$table->dropColumn('last_calculated_at');
$table->dropColumn('timezone');
});
diff --git a/database/migrations/2021_02_24_095050_create_flash_logs_table.php b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
index 37898e77..932c86c3 100644
--- a/database/migrations/2021_02_24_095050_create_flash_logs_table.php
+++ b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
@@ -12,8 +12,7 @@ class CreateFlashLogsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('flash_logs'))
- {
+ if (! Schema::hasTable('flash_logs')) {
Schema::create('flash_logs', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -28,7 +27,7 @@ public function up()
$table->string('log_file')->nullable();
$table->string('log_file_stripped')->nullable();
$table->string('log_file_parsed')->nullable();
- });
+ });
}
}
@@ -39,8 +38,7 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('flash_logs'))
- {
+ if (Schema::hasTable('flash_logs')) {
Schema::drop('flash_logs');
}
}
diff --git a/database/migrations/2021_03_26_124313_add_flashlog_columns.php b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
index 37de53a5..36c40fb8 100644
--- a/database/migrations/2021_03_26_124313_add_flashlog_columns.php
+++ b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
@@ -1,8 +1,8 @@
timestamp('last_evaluated_at')->nullable();
});
}
@@ -29,10 +27,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('alert_rules'))
- {
- Schema::table('alert_rules', function (Blueprint $table)
- {
+ if (Schema::hasTable('alert_rules')) {
+ Schema::table('alert_rules', function (Blueprint $table) {
$table->dropColumn('last_evaluated_at');
});
}
diff --git a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
index 630a7385..47161ff1 100644
--- a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
+++ b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
@@ -1,8 +1,8 @@
convertDb('mysql', 'utf8mb4', 'utf8mb4_unicode_ci', $dryRun);
-}
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ $dryRun = false;
+ $this->convertDb('mysql', 'utf8mb4', 'utf8mb4_unicode_ci', $dryRun);
+ }
-/**
- * Reverse the migrations.
- *
- * @return void
- */
-public function down()
-{
- $dryRun = false;
- $this->convertDb('mysql', 'utf8', 'utf8_unicode_ci', $dryRun);
-}
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ $dryRun = false;
+ $this->convertDb('mysql', 'utf8', 'utf8_unicode_ci', $dryRun);
+ }
-private function convertDb($connection, $charset, $collate, $dryRun)
-{
- $dbName = config("database.connections.{$connection}.database");
-
- $varchars = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'varchar' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
-
- // Check if shrinking field size will truncate!
- $skip = []; // List of table.column that will be handled manually
- $indexed = [];
- if ($charset == 'utf8mb4') {
- $error = false;
- foreach($varchars as $t) {
- if ($t->CHARACTER_MAXIMUM_LENGTH > 191) {
- $key = "{$t->TABLE_NAME}.{$t->COLUMN_NAME}";
-
- // Check if column is indexed
- $index = \DB::connection($connection)
- ->select(\DB::raw("SHOW INDEX FROM `{$t->TABLE_NAME}` where column_name = '{$t->COLUMN_NAME}'"));
- $indexed[$key] = count($index) ? true : false;
-
- if (count($index)) {
- $result = \DB::connection($connection)
- ->select(\DB::raw("SELECT count(*) as `count` from `{$t->TABLE_NAME}` where length(`{$t->COLUMN_NAME}`) > 191"));
- if ($result[0]->count > 0) {
- echo "-- DATA TRUNCATION: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH}) => {$result[0]->count}" . PHP_EOL;
- if (!in_array($key, $skip)) {
- $error = true;
+ private function convertDb($connection, $charset, $collate, $dryRun)
+ {
+ $dbName = config("database.connections.{$connection}.database");
+
+ $varchars = \DB::connection($connection)
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'varchar' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
+
+ // Check if shrinking field size will truncate!
+ $skip = []; // List of table.column that will be handled manually
+ $indexed = [];
+ if ($charset == 'utf8mb4') {
+ $error = false;
+ foreach ($varchars as $t) {
+ if ($t->CHARACTER_MAXIMUM_LENGTH > 191) {
+ $key = "{$t->TABLE_NAME}.{$t->COLUMN_NAME}";
+
+ // Check if column is indexed
+ $index = \DB::connection($connection)
+ ->select(\DB::raw("SHOW INDEX FROM `{$t->TABLE_NAME}` where column_name = '{$t->COLUMN_NAME}'"));
+ $indexed[$key] = count($index) ? true : false;
+
+ if (count($index)) {
+ $result = \DB::connection($connection)
+ ->select(\DB::raw("SELECT count(*) as `count` from `{$t->TABLE_NAME}` where length(`{$t->COLUMN_NAME}`) > 191"));
+ if ($result[0]->count > 0) {
+ echo "-- DATA TRUNCATION: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH}) => {$result[0]->count}".PHP_EOL;
+ if (! in_array($key, $skip)) {
+ $error = true;
+ }
}
}
}
}
+ if ($error) {
+ throw new \Exception('Aborting due to data truncation');
+ }
}
- if ($error) {
- throw new \Exception('Aborting due to data truncation');
- }
- }
- $query = "SET FOREIGN_KEY_CHECKS = 0";
- $this->dbExec($query, $dryRun, $connection);
-
- $query = "ALTER SCHEMA `{$dbName}` DEFAULT CHARACTER SET {$charset} DEFAULT COLLATE {$collate}";
- $this->dbExec($query, $dryRun, $connection);
-
- $tableChanges = [];
-
- // Convert varchar columns
- foreach($varchars as $t) {
- $key = "{$t->TABLE_NAME}.{$t->COLUMN_NAME}";
- if (!in_array($key, $skip)) {
- if ($charset == 'utf8mb4' && $t->CHARACTER_MAXIMUM_LENGTH > 191 && $indexed["{$t->TABLE_NAME}.{$t->COLUMN_NAME}"]) {
- $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR(191) CHARACTER SET {$charset} COLLATE {$collate}";
- echo "-- Shrinking: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH})" . PHP_EOL;
- } else if ($charset == 'utf8' && $t->CHARACTER_MAXIMUM_LENGTH == 191) {
- $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR(255) CHARACTER SET {$charset} COLLATE {$collate}";
- echo "-- Expanding: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH})";
- } else {
- $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR({$t->CHARACTER_MAXIMUM_LENGTH}) CHARACTER SET {$charset} COLLATE {$collate}";
+ $query = 'SET FOREIGN_KEY_CHECKS = 0';
+ $this->dbExec($query, $dryRun, $connection);
+
+ $query = "ALTER SCHEMA `{$dbName}` DEFAULT CHARACTER SET {$charset} DEFAULT COLLATE {$collate}";
+ $this->dbExec($query, $dryRun, $connection);
+
+ $tableChanges = [];
+
+ // Convert varchar columns
+ foreach ($varchars as $t) {
+ $key = "{$t->TABLE_NAME}.{$t->COLUMN_NAME}";
+ if (! in_array($key, $skip)) {
+ if ($charset == 'utf8mb4' && $t->CHARACTER_MAXIMUM_LENGTH > 191 && $indexed["{$t->TABLE_NAME}.{$t->COLUMN_NAME}"]) {
+ $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR(191) CHARACTER SET {$charset} COLLATE {$collate}";
+ echo "-- Shrinking: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH})".PHP_EOL;
+ } elseif ($charset == 'utf8' && $t->CHARACTER_MAXIMUM_LENGTH == 191) {
+ $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR(255) CHARACTER SET {$charset} COLLATE {$collate}";
+ echo "-- Expanding: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH})";
+ } else {
+ $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` VARCHAR({$t->CHARACTER_MAXIMUM_LENGTH}) CHARACTER SET {$charset} COLLATE {$collate}";
+ }
}
}
- }
- // Convert text like columns
- $texts = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE LIKE '%text%' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
- foreach($texts as $t) {
- $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` {$t->DATA_TYPE} CHARACTER SET {$charset} COLLATE {$collate}";
- }
+ // Convert text like columns
+ $texts = \DB::connection($connection)
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE LIKE '%text%' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
+ foreach ($texts as $t) {
+ $tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` {$t->DATA_TYPE} CHARACTER SET {$charset} COLLATE {$collate}";
+ }
- // Convert tables
- $tables = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_COLLATION != '{$collate}' AND TABLE_SCHEMA = '{$dbName}';"));
- foreach($tables as $t) {
- $tableChanges["{$t->TABLE_NAME}"][] = "CONVERT TO CHARACTER SET {$charset} COLLATE {$collate}";
- $tableChanges["{$t->TABLE_NAME}"][] = "DEFAULT CHARACTER SET={$charset} COLLATE={$collate}";
- }
+ // Convert tables
+ $tables = \DB::connection($connection)
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_COLLATION != '{$collate}' AND TABLE_SCHEMA = '{$dbName}';"));
+ foreach ($tables as $t) {
+ $tableChanges["{$t->TABLE_NAME}"][] = "CONVERT TO CHARACTER SET {$charset} COLLATE {$collate}";
+ $tableChanges["{$t->TABLE_NAME}"][] = "DEFAULT CHARACTER SET={$charset} COLLATE={$collate}";
+ }
- foreach ($tableChanges as $table => $changes) {
- $query = "ALTER TABLE `{$table}` ".implode(",\n", $changes);
- $this->dbExec($query, $dryRun, $connection);
- }
+ foreach ($tableChanges as $table => $changes) {
+ $query = "ALTER TABLE `{$table}` ".implode(",\n", $changes);
+ $this->dbExec($query, $dryRun, $connection);
+ }
- $query = "SET FOREIGN_KEY_CHECKS = 1";
- $this->dbExec($query, $dryRun, $connection);
+ $query = 'SET FOREIGN_KEY_CHECKS = 1';
+ $this->dbExec($query, $dryRun, $connection);
- echo "-- {$dbName} CONVERTED TO {$charset}-{$collate}" . PHP_EOL;
-}
+ echo "-- {$dbName} CONVERTED TO {$charset}-{$collate}".PHP_EOL;
+ }
-private function dbExec($query, $dryRun, $connection)
-{
- if ($dryRun) {
- echo $query . ';' . PHP_EOL;
- } else {
- \DB::connection($connection)->getPdo()->exec($query);
+ private function dbExec($query, $dryRun, $connection)
+ {
+ if ($dryRun) {
+ echo $query.';'.PHP_EOL;
+ } else {
+ \DB::connection($connection)->getPdo()->exec($query);
+ }
}
}
-}
diff --git a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
index adc49c14..13c14ef9 100644
--- a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
+++ b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
@@ -1,9 +1,9 @@
whereRaw('bb_depth_cm < bb_height_cm')->get();
$count = 0;
- if (count($hives_bb_error) > 0)
- {
- foreach ($hives_bb_error as $hive) // replace bb_height_cm with bb_depth_cm
- {
- $bb_depth_temp = $hive->bb_height_cm;
- $hive->bb_height_cm = $hive->bb_depth_cm;
- $hive->bb_depth_cm = $bb_depth_temp;
- if ($hive->save())
+ if (count($hives_bb_error) > 0) {
+ foreach ($hives_bb_error as $hive) { // replace bb_height_cm with bb_depth_cm
+ $bb_depth_temp = $hive->bb_height_cm;
+ $hive->bb_height_cm = $hive->bb_depth_cm;
+ $hive->bb_depth_cm = $bb_depth_temp;
+ if ($hive->save()) {
$count++;
+ }
}
}
- echo("Corrected $count hives where bb_depth_cm < bb_height_cm");
+ echo "Corrected $count hives where bb_depth_cm < bb_height_cm";
});
}
diff --git a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
index 84b13145..3d75f59c 100644
--- a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
+++ b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
@@ -26,7 +26,7 @@ public function up()
public function down()
{
Schema::table('users', function (Blueprint $table) {
- $table->dropColumn('rate_limit_per_min');
+ $table->dropColumn('rate_limit_per_min');
});
}
}
diff --git a/database/migrations/2022_06_20_093325_add_queen_birth_date.php b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
index eb44dcfd..ec2a6fbe 100644
--- a/database/migrations/2022_06_20_093325_add_queen_birth_date.php
+++ b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
@@ -1,9 +1,9 @@
date('birth_date')->nullable();
});
-
$queens = Queen::all();
- foreach ($queens as $q)
- {
+ foreach ($queens as $q) {
$q->birth_date = date('Y-m-d', strtotime($q->created_at));
$q->save();
}
@@ -37,8 +34,7 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('queens') && Schema::hasColumn('queens','birth_date'))
- {
+ if (Schema::hasTable('queens') && Schema::hasColumn('queens', 'birth_date')) {
Schema::table('queens', function (Blueprint $table) {
$table->dropColumn('birth_date');
});
diff --git a/database/migrations/2022_06_20_123603_create_hive_tags_table.php b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
index ec2f95bf..75d4a218 100644
--- a/database/migrations/2022_06_20_123603_create_hive_tags_table.php
+++ b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
@@ -20,7 +20,7 @@ public function up()
$table->integer('hive_id')->nullable()->unsigned();
$table->integer('action_id')->nullable()->unsigned();
$table->json('router_link')->nullable();
- });
+ });
}
/**
diff --git a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
index b137c245..f04dec1b 100644
--- a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
+++ b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
@@ -39,10 +39,9 @@ public function up()
*/
public function down()
{
- Schema::table('dashboard_groups', function(Blueprint $table)
- {
- $table->dropForeign(['user_id']);
- });
+ Schema::table('dashboard_groups', function (Blueprint $table) {
+ $table->dropForeign(['user_id']);
+ });
Schema::dropIfExists('dashboard_groups');
}
}
diff --git a/database/migrations/2023_04_03_083652_create_organizations_table.php b/database/migrations/2023_04_03_083652_create_organizations_table.php
index 55357d25..e42438c1 100644
--- a/database/migrations/2023_04_03_083652_create_organizations_table.php
+++ b/database/migrations/2023_04_03_083652_create_organizations_table.php
@@ -12,8 +12,7 @@ class CreateOrganizationsTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('organizations'))
- {
+ if (! Schema::hasTable('organizations')) {
Schema::create('organizations', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
@@ -21,11 +20,10 @@ public function up()
$table->text('description')->nullable();
$table->string('country_code')->nullable();
$table->string('logo_url')->nullable();
- });
+ });
}
- if (Schema::hasTable('users') && !Schema::hasColumn('users','organization_id'))
- {
+ if (Schema::hasTable('users') && ! Schema::hasColumn('users', 'organization_id')) {
Schema::table('users', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -33,8 +31,7 @@ public function up()
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('devices') && !Schema::hasColumn('devices','organization_id'))
- {
+ if (Schema::hasTable('devices') && ! Schema::hasColumn('devices', 'organization_id')) {
Schema::table('devices', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -42,8 +39,7 @@ public function up()
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('sensors') && !Schema::hasColumn('sensors','organization_id'))
- {
+ if (Schema::hasTable('sensors') && ! Schema::hasColumn('sensors', 'organization_id')) {
Schema::table('sensors', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -51,8 +47,7 @@ public function up()
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('checklists') && !Schema::hasColumn('checklists','organization_id'))
- {
+ if (Schema::hasTable('checklists') && ! Schema::hasColumn('checklists', 'organization_id')) {
Schema::table('checklists', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -60,8 +55,7 @@ public function up()
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('locations') && !Schema::hasColumn('locations','organization_id'))
- {
+ if (Schema::hasTable('locations') && ! Schema::hasColumn('locations', 'organization_id')) {
Schema::table('locations', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -69,17 +63,15 @@ public function up()
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('researches') && !Schema::hasColumn('researches','organization_id'))
- {
- Schema::table('researches', function (Blueprint $table) {
+ if (Schema::hasTable('researches') && ! Schema::hasColumn('researches', 'organization_id')) {
+ Schema::table('researches', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
Schema::table('researches', function (Blueprint $table) {
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
});
}
- if (Schema::hasTable('location_researches') && !Schema::hasColumn('location_researches','organization_id'))
- {
+ if (Schema::hasTable('location_researches') && ! Schema::hasColumn('location_researches', 'organization_id')) {
Schema::table('location_researches', function (Blueprint $table) {
$table->integer('organization_id')->unsigned()->nullable();
});
@@ -88,7 +80,6 @@ public function up()
});
}
-
}
/**
@@ -98,70 +89,56 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('users') && Schema::hasColumn('users','organization_id'))
- {
- Schema::table('users', function(Blueprint $table)
- {
+ if (Schema::hasTable('users') && Schema::hasColumn('users', 'organization_id')) {
+ Schema::table('users', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('devices') && Schema::hasColumn('devices','organization_id'))
- {
- Schema::table('devices', function(Blueprint $table)
- {
+ if (Schema::hasTable('devices') && Schema::hasColumn('devices', 'organization_id')) {
+ Schema::table('devices', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('devices', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('sensors') && Schema::hasColumn('sensors','organization_id'))
- {
- Schema::table('sensors', function(Blueprint $table)
- {
+ if (Schema::hasTable('sensors') && Schema::hasColumn('sensors', 'organization_id')) {
+ Schema::table('sensors', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('checklists') && Schema::hasColumn('checklists','organization_id'))
- {
- Schema::table('checklists', function(Blueprint $table)
- {
+ if (Schema::hasTable('checklists') && Schema::hasColumn('checklists', 'organization_id')) {
+ Schema::table('checklists', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('checklists', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('locations') && Schema::hasColumn('locations','organization_id'))
- {
- Schema::table('locations', function(Blueprint $table)
- {
+ if (Schema::hasTable('locations') && Schema::hasColumn('locations', 'organization_id')) {
+ Schema::table('locations', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('locations', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('researches') && Schema::hasColumn('researches','organization_id'))
- {
- Schema::table('researches', function(Blueprint $table)
- {
+ if (Schema::hasTable('researches') && Schema::hasColumn('researches', 'organization_id')) {
+ Schema::table('researches', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('researches', function (Blueprint $table) {
$table->dropColumn('organization_id');
});
}
- if (Schema::hasTable('location_researches') && Schema::hasColumn('location_researches','organization_id'))
- {
- Schema::table('location_researches', function(Blueprint $table)
- {
+ if (Schema::hasTable('location_researches') && Schema::hasColumn('location_researches', 'organization_id')) {
+ Schema::table('location_researches', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
});
Schema::table('location_researches', function (Blueprint $table) {
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index c877120d..9799bc0c 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -14,42 +14,39 @@ class AddUserTypeToRoleUserAndPermissionUserTables extends Migration
public function up()
{
- if (Schema::hasTable('role_user') && !Schema::hasColumn('role_user','organization_id'))
- {
- Schema::table('role_user', function (Blueprint $table) {
- $table->unsignedInteger('organization_id')->nullable();
- $table->string('user_type')->default('App\\\User');
- });
- Schema::table('role_user', function (Blueprint $table) {
- $table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
- $table->unique(['user_id', 'role_id', 'user_type', 'organization_id'], 'unique_role_user_type_organization_constraint');
- });
- }
+ if (Schema::hasTable('role_user') && ! Schema::hasColumn('role_user', 'organization_id')) {
+ Schema::table('role_user', function (Blueprint $table) {
+ $table->unsignedInteger('organization_id')->nullable();
+ $table->string('user_type')->default('App\\\User');
+ });
+ Schema::table('role_user', function (Blueprint $table) {
+ $table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
+ $table->unique(['user_id', 'role_id', 'user_type', 'organization_id'], 'unique_role_user_type_organization_constraint');
+ });
+ }
- // Create table for associating permissions to users (Many To Many Polymorphic)
- if (!Schema::hasTable('permission_user'))
- {
- Schema::create('permission_user', function (Blueprint $table) {
- $table->unsignedInteger('permission_id');
- $table->unsignedInteger('user_id');
- $table->string('user_type')->default('App\\\User');
- $table->unsignedInteger('organization_id')->nullable();
- $table->unique(['user_id', 'permission_id', 'user_type', 'organization_id'], 'unique_permission_user_constraint');
- });
- Schema::table('permission_user', function (Blueprint $table) {
- $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade');
- $table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
- $table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
+ // Create table for associating permissions to users (Many To Many Polymorphic)
+ if (! Schema::hasTable('permission_user')) {
+ Schema::create('permission_user', function (Blueprint $table) {
+ $table->unsignedInteger('permission_id');
+ $table->unsignedInteger('user_id');
+ $table->string('user_type')->default('App\\\User');
+ $table->unsignedInteger('organization_id')->nullable();
+ $table->unique(['user_id', 'permission_id', 'user_type', 'organization_id'], 'unique_permission_user_constraint');
+ });
+ Schema::table('permission_user', function (Blueprint $table) {
+ $table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade');
+ $table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
+ $table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
- });
- }
+ });
+ }
- if (Schema::hasTable('roles') && \App\Role::where('name','api-gateway')->count() == 0)
- {
- $api_role = \App\Role::create(['name'=>'api-gateway', 'display_name'=>'API gateway access role', 'description'=>'API gateway access role to get minimal list of (cached) data for API gateway auth. NB: Set user token in AWS Lambda config variables.']);
- $api_user = \App\User::create(['name'=>'hcs-api-gateway-user', 'email'=>'hcs@iconize.nl']);
- $api_user->attachRole($api_role->id);
- }
+ if (Schema::hasTable('roles') && \App\Role::where('name', 'api-gateway')->count() == 0) {
+ $api_role = \App\Role::create(['name' => 'api-gateway', 'display_name' => 'API gateway access role', 'description' => 'API gateway access role to get minimal list of (cached) data for API gateway auth. NB: Set user token in AWS Lambda config variables.']);
+ $api_user = \App\User::create(['name' => 'hcs-api-gateway-user', 'email' => 'hcs@iconize.nl']);
+ $api_user->attachRole($api_role->id);
+ }
}
/**
@@ -59,10 +56,8 @@ public function up()
*/
public function down()
{
- if (Schema::hasTable('permission_user'))
- {
- Schema::table('permission_user', function(Blueprint $table)
- {
+ if (Schema::hasTable('permission_user')) {
+ Schema::table('permission_user', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
$table->dropForeign(['permission_id']);
$table->dropForeign(['user_id']);
@@ -71,10 +66,8 @@ public function down()
}
// Don't delete table, only organization link and new columns
- if (Schema::hasTable('role_user'))
- {
- Schema::table('role_user', function(Blueprint $table)
- {
+ if (Schema::hasTable('role_user')) {
+ Schema::table('role_user', function (Blueprint $table) {
$table->dropForeign(['organization_id']);
$table->dropUnique('unique_role_user_type_organization_constraint');
$table->dropColumn('organization_id');
diff --git a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
index b4242662..04ae9e71 100644
--- a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
+++ b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
@@ -21,7 +21,7 @@ public function up()
$table->mediumText('svg')->nullable();
$table->integer('pages')->unsigned();
$table->dateTime('last_print')->nullable();
- });
+ });
}
/**
diff --git a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
index 1eecfb65..f514f11d 100644
--- a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
+++ b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
@@ -12,8 +12,7 @@ class CreateAlertRuleFormulasTable extends Migration
*/
public function up()
{
- if (!Schema::hasTable('alert_rule_formulas'))
- {
+ if (! Schema::hasTable('alert_rule_formulas')) {
Schema::create('alert_rule_formulas', function (Blueprint $table) {
$table->increments('id');
@@ -47,7 +46,7 @@ public function up()
// $arf->save();
// }
- // Remove formula fields from the AlertRule table
+ // Remove formula fields from the AlertRule table
}
}
diff --git a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
index b8896201..00f8d1ee 100644
--- a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
+++ b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
@@ -13,8 +13,7 @@ class AddFutureToAlertRuleFormulas extends Migration
*/
public function up()
{
- if (Schema::hasTable('alert_rule_formulas') && Schema::hasColumn('alert_rule_formulas','future') == false)
- {
+ if (Schema::hasTable('alert_rule_formulas') && Schema::hasColumn('alert_rule_formulas', 'future') == false) {
Schema::table('alert_rule_formulas', function (Blueprint $table) {
$table->boolean('future')->default(false);
@@ -22,25 +21,24 @@ public function up()
// Transfer current AlertRule settings to formula's
$alert_rules = \App\Models\AlertRule::all();
- $ar_count = $alert_rules->count();
- $ars_mod = 0;
+ $ar_count = $alert_rules->count();
+ $ars_mod = 0;
- foreach ($alert_rules as $ar_id => $ar)
- {
- $arf = new App\Models\AlertRuleFormula();
- $arf->alert_rule_id = $ar->id;
- $arf->measurement_id = $ar->measurement_id;
- $arf->calculation = $ar->calculation;
- $arf->comparator = $ar->comparator;
- $arf->comparison = $ar->comparison;
- $arf->logical = null;
- $arf->period_minutes = $ar->calculation_minutes;
- $arf->threshold_value = $ar->threshold_value;
- $arf->future = false;
+ foreach ($alert_rules as $ar_id => $ar) {
+ $arf = new App\Models\AlertRuleFormula;
+ $arf->alert_rule_id = $ar->id;
+ $arf->measurement_id = $ar->measurement_id;
+ $arf->calculation = $ar->calculation;
+ $arf->comparator = $ar->comparator;
+ $arf->comparison = $ar->comparison;
+ $arf->logical = null;
+ $arf->period_minutes = $ar->calculation_minutes;
+ $arf->threshold_value = $ar->threshold_value;
+ $arf->future = false;
$arf->save();
}
- // Remove formula fields from the AlertRule table
+ // Remove formula fields from the AlertRule table
// Schema::table('alert_rules', function (Blueprint $table) {
// $table->dropColumn('measurement_id');
// $table->dropColumn('calculation');
diff --git a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
index 2184d5de..350b5feb 100644
--- a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
+++ b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
@@ -13,8 +13,7 @@ class AddEvaluationResultsToAlertRuleFormulas extends Migration
*/
public function up()
{
- if (Schema::hasTable('alert_rule_formulas'))
- {
+ if (Schema::hasTable('alert_rule_formulas')) {
Schema::table('alert_rule_formulas', function (Blueprint $table) {
$table->float('last_result_value')->nullable();
$table->boolean('last_evaluation_value')->default(false);
diff --git a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
index 6f458452..8d648430 100644
--- a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
+++ b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
@@ -1,9 +1,9 @@
boolean('rtc')->nullable();
});
- foreach (Device::all() as $d)
- {
- if ($d->last_downlink_result == 'RTC installed')
- {
+ foreach (Device::all() as $d) {
+ if ($d->last_downlink_result == 'RTC installed') {
$d->last_downlink_result = '';
$d->rtc = true;
$d->save();
diff --git a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
index e4f183c0..cd22d8ba 100644
--- a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
+++ b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
@@ -3,7 +3,6 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-use App\Device;
class AddLogValidationToDevices extends Migration
{
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php
index 6c9f6152..7abd43b1 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeds/DatabaseSeeder.php
@@ -11,8 +11,8 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
- $this->call(DeviceCorrectionSeeder::class);
+ $this->call(DeviceCorrectionSeeder::class);
// $this->call(UserSeeder::class);
- // $this->call(MeasurementSeeder::class);
+ // $this->call(MeasurementSeeder::class);
}
}
diff --git a/database/seeds/DeviceCorrectionSeeder.php b/database/seeds/DeviceCorrectionSeeder.php
index ee67a4d5..544bcc10 100644
--- a/database/seeds/DeviceCorrectionSeeder.php
+++ b/database/seeds/DeviceCorrectionSeeder.php
@@ -1,15 +1,12 @@
get();
- foreach ($devices as $d)
- {
- if (strlen($d->hardware_id) == 20 && strtolower(substr($d->hardware_id, 0, 2)) == '0e')
- {
+ foreach ($devices as $d) {
+ if (strlen($d->hardware_id) == 20 && strtolower(substr($d->hardware_id, 0, 2)) == '0e') {
$ttn_device = $this->getTTNDevice($d->hardware_id);
- if ($ttn_device !== null)
- {
- $dev_eui = $ttn_device->lorawan_device->dev_eui;
- $app_key = $ttn_device->lorawan_device->app_key;
- $dev_id = substr($d->hardware_id, 2);
+ if ($ttn_device !== null) {
+ $dev_eui = $ttn_device->lorawan_device->dev_eui;
+ $app_key = $ttn_device->lorawan_device->app_key;
+ $dev_id = substr($d->hardware_id, 2);
- if (strlen($dev_eui) == 16 && strlen($app_key) == 32 && strlen($dev_id) == 18)
- {
+ if (strlen($dev_eui) == 16 && strlen($app_key) == 32 && strlen($dev_id) == 18) {
$ttn_device->dev_id = $dev_id;
- $ttn_device->lorawan_device->dev_id = $dev_id;
+ $ttn_device->lorawan_device->dev_id = $dev_id;
$ttn_device->lorawan_device->dev_eui = strtolower($dev_eui);
$ttn_device->lorawan_device->app_key = strtolower($app_key);
@@ -45,47 +38,45 @@ public function run()
$response = $this->doTTNRequest($dev_id, 'POST', $ttn_device);
$ok = false;
- if ($response->getStatusCode() == 200)
- {
+ if ($response->getStatusCode() == 200) {
$d->hardware_id = $dev_id;
$d->save();
$ok = true;
}
- print_r(['ok'=>$ok, 'ttn'=>(array)$ttn_device, 'd'=>$d->toArray()]);
+ print_r(['ok' => $ok, 'ttn' => (array) $ttn_device, 'd' => $d->toArray()]);
}
}
}
}
}
- private function doTTNRequest($deviceId, $type='GET', $data=null)
+ private function doTTNRequest($deviceId, $type = 'GET', $data = null)
{
- $guzzle = new Client();
- $url = env('TTN_API_URL').'/applications/'.env('TTN_APP_NAME').'/devices/'.$deviceId;
+ $guzzle = new Client;
+ $url = env('TTN_API_URL').'/applications/'.env('TTN_APP_NAME').'/devices/'.$deviceId;
$response = null;
- try
- {
- $response = $guzzle->request($type, $url, ['headers'=>['Authorization'=>'Bearer '.env('TTN_API_KEY')], 'json' => $data]);
- }
- catch(RequestException $e)
- {
- if (!$e->hasResponse())
+ try {
+ $response = $guzzle->request($type, $url, ['headers' => ['Authorization' => 'Bearer '.env('TTN_API_KEY')], 'json' => $data]);
+ } catch (RequestException $e) {
+ if (! $e->hasResponse()) {
return null;
-
+ }
+
$response = $e->getResponse();
}
return $response;
}
-
+
private function getTTNDevice($dev_id)
{
-
+
$response = $this->doTTNRequest($dev_id);
- if ($response->getStatusCode() == 200)
+ if ($response->getStatusCode() == 200) {
return json_decode($response->getBody());
+ }
return null;
}
@@ -94,10 +85,10 @@ private function deleteTTNDevice($dev_id)
{
$response = $this->doTTNRequest($dev_id, 'DELETE');
- if ($response->getStatusCode() == 200)
+ if ($response->getStatusCode() == 200) {
return json_decode($response->getBody());
+ }
return null;
}
-
-}
\ No newline at end of file
+}
diff --git a/database/seeds/MeasurementSeeder.php b/database/seeds/MeasurementSeeder.php
index a6be772c..c215bbbe 100644
--- a/database/seeds/MeasurementSeeder.php
+++ b/database/seeds/MeasurementSeeder.php
@@ -1,8 +1,8 @@
'temperature',
- 'h' => 'humidity',
- 'p' => 'air_pressure',
- 'w' => 'weight_sum',
- 'l' => 'light',
- 'bv' => 'bat_volt',
- 'w_v' => 'weight_combined_kg',
- 'w_fl' => 'weight_front_left',
- 'w_fr' => 'weight_front_right',
- 'w_bl' => 'weight_back_left',
- 'w_br' => 'weight_back_right',
- 's_fan_4' => 'sound_fanning_4days',
- 's_fan_6' => 'sound_fanning_6days',
- 's_fan_9' => 'sound_fanning_9days',
- 's_fly_a' => 'sound_flying_adult',
- 's_tot' => 'sound_total',
- 't_i' => 'temp_inside',
- 'bc_i' => 'bee_count_in',
- 'bc_o' => 'bee_count_out',
- 'weight_kg_noOutlier' => 'weight_kg_noOutlier',
- 'weight_kg' => 'weight_kg',
- 'weight_kg_corrected' => 'weight_kg_corrected',
- 'rssi' => 'rssi',
- 'snr' => 'snr',
- 'lat' => 'lat',
- 'lon' => 'lon',
- 's_bin098_146Hz' => '098_146Hz',
- 's_bin146_195Hz' => '146_195Hz',
- 's_bin195_244Hz' => '195_244Hz',
- 's_bin244_293Hz' => '244_293Hz',
- 's_bin293_342Hz' => '293_342Hz',
- 's_bin342_391Hz' => '342_391Hz',
- 's_bin391_439Hz' => '391_439Hz',
- 's_bin439_488Hz' => '439_488Hz',
- 's_bin488_537Hz' => '488_537Hz',
- 's_bin537_586Hz' => '537_586Hz',
- 'calibrating_weight' => 'calibrating_weight',
- 'w_fl_kg_per_val' => 'w_fl_kg_per_val',
- 'w_fr_kg_per_val' => 'w_fr_kg_per_val',
- 'w_bl_kg_per_val' => 'w_bl_kg_per_val',
- 'w_br_kg_per_val' => 'w_br_kg_per_val',
- 'w_fl_offset' => 'w_fl_offset',
- 'w_fr_offset' => 'w_fr_offset',
- 'w_bl_offset' => 'w_bl_offset',
- 'w_br_offset' => 'w_br_offset',
+ 't' => 'temperature',
+ 'h' => 'humidity',
+ 'p' => 'air_pressure',
+ 'w' => 'weight_sum',
+ 'l' => 'light',
+ 'bv' => 'bat_volt',
+ 'w_v' => 'weight_combined_kg',
+ 'w_fl' => 'weight_front_left',
+ 'w_fr' => 'weight_front_right',
+ 'w_bl' => 'weight_back_left',
+ 'w_br' => 'weight_back_right',
+ 's_fan_4' => 'sound_fanning_4days',
+ 's_fan_6' => 'sound_fanning_6days',
+ 's_fan_9' => 'sound_fanning_9days',
+ 's_fly_a' => 'sound_flying_adult',
+ 's_tot' => 'sound_total',
+ 't_i' => 'temp_inside',
+ 'bc_i' => 'bee_count_in',
+ 'bc_o' => 'bee_count_out',
+ 'weight_kg_noOutlier' => 'weight_kg_noOutlier',
+ 'weight_kg' => 'weight_kg',
+ 'weight_kg_corrected' => 'weight_kg_corrected',
+ 'rssi' => 'rssi',
+ 'snr' => 'snr',
+ 'lat' => 'lat',
+ 'lon' => 'lon',
+ 's_bin098_146Hz' => '098_146Hz',
+ 's_bin146_195Hz' => '146_195Hz',
+ 's_bin195_244Hz' => '195_244Hz',
+ 's_bin244_293Hz' => '244_293Hz',
+ 's_bin293_342Hz' => '293_342Hz',
+ 's_bin342_391Hz' => '342_391Hz',
+ 's_bin391_439Hz' => '391_439Hz',
+ 's_bin439_488Hz' => '439_488Hz',
+ 's_bin488_537Hz' => '488_537Hz',
+ 's_bin537_586Hz' => '537_586Hz',
+ 'calibrating_weight' => 'calibrating_weight',
+ 'w_fl_kg_per_val' => 'w_fl_kg_per_val',
+ 'w_fr_kg_per_val' => 'w_fr_kg_per_val',
+ 'w_bl_kg_per_val' => 'w_bl_kg_per_val',
+ 'w_br_kg_per_val' => 'w_br_kg_per_val',
+ 'w_fl_offset' => 'w_fl_offset',
+ 'w_fr_offset' => 'w_fr_offset',
+ 'w_bl_offset' => 'w_bl_offset',
+ 'w_br_offset' => 'w_br_offset',
];
+
protected $output_sensors = [
- 't',
- 'h',
- 'p',
- 'l',
- 'bv',
- 's_fan_4',
- 's_fan_6',
- 's_fan_9',
- 's_fly_a',
- 's_tot',
- 't_i',
- 'bc_i',
- 'bc_o',
- 'weight_kg_noOutlier',
- 'weight_kg',
- 'weight_kg_corrected',
- 'rssi',
- 'snr',
- 'lat',
- 'lon',
- 's_bin098_146Hz',
- 's_bin146_195Hz',
- 's_bin195_244Hz',
- 's_bin244_293Hz',
- 's_bin293_342Hz',
- 's_bin342_391Hz',
- 's_bin391_439Hz',
- 's_bin439_488Hz',
- 's_bin488_537Hz',
- 's_bin537_586Hz',
- ];
+ 't',
+ 'h',
+ 'p',
+ 'l',
+ 'bv',
+ 's_fan_4',
+ 's_fan_6',
+ 's_fan_9',
+ 's_fly_a',
+ 's_tot',
+ 't_i',
+ 'bc_i',
+ 'bc_o',
+ 'weight_kg_noOutlier',
+ 'weight_kg',
+ 'weight_kg_corrected',
+ 'rssi',
+ 'snr',
+ 'lat',
+ 'lon',
+ 's_bin098_146Hz',
+ 's_bin146_195Hz',
+ 's_bin195_244Hz',
+ 's_bin244_293Hz',
+ 's_bin293_342Hz',
+ 's_bin342_391Hz',
+ 's_bin391_439Hz',
+ 's_bin439_488Hz',
+ 's_bin488_537Hz',
+ 's_bin537_586Hz',
+ ];
public function run()
{
- if (PhysicalQuantity::where('abbreviation','-')->count() == 0)
- {
- PhysicalQuantity::create(['abbreviation'=>'hPa','name'=>'Pressure','unit'=>'hPa']);
- PhysicalQuantity::create(['abbreviation'=>'V','name'=>'Voltage','unit'=>'V']);
- $pq = PhysicalQuantity::create(['abbreviation'=>'-','name'=>'-','unit'=>'-']);
- }
- else
- {
- $pq = PhysicalQuantity::where('name','-')->first();
+ if (PhysicalQuantity::where('abbreviation', '-')->count() == 0) {
+ PhysicalQuantity::create(['abbreviation' => 'hPa', 'name' => 'Pressure', 'unit' => 'hPa']);
+ PhysicalQuantity::create(['abbreviation' => 'V', 'name' => 'Voltage', 'unit' => 'V']);
+ $pq = PhysicalQuantity::create(['abbreviation' => '-', 'name' => '-', 'unit' => '-']);
+ } else {
+ $pq = PhysicalQuantity::where('name', '-')->first();
}
- foreach ($this->valid_sensors as $abbr => $long)
- {
- $name = ucfirst(str_replace('_', ' ', $long));
- if (Measurement::where('abbreviation',$abbr)->count() == 0)
- {
- $pq_id = $pq->id;
- $show = in_array($abbr, $this->output_sensors);
+ foreach ($this->valid_sensors as $abbr => $long) {
+ $name = ucfirst(str_replace('_', ' ', $long));
+ if (Measurement::where('abbreviation', $abbr)->count() == 0) {
+ $pq_id = $pq->id;
+ $show = in_array($abbr, $this->output_sensors);
- switch($abbr)
- {
- case 't':
- case 'h':
- $pq_id = PhysicalQuantity::where('name',$name)->first()->id;
- break;
- case 'weight_kg':
- case 'weight_kg_corrected':
+ switch ($abbr) {
+ case 't':
+ case 'h':
+ $pq_id = PhysicalQuantity::where('name', $name)->first()->id;
+ break;
+ case 'weight_kg':
+ case 'weight_kg_corrected':
case 'weight_kg_noOutlier':
- $pq_id = PhysicalQuantity::where('unit','kg')->first()->id;
- break;
- case 't_i':
- $pq_id = PhysicalQuantity::where('name','Temperature')->first()->id;
- break;
- case 'bv':
- $pq_id = PhysicalQuantity::where('name','Voltage')->first()->id;
- break;
- case 'p':
- $pq_id = PhysicalQuantity::where('name','Pressure')->first()->id;
- break;
- }
- $data = ['abbreviation'=>$abbr, 'show_in_charts'=>$show, 'physical_quantity_id'=>$pq_id];
- Measurement::create($data);
- }
+ $pq_id = PhysicalQuantity::where('unit', 'kg')->first()->id;
+ break;
+ case 't_i':
+ $pq_id = PhysicalQuantity::where('name', 'Temperature')->first()->id;
+ break;
+ case 'bv':
+ $pq_id = PhysicalQuantity::where('name', 'Voltage')->first()->id;
+ break;
+ case 'p':
+ $pq_id = PhysicalQuantity::where('name', 'Pressure')->first()->id;
+ break;
+ }
+ $data = ['abbreviation' => $abbr, 'show_in_charts' => $show, 'physical_quantity_id' => $pq_id];
+ Measurement::create($data);
+ }
}
}
}
diff --git a/database/seeds/UserSeeder.php b/database/seeds/UserSeeder.php
index e5b34439..14c651bb 100644
--- a/database/seeds/UserSeeder.php
+++ b/database/seeds/UserSeeder.php
@@ -1,7 +1,7 @@
policy_accepted) && $user->email_verified_at == null)
- {
- $user->email_verified_at = "2018-05-25 00:00:00";
+ foreach ($users as $user) {
+ if (isset($user->policy_accepted) && $user->email_verified_at == null) {
+ $user->email_verified_at = '2018-05-25 00:00:00';
$user->save();
}
}
}
}
-
diff --git a/public/docs/source/_tmp/1216e8b83a448fde4e8cbab313b38ca246d5c580.php b/public/docs/source/_tmp/1216e8b83a448fde4e8cbab313b38ca246d5c580.php
index 7fae0fd4..f6745cdd 100644
--- a/public/docs/source/_tmp/1216e8b83a448fde4e8cbab313b38ca246d5c580.php
+++ b/public/docs/source/_tmp/1216e8b83a448fde4e8cbab313b38ca246d5c580.php
@@ -10,13 +10,13 @@
-
+
-
+
@@ -28,28 +28,38 @@
-
+
- addLoop($__currentLoopData); foreach($__currentLoopData as $lang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
+ addLoop($__currentLoopData);
+ foreach ($__currentLoopData as $lang) {
+ $__env->incrementLoopIndices();
+ $loop = $__env->getLastLoop(); ?>
- popLoop(); $loop = $__env->getLastLoop(); ?>
+ popLoop();
+ $loop = $__env->getLastLoop(); ?>
-
-
+
+
-
+
-
+
-
+
-
+
- addLoop($__currentLoopData); foreach($__currentLoopData as $lang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
+ addLoop($__currentLoopData);
+ foreach ($__currentLoopData as $lang) {
+ $__env->incrementLoopIndices();
+ $loop = $__env->getLastLoop(); ?>
- popLoop(); $loop = $__env->getLastLoop(); ?>
+ popLoop();
+ $loop = $__env->getLastLoop(); ?>
-
+
diff --git a/public/docs/source/config.php b/public/docs/source/config.php
index ad392deb..9e791392 100644
--- a/public/docs/source/config.php
+++ b/public/docs/source/config.php
@@ -2,7 +2,6 @@
return [
-
/*
|--------------------------------------------------------------------------
| Deployment configuration
@@ -13,14 +12,14 @@
|
*/
'deployment' => [
-
+
'type' => 'git',
'repository' => '',
'branch' => 'gh-pages',
- 'message' => 'Site updated: ' . strftime('%YYYY-%MM-%DD %HH:%mm:%ss')
-
- ]
-];
\ No newline at end of file
+ 'message' => 'Site updated: '.strftime('%YYYY-%MM-%DD %HH:%mm:%ss'),
+
+ ],
+];
diff --git a/public/index.php b/public/index.php
index 4584cbcd..e1964675 100644
--- a/public/index.php
+++ b/public/index.php
@@ -3,10 +3,8 @@
/**
* Laravel - A PHP Framework For Web Artisans
*
- * @package Laravel
* @author Taylor Otwell
*/
-
define('LARAVEL_START', microtime(true));
/*
diff --git a/resources/lang/en/alert.php b/resources/lang/en/alert.php
index ad2b5791..a893c027 100644
--- a/resources/lang/en/alert.php
+++ b/resources/lang/en/alert.php
@@ -2,13 +2,13 @@
return [
- 'subject' => 'BEEP alert',
- 'Dear' => 'Dear',
- 'Location' => 'Location',
- 'Name' => 'Name',
- 'alert_text' => 'A notification has been created from rule :alertrule.',
- 'alert_value' => 'The measured value(s) that triggered the alert:',
- 'disable_text' => 'Unsubscribe? Disable alert in Alert settings',
- 'View_alerts' => 'View all notifications in the BEEP app'
+ 'subject' => 'BEEP alert',
+ 'Dear' => 'Dear',
+ 'Location' => 'Location',
+ 'Name' => 'Name',
+ 'alert_text' => 'A notification has been created from rule :alertrule.',
+ 'alert_value' => 'The measured value(s) that triggered the alert:',
+ 'disable_text' => 'Unsubscribe? Disable alert in Alert settings',
+ 'View_alerts' => 'View all notifications in the BEEP app',
];
diff --git a/resources/lang/en/beep.php b/resources/lang/en/beep.php
index 9f09177f..2a5b24c5 100644
--- a/resources/lang/en/beep.php
+++ b/resources/lang/en/beep.php
@@ -2,69 +2,69 @@
return [
- 'site_title' => 'BEEP - Management interface',
- 'Hives' => 'Hives',
- 'Hive' => 'Hive',
- 'Location' => 'Apiary',
- 'Locations' => 'Apiaries',
- 'Inspections' => 'Inspections',
- 'Inspection' => 'Inspection',
- 'Conditions' => 'Conditions',
- 'Actions' => 'Actions',
- 'footer_text' => 'Open source bee monitor',
- 'Beep_foundation' => 'BEEP foundation',
+ 'site_title' => 'BEEP - Management interface',
+ 'Hives' => 'Hives',
+ 'Hive' => 'Hive',
+ 'Location' => 'Apiary',
+ 'Locations' => 'Apiaries',
+ 'Inspections' => 'Inspections',
+ 'Inspection' => 'Inspection',
+ 'Conditions' => 'Conditions',
+ 'Actions' => 'Actions',
+ 'footer_text' => 'Open source bee monitor',
+ 'Beep_foundation' => 'BEEP foundation',
- 'PhysicalQuantity' => 'Physical quantities',
- 'physicalquantity' => 'physical quantity',
- 'BeeRace' => 'Bee races',
- 'beerace' => 'bee race',
- 'HiveType' => 'Hive types',
- 'hivetype' => 'hive type',
- 'CategoryInputs' => 'Category item types',
- 'categoryinput' => 'Category item type',
- 'visualization' => 'visualization',
- 'visual' => 'visual',
+ 'PhysicalQuantity' => 'Physical quantities',
+ 'physicalquantity' => 'physical quantity',
+ 'BeeRace' => 'Bee races',
+ 'beerace' => 'bee race',
+ 'HiveType' => 'Hive types',
+ 'hivetype' => 'hive type',
+ 'CategoryInputs' => 'Category item types',
+ 'categoryinput' => 'Category item type',
+ 'visualization' => 'visualization',
+ 'visual' => 'visual',
- 'Checklist' => 'Checklist',
- 'checklist' => 'checklist',
- 'Checklists' => 'Checklists',
- 'checklists' => 'checklists',
+ 'Checklist' => 'Checklist',
+ 'checklist' => 'checklist',
+ 'Checklists' => 'Checklists',
+ 'checklists' => 'checklists',
- 'Webapp' => 'Web app',
- 'language' => 'language',
+ 'Webapp' => 'Web app',
+ 'language' => 'language',
'required_in_inspection' => 'Required in inspection',
- 'Measurement' => 'Measurement',
- 'measurement' => 'sensor measurement',
- 'Research' => 'Research',
- 'Researches' => 'Researches',
- 'calibration' => 'calibration',
- 'calibrated' => 'calibrated',
- 'SensorDefinition' => 'Sensor definition',
+ 'Measurement' => 'Measurement',
+ 'measurement' => 'sensor measurement',
+ 'Research' => 'Research',
+ 'Researches' => 'Researches',
+ 'calibration' => 'calibration',
+ 'calibrated' => 'calibrated',
+ 'SensorDefinition' => 'Sensor definition',
'SensorDefinitions' => 'Sensor definitions',
- 'SampleCode' => 'Sample code',
- 'SampleCodes' => 'Sample codes',
+ 'SampleCode' => 'Sample code',
+ 'SampleCodes' => 'Sample codes',
- 'Alert' => 'Alert',
- 'Alerts' => 'Alerts',
- 'AlertRule' => 'Alert rule',
- 'AlertRules' => 'Alert rules',
- 'AlertRuleFormula' => 'Alert rule formula',
+ 'Alert' => 'Alert',
+ 'Alerts' => 'Alerts',
+ 'AlertRule' => 'Alert rule',
+ 'AlertRules' => 'Alert rules',
+ 'AlertRuleFormula' => 'Alert rule formula',
'AlertRuleFormulas' => 'Alert rule formulas',
- 'min' => 'minimum',
- 'max' => 'maximum',
- 'ave' => 'average',
- 'der' => 'derivative',
- 'cnt' => 'count of',
- 'cnt_zero' => 'no',
- 'val' => 'value',
- 'values' => ' values',
- 'dif' => 'difference',
- 'dec' => 'decrease',
- 'inc' => 'increase',
- 'abs' => 'absolute value',
- 'abs_dif' => 'change',
+ 'min' => 'minimum',
+ 'max' => 'maximum',
+ 'ave' => 'average',
+ 'der' => 'derivative',
+ 'cnt' => 'count of',
+ 'cnt_zero' => 'no',
+ 'val' => 'value',
+ 'values' => ' values',
+ 'dif' => 'difference',
+ 'dec' => 'decrease',
+ 'inc' => 'increase',
+ 'abs' => 'absolute value',
+ 'abs_dif' => 'change',
- 'Flash_logs' => 'Flash log files',
- 'FlashLog' => 'Flash log file',
+ 'Flash_logs' => 'Flash log files',
+ 'FlashLog' => 'Flash log file',
];
diff --git a/resources/lang/en/crud.php b/resources/lang/en/crud.php
index 28f325b8..641a9682 100644
--- a/resources/lang/en/crud.php
+++ b/resources/lang/en/crud.php
@@ -2,43 +2,43 @@
return [
- 'id' => 'ID',
- 'avatar' => 'Image',
- 'avatar_file' => 'Choose an image file as your avatar',
- 'name' => 'Name',
- 'display_name' => 'Display name',
- 'pass' => 'Password',
- 'pass_confirm' => 'Confirm password',
- 'description' => 'Description',
- 'email' => 'E-mail',
- 'type' => 'Type',
- 'key' => 'Device key',
- 'roles' => 'Roles',
- 'actions' => 'Actions',
- 'show' => 'Show',
- 'save' => 'Save',
- 'edit' => 'Edit',
- 'edited' => 'edited',
- 'delete' => 'Delete',
- 'deleted' => 'deleted',
- 'sure' => 'Are you sure you want to delete :item :name?',
- 'create' => 'Create a new :item',
- 'created' => 'created',
- 'created_at' => 'Created at',
- 'add' => 'Add a new :item',
- 'add_a' => 'Add a new :item',
- 'none' => 'None available',
- 'overview' => 'List of existing :item',
- 'select' => 'Select a :item...',
- 'select_multi' => 'Select one or more :item',
- 'management' => ':Item management',
- 'input_err' => 'There are some problems with your input',
- 'Attributes' => 'Attributes',
- 'attributes' => 'attributes',
- 'Item' => 'Item',
- 'item' => 'item',
- 'min' => 'min',
- 'max' => 'max',
- 'upload' => 'Upload :item',
+ 'id' => 'ID',
+ 'avatar' => 'Image',
+ 'avatar_file' => 'Choose an image file as your avatar',
+ 'name' => 'Name',
+ 'display_name' => 'Display name',
+ 'pass' => 'Password',
+ 'pass_confirm' => 'Confirm password',
+ 'description' => 'Description',
+ 'email' => 'E-mail',
+ 'type' => 'Type',
+ 'key' => 'Device key',
+ 'roles' => 'Roles',
+ 'actions' => 'Actions',
+ 'show' => 'Show',
+ 'save' => 'Save',
+ 'edit' => 'Edit',
+ 'edited' => 'edited',
+ 'delete' => 'Delete',
+ 'deleted' => 'deleted',
+ 'sure' => 'Are you sure you want to delete :item :name?',
+ 'create' => 'Create a new :item',
+ 'created' => 'created',
+ 'created_at' => 'Created at',
+ 'add' => 'Add a new :item',
+ 'add_a' => 'Add a new :item',
+ 'none' => 'None available',
+ 'overview' => 'List of existing :item',
+ 'select' => 'Select a :item...',
+ 'select_multi' => 'Select one or more :item',
+ 'management' => ':Item management',
+ 'input_err' => 'There are some problems with your input',
+ 'Attributes' => 'Attributes',
+ 'attributes' => 'attributes',
+ 'Item' => 'Item',
+ 'item' => 'item',
+ 'min' => 'min',
+ 'max' => 'max',
+ 'upload' => 'Upload :item',
];
diff --git a/resources/lang/en/export.php b/resources/lang/en/export.php
index 1f96d1e4..79556b12 100644
--- a/resources/lang/en/export.php
+++ b/resources/lang/en/export.php
@@ -2,52 +2,52 @@
return [
- 'id' => 'ID',
- 'user' => 'User',
- 'users' => 'Users',
- 'location_id' => 'Apiary',
- 'hive_type_id' => 'Hive type ID',
- 'color' => 'Color (HEX)',
- 'name' => 'Name',
- 'created_at' => 'Created at',
- 'updated_at' => 'Updated at',
- 'deleted_at' => 'Deleted at',
- 'type' => 'Type',
- 'hive' => 'Hive',
- 'hive_name' => 'Hive name',
- 'hives' => 'Hives',
- 'devices' => 'Sensor devices (online)',
- 'location' => 'Apiary',
- 'locations' => 'Apiaries',
- 'attention' => 'Needs attention',
- 'impression' => 'General impression',
- 'notes' => 'Notes',
- 'inspections' => 'Inspections',
+ 'id' => 'ID',
+ 'user' => 'User',
+ 'users' => 'Users',
+ 'location_id' => 'Apiary',
+ 'hive_type_id' => 'Hive type ID',
+ 'color' => 'Color (HEX)',
+ 'name' => 'Name',
+ 'created_at' => 'Created at',
+ 'updated_at' => 'Updated at',
+ 'deleted_at' => 'Deleted at',
+ 'type' => 'Type',
+ 'hive' => 'Hive',
+ 'hive_name' => 'Hive name',
+ 'hives' => 'Hives',
+ 'devices' => 'Sensor devices (online)',
+ 'location' => 'Apiary',
+ 'locations' => 'Apiaries',
+ 'attention' => 'Needs attention',
+ 'impression' => 'General impression',
+ 'notes' => 'Notes',
+ 'inspections' => 'Inspections',
'inspection_count' => 'Amount of inspections',
- 'brood_layers' => 'Brood layers',
- 'honey_layers' => 'Honey layers',
- 'frames' => 'Frames total',
- 'email' => 'E-mail address',
- 'avatar' => 'Avatar',
- 'last_login' => 'Last login',
- 'continent' => 'Continent',
- 'coordinate_lat'=> 'Lattitude',
- 'coordinate_lon'=> 'Longitude',
- 'address' => 'Address',
- 'postal_code' => 'Postal code',
- 'country_code' => 'Country',
- 'city' => 'City',
- 'queen' => 'Queen name',
- 'queen_color' => 'Queen color',
- 'queen_born' => 'Queen birth',
- 'queen_fertilized'=> 'Queen fertilized',
+ 'brood_layers' => 'Brood layers',
+ 'honey_layers' => 'Honey layers',
+ 'frames' => 'Frames total',
+ 'email' => 'E-mail address',
+ 'avatar' => 'Avatar',
+ 'last_login' => 'Last login',
+ 'continent' => 'Continent',
+ 'coordinate_lat' => 'Lattitude',
+ 'coordinate_lon' => 'Longitude',
+ 'address' => 'Address',
+ 'postal_code' => 'Postal code',
+ 'country_code' => 'Country',
+ 'city' => 'City',
+ 'queen' => 'Queen name',
+ 'queen_color' => 'Queen color',
+ 'queen_born' => 'Queen birth',
+ 'queen_fertilized' => 'Queen fertilized',
'queen_clipped' => 'Queen clipped',
- 'export_data' => 'Data export',
- 'export_text' => 'Hereby an export of all your data known in the BEEP app.',
- 'enjoy' => 'Have fun with it!',
- 'reminder' => 'Reminder',
+ 'export_data' => 'Data export',
+ 'export_text' => 'Hereby an export of all your data known in the BEEP app.',
+ 'enjoy' => 'Have fun with it!',
+ 'reminder' => 'Reminder',
'reminder_date' => 'Reminder date',
- 'sensordefs' => 'Sensor definitions',
- 'owner' => 'Owner',
- 'incl_group' => ' (including data from collaboration groups)',
+ 'sensordefs' => 'Sensor definitions',
+ 'owner' => 'Owner',
+ 'incl_group' => ' (including data from collaboration groups)',
];
diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php
index eb6d2ebe..aeaca110 100644
--- a/resources/lang/en/general.php
+++ b/resources/lang/en/general.php
@@ -2,91 +2,91 @@
return [
- 'Users' => 'Users',
- 'users' => 'users',
- 'User' => 'User',
- 'user' => 'user',
- 'Roles' => 'Roles',
- 'roles' => 'roles',
- 'Role' => 'Role',
- 'role' => 'role',
- 'Groups' => 'Groups',
- 'groups' => 'groups',
- 'Group' => 'Group',
- 'group' => 'group',
- 'Sensors' => 'Sensors',
- 'sensors' => 'sensors',
- 'Sensor' => 'Sensor',
- 'sensor' => 'sensor',
- 'Devices' => 'Devices',
- 'devices' => 'devices',
- 'Device' => 'Device',
- 'device' => 'device',
- 'Taxonomy' => 'Data categorization',
- 'taxonomy' => 'data categorization',
- 'Translations' => 'Translations',
- 'translations' => 'translations',
- 'Categories' => 'Categories',
- 'categories' => 'categories',
- 'Category' => 'Category',
- 'category' => 'category',
- 'type' => 'type',
- 'Permissions' => 'Permissions',
- 'permissions' => 'permissions',
- 'Permission' => 'Permission',
- 'permission' => 'permission',
- 'Profile' => 'Profile',
- 'Logout' => 'Log out',
- 'member_since' => 'Member since',
- 'last_action' => 'Last action',
- 'last_login' => 'Last login',
-
- 'superadmin' => 'Super admin',
- 'admin' => 'Admin',
- 'manager' => 'Sensor manager',
+ 'Users' => 'Users',
+ 'users' => 'users',
+ 'User' => 'User',
+ 'user' => 'user',
+ 'Roles' => 'Roles',
+ 'roles' => 'roles',
+ 'Role' => 'Role',
+ 'role' => 'role',
+ 'Groups' => 'Groups',
+ 'groups' => 'groups',
+ 'Group' => 'Group',
+ 'group' => 'group',
+ 'Sensors' => 'Sensors',
+ 'sensors' => 'sensors',
+ 'Sensor' => 'Sensor',
+ 'sensor' => 'sensor',
+ 'Devices' => 'Devices',
+ 'devices' => 'devices',
+ 'Device' => 'Device',
+ 'device' => 'device',
+ 'Taxonomy' => 'Data categorization',
+ 'taxonomy' => 'data categorization',
+ 'Translations' => 'Translations',
+ 'translations' => 'translations',
+ 'Categories' => 'Categories',
+ 'categories' => 'categories',
+ 'Category' => 'Category',
+ 'category' => 'category',
+ 'type' => 'type',
+ 'Permissions' => 'Permissions',
+ 'permissions' => 'permissions',
+ 'Permission' => 'Permission',
+ 'permission' => 'permission',
+ 'Profile' => 'Profile',
+ 'Logout' => 'Log out',
+ 'member_since' => 'Member since',
+ 'last_action' => 'Last action',
+ 'last_login' => 'Last login',
- 'Menu' => 'Menu',
- 'menu' => 'menu',
- 'menu_data' => 'Sensor data menu',
- 'toggle_nav' => 'Toggle navigation',
- 'dashboard' => 'Dashboard',
- 'sensordata' => 'Sensor data',
- 'export' => 'Export',
- 'dataexport' => 'Data export',
+ 'superadmin' => 'Super admin',
+ 'admin' => 'Admin',
+ 'manager' => 'Sensor manager',
- 'copyright' => 'Copyright',
- 'rights_res' => 'All rights reserved',
+ 'Menu' => 'Menu',
+ 'menu' => 'menu',
+ 'menu_data' => 'Sensor data menu',
+ 'toggle_nav' => 'Toggle navigation',
+ 'dashboard' => 'Dashboard',
+ 'sensordata' => 'Sensor data',
+ 'export' => 'Export',
+ 'dataexport' => 'Data export',
- 'second' => 'Second',
- 'minute' => 'Minute',
- 'hour' => 'Hour',
- 'day' => 'Day',
- 'week' => 'Week',
- 'month' => 'Month',
- 'year' => 'Year',
+ 'copyright' => 'Copyright',
+ 'rights_res' => 'All rights reserved',
- 'usage' => 'usage',
+ 'second' => 'Second',
+ 'minute' => 'Minute',
+ 'hour' => 'Hour',
+ 'day' => 'Day',
+ 'week' => 'Week',
+ 'month' => 'Month',
+ 'year' => 'Year',
- 'click_legend' => 'Click on one of the quantities in the legend below to hide/unhide its measeurements',
+ 'usage' => 'usage',
- 'Languages' => 'Languages',
- 'Language' => 'Language',
- 'languages' => 'languages',
- 'language' => 'language',
- 'switch_language'=>'Switch language',
- 'Translations' => 'Translations',
+ 'click_legend' => 'Click on one of the quantities in the legend below to hide/unhide its measeurements',
+
+ 'Languages' => 'Languages',
+ 'Language' => 'Language',
+ 'languages' => 'languages',
+ 'language' => 'language',
+ 'switch_language' => 'Switch language',
+ 'Translations' => 'Translations',
'Physical_quantity' => 'Physical quantity',
- 'unit' => 'unit',
- 'Source' => 'Information source',
- 'Icon' => 'Icon',
- 'No' => 'No',
- 'Yes' => 'Yes',
- 'Measurements' => 'Sensor measurements',
- 'Error' => 'Error',
+ 'unit' => 'unit',
+ 'Source' => 'Information source',
+ 'Icon' => 'Icon',
+ 'No' => 'No',
+ 'Yes' => 'Yes',
+ 'Measurements' => 'Sensor measurements',
+ 'Error' => 'Error',
'SensorDefinitions' => 'Sensor definitions',
- 'Images' => 'Images',
- 'Alerts' => 'Alerts',
- 'AlertRules' => 'Alert rules',
+ 'Images' => 'Images',
+ 'Alerts' => 'Alerts',
+ 'AlertRules' => 'Alert rules',
'AlertRuleFormulas' => 'Alert rule formulas',
];
diff --git a/resources/lang/en/group.php b/resources/lang/en/group.php
index f7886d28..d0c7de1c 100644
--- a/resources/lang/en/group.php
+++ b/resources/lang/en/group.php
@@ -2,22 +2,22 @@
return [
- 'subject_invite'=> 'Group invitation',
- 'group_text' => 'Hereby an invitation from :invited_by to join the following Beep hive cooperation group.',
- 'enjoy' => 'Have fun with it!',
- 'Admin' => 'Group administrator',
- 'of' => 'of',
- 'group' => 'group',
- 'Group' => 'group',
+ 'subject_invite' => 'Group invitation',
+ 'group_text' => 'Hereby an invitation from :invited_by to join the following Beep hive cooperation group.',
+ 'enjoy' => 'Have fun with it!',
+ 'Admin' => 'Group administrator',
+ 'of' => 'of',
+ 'group' => 'group',
+ 'Group' => 'group',
'Accept_invite' => 'Accept the invitation',
- 'Dear' => 'Dear',
- 'accepted' => 'accepted the invitation to join group: ',
- 'refused' => 'refused the invitation to join group: ',
- 'subject_accept'=> 'Group acceptation',
- 'subject_refusal'=> 'Group refusal',
- 'email_na' => 'These e-mail addresses are not yet members of Beep: ',
- 'Invited' => 'Invited: ',
- 'Updated' => 'Updated: ',
- 'Created' => 'Created: ',
- 'Deleted' => 'Deleted: ',
+ 'Dear' => 'Dear',
+ 'accepted' => 'accepted the invitation to join group: ',
+ 'refused' => 'refused the invitation to join group: ',
+ 'subject_accept' => 'Group acceptation',
+ 'subject_refusal' => 'Group refusal',
+ 'email_na' => 'These e-mail addresses are not yet members of Beep: ',
+ 'Invited' => 'Invited: ',
+ 'Updated' => 'Updated: ',
+ 'Created' => 'Created: ',
+ 'Deleted' => 'Deleted: ',
];
diff --git a/resources/lang/en/samplecode.php b/resources/lang/en/samplecode.php
index 054ebe7c..e00d7959 100644
--- a/resources/lang/en/samplecode.php
+++ b/resources/lang/en/samplecode.php
@@ -2,12 +2,12 @@
return [
- 'subject' => 'BEEP bee sample lab result',
- 'Dear' => 'Dear',
- 'Hive' => 'Hive: :hive',
- 'result_text' => 'A lab result for the bee sample with code :code, that you sent to the lab, has been uploaded to your BEEP account.',
- 'view_results' => 'View the lab results in the BEEP app',
+ 'subject' => 'BEEP bee sample lab result',
+ 'Dear' => 'Dear',
+ 'Hive' => 'Hive: :hive',
+ 'result_text' => 'A lab result for the bee sample with code :code, that you sent to the lab, has been uploaded to your BEEP account.',
+ 'view_results' => 'View the lab results in the BEEP app',
'lab_data_expl' => 'View explanations of the lab results',
- 'lab_data_url' => 'https://beepsupport.freshdesk.com/en/support/solutions/articles/60000815800-sample-data-clarification',
+ 'lab_data_url' => 'https://beepsupport.freshdesk.com/en/support/solutions/articles/60000815800-sample-data-clarification',
];
diff --git a/resources/lang/en/taxonomy.php b/resources/lang/en/taxonomy.php
index 339f4c02..0815ae2b 100644
--- a/resources/lang/en/taxonomy.php
+++ b/resources/lang/en/taxonomy.php
@@ -13,10 +13,10 @@
|
*/
- 'score_quality' => ['','Poor','Fair','Average','Good','Excellent'],
- 'score_amount' => ['','Low','Medium','High','Extreme'],
- 'smileys_3' => ['','8-(','8-|','8-)'],
- 'boolean' => ['No','Yes'],
- 'boolean_yes_red' => ['No','Yes'],
+ 'score_quality' => ['', 'Poor', 'Fair', 'Average', 'Good', 'Excellent'],
+ 'score_amount' => ['', 'Low', 'Medium', 'High', 'Extreme'],
+ 'smileys_3' => ['', '8-(', '8-|', '8-)'],
+ 'boolean' => ['No', 'Yes'],
+ 'boolean_yes_red' => ['No', 'Yes'],
];
diff --git a/resources/lang/nl/alert.php b/resources/lang/nl/alert.php
index f63981b9..ad241bc6 100644
--- a/resources/lang/nl/alert.php
+++ b/resources/lang/nl/alert.php
@@ -2,13 +2,13 @@
return [
- 'subject' => 'BEEP notificatie',
- 'Dear' => 'Beste',
- 'Location' => 'Locatie',
- 'Name' => 'Naam',
- 'alert_text' => 'Er is op :date een notificatie aangemaakt door de notificatie-instelling: :alertrule.',
- 'alert_value' => 'De gemeten waarde(n) die deze notificatie hebben getriggerd:',
- 'disable_text' => 'Afmelden? Zet deze notificatie uit in instellingen',
- 'View_alerts' => 'Bekijk alle notificaties in de BEEP app'
+ 'subject' => 'BEEP notificatie',
+ 'Dear' => 'Beste',
+ 'Location' => 'Locatie',
+ 'Name' => 'Naam',
+ 'alert_text' => 'Er is op :date een notificatie aangemaakt door de notificatie-instelling: :alertrule.',
+ 'alert_value' => 'De gemeten waarde(n) die deze notificatie hebben getriggerd:',
+ 'disable_text' => 'Afmelden? Zet deze notificatie uit in instellingen',
+ 'View_alerts' => 'Bekijk alle notificaties in de BEEP app',
];
diff --git a/resources/lang/nl/beep.php b/resources/lang/nl/beep.php
index 3b134c0c..ed084284 100644
--- a/resources/lang/nl/beep.php
+++ b/resources/lang/nl/beep.php
@@ -2,69 +2,69 @@
return [
- 'site_title' => 'BEEP - Managementsysteem',
- 'Hives' => 'Kasten',
- 'Hive' => 'Kast',
- 'Location' => 'Bijenstand',
- 'Locations' => 'Bijenstanden',
- 'Inspections' => 'Inspecties',
- 'Inspection' => 'Inspectie',
- 'Conditions' => 'Bevindingen',
- 'Actions' => 'Acties',
- 'footer_text' => 'Open source bijenmonitor',
- 'Beep_foundation' => 'Stichting BEEP',
+ 'site_title' => 'BEEP - Managementsysteem',
+ 'Hives' => 'Kasten',
+ 'Hive' => 'Kast',
+ 'Location' => 'Bijenstand',
+ 'Locations' => 'Bijenstanden',
+ 'Inspections' => 'Inspecties',
+ 'Inspection' => 'Inspectie',
+ 'Conditions' => 'Bevindingen',
+ 'Actions' => 'Acties',
+ 'footer_text' => 'Open source bijenmonitor',
+ 'Beep_foundation' => 'Stichting BEEP',
- 'PhysicalQuantity' => 'Grootheden',
- 'physicalquantity' => 'grootheid',
- 'BeeRace' => 'Bijenrassen',
- 'beerace' => 'bijenras',
- 'HiveType' => 'Kasttypen',
- 'hivetype' => 'kasttype',
- 'CategoryInputs' => 'Categorie itemtypen',
- 'categoryinput' => 'categorie itemtype',
- 'visualization' => 'visualisatie',
- 'visual' => 'visual',
+ 'PhysicalQuantity' => 'Grootheden',
+ 'physicalquantity' => 'grootheid',
+ 'BeeRace' => 'Bijenrassen',
+ 'beerace' => 'bijenras',
+ 'HiveType' => 'Kasttypen',
+ 'hivetype' => 'kasttype',
+ 'CategoryInputs' => 'Categorie itemtypen',
+ 'categoryinput' => 'categorie itemtype',
+ 'visualization' => 'visualisatie',
+ 'visual' => 'visual',
- 'Checklist' => 'Kastkaart',
- 'checklist' => 'kastkaart',
- 'Checklists' => 'Kastkaarten',
- 'checklists' => 'kastkaarten',
+ 'Checklist' => 'Kastkaart',
+ 'checklist' => 'kastkaart',
+ 'Checklists' => 'Kastkaarten',
+ 'checklists' => 'kastkaarten',
- 'Webapp' => 'Webapp',
- 'language' => 'taal',
+ 'Webapp' => 'Webapp',
+ 'language' => 'taal',
'required_in_inspection' => 'Verplicht bij inspectie',
- 'Measurement' => 'Meting',
- 'measurement' => 'sensormeting',
- 'Research' => 'Onderzoek',
- 'Researches' => 'Onderzoeken',
- 'calibration' => 'calibratie',
- 'calibrated' => 'gecalibreerd',
- 'SensorDefinition' => 'Sensordefinitie',
+ 'Measurement' => 'Meting',
+ 'measurement' => 'sensormeting',
+ 'Research' => 'Onderzoek',
+ 'Researches' => 'Onderzoeken',
+ 'calibration' => 'calibratie',
+ 'calibrated' => 'gecalibreerd',
+ 'SensorDefinition' => 'Sensordefinitie',
'SensorDefinitions' => 'Sensordefinities',
- 'SampleCode' => 'Sample code',
- 'SampleCodes' => 'Sample codes',
+ 'SampleCode' => 'Sample code',
+ 'SampleCodes' => 'Sample codes',
- 'Alert' => 'Alarm',
- 'Alerts' => 'Alarmen',
- 'AlertRule' => 'Alarmregel',
- 'AlertRules' => 'Alarmregels',
- 'AlertRuleFormula' => 'Alarmregelformule',
+ 'Alert' => 'Alarm',
+ 'Alerts' => 'Alarmen',
+ 'AlertRule' => 'Alarmregel',
+ 'AlertRules' => 'Alarmregels',
+ 'AlertRuleFormula' => 'Alarmregelformule',
'AlertRuleFormulas' => 'Alarmregelformules',
- 'min' => 'minimum',
- 'max' => 'maximum',
- 'ave' => 'gemiddelde',
- 'der' => 'afgeleide',
- 'cnt' => 'aantal x voorkomen van',
- 'cnt_zero' => 'geen',
- 'val' => 'waarde',
- 'values' => 'waarden',
- 'dif' => 'verschil met vorige waarde',
- 'dec' => 'daling',
- 'inc' => 'stijging',
- 'abs' => 'absolute waarde',
- 'abs_dif' => 'verandering',
+ 'min' => 'minimum',
+ 'max' => 'maximum',
+ 'ave' => 'gemiddelde',
+ 'der' => 'afgeleide',
+ 'cnt' => 'aantal x voorkomen van',
+ 'cnt_zero' => 'geen',
+ 'val' => 'waarde',
+ 'values' => 'waarden',
+ 'dif' => 'verschil met vorige waarde',
+ 'dec' => 'daling',
+ 'inc' => 'stijging',
+ 'abs' => 'absolute waarde',
+ 'abs_dif' => 'verandering',
- 'Flash_logs' => 'Flash log bestanden',
- 'FlashLog' => 'Flash log file',
+ 'Flash_logs' => 'Flash log bestanden',
+ 'FlashLog' => 'Flash log file',
];
diff --git a/resources/lang/nl/crud.php b/resources/lang/nl/crud.php
index 39eb9837..a3d92c4a 100644
--- a/resources/lang/nl/crud.php
+++ b/resources/lang/nl/crud.php
@@ -2,44 +2,44 @@
return [
- 'id' => 'ID',
- 'avatar' => 'Afbeelding',
- 'avatar_file' => 'Kies een afbeeldingsbestand als foto',
- 'name' => 'Naam',
- 'display_name' => 'Te tonen naam',
- 'pass' => 'Wachtwoord',
- 'pass_confirm' => 'Bevestig wachtwoord',
- 'description' => 'Beschrijving',
- 'email' => 'E-mail',
- 'type' => 'Type',
- 'key' => 'Key',
- 'roles' => 'Rollen',
- 'actions' => 'Acties',
- 'show' => 'Toon',
- 'save' => 'Opslaan',
- 'edit' => 'Wijzig',
- 'edited' => 'gewijzigd',
- 'delete' => 'Verwijder',
- 'deleted' => 'verwijderd',
- 'sure' => 'Weet je zeker dat je :item :name wilt verwijderen?',
- 'create' => 'Maak een nieuwe :item',
- 'created' => 'aangemaakt',
- 'created_at' => 'Aangemaakt op',
- 'add' => 'Voeg een nieuwe :item toe',
- 'add_a' => 'Voeg een nieuw :item toe',
- 'added' => 'toegevoegd',
- 'none' => 'Geen beschikbaar',
- 'overview' => 'Lijst van bestaande :item',
- 'select' => 'Selecteer een :item...',
- 'selected' => 'geselecteerd',
- 'select_multi' => 'Selecteer één of meerdere :item',
- 'management' => ':Itemmanagement',
- 'input_err' => 'Er zijn wat problemen met je invoer',
- 'Attributes' => 'Onderdelen',
- 'attributes' => 'onderdelen',
- 'Item' => 'Item',
- 'item' => 'item',
- 'min' => 'min',
- 'max' => 'max',
- 'upload' => ':item uploaden',
+ 'id' => 'ID',
+ 'avatar' => 'Afbeelding',
+ 'avatar_file' => 'Kies een afbeeldingsbestand als foto',
+ 'name' => 'Naam',
+ 'display_name' => 'Te tonen naam',
+ 'pass' => 'Wachtwoord',
+ 'pass_confirm' => 'Bevestig wachtwoord',
+ 'description' => 'Beschrijving',
+ 'email' => 'E-mail',
+ 'type' => 'Type',
+ 'key' => 'Key',
+ 'roles' => 'Rollen',
+ 'actions' => 'Acties',
+ 'show' => 'Toon',
+ 'save' => 'Opslaan',
+ 'edit' => 'Wijzig',
+ 'edited' => 'gewijzigd',
+ 'delete' => 'Verwijder',
+ 'deleted' => 'verwijderd',
+ 'sure' => 'Weet je zeker dat je :item :name wilt verwijderen?',
+ 'create' => 'Maak een nieuwe :item',
+ 'created' => 'aangemaakt',
+ 'created_at' => 'Aangemaakt op',
+ 'add' => 'Voeg een nieuwe :item toe',
+ 'add_a' => 'Voeg een nieuw :item toe',
+ 'added' => 'toegevoegd',
+ 'none' => 'Geen beschikbaar',
+ 'overview' => 'Lijst van bestaande :item',
+ 'select' => 'Selecteer een :item...',
+ 'selected' => 'geselecteerd',
+ 'select_multi' => 'Selecteer één of meerdere :item',
+ 'management' => ':Itemmanagement',
+ 'input_err' => 'Er zijn wat problemen met je invoer',
+ 'Attributes' => 'Onderdelen',
+ 'attributes' => 'onderdelen',
+ 'Item' => 'Item',
+ 'item' => 'item',
+ 'min' => 'min',
+ 'max' => 'max',
+ 'upload' => ':item uploaden',
];
diff --git a/resources/lang/nl/export.php b/resources/lang/nl/export.php
index 29df6636..c7b80b7c 100644
--- a/resources/lang/nl/export.php
+++ b/resources/lang/nl/export.php
@@ -2,52 +2,52 @@
return [
- 'id' => 'ID',
- 'user' => 'Gebruiker',
- 'users' => 'Gebruikers',
- 'location_id' => 'Bijenstand ID',
- 'hive_type_id' => 'Kasttype ID',
- 'color' => 'Kleur (HEX)',
- 'name' => 'Naam',
- 'created_at' => 'Aangemaakt op',
- 'updated_at' => 'Gewijzigd op',
- 'deleted_at' => 'Verwijderd op',
- 'type' => 'Type',
- 'hive' => 'Kast',
- 'hive_name' => 'Kastnaam',
- 'hives' => 'Kasten',
- 'devices' => 'Meetapparaten (online)',
- 'location' => 'Bijenstand',
- 'locations' => 'Bijenstanden',
- 'attention' => 'Aandacht nodig',
- 'impression' => 'Algemene indruk',
- 'notes' => 'Notities',
- 'inspections' => 'Inspecties',
+ 'id' => 'ID',
+ 'user' => 'Gebruiker',
+ 'users' => 'Gebruikers',
+ 'location_id' => 'Bijenstand ID',
+ 'hive_type_id' => 'Kasttype ID',
+ 'color' => 'Kleur (HEX)',
+ 'name' => 'Naam',
+ 'created_at' => 'Aangemaakt op',
+ 'updated_at' => 'Gewijzigd op',
+ 'deleted_at' => 'Verwijderd op',
+ 'type' => 'Type',
+ 'hive' => 'Kast',
+ 'hive_name' => 'Kastnaam',
+ 'hives' => 'Kasten',
+ 'devices' => 'Meetapparaten (online)',
+ 'location' => 'Bijenstand',
+ 'locations' => 'Bijenstanden',
+ 'attention' => 'Aandacht nodig',
+ 'impression' => 'Algemene indruk',
+ 'notes' => 'Notities',
+ 'inspections' => 'Inspecties',
'inspection_count' => 'Aantal inspecties',
- 'brood_layers' => 'Broedlagen',
- 'honey_layers' => 'Honinglagen',
- 'frames' => 'Raten totaal',
- 'email' => 'E-mail adres',
- 'avatar' => 'Avatar',
- 'last_login' => 'Laatste login',
- 'continent' => 'Continent',
- 'coordinate_lat'=> 'Breedtegraad',
- 'coordinate_lon'=> 'Lengtegraad',
- 'address' => 'Adres',
- 'postal_code' => 'Postcode',
- 'country_code' => 'Land',
- 'city' => 'Stad',
- 'queen' => 'Moer naam',
- 'queen_color' => 'Moer kleur',
- 'queen_born' => 'Moer geboren',
- 'queen_fertilized'=> 'Moer bevrucht',
+ 'brood_layers' => 'Broedlagen',
+ 'honey_layers' => 'Honinglagen',
+ 'frames' => 'Raten totaal',
+ 'email' => 'E-mail adres',
+ 'avatar' => 'Avatar',
+ 'last_login' => 'Laatste login',
+ 'continent' => 'Continent',
+ 'coordinate_lat' => 'Breedtegraad',
+ 'coordinate_lon' => 'Lengtegraad',
+ 'address' => 'Adres',
+ 'postal_code' => 'Postcode',
+ 'country_code' => 'Land',
+ 'city' => 'Stad',
+ 'queen' => 'Moer naam',
+ 'queen_color' => 'Moer kleur',
+ 'queen_born' => 'Moer geboren',
+ 'queen_fertilized' => 'Moer bevrucht',
'queen_clipped' => 'Moer geknipt',
- 'export_data' => 'Data export',
- 'export_text' => 'Hierbij een export van al je gegevens die bekend zijn bij BEEP.',
- 'enjoy' => 'Veel plezier ermee!',
- 'reminder' => 'Herinnering',
+ 'export_data' => 'Data export',
+ 'export_text' => 'Hierbij een export van al je gegevens die bekend zijn bij BEEP.',
+ 'enjoy' => 'Veel plezier ermee!',
+ 'reminder' => 'Herinnering',
'reminder_date' => 'Herinneringsdatum',
- 'sensordefs' => 'Sensordefinities',
- 'owner' => 'Eigenaar',
- 'incl_group' => ' (inclusief data uit samenwerkingsgroepen)',
+ 'sensordefs' => 'Sensordefinities',
+ 'owner' => 'Eigenaar',
+ 'incl_group' => ' (inclusief data uit samenwerkingsgroepen)',
];
diff --git a/resources/lang/nl/general.php b/resources/lang/nl/general.php
index de3abded..ade0a59d 100644
--- a/resources/lang/nl/general.php
+++ b/resources/lang/nl/general.php
@@ -2,91 +2,91 @@
return [
- 'Users' => 'Gebruikers',
- 'users' => 'gebruikers',
- 'User' => 'Gebruiker',
- 'user' => 'gebruiker',
- 'Roles' => 'Rollen',
- 'roles' => 'rollen',
- 'Role' => 'Rol',
- 'role' => 'rol',
- 'Groups' => 'Groepen',
- 'groups' => 'groepen',
- 'Group' => 'Groep',
- 'group' => 'groep',
- 'Sensors' => 'Sensoren',
- 'sensors' => 'sensoren',
- 'Sensor' => 'Sensor',
- 'sensor' => 'sensor',
- 'Devices' => 'Meetsystemen',
- 'devices' => 'meetsystemen',
- 'Device' => 'Meetsysteem',
- 'device' => 'meetsysteem',
- 'Taxonomy' => 'Data categorisatie',
- 'taxonomy' => 'data categorisatie',
- 'Translations' => 'Vertalingen',
- 'translations' => 'vertalingen',
- 'Categories' => 'Categoriën',
- 'categories' => 'categoriën',
- 'Category' => 'Categorie',
- 'category' => 'categorie',
- 'type' => 'type',
- 'Permissions' => 'Permissies',
- 'permissions' => 'permissies',
- 'Permission' => 'Permissie',
- 'permission' => 'permissie',
- 'Profile' => 'Profiel',
- 'Logout' => 'Log uit',
- 'member_since' => 'Lid sinds',
- 'last_action' => 'Laatste actie',
- 'last_login' => 'Laatst ingelogd',
-
- 'superadmin' => 'Super admin',
- 'admin' => 'Admin',
- 'manager' => 'Sensor manager',
+ 'Users' => 'Gebruikers',
+ 'users' => 'gebruikers',
+ 'User' => 'Gebruiker',
+ 'user' => 'gebruiker',
+ 'Roles' => 'Rollen',
+ 'roles' => 'rollen',
+ 'Role' => 'Rol',
+ 'role' => 'rol',
+ 'Groups' => 'Groepen',
+ 'groups' => 'groepen',
+ 'Group' => 'Groep',
+ 'group' => 'groep',
+ 'Sensors' => 'Sensoren',
+ 'sensors' => 'sensoren',
+ 'Sensor' => 'Sensor',
+ 'sensor' => 'sensor',
+ 'Devices' => 'Meetsystemen',
+ 'devices' => 'meetsystemen',
+ 'Device' => 'Meetsysteem',
+ 'device' => 'meetsysteem',
+ 'Taxonomy' => 'Data categorisatie',
+ 'taxonomy' => 'data categorisatie',
+ 'Translations' => 'Vertalingen',
+ 'translations' => 'vertalingen',
+ 'Categories' => 'Categoriën',
+ 'categories' => 'categoriën',
+ 'Category' => 'Categorie',
+ 'category' => 'categorie',
+ 'type' => 'type',
+ 'Permissions' => 'Permissies',
+ 'permissions' => 'permissies',
+ 'Permission' => 'Permissie',
+ 'permission' => 'permissie',
+ 'Profile' => 'Profiel',
+ 'Logout' => 'Log uit',
+ 'member_since' => 'Lid sinds',
+ 'last_action' => 'Laatste actie',
+ 'last_login' => 'Laatst ingelogd',
- 'Menu' => 'Menu',
- 'menu' => 'menu',
- 'menu_data' => 'Sensor data menu',
- 'toggle_nav' => 'Schakel navigatie',
- 'dashboard' => 'Dashboard',
- 'sensordata' => 'Sensor data',
- 'export' => 'Exporteer',
- 'dataexport' => 'Data export',
+ 'superadmin' => 'Super admin',
+ 'admin' => 'Admin',
+ 'manager' => 'Sensor manager',
- 'copyright' => 'Copyright',
- 'rights_res' => 'Alle rechten voorbehouden',
+ 'Menu' => 'Menu',
+ 'menu' => 'menu',
+ 'menu_data' => 'Sensor data menu',
+ 'toggle_nav' => 'Schakel navigatie',
+ 'dashboard' => 'Dashboard',
+ 'sensordata' => 'Sensor data',
+ 'export' => 'Exporteer',
+ 'dataexport' => 'Data export',
- 'second' => 'Seconde',
- 'minute' => 'Minuut',
- 'hour' => 'Uur',
- 'day' => 'Dag',
- 'week' => 'Week',
- 'month' => 'Maand',
- 'year' => 'Jaar',
+ 'copyright' => 'Copyright',
+ 'rights_res' => 'Alle rechten voorbehouden',
- 'usage' => 'gebruik',
+ 'second' => 'Seconde',
+ 'minute' => 'Minuut',
+ 'hour' => 'Uur',
+ 'day' => 'Dag',
+ 'week' => 'Week',
+ 'month' => 'Maand',
+ 'year' => 'Jaar',
- 'click_legend' => 'Klik op een van de grootheden in de legenda om meetwaarden te verbergen/tonen',
+ 'usage' => 'gebruik',
- 'Languages' => 'Talen',
- 'Language' => 'Taal',
- 'languages' => 'talen',
- 'language' => 'taal',
- 'switch_language'=>'Andere taal',
- 'Translations' => 'Vertalingen',
+ 'click_legend' => 'Klik op een van de grootheden in de legenda om meetwaarden te verbergen/tonen',
+
+ 'Languages' => 'Talen',
+ 'Language' => 'Taal',
+ 'languages' => 'talen',
+ 'language' => 'taal',
+ 'switch_language' => 'Andere taal',
+ 'Translations' => 'Vertalingen',
'Physical_quantity' => 'Grootheid',
- 'unit' => 'eenheid',
- 'Source' => 'Informatiebron',
- 'Icon' => 'Icoon',
- 'No' => 'Nee',
- 'Yes' => 'Ja',
- 'Measurements' => 'Sensormetingen',
- 'Error' => 'Fout',
+ 'unit' => 'eenheid',
+ 'Source' => 'Informatiebron',
+ 'Icon' => 'Icoon',
+ 'No' => 'Nee',
+ 'Yes' => 'Ja',
+ 'Measurements' => 'Sensormetingen',
+ 'Error' => 'Fout',
'SensorDefinitions' => 'Sensordefinities',
- 'Images' => 'Foto\'s',
- 'Alerts' => 'Alarmen',
- 'AlertRules' => 'Alarmregels',
+ 'Images' => 'Foto\'s',
+ 'Alerts' => 'Alarmen',
+ 'AlertRules' => 'Alarmregels',
'AlertRuleFormulas' => 'Alarmregelformules',
];
diff --git a/resources/lang/nl/group.php b/resources/lang/nl/group.php
index ffd29b1c..1bc64f08 100644
--- a/resources/lang/nl/group.php
+++ b/resources/lang/nl/group.php
@@ -2,21 +2,21 @@
return [
- 'subject_invite'=> 'Groepsuitnodiging',
- 'group_text' => 'Hierbij een uitnodiging van :invited_by om samen te werken in de onderstaande Beep bijenkasten groep.',
- 'enjoy' => 'Veel plezier ermee!',
- 'Admin' => 'Groepsbeheerder',
- 'of' => 'van',
- 'group' => 'groep',
- 'Group' => 'Groep',
+ 'subject_invite' => 'Groepsuitnodiging',
+ 'group_text' => 'Hierbij een uitnodiging van :invited_by om samen te werken in de onderstaande Beep bijenkasten groep.',
+ 'enjoy' => 'Veel plezier ermee!',
+ 'Admin' => 'Groepsbeheerder',
+ 'of' => 'van',
+ 'group' => 'groep',
+ 'Group' => 'Groep',
'Accept_invite' => 'Accepteer de uitnodiging',
- 'Dear' => 'Beste',
- 'accepted' => 'heeft de uitnodiging geaccepteerd voor groep: ',
- 'subject_accept'=> 'Groep acceptatie',
- 'subject_refusal'=> 'Groep afwijzing',
- 'email_na' => 'Deze e-mail adressen zijn nog geen lid van Beep: ',
- 'Invited' => 'Uitgenodigd: ',
- 'Updated' => 'Geupdate: ',
- 'Created' => 'Aangemaakt: ',
- 'Deleted' => 'Verwijderd: ',
+ 'Dear' => 'Beste',
+ 'accepted' => 'heeft de uitnodiging geaccepteerd voor groep: ',
+ 'subject_accept' => 'Groep acceptatie',
+ 'subject_refusal' => 'Groep afwijzing',
+ 'email_na' => 'Deze e-mail adressen zijn nog geen lid van Beep: ',
+ 'Invited' => 'Uitgenodigd: ',
+ 'Updated' => 'Geupdate: ',
+ 'Created' => 'Aangemaakt: ',
+ 'Deleted' => 'Verwijderd: ',
];
diff --git a/resources/lang/nl/passwords.php b/resources/lang/nl/passwords.php
index 527fe20e..16002e67 100644
--- a/resources/lang/nl/passwords.php
+++ b/resources/lang/nl/passwords.php
@@ -17,6 +17,6 @@
'reset' => 'Uw wachtwoord is gereset!',
'sent' => 'We hebben u een wachtwoord-reset-link gestuurd!',
'token' => 'Het wachtwoord-reset-token is ongeldig.',
- 'user' => "We kunnen helaas geen gebruiker vinden met het ingevoerde e-mail adres.",
+ 'user' => 'We kunnen helaas geen gebruiker vinden met het ingevoerde e-mail adres.',
];
diff --git a/resources/lang/nl/samplecode.php b/resources/lang/nl/samplecode.php
index ec700166..57f4e2da 100644
--- a/resources/lang/nl/samplecode.php
+++ b/resources/lang/nl/samplecode.php
@@ -2,12 +2,12 @@
return [
- 'subject' => 'BEEP labresultaat',
- 'Dear' => 'Beste',
- 'Hive' => 'Kast: :hive',
- 'result_text' => 'Een labresultaat voor het door jou opgestuurde bijenmonster met code :code is zojuist door het lab geupload naar je BEEP account.',
- 'view_results' => 'Bekijk het resultaat in de BEEP app',
+ 'subject' => 'BEEP labresultaat',
+ 'Dear' => 'Beste',
+ 'Hive' => 'Kast: :hive',
+ 'result_text' => 'Een labresultaat voor het door jou opgestuurde bijenmonster met code :code is zojuist door het lab geupload naar je BEEP account.',
+ 'view_results' => 'Bekijk het resultaat in de BEEP app',
'lab_data_expl' => 'Bekijk de uitleg van de labresultaten',
- 'lab_data_url' => 'https://beepsupport.freshdesk.com/en/support/solutions/articles/60000815800-sample-data-clarification',
+ 'lab_data_url' => 'https://beepsupport.freshdesk.com/en/support/solutions/articles/60000815800-sample-data-clarification',
];
diff --git a/resources/lang/nl/taxonomy.php b/resources/lang/nl/taxonomy.php
index 8ec714b8..090dbf81 100644
--- a/resources/lang/nl/taxonomy.php
+++ b/resources/lang/nl/taxonomy.php
@@ -13,10 +13,10 @@
|
*/
- 'score_quality' => ['','Slecht','Matig','Gemiddeld','Goed','Zeer goed'],
- 'score_amount' => ['','Laag','Gemiddeld','Hoog','Extreem'],
- 'smileys_3' => ['','8-(','8-|','8-)'],
- 'boolean' => ['Nee','Ja'],
- 'boolean_yes_red' => ['Nee','Ja'],
+ 'score_quality' => ['', 'Slecht', 'Matig', 'Gemiddeld', 'Goed', 'Zeer goed'],
+ 'score_amount' => ['', 'Laag', 'Gemiddeld', 'Hoog', 'Extreem'],
+ 'smileys_3' => ['', '8-(', '8-|', '8-)'],
+ 'boolean' => ['Nee', 'Ja'],
+ 'boolean_yes_red' => ['Nee', 'Ja'],
];
diff --git a/resources/lang/nl/validation.php b/resources/lang/nl/validation.php
index dd7a0026..277dbfeb 100644
--- a/resources/lang/nl/validation.php
+++ b/resources/lang/nl/validation.php
@@ -11,86 +11,86 @@
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
- | NB: Do not change the words directly after a colon (:attribute, :min, :max, :values, etc.)
- | in the translations, these will be replaced with another translation term
- |
+ | NB: Do not change the words directly after a colon (:attribute, :min, :max, :values, etc.)
+ | in the translations, these will be replaced with another translation term
+ |
| NB: Only change translations until the comment block 'Custom Validation Language Lines'
|
*/
- "accepted" => ":attribute dient te worden geaccepteerd.",
- "active_url" => ":attribute is geen geldige URL.",
- "after" => ":attribute dient een datum te zijn na :date.",
- "alpha" => ":attribute mag alleen letters bevatten.",
- "alpha_dash" => ":attribute mag alleen letters, nummers, and strepen bevatten.",
- "alpha_num" => ":attribute mag alleen letters en nummers bevatten.",
- "array" => ":attribute moet een array zijn.",
- "before" => ":attribute moet een datum zijn eerder dan :date.",
- "between" => [
- "numeric" => ":attribute moet tussen :min en :max liggen.",
- "file" => ":attribute moet tussen :min en :max kilobytes zijn.",
- "string" => ":attribute moet tussen :min en :max karakters lang zijn.",
- "array" => ":attribute moet tussen :min en :max items bevatten.",
+ 'accepted' => ':attribute dient te worden geaccepteerd.',
+ 'active_url' => ':attribute is geen geldige URL.',
+ 'after' => ':attribute dient een datum te zijn na :date.',
+ 'alpha' => ':attribute mag alleen letters bevatten.',
+ 'alpha_dash' => ':attribute mag alleen letters, nummers, and strepen bevatten.',
+ 'alpha_num' => ':attribute mag alleen letters en nummers bevatten.',
+ 'array' => ':attribute moet een array zijn.',
+ 'before' => ':attribute moet een datum zijn eerder dan :date.',
+ 'between' => [
+ 'numeric' => ':attribute moet tussen :min en :max liggen.',
+ 'file' => ':attribute moet tussen :min en :max kilobytes zijn.',
+ 'string' => ':attribute moet tussen :min en :max karakters lang zijn.',
+ 'array' => ':attribute moet tussen :min en :max items bevatten.',
],
- "boolean" => ":attribute kan enkel true of false zijn.",
- "confirmed" => ":attribute bevestiging komt niet overeen.",
- "date" => ":attribute is geen geldige datum.",
- "date_format" => ":attribute komt niet overeen met het formaat :format.",
- "different" => ":attribute en :other dienen verschillend te zijn.",
- "digits" => ":attribute moet :digits cijfers zijn.",
- "digits_between" => ":attribute moet tussen :min en :max cijfers zijn.",
- "email" => ":attribute dient een geldig emailadres te zijn.",
- "filled" => ":attribute veld is verplicht.",
- "exists" => "Het geselecteerde :attribute is ongeldig.",
- "image" => ":attribute dient een afbeelding te zijn.",
- "in" => "Het geselecteerde :attribute is ongeldig.",
- "integer" => ":attribute dient een geheel getal te zijn.",
- "ip" => ":attribute dient een geldig IP adres te zijn.",
- "max" => [
- "numeric" => ":attribute mag niet groter zijn dan :max.",
- "file" => ":attribute mag niet groter zijn dan :max kilobytes.",
- "string" => ":attribute mag niet groter zijn dan :max karakters.",
- "array" => ":attribute mag niet meer dan :max items bevatten.",
+ 'boolean' => ':attribute kan enkel true of false zijn.',
+ 'confirmed' => ':attribute bevestiging komt niet overeen.',
+ 'date' => ':attribute is geen geldige datum.',
+ 'date_format' => ':attribute komt niet overeen met het formaat :format.',
+ 'different' => ':attribute en :other dienen verschillend te zijn.',
+ 'digits' => ':attribute moet :digits cijfers zijn.',
+ 'digits_between' => ':attribute moet tussen :min en :max cijfers zijn.',
+ 'email' => ':attribute dient een geldig emailadres te zijn.',
+ 'filled' => ':attribute veld is verplicht.',
+ 'exists' => 'Het geselecteerde :attribute is ongeldig.',
+ 'image' => ':attribute dient een afbeelding te zijn.',
+ 'in' => 'Het geselecteerde :attribute is ongeldig.',
+ 'integer' => ':attribute dient een geheel getal te zijn.',
+ 'ip' => ':attribute dient een geldig IP adres te zijn.',
+ 'max' => [
+ 'numeric' => ':attribute mag niet groter zijn dan :max.',
+ 'file' => ':attribute mag niet groter zijn dan :max kilobytes.',
+ 'string' => ':attribute mag niet groter zijn dan :max karakters.',
+ 'array' => ':attribute mag niet meer dan :max items bevatten.',
],
- "mimes" => ":attribute dient een bestand te zijn van het type: :values.",
- "min" => [
- "numeric" => ":attribute dient minimaal :min te zijn.",
- "file" => ":attribute dient minimaal :min kilobytes te zijn.",
- "string" => ":attribute dient minimaal :min karakters te bevatten.",
- "array" => ":attribute dient minimaal :min items te bevatten.",
+ 'mimes' => ':attribute dient een bestand te zijn van het type: :values.',
+ 'min' => [
+ 'numeric' => ':attribute dient minimaal :min te zijn.',
+ 'file' => ':attribute dient minimaal :min kilobytes te zijn.',
+ 'string' => ':attribute dient minimaal :min karakters te bevatten.',
+ 'array' => ':attribute dient minimaal :min items te bevatten.',
],
- "not_in" => "Het geselecteerde :attribute is ongeldig.",
- "numeric" => "Het :attribute dient een nummer te zijn.",
- "regex" => "Het :attribute formaat is ongeldig.",
- "required" => "Het :attribute veld is verplicht.",
- "required_if" => "Het :attribute veld is verplicht wanneer :other is :value.",
- "required_with" => "Het :attribute veld is verplicht wanneer :values aanwezig is.",
- "required_with_all" => "Het :attribute veld is verplicht wanneer :values aanwezig is.",
- "required_without" => "Het :attribute veld is verplicht wanneer :values niet aanwezig is.",
- "required_without_all" => "Het :attribute veld is verplicht wanneer geen van :values aanwezig is.",
- "same" => "Het :attribute en :other moeten hetzelfde zijn.",
- "size" => [
- "numeric" => ":attribute moet :size zijn.",
- "file" => ":attribute moet :size kilobytes groot zijn.",
- "string" => ":attribute moet :size karakters lang zijn.",
- "array" => ":attribute moet :size items bevatten.",
+ 'not_in' => 'Het geselecteerde :attribute is ongeldig.',
+ 'numeric' => 'Het :attribute dient een nummer te zijn.',
+ 'regex' => 'Het :attribute formaat is ongeldig.',
+ 'required' => 'Het :attribute veld is verplicht.',
+ 'required_if' => 'Het :attribute veld is verplicht wanneer :other is :value.',
+ 'required_with' => 'Het :attribute veld is verplicht wanneer :values aanwezig is.',
+ 'required_with_all' => 'Het :attribute veld is verplicht wanneer :values aanwezig is.',
+ 'required_without' => 'Het :attribute veld is verplicht wanneer :values niet aanwezig is.',
+ 'required_without_all' => 'Het :attribute veld is verplicht wanneer geen van :values aanwezig is.',
+ 'same' => 'Het :attribute en :other moeten hetzelfde zijn.',
+ 'size' => [
+ 'numeric' => ':attribute moet :size zijn.',
+ 'file' => ':attribute moet :size kilobytes groot zijn.',
+ 'string' => ':attribute moet :size karakters lang zijn.',
+ 'array' => ':attribute moet :size items bevatten.',
],
- "unique" => ":attribute is al bezet.",
- "url" => "Het :attribute is geen geldige url.",
- "timezone" => ":attribute moet een geldige tijdszone zijn.",
+ 'unique' => ':attribute is al bezet.',
+ 'url' => 'Het :attribute is geen geldige url.',
+ 'timezone' => ':attribute moet een geldige tijdszone zijn.',
+
+ 'after_or_equal' => ':attribute moet een datum op of na :date zijn.',
+ 'dimensions' => ':attribute heeft onjuiste afbeeldingsafmetingen.',
+ 'distinct' => 'Het :attribute veld is al bezet.',
+ 'file' => ':attribute moet een bestand zijn.',
+ 'in_array' => 'Het :attribute veld bestaat niet in :other.',
+ 'json' => ':attribute moet een geldige JSON string zijn.',
+ 'mimetypes' => ':attribute moet een bestand zijn van type: :values.',
+ 'present' => 'Het :attribute veld moet aanwezig zijn.',
+ 'regex' => ':attribute format is ongeldig.',
+ 'string' => ':attribute moet een string zijn.',
+ 'uploaded' => ':attribute is niet geupload.',
- 'after_or_equal' => ':attribute moet een datum op of na :date zijn.',
- 'dimensions' => ':attribute heeft onjuiste afbeeldingsafmetingen.',
- 'distinct' => 'Het :attribute veld is al bezet.',
- 'file' => ':attribute moet een bestand zijn.',
- 'in_array' => 'Het :attribute veld bestaat niet in :other.',
- 'json' => ':attribute moet een geldige JSON string zijn.',
- 'mimetypes' => ':attribute moet een bestand zijn van type: :values.',
- 'present' => 'Het :attribute veld moet aanwezig zijn.',
- 'regex' => ':attribute format is ongeldig.',
- 'string' => ':attribute moet een string zijn.',
- 'uploaded' => ':attribute is niet geupload.',
-
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
diff --git a/routes/api.php b/routes/api.php
index 0faabbab..deda05f9 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -1,7 +1,5 @@
middleware('throttle:10,1,sensors');
- Route::post('lora_sensors', 'Api\MeasurementController@lora_sensors')->middleware('throttle:10,1,lora_sensors');
- Route::get('sensors/measurement_types', 'Api\MeasurementController@sensor_measurement_types')->middleware('throttle:3,1,measurement_types');
-
- // save sensor data of multiple sensors (unsecure)
- //Route::post('unsecure_sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:1,1');
-
- // User functions
- Route::post('register', 'Api\UserController@register')->middleware('throttle:6,1,register');
- Route::post('login', 'Api\UserController@login')->middleware('throttle:20,1,login');
- Route::post('user/reminder','Api\UserController@reminder')->middleware('throttle:3,1,user_reminder');
- Route::post('user/reset', 'Api\UserController@reset')->middleware('throttle:3,1,user_reset');
-
- // // Email Verification Routes...
- Route::get('email/verify/{id}', 'Api\Auth\VerificationController@verify')->name('apiverification.verify')->middleware('throttle:6,1,verify');
- Route::post('email/resend', 'Api\Auth\VerificationController@resend')->name('apiverification.resend')->middleware('throttle:3,1,resend');
-
- Route::post('groups/checktoken', 'Api\GroupController@checktoken')->middleware('throttle:6,1,checktoken');
-
- // Public Dashboard
- Route::get('dashboard/{code}', 'Api\DashboardGroupController@public')->middleware('throttle:60,1,publicdashboard');
-
- // high traffic routes
- Route::group(['middleware'=>['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min_sensors,1,sensor_traffic']], function()
- {
- Route::post('sensors_auth', 'Api\MeasurementController@storeMeasurementData');
- Route::post('lora_sensors_auth', 'Api\MeasurementController@lora_sensors');
- });
-
- // normal traffic routes
- Route::group(['middleware'=>['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min,1,normal_traffic']], function()
- {
- //Route::post('devices/tts/{step}/{dev_id}/{dev_eui}/{app_key}', 'Api\DeviceController@debugTtsDevice');
-
- // Authenticate and provide the token
- Route::post('authenticate', 'Api\UserController@authenticate');
-
- // get more data of 1 sensor (Device)
- Route::post('devices/multiple', 'Api\DeviceController@storeMultiple');
- Route::get('devices/ttn/{dev_id}', 'Api\DeviceController@getTTNDevice');
- Route::post('devices/ttn/{dev_id}', 'Api\DeviceController@postTTNDevice');
-
- Route::get('sensors/measurements', 'Api\MeasurementController@data');
- Route::get('sensors/comparemeasurements', 'Api\MeasurementController@comparedata');
- Route::get('sensors/cleanedweight', 'Api\MeasurementController@cleanedweight');
- Route::get('sensors/lastvalues', 'Api\MeasurementController@lastvalues');
- Route::get('sensors/lastweight', 'Api\MeasurementController@lastweight');
- Route::post('sensors/calibrateweight','Api\MeasurementController@calibrateweight');
- Route::post('sensors/offsetweight' ,'Api\MeasurementController@offsetweight');
- Route::get('sensors/measurement_types_available', 'Api\MeasurementController@sensor_measurement_types_available');
- Route::post('sensors/flashlog', 'Api\MeasurementController@flashlog');
- Route::get('sensors/decode/p/{port}/pl/{payload}', 'Api\MeasurementController@decode_beep_lora_payload');
-
- Route::post('settings', 'Api\SettingController@store');
- Route::get('settings', 'Api\SettingController@index');
-
- Route::get('taxonomy/lists', 'Api\TaxonomyController@lists');
- Route::get('taxonomy/taxonomy', 'Api\TaxonomyController@taxonomy');
-
- Route::get('inspections', 'Api\InspectionsController@index');
- Route::get('inspections/lists', 'Api\InspectionsController@lists');
- Route::get('inspections/{id}', 'Api\InspectionsController@show');
- Route::get('inspections/hive/{hive_id}', 'Api\InspectionsController@hive');
- Route::post('inspections/store', 'Api\InspectionsController@store');
- Route::delete('inspections/{id}', 'Api\InspectionsController@destroy');
-
-
- Route::get('research', 'Api\ResearchController@index');
- Route::post('research/{id}/add_consent', 'Api\ResearchController@add_consent');
- Route::post('research/{id}/remove_consent','Api\ResearchController@remove_consent');
- Route::patch('research/{id}/edit/{consent_id}','Api\ResearchController@edit_consent');
- Route::delete('research/{id}/delete/{consent_id}','Api\ResearchController@delete_no_consent');
-
- Route::get('researchdata', 'Api\ResearchDataController@index');
- Route::get('researchdata/{id}', 'Api\ResearchDataController@show');
- Route::get('researchdata/{id}/data/{item}', 'Api\ResearchDataController@research_data');
- Route::get('researchdata/{id}/user/{user_id}/{item}', 'Api\ResearchDataController@user_data');
-
- Route::delete('user', 'Api\UserController@destroy');
- Route::patch('user', 'Api\UserController@edit');
- Route::patch('userlocale', 'Api\UserController@userlocale');
-
- // Device specific routes (must be before resource route)
- Route::post('devices/clocksync', 'Api\DeviceController@clocksync');
- Route::post('devices/lora_reset', 'Api\DeviceController@lora_reset');
- Route::post('devices/interval', 'Api\DeviceController@interval');
-
- // Control resources
- Route::resource('devices', 'Api\DeviceController', ['except'=>['create','edit']]);
- Route::resource('checklists', 'Api\ChecklistController', ['except'=>['create','edit']]);
- Route::resource('categories', 'Api\CategoryController', ['except'=>['create','edit','store','update','destroy']]);
- Route::resource('groups', 'Api\GroupController', ['except'=>['create','edit']]);
- Route::resource('hives', 'Api\HiveController', ['except'=>['create','edit']]);
- Route::resource('hive-tags', 'Api\HiveTagsController', ['except'=>['create','edit']]);
- Route::resource('locations', 'Api\LocationController', ['except'=>['create','edit']]);
- Route::resource('queens', 'Api\QueenController', ['except'=>['create','edit']]);
- Route::resource('images', 'Api\ImageController', ['except'=>['create','edit','destroy']]);
- Route::resource('sensordefinition', 'Api\SensorDefinitionController', ['except'=>['create','edit']]);
- Route::resource('samplecode', 'Api\SampleCodeController', ['except'=>['create','edit','destroy']]);
- Route::resource('alerts', 'Api\AlertController', ['except'=>['create','edit']]);
- Route::resource('alert-rules', 'Api\AlertRuleController', ['except'=>['create','edit']]);
- Route::resource('dashboardgroups', 'Api\DashboardGroupController', ['except'=>['create','edit']]);
- Route::resource('checklist-svg', 'Api\ChecklistSvgController', ['except'=>['create','edit']]);
-
- Route::get('alert-rules-default', 'Api\AlertRuleController@default_rules');
-
- Route::delete('samplecode', 'Api\SampleCodeController@destroy');
- Route::delete('images', 'Api\ImageController@destroyByUrl');
- Route::delete('groups/detach/{id}', 'Api\GroupController@detach');
-
- Route::get('categoryinputs', 'Api\CategoryController@inputs');
- Route::post('export/csv', 'Api\ExportController@generate_csv');
-
- Route::get('flashlogs', 'Api\FlashLogController@index');
- Route::get('flashlogs/{id}', 'Api\FlashLogController@show');
- Route::post('flashlogs/{id}', 'Api\FlashLogController@persist');
- Route::delete('flashlogs/{id}', 'Api\FlashLogController@delete');
- });
-
-
- // low traffic routes
- Route::group(['middleware'=>['auth:api', 'verifiedApi', 'throttle:3,1,low_traffic']], function()
- {
- Route::get('export', 'Api\ExportController@all');
- Route::get('weather', 'Api\WeatherController@index');
- });
-
-});
\ No newline at end of file
+Route::group([], function () {
+
+ Route::get('/', function () {
+ return redirect('webapp');
+ });
+
+ // save sensor data of multiple sensors
+ Route::post('sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:10,1,sensors');
+ Route::post('lora_sensors', 'Api\MeasurementController@lora_sensors')->middleware('throttle:10,1,lora_sensors');
+ Route::get('sensors/measurement_types', 'Api\MeasurementController@sensor_measurement_types')->middleware('throttle:3,1,measurement_types');
+
+ // save sensor data of multiple sensors (unsecure)
+ // Route::post('unsecure_sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:1,1');
+
+ // User functions
+ Route::post('register', 'Api\UserController@register')->middleware('throttle:6,1,register');
+ Route::post('login', 'Api\UserController@login')->middleware('throttle:20,1,login');
+ Route::post('user/reminder', 'Api\UserController@reminder')->middleware('throttle:3,1,user_reminder');
+ Route::post('user/reset', 'Api\UserController@reset')->middleware('throttle:3,1,user_reset');
+
+ // // Email Verification Routes...
+ Route::get('email/verify/{id}', 'Api\Auth\VerificationController@verify')->name('apiverification.verify')->middleware('throttle:6,1,verify');
+ Route::post('email/resend', 'Api\Auth\VerificationController@resend')->name('apiverification.resend')->middleware('throttle:3,1,resend');
+
+ Route::post('groups/checktoken', 'Api\GroupController@checktoken')->middleware('throttle:6,1,checktoken');
+
+ // Public Dashboard
+ Route::get('dashboard/{code}', 'Api\DashboardGroupController@public')->middleware('throttle:60,1,publicdashboard');
+
+ // high traffic routes
+ Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min_sensors,1,sensor_traffic']], function () {
+ Route::post('sensors_auth', 'Api\MeasurementController@storeMeasurementData');
+ Route::post('lora_sensors_auth', 'Api\MeasurementController@lora_sensors');
+ });
+
+ // normal traffic routes
+ Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min,1,normal_traffic']], function () {
+ // Route::post('devices/tts/{step}/{dev_id}/{dev_eui}/{app_key}', 'Api\DeviceController@debugTtsDevice');
+
+ // Authenticate and provide the token
+ Route::post('authenticate', 'Api\UserController@authenticate');
+
+ // get more data of 1 sensor (Device)
+ Route::post('devices/multiple', 'Api\DeviceController@storeMultiple');
+ Route::get('devices/ttn/{dev_id}', 'Api\DeviceController@getTTNDevice');
+ Route::post('devices/ttn/{dev_id}', 'Api\DeviceController@postTTNDevice');
+
+ Route::get('sensors/measurements', 'Api\MeasurementController@data');
+ Route::get('sensors/comparemeasurements', 'Api\MeasurementController@comparedata');
+ Route::get('sensors/cleanedweight', 'Api\MeasurementController@cleanedweight');
+ Route::get('sensors/lastvalues', 'Api\MeasurementController@lastvalues');
+ Route::get('sensors/lastweight', 'Api\MeasurementController@lastweight');
+ Route::post('sensors/calibrateweight', 'Api\MeasurementController@calibrateweight');
+ Route::post('sensors/offsetweight', 'Api\MeasurementController@offsetweight');
+ Route::get('sensors/measurement_types_available', 'Api\MeasurementController@sensor_measurement_types_available');
+ Route::post('sensors/flashlog', 'Api\MeasurementController@flashlog');
+ Route::get('sensors/decode/p/{port}/pl/{payload}', 'Api\MeasurementController@decode_beep_lora_payload');
+
+ Route::post('settings', 'Api\SettingController@store');
+ Route::get('settings', 'Api\SettingController@index');
+
+ Route::get('taxonomy/lists', 'Api\TaxonomyController@lists');
+ Route::get('taxonomy/taxonomy', 'Api\TaxonomyController@taxonomy');
+
+ Route::get('inspections', 'Api\InspectionsController@index');
+ Route::get('inspections/lists', 'Api\InspectionsController@lists');
+ Route::get('inspections/{id}', 'Api\InspectionsController@show');
+ Route::get('inspections/hive/{hive_id}', 'Api\InspectionsController@hive');
+ Route::post('inspections/store', 'Api\InspectionsController@store');
+ Route::delete('inspections/{id}', 'Api\InspectionsController@destroy');
+
+ Route::get('research', 'Api\ResearchController@index');
+ Route::post('research/{id}/add_consent', 'Api\ResearchController@add_consent');
+ Route::post('research/{id}/remove_consent', 'Api\ResearchController@remove_consent');
+ Route::patch('research/{id}/edit/{consent_id}', 'Api\ResearchController@edit_consent');
+ Route::delete('research/{id}/delete/{consent_id}', 'Api\ResearchController@delete_no_consent');
+
+ Route::get('researchdata', 'Api\ResearchDataController@index');
+ Route::get('researchdata/{id}', 'Api\ResearchDataController@show');
+ Route::get('researchdata/{id}/data/{item}', 'Api\ResearchDataController@research_data');
+ Route::get('researchdata/{id}/user/{user_id}/{item}', 'Api\ResearchDataController@user_data');
+
+ Route::delete('user', 'Api\UserController@destroy');
+ Route::patch('user', 'Api\UserController@edit');
+ Route::patch('userlocale', 'Api\UserController@userlocale');
+
+ // Device specific routes (must be before resource route)
+ Route::post('devices/clocksync', 'Api\DeviceController@clocksync');
+ Route::post('devices/lora_reset', 'Api\DeviceController@lora_reset');
+ Route::post('devices/interval', 'Api\DeviceController@interval');
+
+ // Control resources
+ Route::resource('devices', 'Api\DeviceController', ['except' => ['create', 'edit']]);
+ Route::resource('checklists', 'Api\ChecklistController', ['except' => ['create', 'edit']]);
+ Route::resource('categories', 'Api\CategoryController', ['except' => ['create', 'edit', 'store', 'update', 'destroy']]);
+ Route::resource('groups', 'Api\GroupController', ['except' => ['create', 'edit']]);
+ Route::resource('hives', 'Api\HiveController', ['except' => ['create', 'edit']]);
+ Route::resource('hive-tags', 'Api\HiveTagsController', ['except' => ['create', 'edit']]);
+ Route::resource('locations', 'Api\LocationController', ['except' => ['create', 'edit']]);
+ Route::resource('queens', 'Api\QueenController', ['except' => ['create', 'edit']]);
+ Route::resource('images', 'Api\ImageController', ['except' => ['create', 'edit', 'destroy']]);
+ Route::resource('sensordefinition', 'Api\SensorDefinitionController', ['except' => ['create', 'edit']]);
+ Route::resource('samplecode', 'Api\SampleCodeController', ['except' => ['create', 'edit', 'destroy']]);
+ Route::resource('alerts', 'Api\AlertController', ['except' => ['create', 'edit']]);
+ Route::resource('alert-rules', 'Api\AlertRuleController', ['except' => ['create', 'edit']]);
+ Route::resource('dashboardgroups', 'Api\DashboardGroupController', ['except' => ['create', 'edit']]);
+ Route::resource('checklist-svg', 'Api\ChecklistSvgController', ['except' => ['create', 'edit']]);
+
+ Route::get('alert-rules-default', 'Api\AlertRuleController@default_rules');
+
+ Route::delete('samplecode', 'Api\SampleCodeController@destroy');
+ Route::delete('images', 'Api\ImageController@destroyByUrl');
+ Route::delete('groups/detach/{id}', 'Api\GroupController@detach');
+
+ Route::get('categoryinputs', 'Api\CategoryController@inputs');
+ Route::post('export/csv', 'Api\ExportController@generate_csv');
+
+ Route::get('flashlogs', 'Api\FlashLogController@index');
+ Route::get('flashlogs/{id}', 'Api\FlashLogController@show');
+ Route::post('flashlogs/{id}', 'Api\FlashLogController@persist');
+ Route::delete('flashlogs/{id}', 'Api\FlashLogController@delete');
+ });
+
+ // low traffic routes
+ Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:3,1,low_traffic']], function () {
+ Route::get('export', 'Api\ExportController@all');
+ Route::get('weather', 'Api\WeatherController@index');
+ });
+
+});
diff --git a/routes/web.php b/routes/web.php
index 86b78b4a..26d9b49b 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -13,25 +13,25 @@
Auth::routes(['verify' => true]);
-Route::get('/',function(){
- return redirect()->away('https://app.beep.nl');
+Route::get('/', function () {
+ return redirect()->away('https://app.beep.nl');
});
-Route::get('home', function(){
- return redirect('dashboard');
+Route::get('home', function () {
+ return redirect('dashboard');
});
-Route::get('admin', function(){
- return redirect('dashboard');
+Route::get('admin', function () {
+ return redirect('dashboard');
});
-Route::get('webapp', function(){
- return redirect()->away('https://app.beep.nl');
+Route::get('webapp', function () {
+ return redirect()->away('https://app.beep.nl');
});
-Route::get('code', ['as'=>'sample-code.code','uses'=>'SampleCodeController@code']);
-Route::post('codecheck', ['as'=>'sample-code.check','uses'=>'SampleCodeController@check'])->middleware('throttle:3,1');
-Route::patch('coderesult',['as'=>'sample-code.resultsave','uses'=>'SampleCodeController@resultsave']);
+Route::get('code', ['as' => 'sample-code.code', 'uses' => 'SampleCodeController@code']);
+Route::post('codecheck', ['as' => 'sample-code.check', 'uses' => 'SampleCodeController@check'])->middleware('throttle:3,1');
+Route::patch('coderesult', ['as' => 'sample-code.resultsave', 'uses' => 'SampleCodeController@resultsave']);
// Hack for redirecting e-mail reset password link to webapp
// Route::get('password/reset/{token}',['as'=>'password.reset', function ($token) {
@@ -40,144 +40,137 @@
// Secured by login
Route::group(
- [
- 'prefix' => LaravelLocalization::setLocale(),
- 'middleware' => ['auth', 'localeSessionRedirect', 'localizationRedirect', 'verified']
- ],
- function()
- {
- Route:: group(
- ['middleware' => ['role:superadmin|admin|lab']],
- function()
- {
- Route::get('code-upload', ['as'=>'sample-code.upload','uses'=>'SampleCodeController@upload']);
- Route::post('code-upload-store', ['as'=>'sample-code.upload-store','uses'=>'SampleCodeController@upload_store']);
- });
-
- Route::group(
- ['middleware' => ['role:superadmin|admin|translator']],
- function()
- {
-
- // Routes
- Route::get('languages', ['as'=>'languages.index','uses'=>'LanguageController@index','middleware' => ['permission:language-list|language-create|language-edit|language-delete']]);
- Route::get('languages/create', ['as'=>'languages.create','uses'=>'LanguageController@create','middleware' => ['permission:language-create']]);
- Route::post('languages/create', ['as'=>'languages.store','uses'=>'LanguageController@store','middleware' => ['permission:language-create']]);
- Route::get('languages/{id}', ['as'=>'languages.show','uses'=>'LanguageController@show']);
- Route::get('languages/{id}/edit', ['as'=>'languages.edit','uses'=>'LanguageController@edit','middleware' => ['permission:language-edit']]);
- Route::patch('languages/{id}', ['as'=>'languages.update','uses'=>'LanguageController@update','middleware' => ['permission:language-edit']]);
- Route::delete('languages/{id}', ['as'=>'languages.destroy','uses'=>'LanguageController@destroy','middleware' => ['permission:language-delete']]);
-
- Route::get('translations', ['as'=>'translations.index','uses'=>'TranslationController@index','middleware' => ['permission:translation-list']]);
- Route::get('translations/{language}',['as'=>'translations.edit','uses'=>'TranslationController@edit','middleware' => ['permission:translation-create']]);
- Route::patch('translations/{language}',['as'=>'translations.update','uses'=>'TranslationController@update','middleware' => ['permission:translation-edit']]);
-
- });
-
- Route::group(
- ['middleware' => ['role:superadmin|admin|manager']],
- function()
- {
-
- Route::get('devices', ['as'=>'devices.index','uses'=>'DeviceController@index','middleware' => ['permission:sensor-list|sensor-create|sensor-edit|sensor-delete']]);
- Route::get('devices/create', ['as'=>'devices.create','uses'=>'DeviceController@create','middleware' => ['permission:sensor-create']]);
- Route::get('devices/data', ['as'=>'devices.data','uses'=>'DeviceController@data']);
- Route::post('devices/create', ['as'=>'devices.store','uses'=>'DeviceController@store','middleware' => ['permission:sensor-create']]);
- Route::get('devices/{id}', ['as'=>'devices.show','uses'=>'DeviceController@show']);
- Route::get('devices/{id}/sync', ['as'=>'devices.sync','uses'=>'DeviceController@sync']);
- Route::get('devices/{id}/undelete', ['as'=>'devices.undelete','uses'=>'DeviceController@undelete']);
- Route::get('devices/{id}/edit', ['as'=>'devices.edit','uses'=>'DeviceController@edit','middleware' => ['permission:sensor-edit']]);
- Route::get('devices/{id}/flashlog/{fl_id}', ['as'=>'devices.flashlog','uses'=>'DeviceController@flashlog','middleware' => ['permission:sensor-edit']]);
- Route::patch('devices/{id}', ['as'=>'devices.update','uses'=>'DeviceController@update','middleware' => ['permission:sensor-edit']]);
- Route::delete('devices/{id}', ['as'=>'devices.destroy','uses'=>'DeviceController@destroy','middleware' => ['permission:sensor-delete']]);
- });
-
-
- Route::group(
- ['middleware' => ['role:superadmin|admin']],
- function()
- {
- Route::get('groups', ['as'=>'groups.index','uses'=>'GroupController@index','middleware' => ['permission:group-list|group-create|group-edit|group-delete']]);
- Route::get('groups/create', ['as'=>'groups.create','uses'=>'GroupController@create','middleware' => ['permission:group-create']]);
- Route::post('groups/create', ['as'=>'groups.store','uses'=>'GroupController@store','middleware' => ['permission:group-create']]);
- Route::get('groups/{id}', ['as'=>'groups.show','uses'=>'GroupController@show']);
- Route::get('groups/{id}/edit', ['as'=>'groups.edit','uses'=>'GroupController@edit','middleware' => ['permission:group-edit']]);
- Route::patch('groups/{id}', ['as'=>'groups.update','uses'=>'GroupController@update','middleware' => ['permission:group-edit']]);
- Route::delete('groups/{id}', ['as'=>'groups.destroy','uses'=>'GroupController@destroy','middleware' => ['permission:group-delete']]);
-
- Route::resource('physicalquantity', 'PhysicalQuantityController');
- Route::resource('categoryinputs', 'CategoryInputsController');
- Route::resource('inspection-items', 'InspectionItemsController');
- Route::resource('measurement', 'MeasurementController');
- Route::resource('sensordefinition' ,'SensorDefinitionController');
- Route::resource('flash-log', 'FlashLogController');
- Route::get('flash-log/parse/{id}', ['as'=>'flash-log.parse','uses'=>'FlashLogController@parse']);
-
- // Create new research
- Route::get('research/create', ['as'=>'research.create','uses'=>'ResearchController@create']);
- Route::post('research/create', ['as'=>'research.store','uses'=>'ResearchController@store']);
-
- Route::resource('categories', 'CategoriesController');
- Route::delete('categories/{id}/pop',['as'=>'categories.pop','uses'=>'CategoriesController@pop','middleware' => ['permission:taxonomy-delete']]);
- Route::get('categories/{id}/fix', ['as'=>'categories.fix','uses'=>'CategoriesController@fix']);
- Route::get('categories/{id}/duplicate', ['as'=>'categories.duplicate','uses'=>'CategoriesController@duplicate']);
- Route::get('taxonomy/display', ['as'=>'taxonomy.display','uses'=>'TaxonomyController@display']);
-
- Route::resource('dashboard-group', 'DashboardGroupController');
- });
-
- Route::group(
- ['middleware' => ['role:superadmin']],
- function()
- {
- Route::get('info', function(){
- return view('phpinfo');
- });
-
- // Roles
- Route::get('roles', ['as'=>'roles.index','uses'=>'RoleController@index','middleware' => ['permission:role-list|role-create|role-edit|role-delete']]);
- Route::get('roles/create', ['as'=>'roles.create','uses'=>'RoleController@create','middleware' => ['permission:role-create']]);
- Route::post('roles/create', ['as'=>'roles.store','uses'=>'RoleController@store','middleware' => ['permission:role-create']]);
- Route::get('roles/{id}', ['as'=>'roles.show','uses'=>'RoleController@show']);
- Route::get('roles/{id}/edit', ['as'=>'roles.edit','uses'=>'RoleController@edit','middleware' => ['permission:role-edit']]);
- Route::patch('roles/{id}', ['as'=>'roles.update','uses'=>'RoleController@update','middleware' => ['permission:role-edit']]);
- Route::delete('roles/{id}', ['as'=>'roles.destroy','uses'=>'RoleController@destroy','middleware' => ['permission:role-delete']]);
- Route::get('alert-rule/{id}/parse',['as'=>'alert-rule.parse','uses'=>'AlertRuleController@parse']);
-
- // Resource controllers
- Route::resource('permissions', 'PermissionController');
- Route::resource('image', 'ImageController');
- Route::resource('sample-code', 'SampleCodeController');
- Route::resource('alert', 'AlertController');
- Route::resource('alert-rule', 'AlertRuleController');
- Route::resource('alert-rule-formula','AlertRuleFormulaController');
- Route::resource('calculation-model', 'CalculationModelController');
-
- Route::get('calculation-model/{id}/run',['as'=>'calculation-model.run','uses'=>'CalculationModelController@run']);
-
- Route::delete('checklists/destroy/copies', ['as'=>'checklists.copies','uses'=>'ChecklistController@destroyCopies']);
-
- });
-
- // Open research routes based on database access
- Route::get('dashboard', ['as'=>'dashboard.index','uses'=>'DashboardController@index']);
-
- Route::resource('checklists', 'ChecklistController');
- Route::resource('inspections', 'InspectionsController');
- Route::resource('users', 'UserController');
- Route::resource('hive-tags', 'HiveTagsController');
- Route::resource('checklist-svg', 'ChecklistSvgController');
-
- Route::get('research', ['as'=>'research.index','uses'=>'ResearchController@index']);
- Route::get('research/{id}', ['as'=>'research.show','uses'=>'ResearchController@show']);
- Route::get('research/{id}/data', ['as'=>'research.data','uses'=>'ResearchController@data']);
- Route::get('research/{id}/consent', ['as'=>'research.consent','uses'=>'ResearchController@consent']);
- Route::get('research/{id}/consent/{c_id}', ['as'=>'research.consent_edit','uses'=>'ResearchController@consent_edit']);
- Route::patch('research/{id}/consent/{c_id}', ['as'=>'research.consent_edit','uses'=>'ResearchController@consent_edit']);
- Route::delete('research/{id}/consent/{c_id}', ['as'=>'research.consent_edit','uses'=>'ResearchController@consent_edit']);
- Route::get('research/{id}/consent/{c_id}', ['as'=>'research.consent_edit','uses'=>'ResearchController@consent_edit']);
- Route::get('research/{id}/edit', ['as'=>'research.edit','uses'=>'ResearchController@edit']);
- Route::patch('research/{id}', ['as'=>'research.update','uses'=>'ResearchController@update']);
- Route::delete('research/{id}', ['as'=>'research.destroy','uses'=>'ResearchController@destroy']);
- }
-);
\ No newline at end of file
+ [
+ 'prefix' => LaravelLocalization::setLocale(),
+ 'middleware' => ['auth', 'localeSessionRedirect', 'localizationRedirect', 'verified'],
+ ],
+ function () {
+ Route::group(
+ ['middleware' => ['role:superadmin|admin|lab']],
+ function () {
+ Route::get('code-upload', ['as' => 'sample-code.upload', 'uses' => 'SampleCodeController@upload']);
+ Route::post('code-upload-store', ['as' => 'sample-code.upload-store', 'uses' => 'SampleCodeController@upload_store']);
+ });
+
+ Route::group(
+ ['middleware' => ['role:superadmin|admin|translator']],
+ function () {
+
+ // Routes
+ Route::get('languages', ['as' => 'languages.index', 'uses' => 'LanguageController@index', 'middleware' => ['permission:language-list|language-create|language-edit|language-delete']]);
+ Route::get('languages/create', ['as' => 'languages.create', 'uses' => 'LanguageController@create', 'middleware' => ['permission:language-create']]);
+ Route::post('languages/create', ['as' => 'languages.store', 'uses' => 'LanguageController@store', 'middleware' => ['permission:language-create']]);
+ Route::get('languages/{id}', ['as' => 'languages.show', 'uses' => 'LanguageController@show']);
+ Route::get('languages/{id}/edit', ['as' => 'languages.edit', 'uses' => 'LanguageController@edit', 'middleware' => ['permission:language-edit']]);
+ Route::patch('languages/{id}', ['as' => 'languages.update', 'uses' => 'LanguageController@update', 'middleware' => ['permission:language-edit']]);
+ Route::delete('languages/{id}', ['as' => 'languages.destroy', 'uses' => 'LanguageController@destroy', 'middleware' => ['permission:language-delete']]);
+
+ Route::get('translations', ['as' => 'translations.index', 'uses' => 'TranslationController@index', 'middleware' => ['permission:translation-list']]);
+ Route::get('translations/{language}', ['as' => 'translations.edit', 'uses' => 'TranslationController@edit', 'middleware' => ['permission:translation-create']]);
+ Route::patch('translations/{language}', ['as' => 'translations.update', 'uses' => 'TranslationController@update', 'middleware' => ['permission:translation-edit']]);
+
+ });
+
+ Route::group(
+ ['middleware' => ['role:superadmin|admin|manager']],
+ function () {
+
+ Route::get('devices', ['as' => 'devices.index', 'uses' => 'DeviceController@index', 'middleware' => ['permission:sensor-list|sensor-create|sensor-edit|sensor-delete']]);
+ Route::get('devices/create', ['as' => 'devices.create', 'uses' => 'DeviceController@create', 'middleware' => ['permission:sensor-create']]);
+ Route::get('devices/data', ['as' => 'devices.data', 'uses' => 'DeviceController@data']);
+ Route::post('devices/create', ['as' => 'devices.store', 'uses' => 'DeviceController@store', 'middleware' => ['permission:sensor-create']]);
+ Route::get('devices/{id}', ['as' => 'devices.show', 'uses' => 'DeviceController@show']);
+ Route::get('devices/{id}/sync', ['as' => 'devices.sync', 'uses' => 'DeviceController@sync']);
+ Route::get('devices/{id}/undelete', ['as' => 'devices.undelete', 'uses' => 'DeviceController@undelete']);
+ Route::get('devices/{id}/edit', ['as' => 'devices.edit', 'uses' => 'DeviceController@edit', 'middleware' => ['permission:sensor-edit']]);
+ Route::get('devices/{id}/flashlog/{fl_id}', ['as' => 'devices.flashlog', 'uses' => 'DeviceController@flashlog', 'middleware' => ['permission:sensor-edit']]);
+ Route::patch('devices/{id}', ['as' => 'devices.update', 'uses' => 'DeviceController@update', 'middleware' => ['permission:sensor-edit']]);
+ Route::delete('devices/{id}', ['as' => 'devices.destroy', 'uses' => 'DeviceController@destroy', 'middleware' => ['permission:sensor-delete']]);
+ });
+
+ Route::group(
+ ['middleware' => ['role:superadmin|admin']],
+ function () {
+ Route::get('groups', ['as' => 'groups.index', 'uses' => 'GroupController@index', 'middleware' => ['permission:group-list|group-create|group-edit|group-delete']]);
+ Route::get('groups/create', ['as' => 'groups.create', 'uses' => 'GroupController@create', 'middleware' => ['permission:group-create']]);
+ Route::post('groups/create', ['as' => 'groups.store', 'uses' => 'GroupController@store', 'middleware' => ['permission:group-create']]);
+ Route::get('groups/{id}', ['as' => 'groups.show', 'uses' => 'GroupController@show']);
+ Route::get('groups/{id}/edit', ['as' => 'groups.edit', 'uses' => 'GroupController@edit', 'middleware' => ['permission:group-edit']]);
+ Route::patch('groups/{id}', ['as' => 'groups.update', 'uses' => 'GroupController@update', 'middleware' => ['permission:group-edit']]);
+ Route::delete('groups/{id}', ['as' => 'groups.destroy', 'uses' => 'GroupController@destroy', 'middleware' => ['permission:group-delete']]);
+
+ Route::resource('physicalquantity', 'PhysicalQuantityController');
+ Route::resource('categoryinputs', 'CategoryInputsController');
+ Route::resource('inspection-items', 'InspectionItemsController');
+ Route::resource('measurement', 'MeasurementController');
+ Route::resource('sensordefinition', 'SensorDefinitionController');
+ Route::resource('flash-log', 'FlashLogController');
+ Route::get('flash-log/parse/{id}', ['as' => 'flash-log.parse', 'uses' => 'FlashLogController@parse']);
+
+ // Create new research
+ Route::get('research/create', ['as' => 'research.create', 'uses' => 'ResearchController@create']);
+ Route::post('research/create', ['as' => 'research.store', 'uses' => 'ResearchController@store']);
+
+ Route::resource('categories', 'CategoriesController');
+ Route::delete('categories/{id}/pop', ['as' => 'categories.pop', 'uses' => 'CategoriesController@pop', 'middleware' => ['permission:taxonomy-delete']]);
+ Route::get('categories/{id}/fix', ['as' => 'categories.fix', 'uses' => 'CategoriesController@fix']);
+ Route::get('categories/{id}/duplicate', ['as' => 'categories.duplicate', 'uses' => 'CategoriesController@duplicate']);
+ Route::get('taxonomy/display', ['as' => 'taxonomy.display', 'uses' => 'TaxonomyController@display']);
+
+ Route::resource('dashboard-group', 'DashboardGroupController');
+ });
+
+ Route::group(
+ ['middleware' => ['role:superadmin']],
+ function () {
+ Route::get('info', function () {
+ return view('phpinfo');
+ });
+
+ // Roles
+ Route::get('roles', ['as' => 'roles.index', 'uses' => 'RoleController@index', 'middleware' => ['permission:role-list|role-create|role-edit|role-delete']]);
+ Route::get('roles/create', ['as' => 'roles.create', 'uses' => 'RoleController@create', 'middleware' => ['permission:role-create']]);
+ Route::post('roles/create', ['as' => 'roles.store', 'uses' => 'RoleController@store', 'middleware' => ['permission:role-create']]);
+ Route::get('roles/{id}', ['as' => 'roles.show', 'uses' => 'RoleController@show']);
+ Route::get('roles/{id}/edit', ['as' => 'roles.edit', 'uses' => 'RoleController@edit', 'middleware' => ['permission:role-edit']]);
+ Route::patch('roles/{id}', ['as' => 'roles.update', 'uses' => 'RoleController@update', 'middleware' => ['permission:role-edit']]);
+ Route::delete('roles/{id}', ['as' => 'roles.destroy', 'uses' => 'RoleController@destroy', 'middleware' => ['permission:role-delete']]);
+ Route::get('alert-rule/{id}/parse', ['as' => 'alert-rule.parse', 'uses' => 'AlertRuleController@parse']);
+
+ // Resource controllers
+ Route::resource('permissions', 'PermissionController');
+ Route::resource('image', 'ImageController');
+ Route::resource('sample-code', 'SampleCodeController');
+ Route::resource('alert', 'AlertController');
+ Route::resource('alert-rule', 'AlertRuleController');
+ Route::resource('alert-rule-formula', 'AlertRuleFormulaController');
+ Route::resource('calculation-model', 'CalculationModelController');
+
+ Route::get('calculation-model/{id}/run', ['as' => 'calculation-model.run', 'uses' => 'CalculationModelController@run']);
+
+ Route::delete('checklists/destroy/copies', ['as' => 'checklists.copies', 'uses' => 'ChecklistController@destroyCopies']);
+
+ });
+
+ // Open research routes based on database access
+ Route::get('dashboard', ['as' => 'dashboard.index', 'uses' => 'DashboardController@index']);
+
+ Route::resource('checklists', 'ChecklistController');
+ Route::resource('inspections', 'InspectionsController');
+ Route::resource('users', 'UserController');
+ Route::resource('hive-tags', 'HiveTagsController');
+ Route::resource('checklist-svg', 'ChecklistSvgController');
+
+ Route::get('research', ['as' => 'research.index', 'uses' => 'ResearchController@index']);
+ Route::get('research/{id}', ['as' => 'research.show', 'uses' => 'ResearchController@show']);
+ Route::get('research/{id}/data', ['as' => 'research.data', 'uses' => 'ResearchController@data']);
+ Route::get('research/{id}/consent', ['as' => 'research.consent', 'uses' => 'ResearchController@consent']);
+ Route::get('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
+ Route::patch('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
+ Route::delete('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
+ Route::get('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
+ Route::get('research/{id}/edit', ['as' => 'research.edit', 'uses' => 'ResearchController@edit']);
+ Route::patch('research/{id}', ['as' => 'research.update', 'uses' => 'ResearchController@update']);
+ Route::delete('research/{id}', ['as' => 'research.destroy', 'uses' => 'ResearchController@destroy']);
+ }
+);
diff --git a/server.php b/server.php
index 5fb6379e..b07fa44b 100644
--- a/server.php
+++ b/server.php
@@ -3,10 +3,8 @@
/**
* Laravel - A PHP Framework For Web Artisans
*
- * @package Laravel
* @author Taylor Otwell
*/
-
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
index 2f2d20ff..9319a1b9 100644
--- a/tests/ExampleTest.php
+++ b/tests/ExampleTest.php
@@ -1,9 +1,5 @@
visit('/')
- ->see('Laravel');
+ ->see('Laravel');
}
}
From 94c8dabe3a307441f973829308692d26807d7fc7 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:25 +0000
Subject: [PATCH 014/127] Convert string references to `::class`
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/Providers/EventServiceProvider.php | 2 +-
config/entrust.php | 6 +++---
...dd_user_type_to_role_user_and_permission_user_tables.php | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 09701c34..b035be27 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -19,7 +19,7 @@ class EventServiceProvider extends ServiceProvider
SendEmailVerificationNotification::class,
],
'Illuminate\Auth\Events\Login' => [
- 'App\Listeners\LogSuccessfulLogin',
+ \App\Listeners\LogSuccessfulLogin::class,
],
];
diff --git a/config/entrust.php b/config/entrust.php
index bd1a5b06..6a9af3be 100644
--- a/config/entrust.php
+++ b/config/entrust.php
@@ -18,7 +18,7 @@
| the role if it is in a different namespace.
|
*/
- 'role' => 'App\Role',
+ 'role' => App\Role::class,
/*
|--------------------------------------------------------------------------
@@ -50,7 +50,7 @@
| Update the User if it is in a different namespace.
|
*/
- 'user' => 'App\User',
+ 'user' => App\User::class,
/*
|--------------------------------------------------------------------------
@@ -94,7 +94,7 @@
| Update the permission if it is in a different namespace.
|
*/
- 'permission' => 'App\Permission',
+ 'permission' => App\Permission::class,
/*
|--------------------------------------------------------------------------
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index 9799bc0c..3d691255 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -17,7 +17,7 @@ public function up()
if (Schema::hasTable('role_user') && ! Schema::hasColumn('role_user', 'organization_id')) {
Schema::table('role_user', function (Blueprint $table) {
$table->unsignedInteger('organization_id')->nullable();
- $table->string('user_type')->default('App\\\User');
+ $table->string('user_type')->default(\App\User::class);
});
Schema::table('role_user', function (Blueprint $table) {
$table->foreign('organization_id')->references('id')->on('organizations')->onUpdate('cascade');
@@ -30,7 +30,7 @@ public function up()
Schema::create('permission_user', function (Blueprint $table) {
$table->unsignedInteger('permission_id');
$table->unsignedInteger('user_id');
- $table->string('user_type')->default('App\\\User');
+ $table->string('user_type')->default(\App\User::class);
$table->unsignedInteger('organization_id')->nullable();
$table->unique(['user_id', 'permission_id', 'user_type', 'organization_id'], 'unique_permission_user_constraint');
});
From 13f12144b2d2b9e6685285e6982f64ab36eb6cba Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:25 +0000
Subject: [PATCH 015/127] Shift core files
---
app/Http/Middleware/TrustHosts.php | 20 ++++++++++++++++++++
app/Http/Middleware/VerifyCsrfToken.php | 7 -------
2 files changed, 20 insertions(+), 7 deletions(-)
create mode 100644 app/Http/Middleware/TrustHosts.php
diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php
new file mode 100644
index 00000000..b0550cfc
--- /dev/null
+++ b/app/Http/Middleware/TrustHosts.php
@@ -0,0 +1,20 @@
+allSubdomainsOfApplicationUrl(),
+ ];
+ }
+}
diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php
index 324a166b..0c13b854 100644
--- a/app/Http/Middleware/VerifyCsrfToken.php
+++ b/app/Http/Middleware/VerifyCsrfToken.php
@@ -6,13 +6,6 @@
class VerifyCsrfToken extends Middleware
{
- /**
- * Indicates whether the XSRF-TOKEN cookie should be set on the response.
- *
- * @var bool
- */
- protected $addHttpCookie = true;
-
/**
* The URIs that should be excluded from CSRF verification.
*
From 92389b4f88bc4bfe08ae9575b19d49586d24b061 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:25 +0000
Subject: [PATCH 016/127] Use generic `Throwable` type hint
---
app/Exceptions/Handler.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 2fba1c6c..ac3ed154 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -2,6 +2,7 @@
namespace App\Exceptions;
+use Throwable;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@@ -31,7 +32,7 @@ class Handler extends ExceptionHandler
*
* @return void
*/
- public function report(Exception $exception)
+ public function report(Throwable $exception)
{
parent::report($exception);
}
@@ -42,7 +43,7 @@ public function report(Exception $exception)
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
- public function render($request, Exception $exception)
+ public function render($request, Throwable $exception)
{
// PGe added redirect in case of (ugly) tokenmismatch exception error page
if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
From 926b0f3e5238245126bc275085b1ea1680194d02 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:26 +0000
Subject: [PATCH 017/127] Add laravel/ui dependency
---
composer.json | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/composer.json b/composer.json
index 86425cac..b13aed2b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,16 @@
{
"name": "beepnl/beep",
- "vendor":"BEEP Foundation",
+ "vendor": "BEEP Foundation",
"version": "2.2.0",
"description": "BEEP digital hive monitor",
- "keywords": ["Beep", "Beekeeping", "apiary", "hive", "app", "measurement system"],
+ "keywords": [
+ "Beep",
+ "Beekeeping",
+ "apiary",
+ "hive",
+ "app",
+ "measurement system"
+ ],
"license": "MIT",
"type": "project",
"require": {
@@ -27,7 +34,8 @@
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^6.3",
- "tray-labs/laravel-influxdb": "*"
+ "tray-labs/laravel-influxdb": "*",
+ "laravel/ui": "^2.0"
},
"require-dev": {
"appzcoder/crud-generator": "^3.0",
@@ -42,7 +50,9 @@
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
- "platform":{"php": "7.4"},
+ "platform": {
+ "php": "7.4"
+ },
"allow-plugins": {
"kylekatarnls/update-helper": true
}
@@ -80,4 +90,4 @@
"@php artisan key:generate --ansi"
]
}
- }
+}
From 9a9351c0e215211d8ac1281a62bed6a39c6850aa Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:26 +0000
Subject: [PATCH 018/127] Unindent vendor mail templates
---
.../views/vendor/mail/html/message.blade.php | 2 +-
.../mail/html/promotion/button.blade.php | 22 +-
.../views/vendor/mail/html/themes/default.css | 312 +++++++++---------
.../vendor/mail/markdown/message.blade.php | 44 +--
4 files changed, 190 insertions(+), 190 deletions(-)
diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/vendor/mail/html/message.blade.php
index f4bd1b09..4a5e4387 100644
--- a/resources/views/vendor/mail/html/message.blade.php
+++ b/resources/views/vendor/mail/html/message.blade.php
@@ -13,7 +13,7 @@
@if (isset($subcopy))
@slot('subcopy')
@component('mail::subcopy')
- {{ $subcopy }}
+{{ $subcopy }}
@endcomponent
@endslot
@endif
diff --git a/resources/views/vendor/mail/html/promotion/button.blade.php b/resources/views/vendor/mail/html/promotion/button.blade.php
index 8e79081c..42604a64 100644
--- a/resources/views/vendor/mail/html/promotion/button.blade.php
+++ b/resources/views/vendor/mail/html/promotion/button.blade.php
@@ -1,13 +1,13 @@
diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/vendor/mail/html/themes/default.css
index 546c2c19..c68cb641 100644
--- a/resources/views/vendor/mail/html/themes/default.css
+++ b/resources/views/vendor/mail/html/themes/default.css
@@ -1,294 +1,294 @@
/* Base */
body, body *:not(html):not(style):not(br):not(tr):not(code) {
- font-family: 'Roboto Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
- box-sizing: border-box;
+font-family: 'Roboto Condensed', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+box-sizing: border-box;
}
body {
- background-color: #F2F4F6;
- color: #333333;
- height: 100%;
- line-height: 1.4;
- margin: 0;
- width: 100% !important;
- -webkit-text-size-adjust: none;
+background-color: #F2F4F6;
+color: #333333;
+height: 100%;
+line-height: 1.4;
+margin: 0;
+width: 100% !important;
+-webkit-text-size-adjust: none;
}
p,
ul,
ol,
blockquote {
- line-height: 1.4;
- text-align: left;
+line-height: 1.4;
+text-align: left;
}
a {
- color: #F29100;
+color: #F29100;
}
a img {
- border: none;
+border: none;
}
/* Typography */
h1 {
- color: #2F3133;
- font-size: 19px;
- font-weight: bold;
- margin-top: 0;
- text-align: left;
+color: #2F3133;
+font-size: 19px;
+font-weight: bold;
+margin-top: 0;
+text-align: left;
}
h2 {
- color: #2F3133;
- font-size: 16px;
- font-weight: bold;
- margin-top: 0;
- text-align: left;
+color: #2F3133;
+font-size: 16px;
+font-weight: bold;
+margin-top: 0;
+text-align: left;
}
h3 {
- color: #2F3133;
- font-size: 14px;
- font-weight: bold;
- margin-top: 0;
- text-align: left;
+color: #2F3133;
+font-size: 14px;
+font-weight: bold;
+margin-top: 0;
+text-align: left;
}
p {
- color: #333333;
- font-size: 14px;
- line-height: 1.5em;
- margin-top: 0;
- text-align: left;
+color: #333333;
+font-size: 14px;
+line-height: 1.5em;
+margin-top: 0;
+text-align: left;
}
p.sub {
- font-size: 12px;
+font-size: 12px;
}
img {
- max-width: 100%;
+max-width: 100%;
}
/* Layout */
.wrapper {
- background-color: #FFF;
- margin: 0;
- padding: 0;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+background-color: #FFF;
+margin: 0;
+padding: 0;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
.content {
- margin: 0;
- padding: 0;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+margin: 0;
+padding: 0;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
/* Header */
.header {
- padding: 15px 0;
- text-align: center;
+padding: 15px 0;
+text-align: center;
}
.header a {
- color: #999999;
- font-size: 19px;
- font-weight: bold;
- text-decoration: none;
- text-shadow: 0 1px 0 white;
+color: #999999;
+font-size: 19px;
+font-weight: bold;
+text-decoration: none;
+text-shadow: 0 1px 0 white;
}
/* Body */
.body {
- background-color: #FFFFFF;
- border-bottom: 1px solid #EDEFF2;
- border-top: 1px solid #EDEFF2;
- margin: 0;
- padding: 0;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+background-color: #FFFFFF;
+border-bottom: 1px solid #EDEFF2;
+border-top: 1px solid #EDEFF2;
+margin: 0;
+padding: 0;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
.inner-body {
- background-color: #FFFFFF;
- margin: 0 auto;
- padding: 0;
- width: 570px;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 570px;
+background-color: #FFFFFF;
+margin: 0 auto;
+padding: 0;
+width: 570px;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 570px;
}
/* Subcopy */
.subcopy {
- border-top: 1px solid #EDEFF2;
- margin-top: 20px;
- padding-top: 20px;
+border-top: 1px solid #EDEFF2;
+margin-top: 20px;
+padding-top: 20px;
}
.subcopy p {
- font-size: 13px;
+font-size: 13px;
}
/* Footer */
.footer {
- margin: 0 auto;
- padding: 0;
- text-align: center;
- width: 570px;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 570px;
+margin: 0 auto;
+padding: 0;
+text-align: center;
+width: 570px;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 570px;
}
.footer p {
- color: #AEAEAE;
- font-size: 12px;
- text-align: center;
+color: #AEAEAE;
+font-size: 12px;
+text-align: center;
}
/* Tables */
.table table {
- margin: 20px auto;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+margin: 20px auto;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
.table th {
- border-bottom: 1px solid #EDEFF2;
- padding-bottom: 8px;
+border-bottom: 1px solid #EDEFF2;
+padding-bottom: 8px;
}
.table td {
- color: #444444;
- font-size: 15px;
- line-height: 16px;
- padding: 10px 0;
+color: #444444;
+font-size: 15px;
+line-height: 16px;
+padding: 10px 0;
}
.content-cell {
- padding: 35px;
+padding: 35px;
}
/* Buttons */
.action {
- margin: 30px auto;
- padding: 0;
- text-align: center;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+margin: 30px auto;
+padding: 0;
+text-align: center;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
.button {
- border-radius: 4px;
- color: #333;
- display: inline-block;
- text-decoration: none;
- -webkit-text-size-adjust: none;
- background-color: #EEEEEE;
- border: 10px solid #EEEEEE;
+border-radius: 4px;
+color: #333;
+display: inline-block;
+text-decoration: none;
+-webkit-text-size-adjust: none;
+background-color: #EEEEEE;
+border: 10px solid #EEEEEE;
}
.button-primary {
- background-color: #F29100;
- border-top: 10px solid #F29100;
- border-right: 18px solid #F29100;
- border-bottom: 10px solid #F29100;
- border-left: 18px solid #F29100;
- color: #FFF;
+background-color: #F29100;
+border-top: 10px solid #F29100;
+border-right: 18px solid #F29100;
+border-bottom: 10px solid #F29100;
+border-left: 18px solid #F29100;
+color: #FFF;
}
.button-info {
- background-color: #243D80;
- border-top: 10px solid #243D80;
- border-right: 18px solid #243D80;
- border-bottom: 10px solid #243D80;
- border-left: 18px solid #243D80;
- color: #FFF;
+background-color: #243D80;
+border-top: 10px solid #243D80;
+border-right: 18px solid #243D80;
+border-bottom: 10px solid #243D80;
+border-left: 18px solid #243D80;
+color: #FFF;
}
.button-success {
- background-color: #2ab27b;
- border-top: 10px solid #2ab27b;
- border-right: 18px solid #2ab27b;
- border-bottom: 10px solid #2ab27b;
- border-left: 18px solid #2ab27b;
- color: #FFF;
+background-color: #2ab27b;
+border-top: 10px solid #2ab27b;
+border-right: 18px solid #2ab27b;
+border-bottom: 10px solid #2ab27b;
+border-left: 18px solid #2ab27b;
+color: #FFF;
}
.button-error {
- background-color: #bf5329;
- border-top: 10px solid #bf5329;
- border-right: 18px solid #bf5329;
- border-bottom: 10px solid #bf5329;
- border-left: 18px solid #bf5329;
- color: #FFF;
+background-color: #bf5329;
+border-top: 10px solid #bf5329;
+border-right: 18px solid #bf5329;
+border-bottom: 10px solid #bf5329;
+border-left: 18px solid #bf5329;
+color: #FFF;
}
/* Panels */
.panel {
- margin: 0 0 10px;
+margin: 0 0 10px;
}
.panel-content {
- background-color: #EDEFF2;
- padding: 20px;
- padding-top: 8px;
- padding-bottom: 8px;
+background-color: #EDEFF2;
+padding: 20px;
+padding-top: 8px;
+padding-bottom: 8px;
}
.panel-item {
- padding: 0;
+padding: 0;
}
.panel-item p:last-of-type {
- margin-bottom: 0;
- padding-bottom: 0;
+margin-bottom: 0;
+padding-bottom: 0;
}
/* Promotions */
.promotion {
- background-color: #FFFFFF;
- border: 2px dashed #9BA2AB;
- margin: 0;
- margin-bottom: 25px;
- margin-top: 25px;
- padding: 24px;
- width: 100%;
- -premailer-cellpadding: 0;
- -premailer-cellspacing: 0;
- -premailer-width: 100%;
+background-color: #FFFFFF;
+border: 2px dashed #9BA2AB;
+margin: 0;
+margin-bottom: 25px;
+margin-top: 25px;
+padding: 24px;
+width: 100%;
+-premailer-cellpadding: 0;
+-premailer-cellspacing: 0;
+-premailer-width: 100%;
}
.promotion h1 {
- text-align: center;
+text-align: center;
}
.promotion p {
- font-size: 15px;
- text-align: center;
+font-size: 15px;
+text-align: center;
}
diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/vendor/mail/markdown/message.blade.php
index 1796a852..725644ee 100644
--- a/resources/views/vendor/mail/markdown/message.blade.php
+++ b/resources/views/vendor/mail/markdown/message.blade.php
@@ -1,27 +1,27 @@
@component('mail::layout')
- {{-- Header --}}
- @slot('header')
- @component('mail::header', ['url' => config('app.url')])
- {{ config('app.name') }}
- @endcomponent
- @endslot
+{{-- Header --}}
+@slot('header')
+@component('mail::header', ['url' => config('app.url')])
+{{ config('app.name') }}
+@endcomponent
+@endslot
- {{-- Body --}}
- {{ $slot }}
+{{-- Body --}}
+{{ $slot }}
- {{-- Subcopy --}}
- @if (isset($subcopy))
- @slot('subcopy')
- @component('mail::subcopy')
- {{ $subcopy }}
- @endcomponent
- @endslot
- @endif
+{{-- Subcopy --}}
+@if (isset($subcopy))
+@slot('subcopy')
+@component('mail::subcopy')
+{{ $subcopy }}
+@endcomponent
+@endslot
+@endif
- {{-- Footer --}}
- @slot('footer')
- @component('mail::footer')
- {{ date('Y') }} team {{ config('app.name') }}
- @endcomponent
- @endslot
+{{-- Footer --}}
+@slot('footer')
+@component('mail::footer')
+{{ date('Y') }} team {{ config('app.name') }}
+@endcomponent
+@endslot
@endcomponent
From 131c2192ac9c33ee99cc9414f8dbb77676394778 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:31 +0000
Subject: [PATCH 019/127] Shift config files
---
.env.example | 2 +-
config/app.php | 1 +
config/auth.php | 14 +++++
config/mail.php | 130 ++++++++++++++++++---------------------------
config/session.php | 18 ++++---
phpunit.xml | 2 +-
6 files changed, 79 insertions(+), 88 deletions(-)
diff --git a/.env.example b/.env.example
index 7e350ea7..8f2e7adb 100644
--- a/.env.example
+++ b/.env.example
@@ -52,7 +52,7 @@ REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
-MAIL_DRIVER=smtp
+MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=username
diff --git a/config/app.php b/config/app.php
index f0dd4130..b580efa3 100644
--- a/config/app.php
+++ b/config/app.php
@@ -212,6 +212,7 @@
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
+ 'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
diff --git a/config/auth.php b/config/auth.php
index 897dc826..aaf982bc 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -97,7 +97,21 @@
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
+ 'throttle' => 60,
],
],
+ /*
+ |--------------------------------------------------------------------------
+ | Password Confirmation Timeout
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define the amount of seconds before a password confirmation
+ | times out and the user is prompted to re-enter their password via the
+ | confirmation screen. By default, the timeout lasts for three hours.
+ |
+ */
+
+ 'password_timeout' => 10800,
+
];
diff --git a/config/mail.php b/config/mail.php
index f4006459..54299aab 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -4,45 +4,73 @@
/*
|--------------------------------------------------------------------------
- | Mail Driver
+ | Default Mailer
|--------------------------------------------------------------------------
|
- | Laravel supports both SMTP and PHP's "mail" function as drivers for the
- | sending of e-mail. You may specify which one you're using throughout
- | your application here. By default, Laravel is setup for SMTP mail.
- |
- | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
- | "sparkpost", "log", "array"
+ | This option controls the default mailer that is used to send any email
+ | messages sent by your application. Alternative mailers may be setup
+ | and used as needed; however, this mailer will be used by default.
|
*/
- 'driver' => env('MAIL_DRIVER', 'smtp'),
+ 'default' => env('MAIL_MAILER', 'smtp'),
/*
|--------------------------------------------------------------------------
- | SMTP Host Address
+ | Mailer Configurations
|--------------------------------------------------------------------------
|
- | Here you may provide the host address of the SMTP server used by your
- | applications. A default option is provided that is compatible with
- | the Mailgun mail service which will provide reliable deliveries.
+ | Here you may configure all of the mailers used by your application plus
+ | their respective settings. Several examples have been configured for
+ | you and you are free to add your own as your application requires.
|
- */
-
- 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
-
- /*
- |--------------------------------------------------------------------------
- | SMTP Host Port
- |--------------------------------------------------------------------------
+ | Laravel supports a variety of mail "transport" drivers to be used while
+ | sending an e-mail. You will specify which one you are using for your
+ | mailers below. You are free to add additional mailers as required.
|
- | This is the SMTP port used by your application to deliver e-mails to
- | users of the application. Like the host we have set this value to
- | stay compatible with the Mailgun e-mail application by default.
+ | Supported: "smtp", "sendmail", "mailgun", "ses",
+ | "postmark", "log", "array"
|
*/
- 'port' => env('MAIL_PORT', 587),
+ 'mailers' => [
+ 'smtp' => [
+ 'transport' => 'smtp',
+ 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
+ 'port' => env('MAIL_PORT', 587),
+ 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
+ 'username' => env('MAIL_USERNAME'),
+ 'password' => env('MAIL_PASSWORD'),
+ 'timeout' => null,
+ 'auth_mode' => null,
+ ],
+
+ 'ses' => [
+ 'transport' => 'ses',
+ ],
+
+ 'mailgun' => [
+ 'transport' => 'mailgun',
+ ],
+
+ 'postmark' => [
+ 'transport' => 'postmark',
+ ],
+
+ 'sendmail' => [
+ 'transport' => 'sendmail',
+ 'path' => '/usr/sbin/sendmail -bs',
+ ],
+
+ 'log' => [
+ 'transport' => 'log',
+ 'channel' => env('MAIL_LOG_CHANNEL'),
+ ],
+
+ 'array' => [
+ 'transport' => 'array',
+ ],
+ ],
/*
|--------------------------------------------------------------------------
@@ -60,47 +88,6 @@
'name' => env('MAIL_FROM_NAME', 'Example'),
],
- /*
- |--------------------------------------------------------------------------
- | E-Mail Encryption Protocol
- |--------------------------------------------------------------------------
- |
- | Here you may specify the encryption protocol that should be used when
- | the application send e-mail messages. A sensible default using the
- | transport layer security protocol should provide great security.
- |
- */
-
- 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
-
- /*
- |--------------------------------------------------------------------------
- | SMTP Server Username
- |--------------------------------------------------------------------------
- |
- | If your SMTP server requires a username for authentication, you should
- | set it here. This will get used to authenticate with your server on
- | connection. You may also set the "password" value below this one.
- |
- */
-
- 'username' => env('MAIL_USERNAME'),
-
- 'password' => env('MAIL_PASSWORD'),
-
- /*
- |--------------------------------------------------------------------------
- | Sendmail System Path
- |--------------------------------------------------------------------------
- |
- | When using the "sendmail" driver to send e-mails, we will need to know
- | the path to where Sendmail lives on this server. A default path has
- | been provided here, which will work well on most of your systems.
- |
- */
-
- 'sendmail' => '/usr/sbin/sendmail -bs',
-
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
@@ -120,17 +107,4 @@
],
],
- /*
- |--------------------------------------------------------------------------
- | Log Channel
- |--------------------------------------------------------------------------
- |
- | If you are using the "log" driver, you may specify the logging channel
- | if you prefer to keep mail messages separate from other log entries
- | for simpler reading. Otherwise, the default channel will be used.
- |
- */
-
- 'log_channel' => env('MAIL_LOG_CHANNEL'),
-
];
diff --git a/config/session.php b/config/session.php
index fae302ae..4e0f66cd 100755
--- a/config/session.php
+++ b/config/session.php
@@ -14,7 +14,7 @@
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
- | "memcached", "redis", "array"
+ | "memcached", "redis", "dynamodb", "array"
|
*/
@@ -92,9 +92,11 @@
| Session Cache Store
|--------------------------------------------------------------------------
|
- | When using the "apc" or "memcached" session drivers, you may specify a
- | cache store that should be used for these sessions. This value must
- | correspond with one of the application's configured cache stores.
+ | While using one of the framework's cache driven session backends you may
+ | list a cache store that should be used for these sessions. This value
+ | must match with one of the application's configured cache "stores".
+ |
+ | Affects: "apc", "dynamodb", "memcached", "redis"
|
*/
@@ -166,7 +168,7 @@
|
*/
- 'secure' => env('SESSION_SECURE_COOKIE', false),
+ 'secure' => env('SESSION_SECURE_COOKIE'),
/*
|--------------------------------------------------------------------------
@@ -188,12 +190,12 @@
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
- | do not enable this as other CSRF protection services are in place.
+ | will set this value to "lax" since this is a secure default value.
|
- | Supported: "lax", "strict"
+ | Supported: "lax", "strict", "none", null
|
*/
- 'same_site' => null,
+ 'same_site' => 'lax',
];
diff --git a/phpunit.xml b/phpunit.xml
index 9566b67e..2261eb2e 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -26,7 +26,7 @@
-
+
From 1e912313924e0f920ab2d629d422df6884161fd3 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:32 +0000
Subject: [PATCH 020/127] Default config files
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
---
config/cache.php | 6 ++++--
config/cors.php | 40 +++++++---------------------------------
config/filesystems.php | 25 +++++++++++++++++++++----
config/logging.php | 12 +++++++++++-
config/queue.php | 3 +++
5 files changed, 46 insertions(+), 40 deletions(-)
diff --git a/config/cache.php b/config/cache.php
index 8ceef964..3b9e6a2a 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -13,7 +13,8 @@
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
- | Supported: "apc", "array", "database", "file", "memcached", "redis"
+ | Supported: "apc", "array", "database", "file",
+ | "memcached", "redis", "dynamodb"
|
*/
@@ -38,6 +39,7 @@
'array' => [
'driver' => 'array',
+ 'serialize' => false,
],
'database' => [
@@ -59,7 +61,7 @@
env('MEMCACHED_PASSWORD'),
],
'options' => [
- // Memcached::OPT_CONNECT_TIMEOUT => 2000,
+ // Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
diff --git a/config/cors.php b/config/cors.php
index 92be67db..558369dc 100644
--- a/config/cors.php
+++ b/config/cors.php
@@ -4,57 +4,31 @@
/*
|--------------------------------------------------------------------------
- | Laravel CORS Options
+ | Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
- | The allowed_methods and allowed_headers options are case-insensitive.
+ | Here you may configure your settings for cross-origin resource sharing
+ | or "CORS". This determines what cross-origin operations may execute
+ | in web browsers. You are free to adjust these settings as needed.
|
- | You don't need to provide both allowed_origins and allowed_origins_patterns.
- | If one of the strings passed matches, it is considered a valid origin.
- |
- | If ['*'] is provided to allowed_methods, allowed_origins or allowed_headers
- | all methods / origins / headers are allowed.
+ | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
*/
- /*
- * You can enable CORS for 1 or multiple paths.
- * Example: ['api/*']
- */
'paths' => ['api/*'],
- /*
- * Matches the request method. `['*']` allows all methods.
- */
'allowed_methods' => ['*'],
- /*
- * Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com`
- */
- 'allowed_origins' => [env('ALLOWED_ORIGINS', '*.beep.nl')],
+ 'allowed_origins' => ['*'],
- /*
- * Patterns that can be used with `preg_match` to match the origin.
- */
'allowed_origins_patterns' => [],
- /*
- * Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
- */
'allowed_headers' => ['*'],
- /*
- * Sets the Access-Control-Expose-Headers response header with these headers.
- */
'exposed_headers' => [],
- /*
- * Sets the Access-Control-Max-Age response header when > 0.
- */
'max_age' => 0,
- /*
- * Sets the Access-Control-Allow-Credentials header.
- */
'supports_credentials' => false,
+
];
diff --git a/config/filesystems.php b/config/filesystems.php
index 80a7f0e2..06913902 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -8,10 +8,8 @@
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
- | by the framework. A "local" driver, as well as a variety of cloud
- | based drivers are available for your choosing. Just store away!
- |
- | Supported: "local", "ftp", "s3", "rackspace"
+ | by the framework. The "local" disk, as well as a variety of cloud
+ | based disks are available to your application. Just store away!
|
*/
@@ -39,6 +37,8 @@
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
+ | Supported Drivers: "local", "ftp", "sftp", "s3"
+ |
*/
'disks' => [
@@ -51,6 +51,7 @@
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
+ 'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
@@ -80,8 +81,24 @@
'expire' => 600,
'prefix' => 'cache-',
],
+ 'endpoint' => env('AWS_ENDPOINT'),
],
],
+ /*
+ |--------------------------------------------------------------------------
+ | Symbolic Links
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the symbolic links that will be created when the
+ | `storage:link` Artisan command is executed. The array keys should be
+ | the locations of the links and the values should be their targets.
+ |
+ */
+
+ 'links' => [
+ public_path('storage') => storage_path('app/public'),
+ ],
+
];
diff --git a/config/logging.php b/config/logging.php
index 691eb56c..2e838918 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -1,5 +1,6 @@
[
'driver' => 'slack',
- 'url' => env('WEBHOOK_URL'),
+ 'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('APP_NAME'),
'emoji' => ':boom:',
'level' => 'critical',
@@ -89,6 +90,15 @@
'driver' => 'errorlog',
'level' => 'debug',
],
+
+ 'null' => [
+ 'driver' => 'monolog',
+ 'handler' => NullHandler::class,
+ ],
+
+ 'emergency' => [
+ 'path' => storage_path('logs/laravel.log'),
+ ],
],
];
diff --git a/config/queue.php b/config/queue.php
index 1765e11c..00b76d65 100644
--- a/config/queue.php
+++ b/config/queue.php
@@ -46,6 +46,7 @@
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
+ 'block_for' => 0,
],
'sqs' => [
@@ -54,6 +55,7 @@
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
+ 'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
@@ -79,6 +81,7 @@
*/
'failed' => [
+ 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
From 82b03791bd9288a301a5dea4da9b0913e03dcd23 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:32 +0000
Subject: [PATCH 021/127] Bump Composer dependencies
---
composer.json | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/composer.json b/composer.json
index b13aed2b..f6e23eb6 100644
--- a/composer.json
+++ b/composer.json
@@ -17,16 +17,16 @@
"php": ">=7.4",
"doctrine/dbal": "^2.9",
"ellipsesynergie/api-response": "0.12.*",
- "fideloper/proxy": "^4.0",
+ "fideloper/proxy": "^4.4",
"fightbulc/moment": "*",
"fruitcake/laravel-cors": "^2.0.4",
"guzzlehttp/guzzle": "^6.5",
- "iatstuti/laravel-cascade-soft-deletes": "^2.0.0",
+ "iatstuti/laravel-cascade-soft-deletes": "^3.0",
"influxdb/influxdb-php": "1.*",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^5.0.1",
- "laravel/framework": "^6.2",
- "laravel/tinker": "~2.0",
+ "laravel/framework": "^7.29",
+ "laravel/tinker": "^2.5",
"laravelcollective/html": "^6.1",
"league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-cached-adapter": "~1.0",
@@ -38,13 +38,15 @@
"laravel/ui": "^2.0"
},
"require-dev": {
- "appzcoder/crud-generator": "^3.0",
+ "appzcoder/crud-generator": "^3.2",
"barryvdh/laravel-debugbar": "^3.6",
"filp/whoops": "^2.0",
"knuckleswtf/scribe": "^3.29",
- "mockery/mockery": "^1.0",
- "nunomaduro/collision": "^3.0",
- "phpunit/phpunit": "^8.0"
+ "mockery/mockery": "^1.3.1",
+ "nunomaduro/collision": "^4.3",
+ "phpunit/phpunit": "^8.5.8|^9.3.3",
+ "facade/ignition": "^2.0",
+ "fakerphp/faker": "^1.9.1"
},
"config": {
"optimize-autoloader": true,
From 8d5ea26959304fbbccd8126bc190035358c22752 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:33 +0000
Subject: [PATCH 022/127] Shift cleanup
---
app/Exceptions/Handler.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index ac3ed154..983af149 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -2,9 +2,9 @@
namespace App\Exceptions;
-use Throwable;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
+use Throwable;
class Handler extends ExceptionHandler
{
From e8ba2823699da7cf0325ef3d3ac5e5fbe7e83674 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 26 May 2026 13:34:34 +0000
Subject: [PATCH 023/127] Add framework testing folder to storage
---
storage/framework/testing/.gitignore | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 storage/framework/testing/.gitignore
diff --git a/storage/framework/testing/.gitignore b/storage/framework/testing/.gitignore
new file mode 100644
index 00000000..d6b7ef32
--- /dev/null
+++ b/storage/framework/testing/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
From 8c3114c5c14673b909ea16a5eda366b04ee3b8a4 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 26 May 2026 15:55:02 +0200
Subject: [PATCH 024/127] herd.yml
---
public/herd.yml | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 public/herd.yml
diff --git a/public/herd.yml b/public/herd.yml
new file mode 100644
index 00000000..03211db5
--- /dev/null
+++ b/public/herd.yml
@@ -0,0 +1,7 @@
+name: BEEP
+php: '8.0'
+secured: true
+aliases:
+ - BEEP.test
+integrations:
+ forge: { }
From 18aae7f0e98968c80c76322a847d148d8436c1c3 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 28 May 2026 13:56:16 +0200
Subject: [PATCH 025/127] attempt fix influxdb 500 error for Device.php
---
app/Device.php | 4 +++-
config/app.php | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/Device.php b/app/Device.php
index 55c20b17..5a9e629e 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -538,8 +538,10 @@ public static function getInfluxQuery($query, $from = 'device')
$options = ['precision' => 's'];
$values = [];
+ $queryApi = $client::createQueryApi();
+
try {
- $result = $client::query($query, $options);
+ $result = $queryApi->query($query, $options);
$values = $result->getPoints();
} catch (\Exception $e) {
// return Response::json('influx-group-by-query-error', 500);
diff --git a/config/app.php b/config/app.php
index b580efa3..2d13d995 100644
--- a/config/app.php
+++ b/config/app.php
@@ -170,6 +170,7 @@
Collective\Html\HtmlServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
+ TrayLabs\InfluxDB\Providers\ServiceProvider::class,
//
/*
From a9e9c811485b5ef234d3c69bfd9681bcc52ba5a6 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 28 May 2026 14:31:39 +0200
Subject: [PATCH 026/127] attempt fix influxdb 500 error for Device.php - via
HCS code
---
app/Device.php | 12 ++++++------
composer.json | 2 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/Device.php b/app/Device.php
index 5a9e629e..71690856 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -12,6 +12,7 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
use Moment\Moment;
+use InfluxDB;
class Device extends Model
{
@@ -534,18 +535,17 @@ public static function getInfluxQuery($query, $from = 'device')
Device::cacheRequestRate('influx-get');
Device::cacheRequestRate('influx-'.$from);
- $client = new \Influx;
+ $client = new \InfluxDB;
$options = ['precision' => 's'];
$values = [];
- $queryApi = $client::createQueryApi();
-
try {
- $result = $queryApi->query($query, $options);
+ $result = $client::query($query, $options);
$values = $result->getPoints();
- } catch (\Exception $e) {
+ } catch (InfluxDB\Exception $e) {
+ Log::error($e);
+ Log::error("Query that caused the error: $query");
// return Response::json('influx-group-by-query-error', 500);
- // die($e->getMessage());
}
return $values;
diff --git a/composer.json b/composer.json
index 688f0071..f5bd8c17 100644
--- a/composer.json
+++ b/composer.json
@@ -34,7 +34,7 @@
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^6.3",
- "tray-labs/laravel-influxdb": "*",
+ "tray-labs/laravel-influxdb": "1.0.*",
"laravel/ui": "^2.0"
},
"require-dev": {
From 69933c1b20751100dc0b21e59509fcf97ccfc7bc Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 28 May 2026 14:36:03 +0200
Subject: [PATCH 027/127] change tray-labs/laravel-influxdb version to 1.0.12
---
composer.json | 4 +-
composer.lock | 638 +-------------------------------------------------
2 files changed, 11 insertions(+), 631 deletions(-)
diff --git a/composer.json b/composer.json
index f5bd8c17..7c580c78 100644
--- a/composer.json
+++ b/composer.json
@@ -27,6 +27,7 @@
"kalnoy/nestedset": "^5.0.1",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
+ "laravel/ui": "^2.0",
"laravelcollective/html": "^6.1",
"league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-cached-adapter": "~1.0",
@@ -34,8 +35,7 @@
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^6.3",
- "tray-labs/laravel-influxdb": "1.0.*",
- "laravel/ui": "^2.0"
+ "tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
"appzcoder/crud-generator": "^3.2",
diff --git a/composer.lock b/composer.lock
index 1c7be67c..d0e0eea2 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "7c3bb40d3f33edeef9bdf57ebcb467ce",
+ "content-hash": "1c37ee94d3bbbd8a62e298d8ff63a15e",
"packages": [
{
"name": "asm89/stack-cors",
@@ -343,72 +343,6 @@
],
"time": "2023-10-01T12:35:29+00:00"
},
- {
- "name": "clue/stream-filter",
- "version": "v1.7.0",
- "source": {
- "type": "git",
- "url": "https://github.com/clue/stream-filter.git",
- "reference": "049509fef80032cb3f051595029ab75b49a3c2f7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7",
- "reference": "049509fef80032cb3f051595029ab75b49a3c2f7",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/functions_include.php"
- ],
- "psr-4": {
- "Clue\\StreamFilter\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Christian Lück",
- "email": "christian@clue.engineering"
- }
- ],
- "description": "A simple and modern approach to stream filtering in PHP",
- "homepage": "https://github.com/clue/stream-filter",
- "keywords": [
- "bucket brigade",
- "callback",
- "filter",
- "php_user_filter",
- "stream",
- "stream_filter_append",
- "stream_filter_register"
- ],
- "support": {
- "issues": "https://github.com/clue/stream-filter/issues",
- "source": "https://github.com/clue/stream-filter/tree/v1.7.0"
- },
- "funding": [
- {
- "url": "https://clue.engineering/support",
- "type": "custom"
- },
- {
- "url": "https://github.com/clue",
- "type": "github"
- }
- ],
- "time": "2023-12-20T15:40:13+00:00"
- },
{
"name": "composer/pcre",
"version": "3.3.2",
@@ -1795,56 +1729,6 @@
"abandoned": "dyrynda/laravel-cascade-soft-deletes",
"time": "2020-03-06T10:28:12+00:00"
},
- {
- "name": "influxdata/influxdb-client-php",
- "version": "3.8.0",
- "source": {
- "type": "git",
- "url": "https://github.com/influxdata/influxdb-client-php.git",
- "reference": "59ac11d63ce030973c79d5b05797813761a0d58e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/influxdata/influxdb-client-php/zipball/59ac11d63ce030973c79d5b05797813761a0d58e",
- "reference": "59ac11d63ce030973c79d5b05797813761a0d58e",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "ext-json": "*",
- "ext-mbstring": "*",
- "php": ">=7.2",
- "php-http/client-common": "^2.2.1",
- "php-http/discovery": "^1.9.1",
- "psr/http-client": "^1.0.1"
- },
- "require-dev": {
- "guzzlehttp/guzzle": "^7.0.1",
- "guzzlehttp/psr7": "^2.0.0",
- "phpunit/phpunit": "^8.5.27",
- "squizlabs/php_codesniffer": "~3.7"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "InfluxDB2\\": "src/InfluxDB2"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "InfluxDB (v2+) Client Library for PHP",
- "homepage": "https://www.github.com/influxdata/influxdb-client-php",
- "keywords": [
- "influxdb"
- ],
- "support": {
- "issues": "https://github.com/influxdata/influxdb-client-php/issues",
- "source": "https://github.com/influxdata/influxdb-client-php/tree/3.8.0"
- },
- "time": "2025-06-26T05:12:59+00:00"
- },
{
"name": "influxdb/influxdb-php",
"version": "1.15.2",
@@ -3606,330 +3490,6 @@
},
"time": "2025-07-08T20:30:08+00:00"
},
- {
- "name": "php-http/client-common",
- "version": "2.7.3",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/client-common.git",
- "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/client-common/zipball/dcc6de29c90dd74faab55f71b79d89409c4bf0c1",
- "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0",
- "php-http/httplug": "^2.0",
- "php-http/message": "^1.6",
- "psr/http-client": "^1.0",
- "psr/http-factory": "^1.0",
- "psr/http-message": "^1.0 || ^2.0",
- "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
- "symfony/polyfill-php80": "^1.17"
- },
- "require-dev": {
- "doctrine/instantiator": "^1.1",
- "guzzlehttp/psr7": "^1.4",
- "nyholm/psr7": "^1.2",
- "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7"
- },
- "suggest": {
- "ext-json": "To detect JSON responses with the ContentTypePlugin",
- "ext-libxml": "To detect XML responses with the ContentTypePlugin",
- "php-http/cache-plugin": "PSR-6 Cache plugin",
- "php-http/logger-plugin": "PSR-3 Logger plugin",
- "php-http/stopwatch-plugin": "Symfony Stopwatch plugin"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Client\\Common\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Common HTTP Client implementations and tools for HTTPlug",
- "homepage": "http://httplug.io",
- "keywords": [
- "client",
- "common",
- "http",
- "httplug"
- ],
- "support": {
- "issues": "https://github.com/php-http/client-common/issues",
- "source": "https://github.com/php-http/client-common/tree/2.7.3"
- },
- "time": "2025-11-29T19:12:34+00:00"
- },
- {
- "name": "php-http/discovery",
- "version": "1.20.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/discovery.git",
- "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d",
- "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^1.0|^2.0",
- "php": "^7.1 || ^8.0"
- },
- "conflict": {
- "nyholm/psr7": "<1.0",
- "zendframework/zend-diactoros": "*"
- },
- "provide": {
- "php-http/async-client-implementation": "*",
- "php-http/client-implementation": "*",
- "psr/http-client-implementation": "*",
- "psr/http-factory-implementation": "*",
- "psr/http-message-implementation": "*"
- },
- "require-dev": {
- "composer/composer": "^1.0.2|^2.0",
- "graham-campbell/phpspec-skip-example-extension": "^5.0",
- "php-http/httplug": "^1.0 || ^2.0",
- "php-http/message-factory": "^1.0",
- "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
- "sebastian/comparator": "^3.0.5 || ^4.0.8",
- "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "Http\\Discovery\\Composer\\Plugin",
- "plugin-optional": true
- },
- "autoload": {
- "psr-4": {
- "Http\\Discovery\\": "src/"
- },
- "exclude-from-classmap": [
- "src/Composer/Plugin.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
- "homepage": "http://php-http.org",
- "keywords": [
- "adapter",
- "client",
- "discovery",
- "factory",
- "http",
- "message",
- "psr17",
- "psr7"
- ],
- "support": {
- "issues": "https://github.com/php-http/discovery/issues",
- "source": "https://github.com/php-http/discovery/tree/1.20.0"
- },
- "time": "2024-10-02T11:20:13+00:00"
- },
- {
- "name": "php-http/httplug",
- "version": "2.4.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/httplug.git",
- "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4",
- "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0",
- "php-http/promise": "^1.1",
- "psr/http-client": "^1.0",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
- "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Client\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Eric GELOEN",
- "email": "geloen.eric@gmail.com"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
- }
- ],
- "description": "HTTPlug, the HTTP client abstraction for PHP",
- "homepage": "http://httplug.io",
- "keywords": [
- "client",
- "http"
- ],
- "support": {
- "issues": "https://github.com/php-http/httplug/issues",
- "source": "https://github.com/php-http/httplug/tree/2.4.1"
- },
- "time": "2024-09-23T11:39:58+00:00"
- },
- {
- "name": "php-http/message",
- "version": "1.16.2",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/message.git",
- "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a",
- "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a",
- "shasum": ""
- },
- "require": {
- "clue/stream-filter": "^1.5",
- "php": "^7.2 || ^8.0",
- "psr/http-message": "^1.1 || ^2.0"
- },
- "provide": {
- "php-http/message-factory-implementation": "1.0"
- },
- "require-dev": {
- "ergebnis/composer-normalize": "^2.6",
- "ext-zlib": "*",
- "guzzlehttp/psr7": "^1.0 || ^2.0",
- "laminas/laminas-diactoros": "^2.0 || ^3.0",
- "php-http/message-factory": "^1.0.2",
- "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
- "slim/slim": "^3.0"
- },
- "suggest": {
- "ext-zlib": "Used with compressor/decompressor streams",
- "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories",
- "laminas/laminas-diactoros": "Used with Diactoros Factories",
- "slim/slim": "Used with Slim Framework PSR-7 implementation"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/filters.php"
- ],
- "psr-4": {
- "Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "HTTP Message related tools",
- "homepage": "http://php-http.org",
- "keywords": [
- "http",
- "message",
- "psr-7"
- ],
- "support": {
- "issues": "https://github.com/php-http/message/issues",
- "source": "https://github.com/php-http/message/tree/1.16.2"
- },
- "time": "2024-10-02T11:34:13+00:00"
- },
- {
- "name": "php-http/promise",
- "version": "1.3.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-http/promise.git",
- "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
- "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3",
- "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Http\\Promise\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Joel Wurtz",
- "email": "joel.wurtz@gmail.com"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "description": "Promise used for asynchronous HTTP requests",
- "homepage": "http://httplug.io",
- "keywords": [
- "promise"
- ],
- "support": {
- "issues": "https://github.com/php-http/promise/issues",
- "source": "https://github.com/php-http/promise/tree/1.3.1"
- },
- "time": "2024-03-15T13:55:21+00:00"
- },
{
"name": "phpoffice/phpspreadsheet",
"version": "1.30.4",
@@ -4370,113 +3930,6 @@
},
"time": "2019-01-08T18:20:26+00:00"
},
- {
- "name": "psr/http-client",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-client.git",
- "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
- "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
- "shasum": ""
- },
- "require": {
- "php": "^7.0 || ^8.0",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Client\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common interface for HTTP clients",
- "homepage": "https://github.com/php-fig/http-client",
- "keywords": [
- "http",
- "http-client",
- "psr",
- "psr-18"
- ],
- "support": {
- "source": "https://github.com/php-fig/http-client"
- },
- "time": "2023-09-23T14:17:50+00:00"
- },
- {
- "name": "psr/http-factory",
- "version": "1.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-factory.git",
- "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
- "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1",
- "psr/http-message": "^1.0 || ^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
- "keywords": [
- "factory",
- "http",
- "message",
- "psr",
- "psr-17",
- "psr-7",
- "request",
- "response"
- ],
- "support": {
- "source": "https://github.com/php-fig/http-factory"
- },
- "time": "2024-04-15T12:06:14+00:00"
- },
{
"name": "psr/http-message",
"version": "1.1",
@@ -5909,75 +5362,6 @@
],
"time": "2026-05-05T14:35:32+00:00"
},
- {
- "name": "symfony/options-resolver",
- "version": "v5.4.45",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/options-resolver.git",
- "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6",
- "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-php73": "~1.0",
- "symfony/polyfill-php80": "^1.16"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\OptionsResolver\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Provides an improved replacement for the array_replace PHP function",
- "homepage": "https://symfony.com",
- "keywords": [
- "config",
- "configuration",
- "options"
- ],
- "support": {
- "source": "https://github.com/symfony/options-resolver/tree/v5.4.45"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2024-09-25T14:11:13+00:00"
- },
{
"name": "symfony/polyfill-ctype",
"version": "v1.37.0",
@@ -7378,25 +6762,21 @@
},
{
"name": "tray-labs/laravel-influxdb",
- "version": "v2.0.0",
+ "version": "1.0.12",
"source": {
"type": "git",
"url": "https://github.com/tray-labs/laravel-influxdb.git",
- "reference": "6f0bcb59d8e64c83e2256ffdfb42e7cce73dc884"
+ "reference": "f918e0f75c739311e95fc1bf0ffc046294ea2310"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tray-labs/laravel-influxdb/zipball/6f0bcb59d8e64c83e2256ffdfb42e7cce73dc884",
- "reference": "6f0bcb59d8e64c83e2256ffdfb42e7cce73dc884",
+ "url": "https://api.github.com/repos/tray-labs/laravel-influxdb/zipball/f918e0f75c739311e95fc1bf0ffc046294ea2310",
+ "reference": "f918e0f75c739311e95fc1bf0ffc046294ea2310",
"shasum": ""
},
"require": {
- "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
- "influxdata/influxdb-client-php": "^3.0"
- },
- "require-dev": {
- "orchestra/testbench": "^8.0|^9.0|^10.0",
- "phpunit/phpunit": "^10.0|^11.0"
+ "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "influxdb/influxdb-php": "^1.15"
},
"type": "library",
"extra": {
@@ -7427,9 +6807,9 @@
"description": "A service made to provide, set up and use the library from influxdata influxphp in Laravel.",
"support": {
"issues": "https://github.com/tray-labs/laravel-influxdb/issues",
- "source": "https://github.com/tray-labs/laravel-influxdb/tree/v2.0.0"
+ "source": "https://github.com/tray-labs/laravel-influxdb/tree/1.0.12"
},
- "time": "2026-05-12T14:54:08+00:00"
+ "time": "2025-05-12T12:23:08+00:00"
},
{
"name": "vlucas/phpdotenv",
From df89416438146bb83bf1328fe25ca911738c803c Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 28 May 2026 14:47:21 +0200
Subject: [PATCH 028/127] change Influx to InfluxDB (via HCS code)
---
app/Http/Controllers/Api/ResearchDataController.php | 2 +-
app/Http/Controllers/ResearchController.php | 2 +-
app/Weather.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/Api/ResearchDataController.php b/app/Http/Controllers/Api/ResearchDataController.php
index 392f0e49..9849b581 100644
--- a/app/Http/Controllers/Api/ResearchDataController.php
+++ b/app/Http/Controllers/Api/ResearchDataController.php
@@ -43,7 +43,7 @@ public function __construct()
$this->valid_sensors = Measurement::getValidMeasurements();
$this->output_sensors = Measurement::getValidMeasurements(true);
$this->output_weather = Measurement::getValidMeasurements(true, true);
- $this->client = new \Influx;
+ $this->client = new \InfluxDB;
// die(print_r($this->valid_sensors));
}
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index 3678a0cf..6a6f493a 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -34,7 +34,7 @@ public function __construct()
{
$this->valid_sensors = Measurement::getValidMeasurements();
$this->output_sensors = Measurement::getValidMeasurements(true);
- $this->client = new \Influx;
+ $this->client = new \InfluxDB;
// die(print_r($this->valid_sensors));
}
diff --git a/app/Weather.php b/app/Weather.php
index ab679348..b3bcdf5e 100644
--- a/app/Weather.php
+++ b/app/Weather.php
@@ -209,7 +209,7 @@ public static function updateLocations()
*/
private static function storeDataToInflux($result) // store posted data
{
- $client = new \Influx;
+ $client = new \InfluxDB;
$points = [];
$data_array = [];
From 53cb6eac739d5b088b0e8cc8f3156a65912a1cd0 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:26 +0000
Subject: [PATCH 029/127] Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.
You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.
For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
---
app/Device.php | 6 +--
.../Controllers/Api/MeasurementController.php | 33 +++++++--------
app/Http/Controllers/DeviceController.php | 2 +-
app/Http/Controllers/RoleController.php | 2 +-
app/Http/Controllers/UserController.php | 2 +-
app/Traits/MeasurementLoRaDecoderTrait.php | 40 +++++++++----------
app/User.php | 2 +-
7 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/app/Device.php b/app/Device.php
index 71690856..199784fb 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -11,8 +11,8 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
-use Moment\Moment;
use InfluxDB;
+use Moment\Moment;
class Device extends Model
{
@@ -87,7 +87,7 @@ public function empty_cache($clear_users = true)
Cache::forget('device-'.$this->id.'-calibrations-measurement-types');
Cache::forget('device-'.$this->id.'-calibrations-measurement-types-0');
Cache::forget('device-'.$this->id.'-calibrations-measurement-types-1');
-
+
Log::debug("Device ID $this->id cache emptied");
if ($clear_users) {
@@ -924,7 +924,7 @@ private function last_sensor_increment_values($data_array = null)
// By default, only return the force recalculation calibrations,
// If recalculate is set to false, return all available calibrations.
- public function calibrationsMeasurementAbbreviations($recalculate=true)
+ public function calibrationsMeasurementAbbreviations($recalculate = true)
{
$cache_name = 'device-'.$this->id.'-calibrations-measurement-types-'.$recalculate ? '1' : '0';
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 7864d48d..e9d6d6e7 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -2,13 +2,8 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Storage;
-use Illuminate\Support\Facades\Log;
-use Auth;
-use App\User;
-use App\Device;
use App\Category;
+use App\Device;
use App\Measurement;
use App\Models\AlertRule;
use App\Models\Calculation;
@@ -17,10 +12,15 @@
use App\SensorDefinition;
use App\Traits\MeasurementLegacyCalculationsTrait;
use App\Traits\MeasurementLoRaDecoderTrait;
-// use App\Transformer\SensorTransformer;
+use App\User;
+use Auth;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
+use Illuminate\Http\Request;
+// use App\Transformer\SensorTransformer;
use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Storage;
use InfluxDB;
use Moment\Moment;
use Response;
@@ -1442,8 +1442,8 @@ public function data(Request $request)
$timeZone = $intervalArr['timeZone'];
$whereKeyAndTime = $device->influxWhereKeys().' AND time >= \''.$start_date.'\' AND time <= \''.$end_date.'\'';
- $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(true);
- $add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
+ $calibration_m_abbr = $device->calibrationsMeasurementAbbreviations(true);
+ $add_calibrations = count($calibration_m_abbr) > 0 ? true : false;
if ($resolution != null) {
if ($device) {
@@ -1489,13 +1489,10 @@ public function data(Request $request)
$sensors_out = Device::getInfluxQuery($sensorQuery, 'data');
// Apply SensorDefinitions that have 'recalculate' set to true
- if ($add_calibrations)
- {
+ if ($add_calibrations) {
$log_set = false;
- foreach ($sensors_out as $i => $data_array)
- {
- if ($log_set == false && isset($data_array['weight_kg']))
- {
+ foreach ($sensors_out as $i => $data_array) {
+ if ($log_set == false && isset($data_array['weight_kg'])) {
Log::debug('measurements device '.$device->name.' ('.$device->id.'), values: '.json_encode($data_array).', calibr: '.json_encode($calibration_m_abbr));
$log_set = true;
}
@@ -1561,16 +1558,16 @@ public function data(Request $request)
if (count($data_time_key_arr) > 0) {
foreach ($sensors_out as $i => $values) {
$time = $values['time'];
- if (isset($data_time_key_arr[$time])) // add clean_weight data to already available datetime
- {
+ if (isset($data_time_key_arr[$time])) { // add clean_weight data to already available datetime
$sensors_out[$i] = array_merge($sensors_out[$i], $data_time_key_arr[$time]); // merge all data incl. net weight
unset($data_time_key_arr[$time]); // to retain missing values and add then later
}
}
}
// add missing time values to sensors
- if (count($data_time_key_arr) > 0)
+ if (count($data_time_key_arr) > 0) {
$sensors_out = array_merge($sensors_out, array_values($data_time_key_arr));
+ }
}
// return Response::json(['sensor_query' => $sensorQuery, 'cleanWeight_query' => $clean_weight_query, 'cleanWeight_out'=> $clean_weight_out, 'measurements' => $sensors_out]);
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index dfef19f9..97a63339 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -480,6 +480,6 @@ public function destroy($id)
Device::find($id)->delete();
return redirect()->route('devices.index')
- ->with('success','Device deleted successfully');
+ ->with('success', 'Device deleted successfully');
}
}
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index b50aef81..4042aeb8 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -137,6 +137,6 @@ public function destroy($id)
DB::table('roles')->where('id', $id)->delete();
return redirect()->route('roles.index')
- ->with('success','Role deleted successfully');
+ ->with('success', 'Role deleted successfully');
}
}
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index 1286aff5..d915b661 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -285,7 +285,7 @@ private function getMyPermittedRoles($user, $returnIdArray = false)
if ($returnIdArray) {
return $roles->pluck('id', 'id')->toArray();
} else {
- return $roles->pluck('display_name','id');
+ return $roles->pluck('display_name', 'id');
}
}
}
diff --git a/app/Traits/MeasurementLoRaDecoderTrait.php b/app/Traits/MeasurementLoRaDecoderTrait.php
index d9d94f7f..cc915184 100644
--- a/app/Traits/MeasurementLoRaDecoderTrait.php
+++ b/app/Traits/MeasurementLoRaDecoderTrait.php
@@ -569,26 +569,26 @@ private function decode_beep_payload($payload, $port)
}
} else { // BEEP base v2 firmware (fport == 1)
$beep_sensors = [
- 't', // 0
- 'h', // 1
- 'w_v',
- 't_i',
- 'a_i',
- 'bv',
- 's_tot',
- 's_fan_4',
- 's_fan_6',
- 's_fan_9',
- 's_fly_a',
- 'w_fl_hb',
- 'w_fl_lb',
- 'w_fr_hb',
- 'w_fr_lb',
- 'w_bl_hb',
- 'w_bl_lb',
- 'w_br_hb',
- 'w_br_lb', // 18
- ];
+ 't', // 0
+ 'h', // 1
+ 'w_v',
+ 't_i',
+ 'a_i',
+ 'bv',
+ 's_tot',
+ 's_fan_4',
+ 's_fan_6',
+ 's_fan_9',
+ 's_fly_a',
+ 'w_fl_hb',
+ 'w_fl_lb',
+ 'w_fr_hb',
+ 'w_fr_lb',
+ 'w_bl_hb',
+ 'w_bl_lb',
+ 'w_br_hb',
+ 'w_br_lb', // 18
+ ];
$minLength = min(strlen($payload) / 2, count($beep_sensors));
diff --git a/app/User.php b/app/User.php
index f4d13790..abd80f8d 100644
--- a/app/User.php
+++ b/app/User.php
@@ -459,6 +459,6 @@ public static function selectList($index = 'id')
return $array;
}
- return Auth::user()->pluck('name','id');
+ return Auth::user()->pluck('name', 'id');
}
}
From f7d4a7a270048a3a028378fdf1984bd7f298b874 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:34 +0000
Subject: [PATCH 030/127] Shift core files
---
public/index.php | 49 +++++++++++++++-----------------
resources/lang/en/auth.php | 1 +
resources/lang/en/validation.php | 46 +++++++++++++++++++-----------
3 files changed, 54 insertions(+), 42 deletions(-)
diff --git a/public/index.php b/public/index.php
index e1964675..1d69f3a2 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,58 +1,55 @@
- */
+use Illuminate\Contracts\Http\Kernel;
+use Illuminate\Http\Request;
+
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
-| Register The Auto Loader
+| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
-| Composer provides a convenient, automatically generated class loader for
-| our application. We just need to utilize it! We'll simply require it
-| into the script here so that we don't have to worry about manual
-| loading any of our classes later on. It feels great to relax.
+| If the application is in maintenance / demo mode via the "down" command
+| we will load this file so that any pre-rendered content can be shown
+| instead of starting the framework, which could cause an exception.
|
*/
-require __DIR__.'/../vendor/autoload.php';
+if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
+ require $maintenance;
+}
/*
|--------------------------------------------------------------------------
-| Turn On The Lights
+| Register The Auto Loader
|--------------------------------------------------------------------------
|
-| We need to illuminate PHP development, so let us turn on the lights.
-| This bootstraps the framework and gets it ready for use, then it
-| will load up this application so that we can run it and send
-| the responses back to the browser and delight our users.
+| Composer provides a convenient, automatically generated class loader for
+| this application. We just need to utilize it! We'll simply require it
+| into the script here so we don't need to manually load our classes.
|
*/
-$app = require_once __DIR__.'/../bootstrap/app.php';
+require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
-| Once we have the application, we can handle the incoming request
-| through the kernel, and send the associated response back to
-| the client's browser allowing them to enjoy the creative
-| and wonderful application we have prepared for them.
+| Once we have the application, we can handle the incoming request using
+| the application's HTTP kernel. Then, we will send the response back
+| to this client's browser, allowing them to enjoy our application.
|
*/
-$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
+$app = require_once __DIR__.'/../bootstrap/app.php';
-$response = $kernel->handle(
- $request = Illuminate\Http\Request::capture()
-);
+$kernel = $app->make(Kernel::class);
-$response->send();
+$response = $kernel->handle(
+ $request = Request::capture()
+)->send();
$kernel->terminate($request, $response);
diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php
index e5506df2..6598e2c0 100755
--- a/resources/lang/en/auth.php
+++ b/resources/lang/en/auth.php
@@ -14,6 +14,7 @@
*/
'failed' => 'These credentials do not match our records.',
+ 'password' => 'The provided password is incorrect.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
];
diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php
index 8ab929cb..783003cf 100755
--- a/resources/lang/en/validation.php
+++ b/resources/lang/en/validation.php
@@ -14,12 +14,13 @@
*/
'accepted' => 'The :attribute must be accepted.',
+ 'accepted_if' => 'The :attribute must be accepted when :other is :value.',
'active_url' => 'The :attribute is not a valid URL.',
'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
- 'alpha' => 'The :attribute may only contain letters.',
- 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.',
- 'alpha_num' => 'The :attribute may only contain letters and numbers.',
+ 'alpha' => 'The :attribute must only contain letters.',
+ 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
+ 'alpha_num' => 'The :attribute must only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
@@ -31,15 +32,20 @@
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
+ 'current_password' => 'The password is incorrect.',
'date' => 'The :attribute is not a valid date.',
'date_equals' => 'The :attribute must be a date equal to :date.',
'date_format' => 'The :attribute does not match the format :format.',
+ 'declined' => 'The :attribute must be declined.',
+ 'declined_if' => 'The :attribute must be declined when :other is :value.',
'different' => 'The :attribute and :other must be different.',
'digits' => 'The :attribute must be :digits digits.',
'digits_between' => 'The :attribute must be between :min and :max digits.',
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
'email' => 'The :attribute must be a valid email address.',
+ 'ends_with' => 'The :attribute must end with one of the following: :values.',
+ 'enum' => 'The selected :attribute is invalid.',
'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
@@ -50,9 +56,9 @@
'array' => 'The :attribute must have more than :value items.',
],
'gte' => [
- 'numeric' => 'The :attribute must be greater than or equal :value.',
- 'file' => 'The :attribute must be greater than or equal :value kilobytes.',
- 'string' => 'The :attribute must be greater than or equal :value characters.',
+ 'numeric' => 'The :attribute must be greater than or equal to :value.',
+ 'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
+ 'string' => 'The :attribute must be greater than or equal to :value characters.',
'array' => 'The :attribute must have :value items or more.',
],
'image' => 'The :attribute must be an image.',
@@ -70,16 +76,17 @@
'array' => 'The :attribute must have less than :value items.',
],
'lte' => [
- 'numeric' => 'The :attribute must be less than or equal :value.',
- 'file' => 'The :attribute must be less than or equal :value kilobytes.',
- 'string' => 'The :attribute must be less than or equal :value characters.',
+ 'numeric' => 'The :attribute must be less than or equal to :value.',
+ 'file' => 'The :attribute must be less than or equal to :value kilobytes.',
+ 'string' => 'The :attribute must be less than or equal to :value characters.',
'array' => 'The :attribute must not have more than :value items.',
],
+ 'mac_address' => 'The :attribute must be a valid MAC address.',
'max' => [
- 'numeric' => 'The :attribute may not be greater than :max.',
- 'file' => 'The :attribute may not be greater than :max kilobytes.',
- 'string' => 'The :attribute may not be greater than :max characters.',
- 'array' => 'The :attribute may not have more than :max items.',
+ 'numeric' => 'The :attribute must not be greater than :max.',
+ 'file' => 'The :attribute must not be greater than :max kilobytes.',
+ 'string' => 'The :attribute must not be greater than :max characters.',
+ 'array' => 'The :attribute must not have more than :max items.',
],
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
@@ -89,12 +96,19 @@
'string' => 'The :attribute must be at least :min characters.',
'array' => 'The :attribute must have at least :min items.',
],
+ 'multiple_of' => 'The :attribute must be a multiple of :value.',
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
+ 'password' => 'The password is incorrect.',
'present' => 'The :attribute field must be present.',
+ 'prohibited' => 'The :attribute field is prohibited.',
+ 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
+ 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
+ 'prohibits' => 'The :attribute field prohibits :other from being present.',
'regex' => 'The :attribute format is invalid.',
'required' => 'The :attribute field is required.',
+ 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
'required_if' => 'The :attribute field is required when :other is :value.',
'required_unless' => 'The :attribute field is required unless :other is in :values.',
'required_with' => 'The :attribute field is required when :values is present.',
@@ -108,12 +122,12 @@
'string' => 'The :attribute must be :size characters.',
'array' => 'The :attribute must contain :size items.',
],
- 'starts_with' => 'The :attribute must start with one of the following: :values',
+ 'starts_with' => 'The :attribute must start with one of the following: :values.',
'string' => 'The :attribute must be a string.',
- 'timezone' => 'The :attribute must be a valid zone.',
+ 'timezone' => 'The :attribute must be a valid timezone.',
'unique' => 'The :attribute has already been taken.',
'uploaded' => 'The :attribute failed to upload.',
- 'url' => 'The :attribute format is invalid.',
+ 'url' => 'The :attribute must be a valid URL.',
'uuid' => 'The :attribute must be a valid UUID.',
/*
From 957ce1e65d441fb99fe18b34ddc7a489c02720fc Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:34 +0000
Subject: [PATCH 031/127] Shift exception handler
---
app/Exceptions/Handler.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index 983af149..b343d648 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -23,6 +23,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontFlash = [
+ 'current_password',
'password',
'password_confirmation',
];
From 0a7fa8d58a5c537dd6ad6bec3b36214299f52364 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:34 +0000
Subject: [PATCH 032/127] Shift HTTP kernel and middleware
---
app/Http/Kernel.php | 5 ++---
...hp => PreventRequestsDuringMaintenance.php} | 6 +++---
.../Middleware/RedirectIfAuthenticated.php | 18 ++++++++++++------
app/Http/Middleware/TrimStrings.php | 3 ++-
app/Http/Middleware/TrustHosts.php | 2 +-
5 files changed, 20 insertions(+), 14 deletions(-)
rename app/Http/Middleware/{CheckForMaintenanceMode.php => PreventRequestsDuringMaintenance.php} (51%)
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index b87993f2..ffcbb8cc 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -15,7 +15,7 @@ class Kernel extends HttpKernel
*/
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
- \App\Http\Middleware\CheckForMaintenanceMode::class,
+ \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
],
'api' => [
- 'bindings',
+ \Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
@@ -53,7 +53,6 @@ class Kernel extends HttpKernel
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
- 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php
similarity index 51%
rename from app/Http/Middleware/CheckForMaintenanceMode.php
rename to app/Http/Middleware/PreventRequestsDuringMaintenance.php
index 35b9824b..74cbd9a9 100644
--- a/app/Http/Middleware/CheckForMaintenanceMode.php
+++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php
@@ -2,14 +2,14 @@
namespace App\Http\Middleware;
-use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
+use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
-class CheckForMaintenanceMode extends Middleware
+class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
- * @var array
+ * @var array
*/
protected $except = [
//
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
index 1e2f1493..4e7c24b7 100644
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -2,7 +2,9 @@
namespace App\Http\Middleware;
+use App\Providers\RouteServiceProvider;
use Closure;
+use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
@@ -10,14 +12,18 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
- * @param \Illuminate\Http\Request $request
- * @param string|null $guard
- * @return mixed
+ * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
+ * @param string|null ...$guards
+ * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
- public function handle($request, Closure $next, $guard = null)
+ public function handle(Request $request, Closure $next, ...$guards)
{
- if (Auth::guard($guard)->check()) {
- return redirect('/home');
+ $guards = empty($guards) ? [null] : $guards;
+
+ foreach ($guards as $guard) {
+ if (Auth::guard($guard)->check()) {
+ return redirect(RouteServiceProvider::HOME);
+ }
}
return $next($request);
diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php
index 5a50e7b5..88cadcaa 100644
--- a/app/Http/Middleware/TrimStrings.php
+++ b/app/Http/Middleware/TrimStrings.php
@@ -9,9 +9,10 @@ class TrimStrings extends Middleware
/**
* The names of the attributes that should not be trimmed.
*
- * @var array
+ * @var array
*/
protected $except = [
+ 'current_password',
'password',
'password_confirmation',
];
diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php
index b0550cfc..7186414c 100644
--- a/app/Http/Middleware/TrustHosts.php
+++ b/app/Http/Middleware/TrustHosts.php
@@ -9,7 +9,7 @@ class TrustHosts extends Middleware
/**
* Get the host patterns that should be trusted.
*
- * @return array
+ * @return array
*/
public function hosts()
{
From f13bce682c0e3db642e8b11b64e48f53904be5ca Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:34 +0000
Subject: [PATCH 033/127] Replace deprecated `HEADER_X_FORWARDED_ALL` constant
---
app/Http/Middleware/TrustProxies.php | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php
index c661475c..3391630e 100644
--- a/app/Http/Middleware/TrustProxies.php
+++ b/app/Http/Middleware/TrustProxies.php
@@ -2,7 +2,7 @@
namespace App\Http\Middleware;
-use Fideloper\Proxy\TrustProxies as Middleware;
+use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
@@ -10,7 +10,7 @@ class TrustProxies extends Middleware
/**
* The trusted proxies for this application.
*
- * @var array
+ * @var array|string|null
*/
protected $proxies;
@@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
- protected $headers = Request::HEADER_X_FORWARDED_ALL;
+ protected $headers =
+ Request::HEADER_X_FORWARDED_FOR |
+ Request::HEADER_X_FORWARDED_HOST |
+ Request::HEADER_X_FORWARDED_PORT |
+ Request::HEADER_X_FORWARDED_PROTO |
+ Request::HEADER_X_FORWARDED_AWS_ELB;
}
From b073c735cb883ee10a263cb160de750f4dd254bf Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:35 +0000
Subject: [PATCH 034/127] Shift service providers
---
app/Providers/EventServiceProvider.php | 1 -
app/Providers/RouteServiceProvider.php | 68 ++++++++++----------------
2 files changed, 26 insertions(+), 43 deletions(-)
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index b035be27..4a572335 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -30,7 +30,6 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
- parent::boot();
//
}
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index b6fba644..927be5d7 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -2,78 +2,62 @@
namespace App\Providers;
+use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
- * This namespace is applied to your controller routes.
+ * The path to the "home" route for your application.
*
- * In addition, it is set as the URL generator's root namespace.
+ * This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
- protected $namespace = 'App\Http\Controllers';
+ public const HOME = '/home';
/**
- * Define your route model bindings, pattern filters, etc.
+ * The controller namespace for the application.
*
- * @return void
+ * When present, controller route declarations will automatically be prefixed with this namespace.
+ *
+ * @var string|null
*/
- public function boot()
- {
- //
-
- parent::boot();
- }
+ protected $namespace = 'App\\Http\\Controllers';
/**
- * Define the routes for the application.
+ * Define your route model bindings, pattern filters, etc.
*
* @return void
*/
- public function map()
+ public function boot()
{
- $this->mapApiRoutes();
+ $this->configureRateLimiting();
- $this->mapWebRoutes();
+ $this->routes(function () {
+ Route::prefix('api')
+ ->middleware('api')
+ ->namespace($this->namespace)
+ ->group(base_path('routes/api.php'));
- //
- }
-
- /**
- * Define the "web" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapWebRoutes()
- {
- Route::group([
- 'middleware' => 'web',
- 'namespace' => $this->namespace,
- ], function ($router) {
- require base_path('routes/web.php');
+ Route::middleware('web')
+ ->namespace($this->namespace)
+ ->group(base_path('routes/web.php'));
});
}
/**
- * Define the "api" routes for the application.
- *
- * These routes are typically stateless.
+ * Configure the rate limiters for the application.
*
* @return void
*/
- protected function mapApiRoutes()
+ protected function configureRateLimiting()
{
- Route::group([
- 'middleware' => 'api',
- 'namespace' => $this->namespace,
- 'prefix' => 'api',
- ], function ($router) {
- require base_path('routes/api.php');
+ RateLimiter::for('api', function (Request $request) {
+ return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}
From 4fb3b031a43cfee8c321bb4bc4ea2151948c27b0 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:35 +0000
Subject: [PATCH 035/127] Convert route options to fluent methods
Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.
---
routes/api.php | 253 ++++++++++++++++++++++++-------------------------
routes/web.php | 147 ++++++++++++++--------------
2 files changed, 194 insertions(+), 206 deletions(-)
diff --git a/routes/api.php b/routes/api.php
index deda05f9..e98f7e14 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -11,133 +11,130 @@
|
*/
-Route::group([], function () {
-
- Route::get('/', function () {
- return redirect('webapp');
- });
-
- // save sensor data of multiple sensors
- Route::post('sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:10,1,sensors');
- Route::post('lora_sensors', 'Api\MeasurementController@lora_sensors')->middleware('throttle:10,1,lora_sensors');
- Route::get('sensors/measurement_types', 'Api\MeasurementController@sensor_measurement_types')->middleware('throttle:3,1,measurement_types');
-
- // save sensor data of multiple sensors (unsecure)
- // Route::post('unsecure_sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:1,1');
-
- // User functions
- Route::post('register', 'Api\UserController@register')->middleware('throttle:6,1,register');
- Route::post('login', 'Api\UserController@login')->middleware('throttle:20,1,login');
- Route::post('user/reminder', 'Api\UserController@reminder')->middleware('throttle:3,1,user_reminder');
- Route::post('user/reset', 'Api\UserController@reset')->middleware('throttle:3,1,user_reset');
-
- // // Email Verification Routes...
- Route::get('email/verify/{id}', 'Api\Auth\VerificationController@verify')->name('apiverification.verify')->middleware('throttle:6,1,verify');
- Route::post('email/resend', 'Api\Auth\VerificationController@resend')->name('apiverification.resend')->middleware('throttle:3,1,resend');
-
- Route::post('groups/checktoken', 'Api\GroupController@checktoken')->middleware('throttle:6,1,checktoken');
-
- // Public Dashboard
- Route::get('dashboard/{code}', 'Api\DashboardGroupController@public')->middleware('throttle:60,1,publicdashboard');
-
- // high traffic routes
- Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min_sensors,1,sensor_traffic']], function () {
- Route::post('sensors_auth', 'Api\MeasurementController@storeMeasurementData');
- Route::post('lora_sensors_auth', 'Api\MeasurementController@lora_sensors');
- });
-
- // normal traffic routes
- Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min,1,normal_traffic']], function () {
- // Route::post('devices/tts/{step}/{dev_id}/{dev_eui}/{app_key}', 'Api\DeviceController@debugTtsDevice');
-
- // Authenticate and provide the token
- Route::post('authenticate', 'Api\UserController@authenticate');
-
- // get more data of 1 sensor (Device)
- Route::post('devices/multiple', 'Api\DeviceController@storeMultiple');
- Route::get('devices/ttn/{dev_id}', 'Api\DeviceController@getTTNDevice');
- Route::post('devices/ttn/{dev_id}', 'Api\DeviceController@postTTNDevice');
-
- Route::get('sensors/measurements', 'Api\MeasurementController@data');
- Route::get('sensors/comparemeasurements', 'Api\MeasurementController@comparedata');
- Route::get('sensors/cleanedweight', 'Api\MeasurementController@cleanedweight');
- Route::get('sensors/lastvalues', 'Api\MeasurementController@lastvalues');
- Route::get('sensors/lastweight', 'Api\MeasurementController@lastweight');
- Route::post('sensors/calibrateweight', 'Api\MeasurementController@calibrateweight');
- Route::post('sensors/offsetweight', 'Api\MeasurementController@offsetweight');
- Route::get('sensors/measurement_types_available', 'Api\MeasurementController@sensor_measurement_types_available');
- Route::post('sensors/flashlog', 'Api\MeasurementController@flashlog');
- Route::get('sensors/decode/p/{port}/pl/{payload}', 'Api\MeasurementController@decode_beep_lora_payload');
-
- Route::post('settings', 'Api\SettingController@store');
- Route::get('settings', 'Api\SettingController@index');
-
- Route::get('taxonomy/lists', 'Api\TaxonomyController@lists');
- Route::get('taxonomy/taxonomy', 'Api\TaxonomyController@taxonomy');
-
- Route::get('inspections', 'Api\InspectionsController@index');
- Route::get('inspections/lists', 'Api\InspectionsController@lists');
- Route::get('inspections/{id}', 'Api\InspectionsController@show');
- Route::get('inspections/hive/{hive_id}', 'Api\InspectionsController@hive');
- Route::post('inspections/store', 'Api\InspectionsController@store');
- Route::delete('inspections/{id}', 'Api\InspectionsController@destroy');
-
- Route::get('research', 'Api\ResearchController@index');
- Route::post('research/{id}/add_consent', 'Api\ResearchController@add_consent');
- Route::post('research/{id}/remove_consent', 'Api\ResearchController@remove_consent');
- Route::patch('research/{id}/edit/{consent_id}', 'Api\ResearchController@edit_consent');
- Route::delete('research/{id}/delete/{consent_id}', 'Api\ResearchController@delete_no_consent');
-
- Route::get('researchdata', 'Api\ResearchDataController@index');
- Route::get('researchdata/{id}', 'Api\ResearchDataController@show');
- Route::get('researchdata/{id}/data/{item}', 'Api\ResearchDataController@research_data');
- Route::get('researchdata/{id}/user/{user_id}/{item}', 'Api\ResearchDataController@user_data');
-
- Route::delete('user', 'Api\UserController@destroy');
- Route::patch('user', 'Api\UserController@edit');
- Route::patch('userlocale', 'Api\UserController@userlocale');
-
- // Device specific routes (must be before resource route)
- Route::post('devices/clocksync', 'Api\DeviceController@clocksync');
- Route::post('devices/lora_reset', 'Api\DeviceController@lora_reset');
- Route::post('devices/interval', 'Api\DeviceController@interval');
-
- // Control resources
- Route::resource('devices', 'Api\DeviceController', ['except' => ['create', 'edit']]);
- Route::resource('checklists', 'Api\ChecklistController', ['except' => ['create', 'edit']]);
- Route::resource('categories', 'Api\CategoryController', ['except' => ['create', 'edit', 'store', 'update', 'destroy']]);
- Route::resource('groups', 'Api\GroupController', ['except' => ['create', 'edit']]);
- Route::resource('hives', 'Api\HiveController', ['except' => ['create', 'edit']]);
- Route::resource('hive-tags', 'Api\HiveTagsController', ['except' => ['create', 'edit']]);
- Route::resource('locations', 'Api\LocationController', ['except' => ['create', 'edit']]);
- Route::resource('queens', 'Api\QueenController', ['except' => ['create', 'edit']]);
- Route::resource('images', 'Api\ImageController', ['except' => ['create', 'edit', 'destroy']]);
- Route::resource('sensordefinition', 'Api\SensorDefinitionController', ['except' => ['create', 'edit']]);
- Route::resource('samplecode', 'Api\SampleCodeController', ['except' => ['create', 'edit', 'destroy']]);
- Route::resource('alerts', 'Api\AlertController', ['except' => ['create', 'edit']]);
- Route::resource('alert-rules', 'Api\AlertRuleController', ['except' => ['create', 'edit']]);
- Route::resource('dashboardgroups', 'Api\DashboardGroupController', ['except' => ['create', 'edit']]);
- Route::resource('checklist-svg', 'Api\ChecklistSvgController', ['except' => ['create', 'edit']]);
-
- Route::get('alert-rules-default', 'Api\AlertRuleController@default_rules');
-
- Route::delete('samplecode', 'Api\SampleCodeController@destroy');
- Route::delete('images', 'Api\ImageController@destroyByUrl');
- Route::delete('groups/detach/{id}', 'Api\GroupController@detach');
-
- Route::get('categoryinputs', 'Api\CategoryController@inputs');
- Route::post('export/csv', 'Api\ExportController@generate_csv');
-
- Route::get('flashlogs', 'Api\FlashLogController@index');
- Route::get('flashlogs/{id}', 'Api\FlashLogController@show');
- Route::post('flashlogs/{id}', 'Api\FlashLogController@persist');
- Route::delete('flashlogs/{id}', 'Api\FlashLogController@delete');
- });
-
- // low traffic routes
- Route::group(['middleware' => ['auth:api', 'verifiedApi', 'throttle:3,1,low_traffic']], function () {
- Route::get('export', 'Api\ExportController@all');
- Route::get('weather', 'Api\WeatherController@index');
- });
+Route::get('/', function () {
+ return redirect('webapp');
+});
+
+// save sensor data of multiple sensors
+Route::post('sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:10,1,sensors');
+Route::post('lora_sensors', 'Api\MeasurementController@lora_sensors')->middleware('throttle:10,1,lora_sensors');
+Route::get('sensors/measurement_types', 'Api\MeasurementController@sensor_measurement_types')->middleware('throttle:3,1,measurement_types');
+
+// save sensor data of multiple sensors (unsecure)
+// Route::post('unsecure_sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:1,1');
+
+// User functions
+Route::post('register', 'Api\UserController@register')->middleware('throttle:6,1,register');
+Route::post('login', 'Api\UserController@login')->middleware('throttle:20,1,login');
+Route::post('user/reminder', 'Api\UserController@reminder')->middleware('throttle:3,1,user_reminder');
+Route::post('user/reset', 'Api\UserController@reset')->middleware('throttle:3,1,user_reset');
+
+// // Email Verification Routes...
+Route::get('email/verify/{id}', 'Api\Auth\VerificationController@verify')->name('apiverification.verify')->middleware('throttle:6,1,verify');
+Route::post('email/resend', 'Api\Auth\VerificationController@resend')->name('apiverification.resend')->middleware('throttle:3,1,resend');
+
+Route::post('groups/checktoken', 'Api\GroupController@checktoken')->middleware('throttle:6,1,checktoken');
+// Public Dashboard
+Route::get('dashboard/{code}', 'Api\DashboardGroupController@public')->middleware('throttle:60,1,publicdashboard');
+
+// high traffic routes
+Route::middleware('auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min_sensors,1,sensor_traffic')->group(function () {
+ Route::post('sensors_auth', 'Api\MeasurementController@storeMeasurementData');
+ Route::post('lora_sensors_auth', 'Api\MeasurementController@lora_sensors');
+});
+
+// normal traffic routes
+Route::middleware('auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min,1,normal_traffic')->group(function () {
+ // Route::post('devices/tts/{step}/{dev_id}/{dev_eui}/{app_key}', 'Api\DeviceController@debugTtsDevice');
+
+ // Authenticate and provide the token
+ Route::post('authenticate', 'Api\UserController@authenticate');
+
+ // get more data of 1 sensor (Device)
+ Route::post('devices/multiple', 'Api\DeviceController@storeMultiple');
+ Route::get('devices/ttn/{dev_id}', 'Api\DeviceController@getTTNDevice');
+ Route::post('devices/ttn/{dev_id}', 'Api\DeviceController@postTTNDevice');
+
+ Route::get('sensors/measurements', 'Api\MeasurementController@data');
+ Route::get('sensors/comparemeasurements', 'Api\MeasurementController@comparedata');
+ Route::get('sensors/cleanedweight', 'Api\MeasurementController@cleanedweight');
+ Route::get('sensors/lastvalues', 'Api\MeasurementController@lastvalues');
+ Route::get('sensors/lastweight', 'Api\MeasurementController@lastweight');
+ Route::post('sensors/calibrateweight', 'Api\MeasurementController@calibrateweight');
+ Route::post('sensors/offsetweight', 'Api\MeasurementController@offsetweight');
+ Route::get('sensors/measurement_types_available', 'Api\MeasurementController@sensor_measurement_types_available');
+ Route::post('sensors/flashlog', 'Api\MeasurementController@flashlog');
+ Route::get('sensors/decode/p/{port}/pl/{payload}', 'Api\MeasurementController@decode_beep_lora_payload');
+
+ Route::post('settings', 'Api\SettingController@store');
+ Route::get('settings', 'Api\SettingController@index');
+
+ Route::get('taxonomy/lists', 'Api\TaxonomyController@lists');
+ Route::get('taxonomy/taxonomy', 'Api\TaxonomyController@taxonomy');
+
+ Route::get('inspections', 'Api\InspectionsController@index');
+ Route::get('inspections/lists', 'Api\InspectionsController@lists');
+ Route::get('inspections/{id}', 'Api\InspectionsController@show');
+ Route::get('inspections/hive/{hive_id}', 'Api\InspectionsController@hive');
+ Route::post('inspections/store', 'Api\InspectionsController@store');
+ Route::delete('inspections/{id}', 'Api\InspectionsController@destroy');
+
+ Route::get('research', 'Api\ResearchController@index');
+ Route::post('research/{id}/add_consent', 'Api\ResearchController@add_consent');
+ Route::post('research/{id}/remove_consent', 'Api\ResearchController@remove_consent');
+ Route::patch('research/{id}/edit/{consent_id}', 'Api\ResearchController@edit_consent');
+ Route::delete('research/{id}/delete/{consent_id}', 'Api\ResearchController@delete_no_consent');
+
+ Route::get('researchdata', 'Api\ResearchDataController@index');
+ Route::get('researchdata/{id}', 'Api\ResearchDataController@show');
+ Route::get('researchdata/{id}/data/{item}', 'Api\ResearchDataController@research_data');
+ Route::get('researchdata/{id}/user/{user_id}/{item}', 'Api\ResearchDataController@user_data');
+
+ Route::delete('user', 'Api\UserController@destroy');
+ Route::patch('user', 'Api\UserController@edit');
+ Route::patch('userlocale', 'Api\UserController@userlocale');
+
+ // Device specific routes (must be before resource route)
+ Route::post('devices/clocksync', 'Api\DeviceController@clocksync');
+ Route::post('devices/lora_reset', 'Api\DeviceController@lora_reset');
+ Route::post('devices/interval', 'Api\DeviceController@interval');
+
+ // Control resources
+ Route::resource('devices', 'Api\DeviceController')->except('create', 'edit');
+ Route::resource('checklists', 'Api\ChecklistController')->except('create', 'edit');
+ Route::resource('categories', 'Api\CategoryController')->except('create', 'edit', 'store', 'update', 'destroy');
+ Route::resource('groups', 'Api\GroupController')->except('create', 'edit');
+ Route::resource('hives', 'Api\HiveController')->except('create', 'edit');
+ Route::resource('hive-tags', 'Api\HiveTagsController')->except('create', 'edit');
+ Route::resource('locations', 'Api\LocationController')->except('create', 'edit');
+ Route::resource('queens', 'Api\QueenController')->except('create', 'edit');
+ Route::resource('images', 'Api\ImageController')->except('create', 'edit', 'destroy');
+ Route::resource('sensordefinition', 'Api\SensorDefinitionController')->except('create', 'edit');
+ Route::resource('samplecode', 'Api\SampleCodeController')->except('create', 'edit', 'destroy');
+ Route::resource('alerts', 'Api\AlertController')->except('create', 'edit');
+ Route::resource('alert-rules', 'Api\AlertRuleController')->except('create', 'edit');
+ Route::resource('dashboardgroups', 'Api\DashboardGroupController')->except('create', 'edit');
+ Route::resource('checklist-svg', 'Api\ChecklistSvgController')->except('create', 'edit');
+
+ Route::get('alert-rules-default', 'Api\AlertRuleController@default_rules');
+
+ Route::delete('samplecode', 'Api\SampleCodeController@destroy');
+ Route::delete('images', 'Api\ImageController@destroyByUrl');
+ Route::delete('groups/detach/{id}', 'Api\GroupController@detach');
+
+ Route::get('categoryinputs', 'Api\CategoryController@inputs');
+ Route::post('export/csv', 'Api\ExportController@generate_csv');
+
+ Route::get('flashlogs', 'Api\FlashLogController@index');
+ Route::get('flashlogs/{id}', 'Api\FlashLogController@show');
+ Route::post('flashlogs/{id}', 'Api\FlashLogController@persist');
+ Route::delete('flashlogs/{id}', 'Api\FlashLogController@delete');
});
+
+// low traffic routes
+Route::middleware('auth:api', 'verifiedApi', 'throttle:3,1,low_traffic')->group(function () {
+ Route::get('export', 'Api\ExportController@all');
+ Route::get('weather', 'Api\WeatherController@index');
+});
+
diff --git a/routes/web.php b/routes/web.php
index 26d9b49b..c7095604 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -29,9 +29,9 @@
return redirect()->away('https://app.beep.nl');
});
-Route::get('code', ['as' => 'sample-code.code', 'uses' => 'SampleCodeController@code']);
-Route::post('codecheck', ['as' => 'sample-code.check', 'uses' => 'SampleCodeController@check'])->middleware('throttle:3,1');
-Route::patch('coderesult', ['as' => 'sample-code.resultsave', 'uses' => 'SampleCodeController@resultsave']);
+Route::get('code', 'SampleCodeController@code')->name('sample-code.code');
+Route::post('codecheck', 'SampleCodeController@check')->name('sample-code.check')->middleware('throttle:3,1');
+Route::patch('coderesult', 'SampleCodeController@resultsave')->name('sample-code.resultsave');
// Hack for redirecting e-mail reset password link to webapp
// Route::get('password/reset/{token}',['as'=>'password.reset', function ($token) {
@@ -39,65 +39,57 @@
// }]);
// Secured by login
-Route::group(
- [
- 'prefix' => LaravelLocalization::setLocale(),
- 'middleware' => ['auth', 'localeSessionRedirect', 'localizationRedirect', 'verified'],
- ],
+Route::prefix(LaravelLocalization::setLocale())->middleware('auth', 'localeSessionRedirect', 'localizationRedirect', 'verified')->group(
function () {
- Route::group(
- ['middleware' => ['role:superadmin|admin|lab']],
+ Route::middleware('role:superadmin|admin|lab')->group(
function () {
- Route::get('code-upload', ['as' => 'sample-code.upload', 'uses' => 'SampleCodeController@upload']);
- Route::post('code-upload-store', ['as' => 'sample-code.upload-store', 'uses' => 'SampleCodeController@upload_store']);
+ Route::get('code-upload', 'SampleCodeController@upload')->name('sample-code.upload');
+ Route::post('code-upload-store', 'SampleCodeController@upload_store')->name('sample-code.upload-store');
});
- Route::group(
- ['middleware' => ['role:superadmin|admin|translator']],
+ Route::middleware('role:superadmin|admin|translator')->group(
function () {
// Routes
- Route::get('languages', ['as' => 'languages.index', 'uses' => 'LanguageController@index', 'middleware' => ['permission:language-list|language-create|language-edit|language-delete']]);
- Route::get('languages/create', ['as' => 'languages.create', 'uses' => 'LanguageController@create', 'middleware' => ['permission:language-create']]);
- Route::post('languages/create', ['as' => 'languages.store', 'uses' => 'LanguageController@store', 'middleware' => ['permission:language-create']]);
- Route::get('languages/{id}', ['as' => 'languages.show', 'uses' => 'LanguageController@show']);
- Route::get('languages/{id}/edit', ['as' => 'languages.edit', 'uses' => 'LanguageController@edit', 'middleware' => ['permission:language-edit']]);
- Route::patch('languages/{id}', ['as' => 'languages.update', 'uses' => 'LanguageController@update', 'middleware' => ['permission:language-edit']]);
- Route::delete('languages/{id}', ['as' => 'languages.destroy', 'uses' => 'LanguageController@destroy', 'middleware' => ['permission:language-delete']]);
-
- Route::get('translations', ['as' => 'translations.index', 'uses' => 'TranslationController@index', 'middleware' => ['permission:translation-list']]);
- Route::get('translations/{language}', ['as' => 'translations.edit', 'uses' => 'TranslationController@edit', 'middleware' => ['permission:translation-create']]);
- Route::patch('translations/{language}', ['as' => 'translations.update', 'uses' => 'TranslationController@update', 'middleware' => ['permission:translation-edit']]);
+ Route::get('languages', 'LanguageController@index')->name('languages.index')->middleware('permission:language-list|language-create|language-edit|language-delete');
+ Route::get('languages/create', 'LanguageController@create')->name('languages.create')->middleware('permission:language-create');
+ Route::post('languages/create', 'LanguageController@store')->name('languages.store')->middleware('permission:language-create');
+ Route::get('languages/{id}', 'LanguageController@show')->name('languages.show');
+ Route::get('languages/{id}/edit', 'LanguageController@edit')->name('languages.edit')->middleware('permission:language-edit');
+ Route::patch('languages/{id}', 'LanguageController@update')->name('languages.update')->middleware('permission:language-edit');
+ Route::delete('languages/{id}', 'LanguageController@destroy')->name('languages.destroy')->middleware('permission:language-delete');
+
+ Route::get('translations', 'TranslationController@index')->name('translations.index')->middleware('permission:translation-list');
+ Route::get('translations/{language}', 'TranslationController@edit')->name('translations.edit')->middleware('permission:translation-create');
+ Route::patch('translations/{language}', 'TranslationController@update')->name('translations.update')->middleware('permission:translation-edit');
});
- Route::group(
- ['middleware' => ['role:superadmin|admin|manager']],
+ Route::middleware('role:superadmin|admin|manager')->group(
function () {
- Route::get('devices', ['as' => 'devices.index', 'uses' => 'DeviceController@index', 'middleware' => ['permission:sensor-list|sensor-create|sensor-edit|sensor-delete']]);
- Route::get('devices/create', ['as' => 'devices.create', 'uses' => 'DeviceController@create', 'middleware' => ['permission:sensor-create']]);
- Route::get('devices/data', ['as' => 'devices.data', 'uses' => 'DeviceController@data']);
- Route::post('devices/create', ['as' => 'devices.store', 'uses' => 'DeviceController@store', 'middleware' => ['permission:sensor-create']]);
- Route::get('devices/{id}', ['as' => 'devices.show', 'uses' => 'DeviceController@show']);
- Route::get('devices/{id}/sync', ['as' => 'devices.sync', 'uses' => 'DeviceController@sync']);
- Route::get('devices/{id}/undelete', ['as' => 'devices.undelete', 'uses' => 'DeviceController@undelete']);
- Route::get('devices/{id}/edit', ['as' => 'devices.edit', 'uses' => 'DeviceController@edit', 'middleware' => ['permission:sensor-edit']]);
- Route::get('devices/{id}/flashlog/{fl_id}', ['as' => 'devices.flashlog', 'uses' => 'DeviceController@flashlog', 'middleware' => ['permission:sensor-edit']]);
- Route::patch('devices/{id}', ['as' => 'devices.update', 'uses' => 'DeviceController@update', 'middleware' => ['permission:sensor-edit']]);
- Route::delete('devices/{id}', ['as' => 'devices.destroy', 'uses' => 'DeviceController@destroy', 'middleware' => ['permission:sensor-delete']]);
+ Route::get('devices', 'DeviceController@index')->name('devices.index')->middleware('permission:sensor-list|sensor-create|sensor-edit|sensor-delete');
+ Route::get('devices/create', 'DeviceController@create')->name('devices.create')->middleware('permission:sensor-create');
+ Route::get('devices/data', 'DeviceController@data')->name('devices.data');
+ Route::post('devices/create', 'DeviceController@store')->name('devices.store')->middleware('permission:sensor-create');
+ Route::get('devices/{id}', 'DeviceController@show')->name('devices.show');
+ Route::get('devices/{id}/sync', 'DeviceController@sync')->name('devices.sync');
+ Route::get('devices/{id}/undelete', 'DeviceController@undelete')->name('devices.undelete');
+ Route::get('devices/{id}/edit', 'DeviceController@edit')->name('devices.edit')->middleware('permission:sensor-edit');
+ Route::get('devices/{id}/flashlog/{fl_id}', 'DeviceController@flashlog')->name('devices.flashlog')->middleware('permission:sensor-edit');
+ Route::patch('devices/{id}', 'DeviceController@update')->name('devices.update')->middleware('permission:sensor-edit');
+ Route::delete('devices/{id}', 'DeviceController@destroy')->name('devices.destroy')->middleware('permission:sensor-delete');
});
- Route::group(
- ['middleware' => ['role:superadmin|admin']],
+ Route::middleware('role:superadmin|admin')->group(
function () {
- Route::get('groups', ['as' => 'groups.index', 'uses' => 'GroupController@index', 'middleware' => ['permission:group-list|group-create|group-edit|group-delete']]);
- Route::get('groups/create', ['as' => 'groups.create', 'uses' => 'GroupController@create', 'middleware' => ['permission:group-create']]);
- Route::post('groups/create', ['as' => 'groups.store', 'uses' => 'GroupController@store', 'middleware' => ['permission:group-create']]);
- Route::get('groups/{id}', ['as' => 'groups.show', 'uses' => 'GroupController@show']);
- Route::get('groups/{id}/edit', ['as' => 'groups.edit', 'uses' => 'GroupController@edit', 'middleware' => ['permission:group-edit']]);
- Route::patch('groups/{id}', ['as' => 'groups.update', 'uses' => 'GroupController@update', 'middleware' => ['permission:group-edit']]);
- Route::delete('groups/{id}', ['as' => 'groups.destroy', 'uses' => 'GroupController@destroy', 'middleware' => ['permission:group-delete']]);
+ Route::get('groups', 'GroupController@index')->name('groups.index')->middleware('permission:group-list|group-create|group-edit|group-delete');
+ Route::get('groups/create', 'GroupController@create')->name('groups.create')->middleware('permission:group-create');
+ Route::post('groups/create', 'GroupController@store')->name('groups.store')->middleware('permission:group-create');
+ Route::get('groups/{id}', 'GroupController@show')->name('groups.show');
+ Route::get('groups/{id}/edit', 'GroupController@edit')->name('groups.edit')->middleware('permission:group-edit');
+ Route::patch('groups/{id}', 'GroupController@update')->name('groups.update')->middleware('permission:group-edit');
+ Route::delete('groups/{id}', 'GroupController@destroy')->name('groups.destroy')->middleware('permission:group-delete');
Route::resource('physicalquantity', 'PhysicalQuantityController');
Route::resource('categoryinputs', 'CategoryInputsController');
@@ -105,37 +97,36 @@ function () {
Route::resource('measurement', 'MeasurementController');
Route::resource('sensordefinition', 'SensorDefinitionController');
Route::resource('flash-log', 'FlashLogController');
- Route::get('flash-log/parse/{id}', ['as' => 'flash-log.parse', 'uses' => 'FlashLogController@parse']);
+ Route::get('flash-log/parse/{id}', 'FlashLogController@parse')->name('flash-log.parse');
// Create new research
- Route::get('research/create', ['as' => 'research.create', 'uses' => 'ResearchController@create']);
- Route::post('research/create', ['as' => 'research.store', 'uses' => 'ResearchController@store']);
+ Route::get('research/create', 'ResearchController@create')->name('research.create');
+ Route::post('research/create', 'ResearchController@store')->name('research.store');
Route::resource('categories', 'CategoriesController');
- Route::delete('categories/{id}/pop', ['as' => 'categories.pop', 'uses' => 'CategoriesController@pop', 'middleware' => ['permission:taxonomy-delete']]);
- Route::get('categories/{id}/fix', ['as' => 'categories.fix', 'uses' => 'CategoriesController@fix']);
- Route::get('categories/{id}/duplicate', ['as' => 'categories.duplicate', 'uses' => 'CategoriesController@duplicate']);
- Route::get('taxonomy/display', ['as' => 'taxonomy.display', 'uses' => 'TaxonomyController@display']);
+ Route::delete('categories/{id}/pop', 'CategoriesController@pop')->name('categories.pop')->middleware('permission:taxonomy-delete');
+ Route::get('categories/{id}/fix', 'CategoriesController@fix')->name('categories.fix');
+ Route::get('categories/{id}/duplicate', 'CategoriesController@duplicate')->name('categories.duplicate');
+ Route::get('taxonomy/display', 'TaxonomyController@display')->name('taxonomy.display');
Route::resource('dashboard-group', 'DashboardGroupController');
});
- Route::group(
- ['middleware' => ['role:superadmin']],
+ Route::middleware('role:superadmin')->group(
function () {
Route::get('info', function () {
return view('phpinfo');
});
// Roles
- Route::get('roles', ['as' => 'roles.index', 'uses' => 'RoleController@index', 'middleware' => ['permission:role-list|role-create|role-edit|role-delete']]);
- Route::get('roles/create', ['as' => 'roles.create', 'uses' => 'RoleController@create', 'middleware' => ['permission:role-create']]);
- Route::post('roles/create', ['as' => 'roles.store', 'uses' => 'RoleController@store', 'middleware' => ['permission:role-create']]);
- Route::get('roles/{id}', ['as' => 'roles.show', 'uses' => 'RoleController@show']);
- Route::get('roles/{id}/edit', ['as' => 'roles.edit', 'uses' => 'RoleController@edit', 'middleware' => ['permission:role-edit']]);
- Route::patch('roles/{id}', ['as' => 'roles.update', 'uses' => 'RoleController@update', 'middleware' => ['permission:role-edit']]);
- Route::delete('roles/{id}', ['as' => 'roles.destroy', 'uses' => 'RoleController@destroy', 'middleware' => ['permission:role-delete']]);
- Route::get('alert-rule/{id}/parse', ['as' => 'alert-rule.parse', 'uses' => 'AlertRuleController@parse']);
+ Route::get('roles', 'RoleController@index')->name('roles.index')->middleware('permission:role-list|role-create|role-edit|role-delete');
+ Route::get('roles/create', 'RoleController@create')->name('roles.create')->middleware('permission:role-create');
+ Route::post('roles/create', 'RoleController@store')->name('roles.store')->middleware('permission:role-create');
+ Route::get('roles/{id}', 'RoleController@show')->name('roles.show');
+ Route::get('roles/{id}/edit', 'RoleController@edit')->name('roles.edit')->middleware('permission:role-edit');
+ Route::patch('roles/{id}', 'RoleController@update')->name('roles.update')->middleware('permission:role-edit');
+ Route::delete('roles/{id}', 'RoleController@destroy')->name('roles.destroy')->middleware('permission:role-delete');
+ Route::get('alert-rule/{id}/parse', 'AlertRuleController@parse')->name('alert-rule.parse');
// Resource controllers
Route::resource('permissions', 'PermissionController');
@@ -146,14 +137,14 @@ function () {
Route::resource('alert-rule-formula', 'AlertRuleFormulaController');
Route::resource('calculation-model', 'CalculationModelController');
- Route::get('calculation-model/{id}/run', ['as' => 'calculation-model.run', 'uses' => 'CalculationModelController@run']);
+ Route::get('calculation-model/{id}/run', 'CalculationModelController@run')->name('calculation-model.run');
- Route::delete('checklists/destroy/copies', ['as' => 'checklists.copies', 'uses' => 'ChecklistController@destroyCopies']);
+ Route::delete('checklists/destroy/copies', 'ChecklistController@destroyCopies')->name('checklists.copies');
});
// Open research routes based on database access
- Route::get('dashboard', ['as' => 'dashboard.index', 'uses' => 'DashboardController@index']);
+ Route::get('dashboard', 'DashboardController@index')->name('dashboard.index');
Route::resource('checklists', 'ChecklistController');
Route::resource('inspections', 'InspectionsController');
@@ -161,16 +152,16 @@ function () {
Route::resource('hive-tags', 'HiveTagsController');
Route::resource('checklist-svg', 'ChecklistSvgController');
- Route::get('research', ['as' => 'research.index', 'uses' => 'ResearchController@index']);
- Route::get('research/{id}', ['as' => 'research.show', 'uses' => 'ResearchController@show']);
- Route::get('research/{id}/data', ['as' => 'research.data', 'uses' => 'ResearchController@data']);
- Route::get('research/{id}/consent', ['as' => 'research.consent', 'uses' => 'ResearchController@consent']);
- Route::get('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
- Route::patch('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
- Route::delete('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
- Route::get('research/{id}/consent/{c_id}', ['as' => 'research.consent_edit', 'uses' => 'ResearchController@consent_edit']);
- Route::get('research/{id}/edit', ['as' => 'research.edit', 'uses' => 'ResearchController@edit']);
- Route::patch('research/{id}', ['as' => 'research.update', 'uses' => 'ResearchController@update']);
- Route::delete('research/{id}', ['as' => 'research.destroy', 'uses' => 'ResearchController@destroy']);
+ Route::get('research', 'ResearchController@index')->name('research.index');
+ Route::get('research/{id}', 'ResearchController@show')->name('research.show');
+ Route::get('research/{id}/data', 'ResearchController@data')->name('research.data');
+ Route::get('research/{id}/consent', 'ResearchController@consent')->name('research.consent');
+ Route::get('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
+ Route::patch('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
+ Route::delete('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
+ Route::get('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
+ Route::get('research/{id}/edit', 'ResearchController@edit')->name('research.edit');
+ Route::patch('research/{id}', 'ResearchController@update')->name('research.update');
+ Route::delete('research/{id}', 'ResearchController@destroy')->name('research.destroy');
}
);
From aa42de42e8e41cb9645bddd5b9f6b81d83b085d5 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:36 +0000
Subject: [PATCH 036/127] Adopt class based routes
---
app/Providers/RouteServiceProvider.php | 11 --
routes/api.php | 183 +++++++++++-----------
routes/web.php | 202 ++++++++++++++-----------
3 files changed, 209 insertions(+), 187 deletions(-)
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 927be5d7..1e395f74 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -19,15 +19,6 @@ class RouteServiceProvider extends ServiceProvider
*/
public const HOME = '/home';
- /**
- * The controller namespace for the application.
- *
- * When present, controller route declarations will automatically be prefixed with this namespace.
- *
- * @var string|null
- */
- protected $namespace = 'App\\Http\\Controllers';
-
/**
* Define your route model bindings, pattern filters, etc.
*
@@ -40,11 +31,9 @@ public function boot()
$this->routes(function () {
Route::prefix('api')
->middleware('api')
- ->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::middleware('web')
- ->namespace($this->namespace)
->group(base_path('routes/web.php'));
});
}
diff --git a/routes/api.php b/routes/api.php
index e98f7e14..4fed936c 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -1,5 +1,8 @@
middleware('throttle:10,1,sensors');
-Route::post('lora_sensors', 'Api\MeasurementController@lora_sensors')->middleware('throttle:10,1,lora_sensors');
-Route::get('sensors/measurement_types', 'Api\MeasurementController@sensor_measurement_types')->middleware('throttle:3,1,measurement_types');
+Route::post('sensors', [Api\MeasurementController::class, 'storeMeasurementData'])->middleware('throttle:10,1,sensors');
+Route::post('lora_sensors', [Api\MeasurementController::class, 'lora_sensors'])->middleware('throttle:10,1,lora_sensors');
+Route::get('sensors/measurement_types', [Api\MeasurementController::class, 'sensor_measurement_types'])->middleware('throttle:3,1,measurement_types');
// save sensor data of multiple sensors (unsecure)
// Route::post('unsecure_sensors', 'Api\MeasurementController@storeMeasurementData')->middleware('throttle:1,1');
// User functions
-Route::post('register', 'Api\UserController@register')->middleware('throttle:6,1,register');
-Route::post('login', 'Api\UserController@login')->middleware('throttle:20,1,login');
-Route::post('user/reminder', 'Api\UserController@reminder')->middleware('throttle:3,1,user_reminder');
-Route::post('user/reset', 'Api\UserController@reset')->middleware('throttle:3,1,user_reset');
+Route::post('register', [Api\UserController::class, 'register'])->middleware('throttle:6,1,register');
+Route::post('login', [Api\UserController::class, 'login'])->middleware('throttle:20,1,login');
+Route::post('user/reminder', [Api\UserController::class, 'reminder'])->middleware('throttle:3,1,user_reminder');
+Route::post('user/reset', [Api\UserController::class, 'reset'])->middleware('throttle:3,1,user_reset');
// // Email Verification Routes...
-Route::get('email/verify/{id}', 'Api\Auth\VerificationController@verify')->name('apiverification.verify')->middleware('throttle:6,1,verify');
-Route::post('email/resend', 'Api\Auth\VerificationController@resend')->name('apiverification.resend')->middleware('throttle:3,1,resend');
+Route::get('email/verify/{id}', [Api\Auth\VerificationController::class, 'verify'])->name('apiverification.verify')->middleware('throttle:6,1,verify');
+Route::post('email/resend', [Api\Auth\VerificationController::class, 'resend'])->name('apiverification.resend')->middleware('throttle:3,1,resend');
-Route::post('groups/checktoken', 'Api\GroupController@checktoken')->middleware('throttle:6,1,checktoken');
+Route::post('groups/checktoken', [Api\GroupController::class, 'checktoken'])->middleware('throttle:6,1,checktoken');
// Public Dashboard
-Route::get('dashboard/{code}', 'Api\DashboardGroupController@public')->middleware('throttle:60,1,publicdashboard');
+Route::get('dashboard/{code}', [Api\DashboardGroupController::class, 'public'])->middleware('throttle:60,1,publicdashboard');
// high traffic routes
Route::middleware('auth:api', 'verifiedApi', 'throttle:global_rate_limit_per_min_sensors,1,sensor_traffic')->group(function () {
- Route::post('sensors_auth', 'Api\MeasurementController@storeMeasurementData');
- Route::post('lora_sensors_auth', 'Api\MeasurementController@lora_sensors');
+ Route::post('sensors_auth', [Api\MeasurementController::class, 'storeMeasurementData']);
+ Route::post('lora_sensors_auth', [Api\MeasurementController::class, 'lora_sensors']);
});
// normal traffic routes
@@ -49,92 +52,92 @@
// Route::post('devices/tts/{step}/{dev_id}/{dev_eui}/{app_key}', 'Api\DeviceController@debugTtsDevice');
// Authenticate and provide the token
- Route::post('authenticate', 'Api\UserController@authenticate');
+ Route::post('authenticate', [Api\UserController::class, 'authenticate']);
// get more data of 1 sensor (Device)
- Route::post('devices/multiple', 'Api\DeviceController@storeMultiple');
- Route::get('devices/ttn/{dev_id}', 'Api\DeviceController@getTTNDevice');
- Route::post('devices/ttn/{dev_id}', 'Api\DeviceController@postTTNDevice');
-
- Route::get('sensors/measurements', 'Api\MeasurementController@data');
- Route::get('sensors/comparemeasurements', 'Api\MeasurementController@comparedata');
- Route::get('sensors/cleanedweight', 'Api\MeasurementController@cleanedweight');
- Route::get('sensors/lastvalues', 'Api\MeasurementController@lastvalues');
- Route::get('sensors/lastweight', 'Api\MeasurementController@lastweight');
- Route::post('sensors/calibrateweight', 'Api\MeasurementController@calibrateweight');
- Route::post('sensors/offsetweight', 'Api\MeasurementController@offsetweight');
- Route::get('sensors/measurement_types_available', 'Api\MeasurementController@sensor_measurement_types_available');
- Route::post('sensors/flashlog', 'Api\MeasurementController@flashlog');
- Route::get('sensors/decode/p/{port}/pl/{payload}', 'Api\MeasurementController@decode_beep_lora_payload');
-
- Route::post('settings', 'Api\SettingController@store');
- Route::get('settings', 'Api\SettingController@index');
-
- Route::get('taxonomy/lists', 'Api\TaxonomyController@lists');
- Route::get('taxonomy/taxonomy', 'Api\TaxonomyController@taxonomy');
-
- Route::get('inspections', 'Api\InspectionsController@index');
- Route::get('inspections/lists', 'Api\InspectionsController@lists');
- Route::get('inspections/{id}', 'Api\InspectionsController@show');
- Route::get('inspections/hive/{hive_id}', 'Api\InspectionsController@hive');
- Route::post('inspections/store', 'Api\InspectionsController@store');
- Route::delete('inspections/{id}', 'Api\InspectionsController@destroy');
-
- Route::get('research', 'Api\ResearchController@index');
- Route::post('research/{id}/add_consent', 'Api\ResearchController@add_consent');
- Route::post('research/{id}/remove_consent', 'Api\ResearchController@remove_consent');
- Route::patch('research/{id}/edit/{consent_id}', 'Api\ResearchController@edit_consent');
- Route::delete('research/{id}/delete/{consent_id}', 'Api\ResearchController@delete_no_consent');
-
- Route::get('researchdata', 'Api\ResearchDataController@index');
- Route::get('researchdata/{id}', 'Api\ResearchDataController@show');
- Route::get('researchdata/{id}/data/{item}', 'Api\ResearchDataController@research_data');
- Route::get('researchdata/{id}/user/{user_id}/{item}', 'Api\ResearchDataController@user_data');
-
- Route::delete('user', 'Api\UserController@destroy');
- Route::patch('user', 'Api\UserController@edit');
- Route::patch('userlocale', 'Api\UserController@userlocale');
+ Route::post('devices/multiple', [Api\DeviceController::class, 'storeMultiple']);
+ Route::get('devices/ttn/{dev_id}', [Api\DeviceController::class, 'getTTNDevice']);
+ Route::post('devices/ttn/{dev_id}', [Api\DeviceController::class, 'postTTNDevice']);
+
+ Route::get('sensors/measurements', [Api\MeasurementController::class, 'data']);
+ Route::get('sensors/comparemeasurements', [Api\MeasurementController::class, 'comparedata']);
+ Route::get('sensors/cleanedweight', [Api\MeasurementController::class, 'cleanedweight']);
+ Route::get('sensors/lastvalues', [Api\MeasurementController::class, 'lastvalues']);
+ Route::get('sensors/lastweight', [Api\MeasurementController::class, 'lastweight']);
+ Route::post('sensors/calibrateweight', [Api\MeasurementController::class, 'calibrateweight']);
+ Route::post('sensors/offsetweight', [Api\MeasurementController::class, 'offsetweight']);
+ Route::get('sensors/measurement_types_available', [Api\MeasurementController::class, 'sensor_measurement_types_available']);
+ Route::post('sensors/flashlog', [Api\MeasurementController::class, 'flashlog']);
+ Route::get('sensors/decode/p/{port}/pl/{payload}', [Api\MeasurementController::class, 'decode_beep_lora_payload']);
+
+ Route::post('settings', [Api\SettingController::class, 'store']);
+ Route::get('settings', [Api\SettingController::class, 'index']);
+
+ Route::get('taxonomy/lists', [Api\TaxonomyController::class, 'lists']);
+ Route::get('taxonomy/taxonomy', [Api\TaxonomyController::class, 'taxonomy']);
+
+ Route::get('inspections', [Api\InspectionsController::class, 'index']);
+ Route::get('inspections/lists', [Api\InspectionsController::class, 'lists']);
+ Route::get('inspections/{id}', [Api\InspectionsController::class, 'show']);
+ Route::get('inspections/hive/{hive_id}', [Api\InspectionsController::class, 'hive']);
+ Route::post('inspections/store', [Api\InspectionsController::class, 'store']);
+ Route::delete('inspections/{id}', [Api\InspectionsController::class, 'destroy']);
+
+ Route::get('research', [Api\ResearchController::class, 'index']);
+ Route::post('research/{id}/add_consent', [Api\ResearchController::class, 'add_consent']);
+ Route::post('research/{id}/remove_consent', [Api\ResearchController::class, 'remove_consent']);
+ Route::patch('research/{id}/edit/{consent_id}', [Api\ResearchController::class, 'edit_consent']);
+ Route::delete('research/{id}/delete/{consent_id}', [Api\ResearchController::class, 'delete_no_consent']);
+
+ Route::get('researchdata', [Api\ResearchDataController::class, 'index']);
+ Route::get('researchdata/{id}', [Api\ResearchDataController::class, 'show']);
+ Route::get('researchdata/{id}/data/{item}', [Api\ResearchDataController::class, 'research_data']);
+ Route::get('researchdata/{id}/user/{user_id}/{item}', [Api\ResearchDataController::class, 'user_data']);
+
+ Route::delete('user', [Api\UserController::class, 'destroy']);
+ Route::patch('user', [Api\UserController::class, 'edit']);
+ Route::patch('userlocale', [Api\UserController::class, 'userlocale']);
// Device specific routes (must be before resource route)
- Route::post('devices/clocksync', 'Api\DeviceController@clocksync');
- Route::post('devices/lora_reset', 'Api\DeviceController@lora_reset');
- Route::post('devices/interval', 'Api\DeviceController@interval');
+ Route::post('devices/clocksync', [Api\DeviceController::class, 'clocksync']);
+ Route::post('devices/lora_reset', [Api\DeviceController::class, 'lora_reset']);
+ Route::post('devices/interval', [Api\DeviceController::class, 'interval']);
// Control resources
- Route::resource('devices', 'Api\DeviceController')->except('create', 'edit');
- Route::resource('checklists', 'Api\ChecklistController')->except('create', 'edit');
- Route::resource('categories', 'Api\CategoryController')->except('create', 'edit', 'store', 'update', 'destroy');
- Route::resource('groups', 'Api\GroupController')->except('create', 'edit');
- Route::resource('hives', 'Api\HiveController')->except('create', 'edit');
- Route::resource('hive-tags', 'Api\HiveTagsController')->except('create', 'edit');
- Route::resource('locations', 'Api\LocationController')->except('create', 'edit');
- Route::resource('queens', 'Api\QueenController')->except('create', 'edit');
- Route::resource('images', 'Api\ImageController')->except('create', 'edit', 'destroy');
- Route::resource('sensordefinition', 'Api\SensorDefinitionController')->except('create', 'edit');
- Route::resource('samplecode', 'Api\SampleCodeController')->except('create', 'edit', 'destroy');
- Route::resource('alerts', 'Api\AlertController')->except('create', 'edit');
- Route::resource('alert-rules', 'Api\AlertRuleController')->except('create', 'edit');
- Route::resource('dashboardgroups', 'Api\DashboardGroupController')->except('create', 'edit');
- Route::resource('checklist-svg', 'Api\ChecklistSvgController')->except('create', 'edit');
-
- Route::get('alert-rules-default', 'Api\AlertRuleController@default_rules');
-
- Route::delete('samplecode', 'Api\SampleCodeController@destroy');
- Route::delete('images', 'Api\ImageController@destroyByUrl');
- Route::delete('groups/detach/{id}', 'Api\GroupController@detach');
-
- Route::get('categoryinputs', 'Api\CategoryController@inputs');
- Route::post('export/csv', 'Api\ExportController@generate_csv');
-
- Route::get('flashlogs', 'Api\FlashLogController@index');
- Route::get('flashlogs/{id}', 'Api\FlashLogController@show');
- Route::post('flashlogs/{id}', 'Api\FlashLogController@persist');
- Route::delete('flashlogs/{id}', 'Api\FlashLogController@delete');
+ Route::resource('devices', Api\DeviceController::class)->except('create', 'edit');
+ Route::resource('checklists', Api\ChecklistController::class)->except('create', 'edit');
+ Route::resource('categories', Api\CategoryController::class)->except('create', 'edit', 'store', 'update', 'destroy');
+ Route::resource('groups', Api\GroupController::class)->except('create', 'edit');
+ Route::resource('hives', Api\HiveController::class)->except('create', 'edit');
+ Route::resource('hive-tags', Api\HiveTagsController::class)->except('create', 'edit');
+ Route::resource('locations', Api\LocationController::class)->except('create', 'edit');
+ Route::resource('queens', Api\QueenController::class)->except('create', 'edit');
+ Route::resource('images', Api\ImageController::class)->except('create', 'edit', 'destroy');
+ Route::resource('sensordefinition', Api\SensorDefinitionController::class)->except('create', 'edit');
+ Route::resource('samplecode', Api\SampleCodeController::class)->except('create', 'edit', 'destroy');
+ Route::resource('alerts', Api\AlertController::class)->except('create', 'edit');
+ Route::resource('alert-rules', Api\AlertRuleController::class)->except('create', 'edit');
+ Route::resource('dashboardgroups', Api\DashboardGroupController::class)->except('create', 'edit');
+ Route::resource('checklist-svg', Api\ChecklistSvgController::class)->except('create', 'edit');
+
+ Route::get('alert-rules-default', [Api\AlertRuleController::class, 'default_rules']);
+
+ Route::delete('samplecode', [Api\SampleCodeController::class, 'destroy']);
+ Route::delete('images', [Api\ImageController::class, 'destroyByUrl']);
+ Route::delete('groups/detach/{id}', [Api\GroupController::class, 'detach']);
+
+ Route::get('categoryinputs', [Api\CategoryController::class, 'inputs']);
+ Route::post('export/csv', [Api\ExportController::class, 'generate_csv']);
+
+ Route::get('flashlogs', [Api\FlashLogController::class, 'index']);
+ Route::get('flashlogs/{id}', [Api\FlashLogController::class, 'show']);
+ Route::post('flashlogs/{id}', [Api\FlashLogController::class, 'persist']);
+ Route::delete('flashlogs/{id}', [Api\FlashLogController::class, 'delete']);
});
// low traffic routes
Route::middleware('auth:api', 'verifiedApi', 'throttle:3,1,low_traffic')->group(function () {
- Route::get('export', 'Api\ExportController@all');
- Route::get('weather', 'Api\WeatherController@index');
+ Route::get('export', [Api\ExportController::class, 'all']);
+ Route::get('weather', [Api\WeatherController::class, 'index']);
});
diff --git a/routes/web.php b/routes/web.php
index c7095604..333f0fd6 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,5 +1,35 @@
away('https://app.beep.nl');
});
-Route::get('code', 'SampleCodeController@code')->name('sample-code.code');
-Route::post('codecheck', 'SampleCodeController@check')->name('sample-code.check')->middleware('throttle:3,1');
-Route::patch('coderesult', 'SampleCodeController@resultsave')->name('sample-code.resultsave');
+Route::get('code', [SampleCodeController::class, 'code'])->name('sample-code.code');
+Route::post('codecheck', [SampleCodeController::class, 'check'])->name('sample-code.check')->middleware('throttle:3,1');
+Route::patch('coderesult', [SampleCodeController::class, 'resultsave'])->name('sample-code.resultsave');
// Hack for redirecting e-mail reset password link to webapp
// Route::get('password/reset/{token}',['as'=>'password.reset', function ($token) {
@@ -43,73 +73,73 @@
function () {
Route::middleware('role:superadmin|admin|lab')->group(
function () {
- Route::get('code-upload', 'SampleCodeController@upload')->name('sample-code.upload');
- Route::post('code-upload-store', 'SampleCodeController@upload_store')->name('sample-code.upload-store');
+ Route::get('code-upload', [SampleCodeController::class, 'upload'])->name('sample-code.upload');
+ Route::post('code-upload-store', [SampleCodeController::class, 'upload_store'])->name('sample-code.upload-store');
});
Route::middleware('role:superadmin|admin|translator')->group(
function () {
// Routes
- Route::get('languages', 'LanguageController@index')->name('languages.index')->middleware('permission:language-list|language-create|language-edit|language-delete');
- Route::get('languages/create', 'LanguageController@create')->name('languages.create')->middleware('permission:language-create');
- Route::post('languages/create', 'LanguageController@store')->name('languages.store')->middleware('permission:language-create');
- Route::get('languages/{id}', 'LanguageController@show')->name('languages.show');
- Route::get('languages/{id}/edit', 'LanguageController@edit')->name('languages.edit')->middleware('permission:language-edit');
- Route::patch('languages/{id}', 'LanguageController@update')->name('languages.update')->middleware('permission:language-edit');
- Route::delete('languages/{id}', 'LanguageController@destroy')->name('languages.destroy')->middleware('permission:language-delete');
-
- Route::get('translations', 'TranslationController@index')->name('translations.index')->middleware('permission:translation-list');
- Route::get('translations/{language}', 'TranslationController@edit')->name('translations.edit')->middleware('permission:translation-create');
- Route::patch('translations/{language}', 'TranslationController@update')->name('translations.update')->middleware('permission:translation-edit');
+ Route::get('languages', [LanguageController::class, 'index'])->name('languages.index')->middleware('permission:language-list|language-create|language-edit|language-delete');
+ Route::get('languages/create', [LanguageController::class, 'create'])->name('languages.create')->middleware('permission:language-create');
+ Route::post('languages/create', [LanguageController::class, 'store'])->name('languages.store')->middleware('permission:language-create');
+ Route::get('languages/{id}', [LanguageController::class, 'show'])->name('languages.show');
+ Route::get('languages/{id}/edit', [LanguageController::class, 'edit'])->name('languages.edit')->middleware('permission:language-edit');
+ Route::patch('languages/{id}', [LanguageController::class, 'update'])->name('languages.update')->middleware('permission:language-edit');
+ Route::delete('languages/{id}', [LanguageController::class, 'destroy'])->name('languages.destroy')->middleware('permission:language-delete');
+
+ Route::get('translations', [TranslationController::class, 'index'])->name('translations.index')->middleware('permission:translation-list');
+ Route::get('translations/{language}', [TranslationController::class, 'edit'])->name('translations.edit')->middleware('permission:translation-create');
+ Route::patch('translations/{language}', [TranslationController::class, 'update'])->name('translations.update')->middleware('permission:translation-edit');
});
Route::middleware('role:superadmin|admin|manager')->group(
function () {
- Route::get('devices', 'DeviceController@index')->name('devices.index')->middleware('permission:sensor-list|sensor-create|sensor-edit|sensor-delete');
- Route::get('devices/create', 'DeviceController@create')->name('devices.create')->middleware('permission:sensor-create');
- Route::get('devices/data', 'DeviceController@data')->name('devices.data');
- Route::post('devices/create', 'DeviceController@store')->name('devices.store')->middleware('permission:sensor-create');
- Route::get('devices/{id}', 'DeviceController@show')->name('devices.show');
- Route::get('devices/{id}/sync', 'DeviceController@sync')->name('devices.sync');
- Route::get('devices/{id}/undelete', 'DeviceController@undelete')->name('devices.undelete');
- Route::get('devices/{id}/edit', 'DeviceController@edit')->name('devices.edit')->middleware('permission:sensor-edit');
- Route::get('devices/{id}/flashlog/{fl_id}', 'DeviceController@flashlog')->name('devices.flashlog')->middleware('permission:sensor-edit');
- Route::patch('devices/{id}', 'DeviceController@update')->name('devices.update')->middleware('permission:sensor-edit');
- Route::delete('devices/{id}', 'DeviceController@destroy')->name('devices.destroy')->middleware('permission:sensor-delete');
+ Route::get('devices', [DeviceController::class, 'index'])->name('devices.index')->middleware('permission:sensor-list|sensor-create|sensor-edit|sensor-delete');
+ Route::get('devices/create', [DeviceController::class, 'create'])->name('devices.create')->middleware('permission:sensor-create');
+ Route::get('devices/data', [DeviceController::class, 'data'])->name('devices.data');
+ Route::post('devices/create', [DeviceController::class, 'store'])->name('devices.store')->middleware('permission:sensor-create');
+ Route::get('devices/{id}', [DeviceController::class, 'show'])->name('devices.show');
+ Route::get('devices/{id}/sync', [DeviceController::class, 'sync'])->name('devices.sync');
+ Route::get('devices/{id}/undelete', [DeviceController::class, 'undelete'])->name('devices.undelete');
+ Route::get('devices/{id}/edit', [DeviceController::class, 'edit'])->name('devices.edit')->middleware('permission:sensor-edit');
+ Route::get('devices/{id}/flashlog/{fl_id}', [DeviceController::class, 'flashlog'])->name('devices.flashlog')->middleware('permission:sensor-edit');
+ Route::patch('devices/{id}', [DeviceController::class, 'update'])->name('devices.update')->middleware('permission:sensor-edit');
+ Route::delete('devices/{id}', [DeviceController::class, 'destroy'])->name('devices.destroy')->middleware('permission:sensor-delete');
});
Route::middleware('role:superadmin|admin')->group(
function () {
- Route::get('groups', 'GroupController@index')->name('groups.index')->middleware('permission:group-list|group-create|group-edit|group-delete');
- Route::get('groups/create', 'GroupController@create')->name('groups.create')->middleware('permission:group-create');
- Route::post('groups/create', 'GroupController@store')->name('groups.store')->middleware('permission:group-create');
- Route::get('groups/{id}', 'GroupController@show')->name('groups.show');
- Route::get('groups/{id}/edit', 'GroupController@edit')->name('groups.edit')->middleware('permission:group-edit');
- Route::patch('groups/{id}', 'GroupController@update')->name('groups.update')->middleware('permission:group-edit');
- Route::delete('groups/{id}', 'GroupController@destroy')->name('groups.destroy')->middleware('permission:group-delete');
-
- Route::resource('physicalquantity', 'PhysicalQuantityController');
- Route::resource('categoryinputs', 'CategoryInputsController');
- Route::resource('inspection-items', 'InspectionItemsController');
- Route::resource('measurement', 'MeasurementController');
- Route::resource('sensordefinition', 'SensorDefinitionController');
- Route::resource('flash-log', 'FlashLogController');
- Route::get('flash-log/parse/{id}', 'FlashLogController@parse')->name('flash-log.parse');
+ Route::get('groups', [GroupController::class, 'index'])->name('groups.index')->middleware('permission:group-list|group-create|group-edit|group-delete');
+ Route::get('groups/create', [GroupController::class, 'create'])->name('groups.create')->middleware('permission:group-create');
+ Route::post('groups/create', [GroupController::class, 'store'])->name('groups.store')->middleware('permission:group-create');
+ Route::get('groups/{id}', [GroupController::class, 'show'])->name('groups.show');
+ Route::get('groups/{id}/edit', [GroupController::class, 'edit'])->name('groups.edit')->middleware('permission:group-edit');
+ Route::patch('groups/{id}', [GroupController::class, 'update'])->name('groups.update')->middleware('permission:group-edit');
+ Route::delete('groups/{id}', [GroupController::class, 'destroy'])->name('groups.destroy')->middleware('permission:group-delete');
+
+ Route::resource('physicalquantity', PhysicalQuantityController::class);
+ Route::resource('categoryinputs', CategoryInputsController::class);
+ Route::resource('inspection-items', InspectionItemsController::class);
+ Route::resource('measurement', MeasurementController::class);
+ Route::resource('sensordefinition', SensorDefinitionController::class);
+ Route::resource('flash-log', FlashLogController::class);
+ Route::get('flash-log/parse/{id}', [FlashLogController::class, 'parse'])->name('flash-log.parse');
// Create new research
- Route::get('research/create', 'ResearchController@create')->name('research.create');
- Route::post('research/create', 'ResearchController@store')->name('research.store');
+ Route::get('research/create', [ResearchController::class, 'create'])->name('research.create');
+ Route::post('research/create', [ResearchController::class, 'store'])->name('research.store');
- Route::resource('categories', 'CategoriesController');
- Route::delete('categories/{id}/pop', 'CategoriesController@pop')->name('categories.pop')->middleware('permission:taxonomy-delete');
- Route::get('categories/{id}/fix', 'CategoriesController@fix')->name('categories.fix');
- Route::get('categories/{id}/duplicate', 'CategoriesController@duplicate')->name('categories.duplicate');
- Route::get('taxonomy/display', 'TaxonomyController@display')->name('taxonomy.display');
+ Route::resource('categories', CategoriesController::class);
+ Route::delete('categories/{id}/pop', [CategoriesController::class, 'pop'])->name('categories.pop')->middleware('permission:taxonomy-delete');
+ Route::get('categories/{id}/fix', [CategoriesController::class, 'fix'])->name('categories.fix');
+ Route::get('categories/{id}/duplicate', [CategoriesController::class, 'duplicate'])->name('categories.duplicate');
+ Route::get('taxonomy/display', [TaxonomyController::class, 'display'])->name('taxonomy.display');
- Route::resource('dashboard-group', 'DashboardGroupController');
+ Route::resource('dashboard-group', DashboardGroupController::class);
});
Route::middleware('role:superadmin')->group(
@@ -119,49 +149,49 @@ function () {
});
// Roles
- Route::get('roles', 'RoleController@index')->name('roles.index')->middleware('permission:role-list|role-create|role-edit|role-delete');
- Route::get('roles/create', 'RoleController@create')->name('roles.create')->middleware('permission:role-create');
- Route::post('roles/create', 'RoleController@store')->name('roles.store')->middleware('permission:role-create');
- Route::get('roles/{id}', 'RoleController@show')->name('roles.show');
- Route::get('roles/{id}/edit', 'RoleController@edit')->name('roles.edit')->middleware('permission:role-edit');
- Route::patch('roles/{id}', 'RoleController@update')->name('roles.update')->middleware('permission:role-edit');
- Route::delete('roles/{id}', 'RoleController@destroy')->name('roles.destroy')->middleware('permission:role-delete');
- Route::get('alert-rule/{id}/parse', 'AlertRuleController@parse')->name('alert-rule.parse');
+ Route::get('roles', [RoleController::class, 'index'])->name('roles.index')->middleware('permission:role-list|role-create|role-edit|role-delete');
+ Route::get('roles/create', [RoleController::class, 'create'])->name('roles.create')->middleware('permission:role-create');
+ Route::post('roles/create', [RoleController::class, 'store'])->name('roles.store')->middleware('permission:role-create');
+ Route::get('roles/{id}', [RoleController::class, 'show'])->name('roles.show');
+ Route::get('roles/{id}/edit', [RoleController::class, 'edit'])->name('roles.edit')->middleware('permission:role-edit');
+ Route::patch('roles/{id}', [RoleController::class, 'update'])->name('roles.update')->middleware('permission:role-edit');
+ Route::delete('roles/{id}', [RoleController::class, 'destroy'])->name('roles.destroy')->middleware('permission:role-delete');
+ Route::get('alert-rule/{id}/parse', [AlertRuleController::class, 'parse'])->name('alert-rule.parse');
// Resource controllers
- Route::resource('permissions', 'PermissionController');
- Route::resource('image', 'ImageController');
- Route::resource('sample-code', 'SampleCodeController');
- Route::resource('alert', 'AlertController');
- Route::resource('alert-rule', 'AlertRuleController');
- Route::resource('alert-rule-formula', 'AlertRuleFormulaController');
- Route::resource('calculation-model', 'CalculationModelController');
+ Route::resource('permissions', PermissionController::class);
+ Route::resource('image', ImageController::class);
+ Route::resource('sample-code', SampleCodeController::class);
+ Route::resource('alert', AlertController::class);
+ Route::resource('alert-rule', AlertRuleController::class);
+ Route::resource('alert-rule-formula', AlertRuleFormulaController::class);
+ Route::resource('calculation-model', CalculationModelController::class);
- Route::get('calculation-model/{id}/run', 'CalculationModelController@run')->name('calculation-model.run');
+ Route::get('calculation-model/{id}/run', [CalculationModelController::class, 'run'])->name('calculation-model.run');
- Route::delete('checklists/destroy/copies', 'ChecklistController@destroyCopies')->name('checklists.copies');
+ Route::delete('checklists/destroy/copies', [ChecklistController::class, 'destroyCopies'])->name('checklists.copies');
});
// Open research routes based on database access
- Route::get('dashboard', 'DashboardController@index')->name('dashboard.index');
-
- Route::resource('checklists', 'ChecklistController');
- Route::resource('inspections', 'InspectionsController');
- Route::resource('users', 'UserController');
- Route::resource('hive-tags', 'HiveTagsController');
- Route::resource('checklist-svg', 'ChecklistSvgController');
-
- Route::get('research', 'ResearchController@index')->name('research.index');
- Route::get('research/{id}', 'ResearchController@show')->name('research.show');
- Route::get('research/{id}/data', 'ResearchController@data')->name('research.data');
- Route::get('research/{id}/consent', 'ResearchController@consent')->name('research.consent');
- Route::get('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
- Route::patch('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
- Route::delete('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
- Route::get('research/{id}/consent/{c_id}', 'ResearchController@consent_edit')->name('research.consent_edit');
- Route::get('research/{id}/edit', 'ResearchController@edit')->name('research.edit');
- Route::patch('research/{id}', 'ResearchController@update')->name('research.update');
- Route::delete('research/{id}', 'ResearchController@destroy')->name('research.destroy');
+ Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard.index');
+
+ Route::resource('checklists', ChecklistController::class);
+ Route::resource('inspections', InspectionsController::class);
+ Route::resource('users', UserController::class);
+ Route::resource('hive-tags', HiveTagsController::class);
+ Route::resource('checklist-svg', ChecklistSvgController::class);
+
+ Route::get('research', [ResearchController::class, 'index'])->name('research.index');
+ Route::get('research/{id}', [ResearchController::class, 'show'])->name('research.show');
+ Route::get('research/{id}/data', [ResearchController::class, 'data'])->name('research.data');
+ Route::get('research/{id}/consent', [ResearchController::class, 'consent'])->name('research.consent');
+ Route::get('research/{id}/consent/{c_id}', [ResearchController::class, 'consent_edit'])->name('research.consent_edit');
+ Route::patch('research/{id}/consent/{c_id}', [ResearchController::class, 'consent_edit'])->name('research.consent_edit');
+ Route::delete('research/{id}/consent/{c_id}', [ResearchController::class, 'consent_edit'])->name('research.consent_edit');
+ Route::get('research/{id}/consent/{c_id}', [ResearchController::class, 'consent_edit'])->name('research.consent_edit');
+ Route::get('research/{id}/edit', [ResearchController::class, 'edit'])->name('research.edit');
+ Route::patch('research/{id}', [ResearchController::class, 'update'])->name('research.update');
+ Route::delete('research/{id}', [ResearchController::class, 'destroy'])->name('research.destroy');
}
);
From 5c8b1bdc6b06a4ee403871d2feee2de7ad92cfa7 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:36 +0000
Subject: [PATCH 037/127] Shift console routes
---
routes/console.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/routes/console.php b/routes/console.php
index 75dd0cde..e05f4c9a 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -1,6 +1,7 @@
comment(Inspiring::quote());
-})->describe('Display an inspiring quote');
+})->purpose('Display an inspiring quote');
From 790267ae5813f00ff47b1afcf6208f9f7f482237 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:36 +0000
Subject: [PATCH 038/127] Ignore temporary framework files
---
storage/framework/.gitignore | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore
index b02b700f..05c4471f 100755
--- a/storage/framework/.gitignore
+++ b/storage/framework/.gitignore
@@ -1,8 +1,9 @@
+compiled.php
config.php
+down
+events.scanned.php
+maintenance.php
routes.php
+routes.scanned.php
schedule-*
-compiled.php
services.json
-events.scanned.php
-routes.scanned.php
-down
From 7a4e4a5995f79cec6b301e84778c933ceea992ea Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:37 +0000
Subject: [PATCH 039/127] Shift to class based factories
---
app/Hive.php | 3 +
app/HiveLayer.php | 3 +
app/HiveLayerFrame.php | 3 +
app/Location.php | 3 +
app/User.php | 3 +
database/factories/HiveFactory.php | 35 ++++++++
database/factories/HiveLayerFactory.php | 52 ++++++++++++
database/factories/HiveLayerFrameFactory.php | 34 ++++++++
database/factories/LocationFactory.php | 40 ++++++++++
database/factories/ModelFactory.php | 84 --------------------
database/factories/UserFactory.php | 38 +++++++++
11 files changed, 214 insertions(+), 84 deletions(-)
create mode 100644 database/factories/HiveFactory.php
create mode 100644 database/factories/HiveLayerFactory.php
create mode 100644 database/factories/HiveLayerFrameFactory.php
create mode 100644 database/factories/LocationFactory.php
delete mode 100644 database/factories/ModelFactory.php
create mode 100644 database/factories/UserFactory.php
diff --git a/app/Hive.php b/app/Hive.php
index 981b52ca..a45506fd 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Auth;
use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
@@ -11,6 +12,8 @@
class Hive extends Model
{
+ use HasFactory;
+
use CascadeSoftDeletes, SoftDeletes;
protected $cascadeDeletes = ['queen', 'inspections', 'layers', 'frames'];
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index fa91b60f..104dbcf7 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Cache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -9,6 +10,8 @@
class HiveLayer extends Model
{
+ use HasFactory;
+
use SoftDeletes;
protected $fillable = ['hive_id', 'category_id', 'order', 'color'];
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index 933c70b8..85699ef8 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -2,11 +2,14 @@
namespace App;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class HiveLayerFrame extends Model
{
+ use HasFactory;
+
use SoftDeletes;
protected $fillable = ['layer_id', 'category_id', 'present', 'order'];
diff --git a/app/Location.php b/app/Location.php
index 7000816b..63309ecc 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Auth;
use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
@@ -11,6 +12,8 @@
class Location extends Model
{
+ use HasFactory;
+
use CascadeSoftDeletes, SoftDeletes;
protected $cascadeDeletes = ['hives', 'inspections'];
diff --git a/app/User.php b/app/User.php
index abd80f8d..d466ea28 100644
--- a/app/User.php
+++ b/app/User.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Alert;
use App\Models\AlertRule;
use App\Models\ChecklistSvg;
@@ -20,6 +21,8 @@
class User extends Authenticatable
{
+ use HasFactory;
+
use LaratrustUserTrait;
use Notifiable;
diff --git a/database/factories/HiveFactory.php b/database/factories/HiveFactory.php
new file mode 100644
index 00000000..35ab15a1
--- /dev/null
+++ b/database/factories/HiveFactory.php
@@ -0,0 +1,35 @@
+ 1,
+ 'location_id' => 1,
+ 'hive_type_id' => 1,
+ 'color' => $this->faker->hexcolor,
+ 'name' => $this->faker->name,
+ ];
+ }
+}
diff --git a/database/factories/HiveLayerFactory.php b/database/factories/HiveLayerFactory.php
new file mode 100644
index 00000000..c1f269ad
--- /dev/null
+++ b/database/factories/HiveLayerFactory.php
@@ -0,0 +1,52 @@
+ 1,
+ 'category_id' => 26,
+ 'order' => $this->faker->numberBetween($min = 1, $max = 99),
+ 'color' => $this->faker->hexcolor,
+ ];
+ }
+
+ public function brood()
+ {
+ return $this->state(function () {
+ return [
+ 'category_id' => 26,
+ ];
+ });
+ }
+
+ public function honey()
+ {
+ return $this->state(function () {
+ return [
+ 'category_id' => 27,
+ ];
+ });
+ }
+}
diff --git a/database/factories/HiveLayerFrameFactory.php b/database/factories/HiveLayerFrameFactory.php
new file mode 100644
index 00000000..985f14c8
--- /dev/null
+++ b/database/factories/HiveLayerFrameFactory.php
@@ -0,0 +1,34 @@
+ 1,
+ 'category_id' => 29, // wax
+ 'order' => $this->faker->numberBetween($min = 1, $max = 99),
+ 'present' => true,
+ ];
+ }
+}
diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php
new file mode 100644
index 00000000..67fbe39b
--- /dev/null
+++ b/database/factories/LocationFactory.php
@@ -0,0 +1,40 @@
+ 1,
+ 'continent_id' => 4, // eu
+ 'category_id' => 36, // fixed
+ 'name' => $this->faker->name,
+ 'coordinate_lat' => $this->faker->latitude,
+ 'coordinate_lon' => $this->faker->longitude,
+ 'street' => $this->faker->streetName,
+ 'street_no' => $this->faker->numberBetween($min = 1, $max = 99),
+ 'postal_code' => $this->faker->postcode,
+ 'country_code' => $this->faker->country,
+ ];
+ }
+}
diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php
deleted file mode 100644
index d3000757..00000000
--- a/database/factories/ModelFactory.php
+++ /dev/null
@@ -1,84 +0,0 @@
-define(App\User::class, function (Faker\Generator $faker) {
- static $password;
-
- return [
- 'name' => $faker->name,
- 'email' => $faker->unique()->safeEmail,
- 'email_verified_at' => now(),
- 'password' => $password ?: $password = bcrypt('secret'),
- 'remember_token' => Str::random(10),
- 'api_token' => Str::random(60),
- ];
-});
-
-$factory->define(App\Location::class, function (Faker\Generator $faker) {
-
- return [
- 'user_id' => 1,
- 'continent_id' => 4, // eu
- 'category_id' => 36, // fixed
- 'name' => $faker->name,
- 'coordinate_lat' => $faker->latitude,
- 'coordinate_lon' => $faker->longitude,
- 'street' => $faker->streetName,
- 'street_no' => $faker->numberBetween($min = 1, $max = 99),
- 'postal_code' => $faker->postcode,
- 'country_code' => $faker->country,
- ];
-});
-
-$factory->define(App\Hive::class, function (Faker\Generator $faker) {
-
- return [
- 'user_id' => 1,
- 'location_id' => 1,
- 'hive_type_id' => 1,
- 'color' => $faker->hexcolor,
- 'name' => $faker->name,
- ];
-});
-
-$factory->define(App\HiveLayer::class, function (Faker\Generator $faker) {
-
- return [
- 'hive_id' => 1,
- 'category_id' => 26,
- 'order' => $faker->numberBetween($min = 1, $max = 99),
- 'color' => $faker->hexcolor,
- ];
-});
-
-$factory->state(App\HiveLayer::class, 'brood', function ($faker) {
- return [
- 'category_id' => 26,
- ];
-});
-
-$factory->state(App\HiveLayer::class, 'honey', function ($faker) {
- return [
- 'category_id' => 27,
- ];
-});
-
-$factory->define(App\HiveLayerFrame::class, function (Faker\Generator $faker) {
-
- return [
- 'layer_id' => 1,
- 'category_id' => 29, // wax
- 'order' => $faker->numberBetween($min = 1, $max = 99),
- 'present' => true,
- ];
-});
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
new file mode 100644
index 00000000..759a0f77
--- /dev/null
+++ b/database/factories/UserFactory.php
@@ -0,0 +1,38 @@
+ $this->faker->name,
+ 'email' => $this->faker->unique()->safeEmail,
+ 'email_verified_at' => now(),
+ 'password' => $password ?: $password = bcrypt('secret'),
+ 'remember_token' => Str::random(10),
+ 'api_token' => Str::random(60),
+ ];
+ }
+}
From 464108fafad4491efeaec008ec8d40c6f4f7fbdd Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:37 +0000
Subject: [PATCH 040/127] Namespace seeders
---
database/{seeds => seeders}/.gitkeep | 0
database/{seeds => seeders}/DatabaseSeeder.php | 2 ++
database/{seeds => seeders}/DeviceCorrectionSeeder.php | 2 ++
database/{seeds => seeders}/MeasurementSeeder.php | 2 ++
database/{seeds => seeders}/UserSeeder.php | 2 ++
5 files changed, 8 insertions(+)
rename database/{seeds => seeders}/.gitkeep (100%)
rename database/{seeds => seeders}/DatabaseSeeder.php (92%)
rename database/{seeds => seeders}/DeviceCorrectionSeeder.php (99%)
rename database/{seeds => seeders}/MeasurementSeeder.php (99%)
rename database/{seeds => seeders}/UserSeeder.php (94%)
diff --git a/database/seeds/.gitkeep b/database/seeders/.gitkeep
similarity index 100%
rename from database/seeds/.gitkeep
rename to database/seeders/.gitkeep
diff --git a/database/seeds/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php
similarity index 92%
rename from database/seeds/DatabaseSeeder.php
rename to database/seeders/DatabaseSeeder.php
index 7abd43b1..6fe425ef 100644
--- a/database/seeds/DatabaseSeeder.php
+++ b/database/seeders/DatabaseSeeder.php
@@ -1,5 +1,7 @@
Date: Thu, 28 May 2026 13:14:37 +0000
Subject: [PATCH 041/127] PSR-4 autoload database factories and seeders
---
composer.json | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/composer.json b/composer.json
index 7c580c78..83c4a169 100644
--- a/composer.json
+++ b/composer.json
@@ -67,12 +67,10 @@
},
"autoload": {
"psr-4": {
- "App\\": "app/"
- },
- "classmap": [
- "database/seeds",
- "database/factories"
- ]
+ "App\\": "app/",
+ "Database\\Factories\\": "database/factories/",
+ "Database\\Seeders\\": "database/seeders/"
+ }
},
"autoload-dev": {
"psr-4": {
From ec3b48662a5428e9c72f9be2bb410c30421c95ba Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:40 +0000
Subject: [PATCH 042/127] Shift config files
---
config/app.php | 3 +++
config/cors.php | 2 +-
config/queue.php | 8 ++++++--
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/config/app.php b/config/app.php
index 2d13d995..751e844b 100644
--- a/config/app.php
+++ b/config/app.php
@@ -207,6 +207,7 @@
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
+ 'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
@@ -214,12 +215,14 @@
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
+ 'Js' => Illuminate\Support\Js::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
+ 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
diff --git a/config/cors.php b/config/cors.php
index 558369dc..8a39e6da 100644
--- a/config/cors.php
+++ b/config/cors.php
@@ -15,7 +15,7 @@
|
*/
- 'paths' => ['api/*'],
+ 'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
diff --git a/config/queue.php b/config/queue.php
index 00b76d65..25ea5a81 100644
--- a/config/queue.php
+++ b/config/queue.php
@@ -39,6 +39,7 @@
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
+ 'after_commit' => false,
],
'beanstalkd' => [
@@ -47,6 +48,7 @@
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
+ 'after_commit' => false,
],
'sqs' => [
@@ -54,9 +56,10 @@
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
- 'queue' => env('SQS_QUEUE', 'your-queue-name'),
+ 'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ 'after_commit' => false,
],
'redis' => [
@@ -65,6 +68,7 @@
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
+ 'after_commit' => false,
],
],
@@ -81,7 +85,7 @@
*/
'failed' => [
- 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
+ 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
From ebcb5c1867cc27694dd07b3dfe3f478321af270f Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:42 +0000
Subject: [PATCH 043/127] Default config files
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
---
config/auth.php | 10 ++--------
config/broadcasting.php | 12 +++++++++---
config/cache.php | 12 +++++++++---
config/filesystems.php | 14 +-------------
config/logging.php | 26 ++++++++++++++++++++------
5 files changed, 41 insertions(+), 33 deletions(-)
diff --git a/config/auth.php b/config/auth.php
index aaf982bc..55afa181 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -31,7 +31,7 @@
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
- | Supported: "session", "token"
+ | Supported: "session"
|
*/
@@ -40,12 +40,6 @@
'driver' => 'session',
'provider' => 'users',
],
-
- 'api' => [
- 'driver' => 'token',
- 'provider' => 'users',
- 'hash' => false,
- ],
],
/*
@@ -86,7 +80,7 @@
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
- | The expire time is the number of minutes that the reset token should be
+ | The expire time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
diff --git a/config/broadcasting.php b/config/broadcasting.php
index 080f8426..62e5f921 100644
--- a/config/broadcasting.php
+++ b/config/broadcasting.php
@@ -11,7 +11,7 @@
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
- | Supported: "pusher", "redis", "log", "null"
+ | Supported: "pusher", "ably", "redis", "log", "null"
|
*/
@@ -32,15 +32,21 @@
'pusher' => [
'driver' => 'pusher',
- 'key' => env('PUSHER_KEY'),
- 'secret' => env('PUSHER_SECRET'),
+ 'key' => env('PUSHER_APP_KEY'),
+ 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
+ 'useTLS' => true,
],
],
+ 'ably' => [
+ 'driver' => 'ably',
+ 'key' => env('ABLY_KEY'),
+ ],
+
'redis' => [
'driver' => 'redis',
'connection' => 'default',
diff --git a/config/cache.php b/config/cache.php
index 3b9e6a2a..10f1c7b6 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -13,9 +13,6 @@
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
- | Supported: "apc", "array", "database", "file",
- | "memcached", "redis", "dynamodb"
- |
*/
'default' => env('CACHE_DRIVER', 'file'),
@@ -29,6 +26,9 @@
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
+ | Supported drivers: "apc", "array", "database", "file",
+ | "memcached", "redis", "dynamodb", "octane", "null"
+ |
*/
'stores' => [
@@ -46,6 +46,7 @@
'driver' => 'database',
'table' => 'cache',
'connection' => null,
+ 'lock_connection' => null,
],
'file' => [
@@ -75,6 +76,7 @@
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
+ 'lock_connection' => 'default',
],
'dynamodb' => [
@@ -86,6 +88,10 @@
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
+ 'octane' => [
+ 'driver' => 'octane',
+ ],
+
],
/*
diff --git a/config/filesystems.php b/config/filesystems.php
index 06913902..f12247f6 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -15,19 +15,6 @@
'default' => env('FILESYSTEM_DRIVER', 'local'),
- /*
- |--------------------------------------------------------------------------
- | Default Cloud Filesystem Disk
- |--------------------------------------------------------------------------
- |
- | Many applications store files both locally and in the cloud. For this
- | reason, you may specify a default "cloud" driver here. This driver
- | will be bound as the Cloud disk implementation in the container.
- |
- */
-
- 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
-
/*
|--------------------------------------------------------------------------
| Filesystem Disks
@@ -82,6 +69,7 @@
'prefix' => 'cache-',
],
'endpoint' => env('AWS_ENDPOINT'),
+ 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
],
diff --git a/config/logging.php b/config/logging.php
index 2e838918..cdafce74 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -19,6 +19,19 @@
'default' => env('LOG_CHANNEL', 'stack'),
+ /*
+ |--------------------------------------------------------------------------
+ | Deprecations Log Channel
+ |--------------------------------------------------------------------------
+ |
+ | This option controls the log channel that should be used to log warnings
+ | regarding deprecated PHP and library features. This allows you to get
+ | your application ready for upcoming major versions of dependencies.
+ |
+ */
+
+ 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
+
/*
|--------------------------------------------------------------------------
| Log Channels
@@ -44,13 +57,13 @@
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
- 'level' => 'debug',
+ 'level' => env('LOG_LEVEL', 'debug'),
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
- 'level' => 'debug',
+ 'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
@@ -59,12 +72,12 @@
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => env('APP_NAME'),
'emoji' => ':boom:',
- 'level' => 'critical',
+ 'level' => env('LOG_LEVEL', 'critical'),
],
'papertrail' => [
'driver' => 'monolog',
- 'level' => 'debug',
+ 'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
@@ -74,6 +87,7 @@
'stderr' => [
'driver' => 'monolog',
+ 'level' => env('LOG_LEVEL', 'debug'),
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
@@ -83,12 +97,12 @@
'syslog' => [
'driver' => 'syslog',
- 'level' => 'debug',
+ 'level' => env('LOG_LEVEL', 'debug'),
],
'errorlog' => [
'driver' => 'errorlog',
- 'level' => 'debug',
+ 'level' => env('LOG_LEVEL', 'debug'),
],
'null' => [
From b986353918406833b3f9380b5eb92e676e10d02d Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:42 +0000
Subject: [PATCH 044/127] Bump Composer dependencies
---
composer.json | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/composer.json b/composer.json
index 83c4a169..4dd3d98b 100644
--- a/composer.json
+++ b/composer.json
@@ -15,23 +15,22 @@
"type": "project",
"require": {
"php": ">=7.4",
- "doctrine/dbal": "^2.9",
+ "doctrine/dbal": "^2.13",
"ellipsesynergie/api-response": "0.12.*",
- "fideloper/proxy": "^4.4",
"fightbulc/moment": "*",
"fruitcake/laravel-cors": "^2.0.4",
- "guzzlehttp/guzzle": "^6.5",
- "iatstuti/laravel-cascade-soft-deletes": "^3.0",
- "influxdb/influxdb-php": "1.*",
+ "guzzlehttp/guzzle": "^7.0.1",
+ "iatstuti/laravel-cascade-soft-deletes": "^4.0",
+ "influxdb/influxdb-php": "^1.15",
"intervention/image": "^2.4.2",
- "kalnoy/nestedset": "^5.0.1",
- "laravel/framework": "^7.29",
+ "kalnoy/nestedset": "^6.0",
+ "laravel/framework": "^8.83",
"laravel/tinker": "^2.5",
- "laravel/ui": "^2.0",
- "laravelcollective/html": "^6.1",
+ "laravel/ui": "^3.0",
+ "laravelcollective/html": "^6.2",
"league/flysystem-aws-s3-v3": "~1.0",
"league/flysystem-cached-adapter": "~1.0",
- "mcamara/laravel-localization": "1.5.*",
+ "mcamara/laravel-localization": "^1.6",
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^6.3",
@@ -42,10 +41,10 @@
"barryvdh/laravel-debugbar": "^3.6",
"filp/whoops": "^2.0",
"knuckleswtf/scribe": "^3.29",
- "mockery/mockery": "^1.3.1",
- "nunomaduro/collision": "^4.3",
- "phpunit/phpunit": "^8.5.8|^9.3.3",
- "facade/ignition": "^2.0",
+ "mockery/mockery": "^1.4.4",
+ "nunomaduro/collision": "^5.10",
+ "phpunit/phpunit": "^9.5.10",
+ "facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1"
},
"config": {
@@ -89,6 +88,9 @@
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
+ ],
+ "post-update-cmd": [
+ "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
}
}
From 4fc13d888aac7768b93de10ac9b610fc416909b7 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 13:14:44 +0000
Subject: [PATCH 045/127] Shift cleanup
---
app/Hive.php | 5 ++---
app/HiveLayer.php | 3 +--
app/HiveLayerFrame.php | 1 -
app/Location.php | 5 ++---
app/User.php | 3 +--
database/factories/HiveFactory.php | 2 +-
database/factories/HiveLayerFactory.php | 2 +-
database/factories/HiveLayerFrameFactory.php | 2 +-
database/factories/LocationFactory.php | 2 +-
database/factories/UserFactory.php | 3 ++-
routes/api.php | 1 -
routes/web.php | 22 ++++++++++----------
12 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/app/Hive.php b/app/Hive.php
index a45506fd..99925d92 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -2,19 +2,18 @@
namespace App;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use Auth;
use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
class Hive extends Model
{
- use HasFactory;
-
use CascadeSoftDeletes, SoftDeletes;
+ use HasFactory;
protected $cascadeDeletes = ['queen', 'inspections', 'layers', 'frames'];
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index 104dbcf7..80828174 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use Cache;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
@@ -11,7 +11,6 @@
class HiveLayer extends Model
{
use HasFactory;
-
use SoftDeletes;
protected $fillable = ['hive_id', 'category_id', 'order', 'color'];
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index 85699ef8..b1e87e5f 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -9,7 +9,6 @@
class HiveLayerFrame extends Model
{
use HasFactory;
-
use SoftDeletes;
protected $fillable = ['layer_id', 'category_id', 'present', 'order'];
diff --git a/app/Location.php b/app/Location.php
index 63309ecc..cde477fa 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -2,19 +2,18 @@
namespace App;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use Auth;
use Cache;
use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
class Location extends Model
{
- use HasFactory;
-
use CascadeSoftDeletes, SoftDeletes;
+ use HasFactory;
protected $cascadeDeletes = ['hives', 'inspections'];
diff --git a/app/User.php b/app/User.php
index d466ea28..2c91669b 100644
--- a/app/User.php
+++ b/app/User.php
@@ -2,7 +2,6 @@
namespace App;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Models\Alert;
use App\Models\AlertRule;
use App\Models\ChecklistSvg;
@@ -14,6 +13,7 @@
use Auth;
use Cache;
use DB;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Log;
@@ -22,7 +22,6 @@
class User extends Authenticatable
{
use HasFactory;
-
use LaratrustUserTrait;
use Notifiable;
diff --git a/database/factories/HiveFactory.php b/database/factories/HiveFactory.php
index 35ab15a1..b2208235 100644
--- a/database/factories/HiveFactory.php
+++ b/database/factories/HiveFactory.php
@@ -1,9 +1,9 @@
Date: Thu, 28 May 2026 15:32:53 +0200
Subject: [PATCH 046/127] update composer.lock & phpunit.xml for Laravel v8.x
---
composer.lock | 1492 +++++++++++++++++++++++++++++--------------------
phpunit.xml | 16 +-
2 files changed, 910 insertions(+), 598 deletions(-)
diff --git a/composer.lock b/composer.lock
index d0e0eea2..8f56daf9 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1c37ee94d3bbbd8a62e298d8ff63a15e",
+ "content-hash": "bf09585ed3f577944694c6a4491bb7cf",
"packages": [
{
"name": "asm89/stack-cors",
@@ -344,44 +344,38 @@
"time": "2023-10-01T12:35:29+00:00"
},
{
- "name": "composer/pcre",
- "version": "3.3.2",
+ "name": "dflydev/dot-access-data",
+ "version": "v3.0.3",
"source": {
"type": "git",
- "url": "https://github.com/composer/pcre.git",
- "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
+ "url": "https://github.com/dflydev/dflydev-dot-access-data.git",
+ "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
- "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f",
+ "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f",
"shasum": ""
},
"require": {
- "php": "^7.4 || ^8.0"
- },
- "conflict": {
- "phpstan/phpstan": "<1.11.10"
+ "php": "^7.1 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^1.12 || ^2",
- "phpstan/phpstan-strict-rules": "^1 || ^2",
- "phpunit/phpunit": "^8 || ^9"
+ "phpstan/phpstan": "^0.12.42",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
+ "scrutinizer/ocular": "1.6.0",
+ "squizlabs/php_codesniffer": "^3.5",
+ "vimeo/psalm": "^4.0.0"
},
"type": "library",
"extra": {
- "phpstan": {
- "includes": [
- "extension.neon"
- ]
- },
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
- "Composer\\Pcre\\": "src"
+ "Dflydev\\DotAccessData\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -390,37 +384,39 @@
],
"authors": [
{
- "name": "Jordi Boggiano",
- "email": "j.boggiano@seld.be",
- "homepage": "http://seld.be"
- }
- ],
- "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
- "keywords": [
- "PCRE",
- "preg",
- "regex",
- "regular expression"
- ],
- "support": {
- "issues": "https://github.com/composer/pcre/issues",
- "source": "https://github.com/composer/pcre/tree/3.3.2"
- },
- "funding": [
+ "name": "Dragonfly Development Inc.",
+ "email": "info@dflydev.com",
+ "homepage": "http://dflydev.com"
+ },
{
- "url": "https://packagist.com",
- "type": "custom"
+ "name": "Beau Simensen",
+ "email": "beau@dflydev.com",
+ "homepage": "http://beausimensen.com"
},
{
- "url": "https://github.com/composer",
- "type": "github"
+ "name": "Carlos Frutos",
+ "email": "carlos@kiwing.it",
+ "homepage": "https://github.com/cfrutos"
},
{
- "url": "https://tidelift.com/funding/github/packagist/composer/composer",
- "type": "tidelift"
+ "name": "Colin O'Dell",
+ "email": "colinodell@gmail.com",
+ "homepage": "https://www.colinodell.com"
}
],
- "time": "2024-11-12T16:29:46+00:00"
+ "description": "Given a deep data structure, access data by dot notation.",
+ "homepage": "https://github.com/dflydev/dflydev-dot-access-data",
+ "keywords": [
+ "access",
+ "data",
+ "dot",
+ "notation"
+ ],
+ "support": {
+ "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
+ "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3"
+ },
+ "time": "2024-07-08T12:26:09+00:00"
},
{
"name": "doctrine/cache",
@@ -933,28 +929,33 @@
},
{
"name": "dragonmantank/cron-expression",
- "version": "v2.3.1",
+ "version": "v3.5.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
- "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2"
+ "reference": "1b2de7f4a468165dca07b142240733a1973e766d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2",
- "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2",
+ "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/1b2de7f4a468165dca07b142240733a1973e766d",
+ "reference": "1b2de7f4a468165dca07b142240733a1973e766d",
"shasum": ""
},
"require": {
- "php": "^7.0|^8.0"
+ "php": "^7.2|^8.0"
+ },
+ "replace": {
+ "mtdowling/cron-expression": "^1.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0"
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^1.12.32|^2.1.31",
+ "phpunit/phpunit": "^8.5.48|^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
@@ -967,11 +968,6 @@
"MIT"
],
"authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
{
"name": "Chris Tankersley",
"email": "chris@ctankersley.com",
@@ -985,7 +981,7 @@
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
- "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1"
+ "source": "https://github.com/dragonmantank/cron-expression/tree/v3.5.0"
},
"funding": [
{
@@ -993,7 +989,7 @@
"type": "github"
}
],
- "time": "2020-10-13T00:52:37+00:00"
+ "time": "2025-10-31T18:36:32+00:00"
},
{
"name": "egulias/email-validator",
@@ -1127,125 +1123,6 @@
},
"time": "2016-07-14T12:33:35+00:00"
},
- {
- "name": "ezyang/htmlpurifier",
- "version": "v4.19.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ezyang/htmlpurifier.git",
- "reference": "b287d2a16aceffbf6e0295559b39662612b77fcf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/b287d2a16aceffbf6e0295559b39662612b77fcf",
- "reference": "b287d2a16aceffbf6e0295559b39662612b77fcf",
- "shasum": ""
- },
- "require": {
- "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
- },
- "require-dev": {
- "cerdic/css-tidy": "^1.7 || ^2.0",
- "simpletest/simpletest": "dev-master"
- },
- "suggest": {
- "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
- "ext-bcmath": "Used for unit conversion and imagecrash protection",
- "ext-iconv": "Converts text to and from non-UTF-8 encodings",
- "ext-tidy": "Used for pretty-printing HTML"
- },
- "type": "library",
- "autoload": {
- "files": [
- "library/HTMLPurifier.composer.php"
- ],
- "psr-0": {
- "HTMLPurifier": "library/"
- },
- "exclude-from-classmap": [
- "/library/HTMLPurifier/Language/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "LGPL-2.1-or-later"
- ],
- "authors": [
- {
- "name": "Edward Z. Yang",
- "email": "admin@htmlpurifier.org",
- "homepage": "http://ezyang.com"
- }
- ],
- "description": "Standards compliant HTML filter written in PHP",
- "homepage": "http://htmlpurifier.org/",
- "keywords": [
- "html"
- ],
- "support": {
- "issues": "https://github.com/ezyang/htmlpurifier/issues",
- "source": "https://github.com/ezyang/htmlpurifier/tree/v4.19.0"
- },
- "time": "2025-10-17T16:34:55+00:00"
- },
- {
- "name": "fideloper/proxy",
- "version": "4.4.2",
- "source": {
- "type": "git",
- "url": "https://github.com/fideloper/TrustedProxy.git",
- "reference": "a751f2bc86dd8e6cfef12dc0cbdada82f5a18750"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/a751f2bc86dd8e6cfef12dc0cbdada82f5a18750",
- "reference": "a751f2bc86dd8e6cfef12dc0cbdada82f5a18750",
- "shasum": ""
- },
- "require": {
- "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "illuminate/http": "^5.0|^6.0|^7.0|^8.0|^9.0",
- "mockery/mockery": "^1.0",
- "phpunit/phpunit": "^8.5.8|^9.3.3"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "Fideloper\\Proxy\\TrustedProxyServiceProvider"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "Fideloper\\Proxy\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Chris Fidao",
- "email": "fideloper@gmail.com"
- }
- ],
- "description": "Set trusted proxies for Laravel",
- "keywords": [
- "load balancing",
- "proxy",
- "trusted proxy"
- ],
- "support": {
- "issues": "https://github.com/fideloper/TrustedProxy/issues",
- "source": "https://github.com/fideloper/TrustedProxy/tree/4.4.2"
- },
- "time": "2022-02-09T13:33:34+00:00"
- },
{
"name": "fightbulc/moment",
"version": "1.35.0",
@@ -1383,39 +1260,112 @@
"abandoned": true,
"time": "2022-02-23T14:25:13+00:00"
},
+ {
+ "name": "graham-campbell/result-type",
+ "version": "v1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/GrahamCampbell/Result-Type.git",
+ "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
+ "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "phpoption/phpoption": "^1.9.5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "GrahamCampbell\\ResultType\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ }
+ ],
+ "description": "An Implementation Of The Result Type",
+ "keywords": [
+ "Graham Campbell",
+ "GrahamCampbell",
+ "Result Type",
+ "Result-Type",
+ "result"
+ ],
+ "support": {
+ "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
+ "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-12-27T19:43:20+00:00"
+ },
{
"name": "guzzlehttp/guzzle",
- "version": "6.5.8",
+ "version": "7.10.5",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981"
+ "reference": "7c8d84b39e680315f687e8662a9d6fb0865c5148"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981",
- "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7c8d84b39e680315f687e8662a9d6fb0865c5148",
+ "reference": "7c8d84b39e680315f687e8662a9d6fb0865c5148",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^1.0",
- "guzzlehttp/psr7": "^1.9",
- "php": ">=5.5",
- "symfony/polyfill-intl-idn": "^1.17"
+ "guzzlehttp/promises": "^2.3",
+ "guzzlehttp/psr7": "^2.8",
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-client": "^1.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ },
+ "provide": {
+ "psr/http-client-implementation": "1.0"
},
"require-dev": {
+ "bamarni/composer-bin-plugin": "^1.8.2",
"ext-curl": "*",
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
- "psr/log": "^1.1"
+ "guzzle/client-integration-tests": "3.0.2",
+ "guzzlehttp/test-server": "^0.4",
+ "php-http/message-factory": "^1.1",
+ "phpunit/phpunit": "^8.5.52 || ^9.6.34",
+ "psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
+ "ext-curl": "Required for CURL handler support",
+ "ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "6.5-dev"
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
}
},
"autoload": {
@@ -1468,19 +1418,20 @@
}
],
"description": "Guzzle is a PHP HTTP client library",
- "homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
+ "psr-18",
+ "psr-7",
"rest",
"web service"
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/6.5.8"
+ "source": "https://github.com/guzzle/guzzle/tree/7.10.5"
},
"funding": [
{
@@ -1496,33 +1447,37 @@
"type": "tidelift"
}
],
- "time": "2022-06-20T22:16:07+00:00"
+ "time": "2026-05-27T11:53:46+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "1.5.3",
+ "version": "2.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e"
+ "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e",
- "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2",
+ "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2",
"shasum": ""
},
"require": {
- "php": ">=5.5"
+ "php": "^7.2.5 || ^8.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "^4.4 || ^5.1"
+ "bamarni/composer-bin-plugin": "^1.8.2",
+ "phpunit/phpunit": "^8.5.52 || ^9.6.34"
},
"type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
}
@@ -1559,7 +1514,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/1.5.3"
+ "source": "https://github.com/guzzle/promises/tree/2.4.1"
},
"funding": [
{
@@ -1575,42 +1530,49 @@
"type": "tidelift"
}
],
- "time": "2023-05-21T12:31:43+00:00"
+ "time": "2026-05-20T22:57:30+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "1.9.1",
+ "version": "2.10.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b"
+ "reference": "7c1472269227dc6f18930bd903d7a88fe6c52130"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b",
- "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/7c1472269227dc6f18930bd903d7a88fe6c52130",
+ "reference": "7c1472269227dc6f18930bd903d7a88fe6c52130",
"shasum": ""
},
"require": {
- "php": ">=5.4.0",
- "psr/http-message": "~1.0",
- "ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
+ "php": "^7.2.5 || ^8.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.1 || ^2.0",
+ "ralouphie/getallheaders": "^3.0"
},
"provide": {
+ "psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
- "ext-zlib": "*",
- "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
+ "bamarni/composer-bin-plugin": "^1.8.2",
+ "http-interop/http-factory-tests": "1.1.0",
+ "jshttp/mime-db": "1.54.0.1",
+ "phpunit/phpunit": "^8.5.52 || ^9.6.34"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
"autoload": {
- "files": [
- "src/functions_include.php"
- ],
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
}
@@ -1649,6 +1611,11 @@
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
@@ -1664,7 +1631,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/1.9.1"
+ "source": "https://github.com/guzzle/psr7/tree/2.10.3"
},
"funding": [
{
@@ -1680,34 +1647,34 @@
"type": "tidelift"
}
],
- "time": "2023-04-17T16:00:37+00:00"
+ "time": "2026-05-27T11:48:20+00:00"
},
{
"name": "iatstuti/laravel-cascade-soft-deletes",
- "version": "3.0.0",
+ "version": "4.2.1",
"source": {
"type": "git",
"url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "b2e13870f7c0f47b6c3db1ec2031f84f37d03794"
+ "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/b2e13870f7c0f47b6c3db1ec2031f84f37d03794",
- "reference": "b2e13870f7c0f47b6c3db1ec2031f84f37d03794",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
+ "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
"shasum": ""
},
"require": {
- "illuminate/database": "^6.0|^7.0",
- "illuminate/events": "^6.0|^7.0",
- "php": "^7.2.5"
+ "illuminate/database": "^8.12|^9.0",
+ "illuminate/events": "^8.12|^9.0",
+ "php": "^7.3|^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^8.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "utility",
"autoload": {
"psr-4": {
- "Iatstuti\\Database\\Support\\": "src/"
+ "Dyrynda\\Database\\Support\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1724,10 +1691,10 @@
"description": "Cascading deletes for Eloquent models that implement soft deletes",
"support": {
"issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/3.0.0"
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.2.1"
},
"abandoned": "dyrynda/laravel-cascade-soft-deletes",
- "time": "2020-03-06T10:28:12+00:00"
+ "time": "2022-11-22T03:11:30+00:00"
},
{
"name": "influxdb/influxdb-php",
@@ -1882,26 +1849,26 @@
},
{
"name": "kalnoy/nestedset",
- "version": "v5.0.5",
+ "version": "v6.0.5",
"source": {
"type": "git",
"url": "https://github.com/lazychaser/laravel-nestedset.git",
- "reference": "abf4c8602977874368a79eb6648d5d0014b613bb"
+ "reference": "fa3f77bb96709eb6b394f66b54eb08f0d8d47d63"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/abf4c8602977874368a79eb6648d5d0014b613bb",
- "reference": "abf4c8602977874368a79eb6648d5d0014b613bb",
+ "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/fa3f77bb96709eb6b394f66b54eb08f0d8d47d63",
+ "reference": "fa3f77bb96709eb6b394f66b54eb08f0d8d47d63",
"shasum": ""
},
"require": {
- "illuminate/database": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0",
- "illuminate/events": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0",
- "illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0|>=8.0 <8.43.0",
- "php": ">=7.1.3"
+ "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/events": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "php": "^7.2.5|^8.0"
},
"require-dev": {
- "phpunit/phpunit": "7.*"
+ "phpunit/phpunit": "7.*|8.*|9.*|^10.5"
},
"type": "library",
"extra": {
@@ -1939,9 +1906,9 @@
],
"support": {
"issues": "https://github.com/lazychaser/laravel-nestedset/issues",
- "source": "https://github.com/lazychaser/laravel-nestedset/tree/v5.0.5"
+ "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.5"
},
- "time": "2021-05-28T07:23:48+00:00"
+ "time": "2025-02-25T11:09:07+00:00"
},
{
"name": "kkszymanowski/traitor",
@@ -1995,60 +1962,63 @@
},
{
"name": "laravel/framework",
- "version": "v7.30.7",
+ "version": "v8.83.29",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "0fe75bafb8703c6c8184792b91ce5e27ad80aa7b"
+ "reference": "d841a226a50c715431952a10260ba4fac9e91cc4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/0fe75bafb8703c6c8184792b91ce5e27ad80aa7b",
- "reference": "0fe75bafb8703c6c8184792b91ce5e27ad80aa7b",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/d841a226a50c715431952a10260ba4fac9e91cc4",
+ "reference": "d841a226a50c715431952a10260ba4fac9e91cc4",
"shasum": ""
},
"require": {
"doctrine/inflector": "^1.4|^2.0",
- "dragonmantank/cron-expression": "^2.3.1",
+ "dragonmantank/cron-expression": "^3.0.2",
"egulias/email-validator": "^2.1.10",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
- "league/commonmark": "^1.3",
+ "laravel/serializable-closure": "^1.0",
+ "league/commonmark": "^1.3|^2.0.2",
"league/flysystem": "^1.1",
"monolog/monolog": "^2.0",
- "nesbot/carbon": "^2.31",
+ "nesbot/carbon": "^2.53.1",
"opis/closure": "^3.6",
- "php": "^7.2.5|^8.0",
+ "php": "^7.3|^8.0",
"psr/container": "^1.0",
+ "psr/log": "^1.0|^2.0",
"psr/simple-cache": "^1.0",
- "ramsey/uuid": "^3.7|^4.0",
- "swiftmailer/swiftmailer": "^6.0",
- "symfony/console": "^5.0",
- "symfony/error-handler": "^5.0",
- "symfony/finder": "^5.0",
- "symfony/http-foundation": "^5.0",
- "symfony/http-kernel": "^5.0",
- "symfony/mime": "^5.0",
- "symfony/polyfill-php73": "^1.17",
- "symfony/process": "^5.0",
- "symfony/routing": "^5.0",
- "symfony/var-dumper": "^5.0",
+ "ramsey/uuid": "^4.2.2",
+ "swiftmailer/swiftmailer": "^6.3",
+ "symfony/console": "^5.4",
+ "symfony/error-handler": "^5.4",
+ "symfony/finder": "^5.4",
+ "symfony/http-foundation": "^5.4",
+ "symfony/http-kernel": "^5.4",
+ "symfony/mime": "^5.4",
+ "symfony/process": "^5.4",
+ "symfony/routing": "^5.4",
+ "symfony/var-dumper": "^5.4",
"tijsverkoyen/css-to-inline-styles": "^2.2.2",
- "vlucas/phpdotenv": "^4.0",
- "voku/portable-ascii": "^1.4.8"
+ "vlucas/phpdotenv": "^5.4.1",
+ "voku/portable-ascii": "^1.6.1"
},
"conflict": {
"tightenco/collect": "<5.5.33"
},
"provide": {
- "psr/container-implementation": "1.0"
+ "psr/container-implementation": "1.0",
+ "psr/simple-cache-implementation": "1.0"
},
"replace": {
"illuminate/auth": "self.version",
"illuminate/broadcasting": "self.version",
"illuminate/bus": "self.version",
"illuminate/cache": "self.version",
+ "illuminate/collections": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/container": "self.version",
@@ -2061,6 +2031,7 @@
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
"illuminate/log": "self.version",
+ "illuminate/macroable": "self.version",
"illuminate/mail": "self.version",
"illuminate/notifications": "self.version",
"illuminate/pagination": "self.version",
@@ -2076,22 +2047,24 @@
"illuminate/view": "self.version"
},
"require-dev": {
- "aws/aws-sdk-php": "^3.155",
- "doctrine/dbal": "^2.6",
- "filp/whoops": "^2.8",
- "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
+ "aws/aws-sdk-php": "^3.198.1",
+ "doctrine/dbal": "^2.13.3|^3.1.4",
+ "filp/whoops": "^2.14.3",
+ "guzzlehttp/guzzle": "^6.5.5|^7.0.1",
"league/flysystem-cached-adapter": "^1.0",
- "mockery/mockery": "~1.3.3|^1.4.2",
- "moontoast/math": "^1.1",
- "orchestra/testbench-core": "^5.8",
+ "mockery/mockery": "^1.4.4",
+ "orchestra/testbench-core": "^6.27",
"pda/pheanstalk": "^4.0",
- "phpunit/phpunit": "^8.4|^9.3.3",
- "predis/predis": "^1.1.1",
- "symfony/cache": "^5.0"
+ "phpunit/phpunit": "^8.5.19|^9.5.8",
+ "predis/predis": "^1.1.9",
+ "symfony/cache": "^5.4"
},
"suggest": {
- "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).",
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
+ "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
+ "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).",
+ "brianium/paratest": "Required to run tests in parallel (^6.0).",
+ "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).",
+ "ext-bcmath": "Required to use the multiple_of validation rule.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
"ext-memcached": "Required to use the memcache cache driver.",
@@ -2099,38 +2072,43 @@
"ext-posix": "Required to use all features of the queue worker.",
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
- "filp/whoops": "Required for friendly error pages in development (^2.8).",
- "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.3.1|^7.0.1).",
+ "filp/whoops": "Required for friendly error pages in development (^2.14.3).",
+ "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
- "mockery/mockery": "Required to use mocking (~1.3.3|^1.4.2).",
- "moontoast/math": "Required to use ordered UUIDs (^1.1).",
+ "mockery/mockery": "Required to use mocking (^1.4.4).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
- "phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.3.3).",
- "predis/predis": "Required to use the predis connector (^1.1.2).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).",
+ "predis/predis": "Required to use the predis connector (^1.1.9).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
- "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^5.0).",
- "symfony/filesystem": "Required to create relative storage directory symbolic links (^5.0).",
+ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0|^7.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^5.4).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).",
"wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"autoload": {
"files": [
+ "src/Illuminate/Collections/helpers.php",
+ "src/Illuminate/Events/functions.php",
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Support/helpers.php"
],
"psr-4": {
- "Illuminate\\": "src/Illuminate/"
+ "Illuminate\\": "src/Illuminate/",
+ "Illuminate\\Support\\": [
+ "src/Illuminate/Macroable/",
+ "src/Illuminate/Collections/"
+ ]
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2153,7 +2131,68 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2024-11-12T15:42:13+00:00"
+ "time": "2024-11-20T15:55:41+00:00"
+ },
+ {
+ "name": "laravel/serializable-closure",
+ "version": "v1.3.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/serializable-closure.git",
+ "reference": "4f48ade902b94323ca3be7646db16209ec76be3d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d",
+ "reference": "4f48ade902b94323ca3be7646db16209ec76be3d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3|^8.0"
+ },
+ "require-dev": {
+ "illuminate/support": "^8.0|^9.0|^10.0|^11.0",
+ "nesbot/carbon": "^2.61|^3.0",
+ "pestphp/pest": "^1.21.3",
+ "phpstan/phpstan": "^1.8.2",
+ "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Laravel\\SerializableClosure\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "taylor@laravel.com"
+ },
+ {
+ "name": "Nuno Maduro",
+ "email": "nuno@laravel.com"
+ }
+ ],
+ "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.",
+ "keywords": [
+ "closure",
+ "laravel",
+ "serializable"
+ ],
+ "support": {
+ "issues": "https://github.com/laravel/serializable-closure/issues",
+ "source": "https://github.com/laravel/serializable-closure"
+ },
+ "time": "2024-11-14T18:34:49+00:00"
},
{
"name": "laravel/tinker",
@@ -2223,23 +2262,27 @@
},
{
"name": "laravel/ui",
- "version": "v2.5.0",
+ "version": "v3.4.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/ui.git",
- "reference": "d01a705763c243b07be795e9d1bb47f89260f73d"
+ "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/ui/zipball/d01a705763c243b07be795e9d1bb47f89260f73d",
- "reference": "d01a705763c243b07be795e9d1bb47f89260f73d",
+ "url": "https://api.github.com/repos/laravel/ui/zipball/65ec5c03f7fee2c8ecae785795b829a15be48c2c",
+ "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c",
"shasum": ""
},
"require": {
- "illuminate/console": "^7.0",
- "illuminate/filesystem": "^7.0",
- "illuminate/support": "^7.0",
- "php": "^7.2.5|^8.0"
+ "illuminate/console": "^8.42|^9.0",
+ "illuminate/filesystem": "^8.42|^9.0",
+ "illuminate/support": "^8.82|^9.0",
+ "illuminate/validation": "^8.42|^9.0",
+ "php": "^7.3|^8.0"
+ },
+ "require-dev": {
+ "orchestra/testbench": "^6.23|^7.0"
},
"type": "library",
"extra": {
@@ -2247,6 +2290,9 @@
"providers": [
"Laravel\\Ui\\UiServiceProvider"
]
+ },
+ "branch-alias": {
+ "dev-master": "3.x-dev"
}
},
"autoload": {
@@ -2271,10 +2317,9 @@
"ui"
],
"support": {
- "issues": "https://github.com/laravel/ui/issues",
- "source": "https://github.com/laravel/ui/tree/v2.5.0"
+ "source": "https://github.com/laravel/ui/tree/v3.4.6"
},
- "time": "2020-11-03T19:45:19+00:00"
+ "time": "2022-05-20T13:38:08+00:00"
},
{
"name": "laravelcollective/html",
@@ -2351,42 +2396,55 @@
},
{
"name": "league/commonmark",
- "version": "1.6.7",
+ "version": "2.8.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
- "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b"
+ "reference": "59fb075d2101740c337c7216e3f32b36c204218b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2b8185c13bc9578367a5bf901881d1c1b5bbd09b",
- "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b",
+ "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/59fb075d2101740c337c7216e3f32b36c204218b",
+ "reference": "59fb075d2101740c337c7216e3f32b36c204218b",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
- "php": "^7.1 || ^8.0"
- },
- "conflict": {
- "scrutinizer/ocular": "1.7.*"
+ "league/config": "^1.1.1",
+ "php": "^7.4 || ^8.0",
+ "psr/event-dispatcher": "^1.0",
+ "symfony/deprecation-contracts": "^2.1 || ^3.0",
+ "symfony/polyfill-php80": "^1.16"
},
"require-dev": {
- "cebe/markdown": "~1.0",
- "commonmark/commonmark.js": "0.29.2",
- "erusev/parsedown": "~1.0",
+ "cebe/markdown": "^1.0",
+ "commonmark/cmark": "0.31.1",
+ "commonmark/commonmark.js": "0.31.1",
+ "composer/package-versions-deprecated": "^1.8",
+ "embed/embed": "^4.4",
+ "erusev/parsedown": "^1.0",
"ext-json": "*",
"github/gfm": "0.29.0",
- "michelf/php-markdown": "~1.4",
- "mikehaertl/php-shellcommand": "^1.4",
- "phpstan/phpstan": "^0.12.90",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2",
- "scrutinizer/ocular": "^1.5",
- "symfony/finder": "^4.2"
+ "michelf/php-markdown": "^1.4 || ^2.0",
+ "nyholm/psr7": "^1.5",
+ "phpstan/phpstan": "^1.8.2",
+ "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
+ "scrutinizer/ocular": "^1.8.1",
+ "symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0",
+ "symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0",
+ "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0",
+ "unleashedtech/php-coding-standard": "^3.1.1",
+ "vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0"
+ },
+ "suggest": {
+ "symfony/yaml": "v2.3+ required if using the Front Matter extension"
},
- "bin": [
- "bin/commonmark"
- ],
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.9-dev"
+ }
+ },
"autoload": {
"psr-4": {
"League\\CommonMark\\": "src"
@@ -2404,7 +2462,7 @@
"role": "Lead Developer"
}
],
- "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)",
+ "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)",
"homepage": "https://commonmark.thephpleague.com",
"keywords": [
"commonmark",
@@ -2418,6 +2476,7 @@
],
"support": {
"docs": "https://commonmark.thephpleague.com/",
+ "forum": "https://github.com/thephpleague/commonmark/discussions",
"issues": "https://github.com/thephpleague/commonmark/issues",
"rss": "https://github.com/thephpleague/commonmark/releases.atom",
"source": "https://github.com/thephpleague/commonmark"
@@ -2440,7 +2499,89 @@
"type": "tidelift"
}
],
- "time": "2022-01-13T17:18:13+00:00"
+ "time": "2026-03-19T13:16:38+00:00"
+ },
+ {
+ "name": "league/config",
+ "version": "v1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/config.git",
+ "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
+ "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
+ "shasum": ""
+ },
+ "require": {
+ "dflydev/dot-access-data": "^3.0.1",
+ "nette/schema": "^1.2",
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.8.2",
+ "phpunit/phpunit": "^9.5.5",
+ "scrutinizer/ocular": "^1.8.1",
+ "unleashedtech/php-coding-standard": "^3.1",
+ "vimeo/psalm": "^4.7.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Config\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Colin O'Dell",
+ "email": "colinodell@gmail.com",
+ "homepage": "https://www.colinodell.com",
+ "role": "Lead Developer"
+ }
+ ],
+ "description": "Define configuration arrays with strict schemas and access values with dot notation",
+ "homepage": "https://config.thephpleague.com",
+ "keywords": [
+ "array",
+ "config",
+ "configuration",
+ "dot",
+ "dot-access",
+ "nested",
+ "schema"
+ ],
+ "support": {
+ "docs": "https://config.thephpleague.com/",
+ "issues": "https://github.com/thephpleague/config/issues",
+ "rss": "https://github.com/thephpleague/config/releases.atom",
+ "source": "https://github.com/thephpleague/config"
+ },
+ "funding": [
+ {
+ "url": "https://www.colinodell.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.paypal.me/colinpodell/10.00",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/colinodell",
+ "type": "github"
+ }
+ ],
+ "time": "2022-12-11T20:36:23+00:00"
},
{
"name": "league/flysystem",
@@ -2760,124 +2901,94 @@
],
"description": "Mime-type detection for Flysystem",
"support": {
- "issues": "https://github.com/thephpleague/mime-type-detection/issues",
- "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0"
- },
- "funding": [
- {
- "url": "https://github.com/frankdejonge",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
- "type": "tidelift"
- }
- ],
- "time": "2024-09-21T08:32:55+00:00"
- },
- {
- "name": "maennchen/zipstream-php",
- "version": "2.2.6",
- "source": {
- "type": "git",
- "url": "https://github.com/maennchen/ZipStream-PHP.git",
- "reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f",
- "reference": "30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f",
- "shasum": ""
- },
- "require": {
- "myclabs/php-enum": "^1.5",
- "php": "^7.4 || ^8.0",
- "psr/http-message": "^1.0",
- "symfony/polyfill-mbstring": "^1.0"
- },
- "require-dev": {
- "ext-zip": "*",
- "friendsofphp/php-cs-fixer": "^3.9",
- "guzzlehttp/guzzle": "^6.5.3 || ^7.2.0",
- "mikey179/vfsstream": "^1.6",
- "php-coveralls/php-coveralls": "^2.4",
- "phpunit/phpunit": "^8.5.8 || ^9.4.2",
- "vimeo/psalm": "^4.1"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "ZipStream\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Paul Duncan",
- "email": "pabs@pablotron.org"
- },
- {
- "name": "Jonatan Männchen",
- "email": "jonatan@maennchen.ch"
- },
- {
- "name": "Jesse Donat",
- "email": "donatj@gmail.com"
- },
- {
- "name": "András Kolesár",
- "email": "kolesar@kolesar.hu"
- }
- ],
- "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
- "keywords": [
- "stream",
- "zip"
- ],
- "support": {
- "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
- "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.6"
+ "issues": "https://github.com/thephpleague/mime-type-detection/issues",
+ "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0"
},
"funding": [
{
- "url": "https://github.com/maennchen",
+ "url": "https://github.com/frankdejonge",
"type": "github"
},
{
- "url": "https://opencollective.com/zipstream",
- "type": "open_collective"
+ "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
+ "type": "tidelift"
}
],
- "time": "2022-11-25T18:57:19+00:00"
+ "time": "2024-09-21T08:32:55+00:00"
},
{
"name": "markbaker/complex",
- "version": "3.0.2",
+ "version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
- "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
+ "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
- "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/c3131244e29c08d44fefb49e0dd35021e9e39dd2",
+ "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2",
"shasum": ""
},
"require": {
- "php": "^7.2 || ^8.0"
+ "php": "^5.6.0|^7.0"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
- "phpcompatibility/php-compatibility": "^9.3",
- "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
- "squizlabs/php_codesniffer": "^3.7"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
+ "phpcompatibility/php-compatibility": "^9.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "^4.0|^5.0|^6.0|^7.0",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^4.8.35|^5.0|^6.0|^7.0",
+ "sebastian/phpcpd": "2.*",
+ "squizlabs/php_codesniffer": "^3.4.0"
},
"type": "library",
"autoload": {
+ "files": [
+ "classes/src/functions/abs.php",
+ "classes/src/functions/acos.php",
+ "classes/src/functions/acosh.php",
+ "classes/src/functions/acot.php",
+ "classes/src/functions/acoth.php",
+ "classes/src/functions/acsc.php",
+ "classes/src/functions/acsch.php",
+ "classes/src/functions/argument.php",
+ "classes/src/functions/asec.php",
+ "classes/src/functions/asech.php",
+ "classes/src/functions/asin.php",
+ "classes/src/functions/asinh.php",
+ "classes/src/functions/atan.php",
+ "classes/src/functions/atanh.php",
+ "classes/src/functions/conjugate.php",
+ "classes/src/functions/cos.php",
+ "classes/src/functions/cosh.php",
+ "classes/src/functions/cot.php",
+ "classes/src/functions/coth.php",
+ "classes/src/functions/csc.php",
+ "classes/src/functions/csch.php",
+ "classes/src/functions/exp.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/ln.php",
+ "classes/src/functions/log2.php",
+ "classes/src/functions/log10.php",
+ "classes/src/functions/negative.php",
+ "classes/src/functions/pow.php",
+ "classes/src/functions/rho.php",
+ "classes/src/functions/sec.php",
+ "classes/src/functions/sech.php",
+ "classes/src/functions/sin.php",
+ "classes/src/functions/sinh.php",
+ "classes/src/functions/sqrt.php",
+ "classes/src/functions/tan.php",
+ "classes/src/functions/tanh.php",
+ "classes/src/functions/theta.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ],
"psr-4": {
"Complex\\": "classes/src/"
}
@@ -2900,39 +3011,56 @@
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
- "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
+ "source": "https://github.com/MarkBaker/PHPComplex/tree/1.5.0"
},
- "time": "2022-12-06T16:21:08+00:00"
+ "time": "2020-08-26T19:47:57+00:00"
},
{
"name": "markbaker/matrix",
- "version": "3.0.1",
+ "version": "1.2.3",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
- "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
+ "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
- "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/44bb1ab01811116f01fe216ab37d921dccc6c10d",
+ "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0"
+ "php": "^5.6.0|^7.0.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
- "phpcompatibility/php-compatibility": "^9.3",
- "phpdocumentor/phpdocumentor": "2.*",
- "phploc/phploc": "^4.0",
- "phpmd/phpmd": "2.*",
- "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
- "sebastian/phpcpd": "^4.0",
- "squizlabs/php_codesniffer": "^3.7"
+ "phpcompatibility/php-compatibility": "dev-master",
+ "phploc/phploc": "^4",
+ "phpmd/phpmd": "dev-master",
+ "phpunit/phpunit": "^5.7|^6.0|7.0",
+ "sebastian/phpcpd": "^3.0",
+ "squizlabs/php_codesniffer": "^3.0@dev"
},
"type": "library",
"autoload": {
+ "files": [
+ "classes/src/Functions/adjoint.php",
+ "classes/src/Functions/antidiagonal.php",
+ "classes/src/Functions/cofactors.php",
+ "classes/src/Functions/determinant.php",
+ "classes/src/Functions/diagonal.php",
+ "classes/src/Functions/identity.php",
+ "classes/src/Functions/inverse.php",
+ "classes/src/Functions/minors.php",
+ "classes/src/Functions/trace.php",
+ "classes/src/Functions/transpose.php",
+ "classes/src/Operations/add.php",
+ "classes/src/Operations/directsum.php",
+ "classes/src/Operations/subtract.php",
+ "classes/src/Operations/multiply.php",
+ "classes/src/Operations/divideby.php",
+ "classes/src/Operations/divideinto.php"
+ ],
"psr-4": {
"Matrix\\": "classes/src/"
}
@@ -2944,7 +3072,7 @@
"authors": [
{
"name": "Mark Baker",
- "email": "mark@demon-angel.eu"
+ "email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with matrices",
@@ -2956,31 +3084,31 @@
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
- "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
+ "source": "https://github.com/MarkBaker/PHPMatrix/tree/1.2.3"
},
- "time": "2022-12-02T22:17:43+00:00"
+ "time": "2021-01-26T14:36:01+00:00"
},
{
"name": "mcamara/laravel-localization",
- "version": "1.5.0",
+ "version": "V1.8.0",
"source": {
"type": "git",
"url": "https://github.com/mcamara/laravel-localization.git",
- "reference": "13a51715f8e066b0bfb637fd9065d7496c3579ec"
+ "reference": "9b1779a963c1779d1977d8ad0558a681608e3ec1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/13a51715f8e066b0bfb637fd9065d7496c3579ec",
- "reference": "13a51715f8e066b0bfb637fd9065d7496c3579ec",
+ "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/9b1779a963c1779d1977d8ad0558a681608e3ec1",
+ "reference": "9b1779a963c1779d1977d8ad0558a681608e3ec1",
"shasum": ""
},
"require": {
- "laravel/framework": "~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0",
+ "laravel/framework": "~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0||^9.0|^10.0",
"php": ">=7.1.0"
},
"require-dev": {
- "orchestra/testbench-browser-kit": "~3.4|~3.8|~4.0",
- "phpunit/phpunit": "6.0.*|^8.0"
+ "orchestra/testbench-browser-kit": "~3.4|~3.8|~4.0|^7.12",
+ "phpunit/phpunit": "6.0.*|^8.0|^9.5.10"
},
"suggest": {
"ext-intl": "*"
@@ -3022,7 +3150,7 @@
],
"support": {
"issues": "https://github.com/mcamara/laravel-localization/issues",
- "source": "https://github.com/mcamara/laravel-localization/tree/master"
+ "source": "https://github.com/mcamara/laravel-localization/tree/V1.8.0"
},
"funding": [
{
@@ -3034,7 +3162,7 @@
"type": "github"
}
],
- "time": "2020-03-05T15:19:05+00:00"
+ "time": "2023-02-18T15:43:23+00:00"
},
{
"name": "monolog/monolog",
@@ -3204,69 +3332,6 @@
},
"time": "2024-09-04T18:46:31+00:00"
},
- {
- "name": "myclabs/php-enum",
- "version": "1.8.5",
- "source": {
- "type": "git",
- "url": "https://github.com/myclabs/php-enum.git",
- "reference": "e7be26966b7398204a234f8673fdad5ac6277802"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802",
- "reference": "e7be26966b7398204a234f8673fdad5ac6277802",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "php": "^7.3 || ^8.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.5",
- "squizlabs/php_codesniffer": "1.*",
- "vimeo/psalm": "^4.6.2 || ^5.2"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "MyCLabs\\Enum\\": "src/"
- },
- "classmap": [
- "stubs/Stringable.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP Enum contributors",
- "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
- }
- ],
- "description": "PHP Enum implementation",
- "homepage": "https://github.com/myclabs/php-enum",
- "keywords": [
- "enum"
- ],
- "support": {
- "issues": "https://github.com/myclabs/php-enum/issues",
- "source": "https://github.com/myclabs/php-enum/tree/1.8.5"
- },
- "funding": [
- {
- "url": "https://github.com/mnapoli",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
- "type": "tidelift"
- }
- ],
- "time": "2025-01-14T11:49:03+00:00"
- },
{
"name": "nesbot/carbon",
"version": "2.73.0",
@@ -3374,6 +3439,154 @@
],
"time": "2025-01-08T20:10:23+00:00"
},
+ {
+ "name": "nette/schema",
+ "version": "v1.2.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nette/schema.git",
+ "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a",
+ "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a",
+ "shasum": ""
+ },
+ "require": {
+ "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
+ "php": "7.1 - 8.3"
+ },
+ "require-dev": {
+ "nette/tester": "^2.3 || ^2.4",
+ "phpstan/phpstan-nette": "^1.0",
+ "tracy/tracy": "^2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause",
+ "GPL-2.0-only",
+ "GPL-3.0-only"
+ ],
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "https://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "https://nette.org/contributors"
+ }
+ ],
+ "description": "📐 Nette Schema: validating data structures against a given Schema.",
+ "homepage": "https://nette.org",
+ "keywords": [
+ "config",
+ "nette"
+ ],
+ "support": {
+ "issues": "https://github.com/nette/schema/issues",
+ "source": "https://github.com/nette/schema/tree/v1.2.5"
+ },
+ "time": "2023-10-05T20:37:59+00:00"
+ },
+ {
+ "name": "nette/utils",
+ "version": "v3.2.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nette/utils.git",
+ "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nette/utils/zipball/a4175c62652f2300c8017fb7e640f9ccb11648d2",
+ "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2 <8.4"
+ },
+ "conflict": {
+ "nette/di": "<3.0.6"
+ },
+ "require-dev": {
+ "jetbrains/phpstorm-attributes": "dev-master",
+ "nette/tester": "~2.0",
+ "phpstan/phpstan": "^1.0",
+ "tracy/tracy": "^2.3"
+ },
+ "suggest": {
+ "ext-gd": "to use Image",
+ "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()",
+ "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
+ "ext-json": "to use Nette\\Utils\\Json",
+ "ext-mbstring": "to use Strings::lower() etc...",
+ "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()",
+ "ext-xml": "to use Strings::length() etc. when mbstring is not available"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause",
+ "GPL-2.0-only",
+ "GPL-3.0-only"
+ ],
+ "authors": [
+ {
+ "name": "David Grudl",
+ "homepage": "https://davidgrudl.com"
+ },
+ {
+ "name": "Nette Community",
+ "homepage": "https://nette.org/contributors"
+ }
+ ],
+ "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
+ "homepage": "https://nette.org",
+ "keywords": [
+ "array",
+ "core",
+ "datetime",
+ "images",
+ "json",
+ "nette",
+ "paginator",
+ "password",
+ "slugify",
+ "string",
+ "unicode",
+ "utf-8",
+ "utility",
+ "validation"
+ ],
+ "support": {
+ "issues": "https://github.com/nette/utils/issues",
+ "source": "https://github.com/nette/utils/tree/v3.2.10"
+ },
+ "time": "2023-07-30T15:38:18+00:00"
+ },
{
"name": "nikic/php-parser",
"version": "v4.19.5",
@@ -3492,20 +3705,19 @@
},
{
"name": "phpoffice/phpspreadsheet",
- "version": "1.30.4",
+ "version": "1.12.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
- "reference": "02970383cc12e7bf0bc0707ea6e2e8ed23a7aec9"
+ "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/02970383cc12e7bf0bc0707ea6e2e8ed23a7aec9",
- "reference": "02970383cc12e7bf0bc0707ea6e2e8ed23a7aec9",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/f79611d6dc1f6b7e8e30b738fc371b392001dbfd",
+ "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd",
"shasum": ""
},
"require": {
- "composer/pcre": "^1||^2||^3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
@@ -3519,31 +3731,24 @@
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
- "ezyang/htmlpurifier": "^4.15",
- "maennchen/zipstream-php": "^2.1 || ^3.0",
- "markbaker/complex": "^3.0",
- "markbaker/matrix": "^3.0",
- "php": ">=7.4.0 <8.5.0",
- "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+ "markbaker/complex": "^1.4",
+ "markbaker/matrix": "^1.2",
+ "php": "^7.1",
+ "psr/simple-cache": "^1.0"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
- "doctrine/instantiator": "^1.5",
- "dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
- "friendsofphp/php-cs-fixer": "^3.2",
- "mitoteam/jpgraph": "^10.3",
- "mpdf/mpdf": "^8.1.1",
+ "dompdf/dompdf": "^0.8.3",
+ "friendsofphp/php-cs-fixer": "^2.16",
+ "jpgraph/jpgraph": "^4.0",
+ "mpdf/mpdf": "^8.0",
"phpcompatibility/php-compatibility": "^9.3",
- "phpstan/phpstan": "^1.1",
- "phpstan/phpstan-phpunit": "^1.0",
- "phpunit/phpunit": "^8.5 || ^9.0",
- "squizlabs/php_codesniffer": "^3.7",
- "tecnickcom/tcpdf": "^6.5"
+ "phpunit/phpunit": "^7.5",
+ "squizlabs/php_codesniffer": "^3.5",
+ "tecnickcom/tcpdf": "^6.3"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
- "ext-intl": "PHP Internationalization Functions",
- "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+ "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
@@ -3575,9 +3780,6 @@
},
{
"name": "Adrien Crivelli"
- },
- {
- "name": "Owen Leibman"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
@@ -3594,9 +3796,9 @@
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
- "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.30.4"
+ "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.12.0"
},
- "time": "2026-04-19T06:00:39+00:00"
+ "time": "2020-04-27T08:12:48+00:00"
},
{
"name": "phpoption/phpoption",
@@ -3930,18 +4132,125 @@
},
"time": "2019-01-08T18:20:26+00:00"
},
+ {
+ "name": "psr/http-client",
+ "version": "1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Client\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
+ "keywords": [
+ "http",
+ "http-client",
+ "psr",
+ "psr-18"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-client"
+ },
+ "time": "2023-09-23T14:17:50+00:00"
+ },
+ {
+ "name": "psr/http-factory",
+ "version": "1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory"
+ },
+ "time": "2024-04-15T12:06:14+00:00"
+ },
{
"name": "psr/http-message",
- "version": "1.1",
+ "version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
- "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
- "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
@@ -3950,7 +4259,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -3965,7 +4274,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
@@ -3979,9 +4288,9 @@
"response"
],
"support": {
- "source": "https://github.com/php-fig/http-message/tree/1.1"
+ "source": "https://github.com/php-fig/http-message/tree/2.0"
},
- "time": "2023-04-04T09:50:52+00:00"
+ "time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/log",
@@ -5158,16 +5467,16 @@
},
{
"name": "symfony/http-kernel",
- "version": "v5.4.52",
+ "version": "v5.4.53",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "bc30eed68e20ad16e6c9885075eac81a8eca08a5"
+ "reference": "ff18e126cc514769d03f1b2487567a4b85fc7ca6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/bc30eed68e20ad16e6c9885075eac81a8eca08a5",
- "reference": "bc30eed68e20ad16e6c9885075eac81a8eca08a5",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ff18e126cc514769d03f1b2487567a4b85fc7ca6",
+ "reference": "ff18e126cc514769d03f1b2487567a4b85fc7ca6",
"shasum": ""
},
"require": {
@@ -5251,7 +5560,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v5.4.52"
+ "source": "https://github.com/symfony/http-kernel/tree/v5.4.53"
},
"funding": [
{
@@ -5271,7 +5580,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-20T08:20:12+00:00"
+ "time": "2026-05-27T08:14:55+00:00"
},
{
"name": "symfony/mime",
@@ -6180,16 +6489,16 @@
},
{
"name": "symfony/routing",
- "version": "v5.4.52",
+ "version": "v5.4.53",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "275b31328b2e58cab004be0cf086380e2a5c5ee7"
+ "reference": "f4ca0c533854c26e3b27e981da760807f89e1a42"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/275b31328b2e58cab004be0cf086380e2a5c5ee7",
- "reference": "275b31328b2e58cab004be0cf086380e2a5c5ee7",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/f4ca0c533854c26e3b27e981da760807f89e1a42",
+ "reference": "f4ca0c533854c26e3b27e981da760807f89e1a42",
"shasum": ""
},
"require": {
@@ -6250,7 +6559,7 @@
"url"
],
"support": {
- "source": "https://github.com/symfony/routing/tree/v5.4.52"
+ "source": "https://github.com/symfony/routing/tree/v5.4.53"
},
"funding": [
{
@@ -6270,7 +6579,7 @@
"type": "tidelift"
}
],
- "time": "2026-04-16T14:40:03+00:00"
+ "time": "2026-05-22T19:02:28+00:00"
},
{
"name": "symfony/service-contracts",
@@ -6813,41 +7122,43 @@
},
{
"name": "vlucas/phpdotenv",
- "version": "v4.3.0",
+ "version": "v5.6.3",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
- "reference": "67a491df68208bef8c37092db11fa3885008efcf"
+ "reference": "955e7815d677a3eaa7075231212f2110983adecc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/67a491df68208bef8c37092db11fa3885008efcf",
- "reference": "67a491df68208bef8c37092db11fa3885008efcf",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc",
+ "reference": "955e7815d677a3eaa7075231212f2110983adecc",
"shasum": ""
},
"require": {
- "php": "^5.5.9 || ^7.0 || ^8.0",
- "phpoption/phpoption": "^1.7.3",
- "symfony/polyfill-ctype": "^1.17"
+ "ext-pcre": "*",
+ "graham-campbell/result-type": "^1.1.4",
+ "php": "^7.2.5 || ^8.0",
+ "phpoption/phpoption": "^1.9.5",
+ "symfony/polyfill-ctype": "^1.26",
+ "symfony/polyfill-mbstring": "^1.26",
+ "symfony/polyfill-php80": "^1.26"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
+ "bamarni/composer-bin-plugin": "^1.8.2",
"ext-filter": "*",
- "ext-pcre": "*",
- "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.30"
+ "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
},
"suggest": {
- "ext-filter": "Required to use the boolean validator.",
- "ext-pcre": "Required to use most of the library."
+ "ext-filter": "Required to use the boolean validator."
},
"type": "library",
"extra": {
"bamarni-bin": {
"bin-links": true,
- "forward-command": true
+ "forward-command": false
},
"branch-alias": {
- "dev-master": "4.3-dev"
+ "dev-master": "5.6-dev"
}
},
"autoload": {
@@ -6879,7 +7190,7 @@
],
"support": {
"issues": "https://github.com/vlucas/phpdotenv/issues",
- "source": "https://github.com/vlucas/phpdotenv/tree/v4.3.0"
+ "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3"
},
"funding": [
{
@@ -6891,7 +7202,7 @@
"type": "tidelift"
}
],
- "time": "2022-10-16T00:51:09+00:00"
+ "time": "2025-12-27T19:49:13+00:00"
},
{
"name": "voku/portable-ascii",
@@ -7982,35 +8293,34 @@
},
{
"name": "nunomaduro/collision",
- "version": "v4.3.0",
+ "version": "v5.11.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
- "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e"
+ "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c125dc2463f3e144ddc7e05e63077109508c94e",
- "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e",
+ "url": "https://api.github.com/repos/nunomaduro/collision/zipball/8b610eef8582ccdc05d8f2ab23305e2d37049461",
+ "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461",
"shasum": ""
},
"require": {
"facade/ignition-contracts": "^1.0",
- "filp/whoops": "^2.4",
- "php": "^7.2.5 || ^8.0",
+ "filp/whoops": "^2.14.3",
+ "php": "^7.3 || ^8.0",
"symfony/console": "^5.0"
},
"require-dev": {
- "facade/ignition": "^2.0",
- "fideloper/proxy": "^4.2",
- "friendsofphp/php-cs-fixer": "^2.16",
- "fruitcake/laravel-cors": "^1.0",
- "laravel/framework": "^7.0",
- "laravel/tinker": "^2.0",
- "nunomaduro/larastan": "^0.6",
- "orchestra/testbench": "^5.0",
- "phpstan/phpstan": "^0.12.3",
- "phpunit/phpunit": "^8.5.1 || ^9.0"
+ "brianium/paratest": "^6.1",
+ "fideloper/proxy": "^4.4.1",
+ "fruitcake/laravel-cors": "^2.0.3",
+ "laravel/framework": "8.x-dev",
+ "nunomaduro/larastan": "^0.6.2",
+ "nunomaduro/mock-final-classes": "^1.0",
+ "orchestra/testbench": "^6.0",
+ "phpstan/phpstan": "^0.12.64",
+ "phpunit/phpunit": "^9.5.0"
},
"type": "library",
"extra": {
@@ -8054,7 +8364,7 @@
},
"funding": [
{
- "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
+ "url": "https://www.paypal.com/paypalme/enunomaduro",
"type": "custom"
},
{
@@ -8066,7 +8376,7 @@
"type": "patreon"
}
],
- "time": "2020-10-29T15:12:23+00:00"
+ "time": "2022-01-10T16:22:52+00:00"
},
{
"name": "phar-io/manifest",
@@ -8726,7 +9036,6 @@
"type": "github"
}
],
- "abandoned": true,
"time": "2020-10-26T13:08:54+00:00"
},
{
@@ -8782,7 +9091,6 @@
"type": "github"
}
],
- "abandoned": true,
"time": "2020-09-28T05:30:19+00:00"
},
{
@@ -9873,16 +10181,16 @@
},
{
"name": "symfony/yaml",
- "version": "v5.4.52",
+ "version": "v5.4.53",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "b0b27055f055f0d314c5c68ed0c10f0bbd90aee0"
+ "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/b0b27055f055f0d314c5c68ed0c10f0bbd90aee0",
- "reference": "b0b27055f055f0d314c5c68ed0c10f0bbd90aee0",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77",
+ "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77",
"shasum": ""
},
"require": {
@@ -9928,7 +10236,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/yaml/tree/v5.4.52"
+ "source": "https://github.com/symfony/yaml/tree/v5.4.53"
},
"funding": [
{
@@ -9948,7 +10256,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-15T06:40:16+00:00"
+ "time": "2026-05-20T17:13:41+00:00"
},
{
"name": "theseer/tokenizer",
diff --git a/phpunit.xml b/phpunit.xml
index 2261eb2e..b392b271 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,5 +1,8 @@
-./tests/Feature
-
-
+
+
./app
-
-
+
+
@@ -29,5 +32,6 @@
+
-
+
\ No newline at end of file
From 1f8d5a6d41f143ae5a19e2284735a7d96d378b70 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 28 May 2026 16:38:58 +0200
Subject: [PATCH 047/127] restore token driver + replace
iatstuti/laravel-cascade-soft-deletes by dyrynda/laravel-cascade-soft-deletes
---
app/Device.php | 2 +-
app/Group.php | 2 +-
app/Hive.php | 2 +-
app/Inspection.php | 2 +-
app/Location.php | 2 +-
app/Queen.php | 2 +-
composer.json | 3 +-
composer.lock | 95 +++++++++++++++++++++++-----------------------
config/auth.php | 8 +++-
9 files changed, 61 insertions(+), 57 deletions(-)
diff --git a/app/Device.php b/app/Device.php
index 199784fb..ec13f266 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -7,7 +7,7 @@
use Auth;
use Cache;
use DB;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Group.php b/app/Group.php
index 7cbd3914..216e7b3d 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -5,7 +5,7 @@
use Auth;
use Cache;
use DB;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Hive.php b/app/Hive.php
index 99925d92..fb215f42 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -4,7 +4,7 @@
use Auth;
use Cache;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
diff --git a/app/Inspection.php b/app/Inspection.php
index cff956be..ea22b083 100644
--- a/app/Inspection.php
+++ b/app/Inspection.php
@@ -4,7 +4,7 @@
use Auth;
use Cache;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Location.php b/app/Location.php
index cde477fa..4284e5d1 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -4,7 +4,7 @@
use Auth;
use Cache;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
diff --git a/app/Queen.php b/app/Queen.php
index d949bd19..1c24a14f 100644
--- a/app/Queen.php
+++ b/app/Queen.php
@@ -3,7 +3,7 @@
namespace App;
use Cache;
-use Iatstuti\Database\Support\CascadeSoftDeletes;
+use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/composer.json b/composer.json
index 4dd3d98b..b80188b4 100644
--- a/composer.json
+++ b/composer.json
@@ -16,12 +16,11 @@
"require": {
"php": ">=7.4",
"doctrine/dbal": "^2.13",
+ "dyrynda/laravel-cascade-soft-deletes": "4.1",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
"fruitcake/laravel-cors": "^2.0.4",
"guzzlehttp/guzzle": "^7.0.1",
- "iatstuti/laravel-cascade-soft-deletes": "^4.0",
- "influxdb/influxdb-php": "^1.15",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
"laravel/framework": "^8.83",
diff --git a/composer.lock b/composer.lock
index 8f56daf9..b4c87e37 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "bf09585ed3f577944694c6a4491bb7cf",
+ "content-hash": "6cd218ac8731ae9d161724db8af584ff",
"packages": [
{
"name": "asm89/stack-cors",
@@ -991,6 +991,52 @@
],
"time": "2025-10-31T18:36:32+00:00"
},
+ {
+ "name": "dyrynda/laravel-cascade-soft-deletes",
+ "version": "4.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
+ "reference": "dcfd120af3467901444a155ece03d8326efb53b3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/dcfd120af3467901444a155ece03d8326efb53b3",
+ "reference": "dcfd120af3467901444a155ece03d8326efb53b3",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/database": "^8.12",
+ "illuminate/events": "^8.12",
+ "php": "^7.3|^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "utility",
+ "autoload": {
+ "psr-4": {
+ "Dyrynda\\Database\\Support\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Michael Dyrynda",
+ "email": "michael@dyrynda.com.au",
+ "homepage": "https://dyrynda.com.au"
+ }
+ ],
+ "description": "Cascading deletes for Eloquent models that implement soft deletes",
+ "support": {
+ "issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.1.0"
+ },
+ "time": "2020-12-01T02:43:25+00:00"
+ },
{
"name": "egulias/email-validator",
"version": "2.1.25",
@@ -1649,53 +1695,6 @@
],
"time": "2026-05-27T11:48:20+00:00"
},
- {
- "name": "iatstuti/laravel-cascade-soft-deletes",
- "version": "4.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
- "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
- "shasum": ""
- },
- "require": {
- "illuminate/database": "^8.12|^9.0",
- "illuminate/events": "^8.12|^9.0",
- "php": "^7.3|^8.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "utility",
- "autoload": {
- "psr-4": {
- "Dyrynda\\Database\\Support\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dyrynda",
- "email": "michael@dyrynda.com.au",
- "homepage": "https://dyrynda.com.au"
- }
- ],
- "description": "Cascading deletes for Eloquent models that implement soft deletes",
- "support": {
- "issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.2.1"
- },
- "abandoned": "dyrynda/laravel-cascade-soft-deletes",
- "time": "2022-11-22T03:11:30+00:00"
- },
{
"name": "influxdb/influxdb-php",
"version": "1.15.2",
diff --git a/config/auth.php b/config/auth.php
index 55afa181..f554c077 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -31,7 +31,7 @@
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
- | Supported: "session"
+ | Supported: "session", "token"
|
*/
@@ -40,6 +40,12 @@
'driver' => 'session',
'provider' => 'users',
],
+ 'api' => [
+ 'driver' => 'token',
+ 'provider' => 'users',
+ 'hash' => false,
+ ],
+
],
/*
From 5bdc0f65259b466e2e2d6a3bdfb31e7c6e0b1389 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:49 +0000
Subject: [PATCH 048/127] Move `resources/lang` folder
---
{resources/lang => lang}/en/alert.php | 0
{resources/lang => lang}/en/auth.php | 0
{resources/lang => lang}/en/beep.php | 0
{resources/lang => lang}/en/crud.php | 0
{resources/lang => lang}/en/export.php | 0
{resources/lang => lang}/en/general.php | 0
{resources/lang => lang}/en/group.php | 0
{resources/lang => lang}/en/pagination.php | 0
{resources/lang => lang}/en/passwords.php | 0
{resources/lang => lang}/en/samplecode.php | 0
{resources/lang => lang}/en/taxonomy.php | 0
{resources/lang => lang}/en/validation.php | 0
{resources/lang => lang}/nl.json | 0
{resources/lang => lang}/nl/alert.php | 0
{resources/lang => lang}/nl/auth.php | 0
{resources/lang => lang}/nl/beep.php | 0
{resources/lang => lang}/nl/crud.php | 0
{resources/lang => lang}/nl/export.php | 0
{resources/lang => lang}/nl/general.php | 0
{resources/lang => lang}/nl/group.php | 0
{resources/lang => lang}/nl/pagination.php | 0
{resources/lang => lang}/nl/passwords.php | 0
{resources/lang => lang}/nl/samplecode.php | 0
{resources/lang => lang}/nl/taxonomy.php | 0
{resources/lang => lang}/nl/validation.php | 0
25 files changed, 0 insertions(+), 0 deletions(-)
rename {resources/lang => lang}/en/alert.php (100%)
rename {resources/lang => lang}/en/auth.php (100%)
rename {resources/lang => lang}/en/beep.php (100%)
rename {resources/lang => lang}/en/crud.php (100%)
rename {resources/lang => lang}/en/export.php (100%)
rename {resources/lang => lang}/en/general.php (100%)
rename {resources/lang => lang}/en/group.php (100%)
rename {resources/lang => lang}/en/pagination.php (100%)
rename {resources/lang => lang}/en/passwords.php (100%)
rename {resources/lang => lang}/en/samplecode.php (100%)
rename {resources/lang => lang}/en/taxonomy.php (100%)
rename {resources/lang => lang}/en/validation.php (100%)
rename {resources/lang => lang}/nl.json (100%)
rename {resources/lang => lang}/nl/alert.php (100%)
rename {resources/lang => lang}/nl/auth.php (100%)
rename {resources/lang => lang}/nl/beep.php (100%)
rename {resources/lang => lang}/nl/crud.php (100%)
rename {resources/lang => lang}/nl/export.php (100%)
rename {resources/lang => lang}/nl/general.php (100%)
rename {resources/lang => lang}/nl/group.php (100%)
rename {resources/lang => lang}/nl/pagination.php (100%)
rename {resources/lang => lang}/nl/passwords.php (100%)
rename {resources/lang => lang}/nl/samplecode.php (100%)
rename {resources/lang => lang}/nl/taxonomy.php (100%)
rename {resources/lang => lang}/nl/validation.php (100%)
diff --git a/resources/lang/en/alert.php b/lang/en/alert.php
similarity index 100%
rename from resources/lang/en/alert.php
rename to lang/en/alert.php
diff --git a/resources/lang/en/auth.php b/lang/en/auth.php
similarity index 100%
rename from resources/lang/en/auth.php
rename to lang/en/auth.php
diff --git a/resources/lang/en/beep.php b/lang/en/beep.php
similarity index 100%
rename from resources/lang/en/beep.php
rename to lang/en/beep.php
diff --git a/resources/lang/en/crud.php b/lang/en/crud.php
similarity index 100%
rename from resources/lang/en/crud.php
rename to lang/en/crud.php
diff --git a/resources/lang/en/export.php b/lang/en/export.php
similarity index 100%
rename from resources/lang/en/export.php
rename to lang/en/export.php
diff --git a/resources/lang/en/general.php b/lang/en/general.php
similarity index 100%
rename from resources/lang/en/general.php
rename to lang/en/general.php
diff --git a/resources/lang/en/group.php b/lang/en/group.php
similarity index 100%
rename from resources/lang/en/group.php
rename to lang/en/group.php
diff --git a/resources/lang/en/pagination.php b/lang/en/pagination.php
similarity index 100%
rename from resources/lang/en/pagination.php
rename to lang/en/pagination.php
diff --git a/resources/lang/en/passwords.php b/lang/en/passwords.php
similarity index 100%
rename from resources/lang/en/passwords.php
rename to lang/en/passwords.php
diff --git a/resources/lang/en/samplecode.php b/lang/en/samplecode.php
similarity index 100%
rename from resources/lang/en/samplecode.php
rename to lang/en/samplecode.php
diff --git a/resources/lang/en/taxonomy.php b/lang/en/taxonomy.php
similarity index 100%
rename from resources/lang/en/taxonomy.php
rename to lang/en/taxonomy.php
diff --git a/resources/lang/en/validation.php b/lang/en/validation.php
similarity index 100%
rename from resources/lang/en/validation.php
rename to lang/en/validation.php
diff --git a/resources/lang/nl.json b/lang/nl.json
similarity index 100%
rename from resources/lang/nl.json
rename to lang/nl.json
diff --git a/resources/lang/nl/alert.php b/lang/nl/alert.php
similarity index 100%
rename from resources/lang/nl/alert.php
rename to lang/nl/alert.php
diff --git a/resources/lang/nl/auth.php b/lang/nl/auth.php
similarity index 100%
rename from resources/lang/nl/auth.php
rename to lang/nl/auth.php
diff --git a/resources/lang/nl/beep.php b/lang/nl/beep.php
similarity index 100%
rename from resources/lang/nl/beep.php
rename to lang/nl/beep.php
diff --git a/resources/lang/nl/crud.php b/lang/nl/crud.php
similarity index 100%
rename from resources/lang/nl/crud.php
rename to lang/nl/crud.php
diff --git a/resources/lang/nl/export.php b/lang/nl/export.php
similarity index 100%
rename from resources/lang/nl/export.php
rename to lang/nl/export.php
diff --git a/resources/lang/nl/general.php b/lang/nl/general.php
similarity index 100%
rename from resources/lang/nl/general.php
rename to lang/nl/general.php
diff --git a/resources/lang/nl/group.php b/lang/nl/group.php
similarity index 100%
rename from resources/lang/nl/group.php
rename to lang/nl/group.php
diff --git a/resources/lang/nl/pagination.php b/lang/nl/pagination.php
similarity index 100%
rename from resources/lang/nl/pagination.php
rename to lang/nl/pagination.php
diff --git a/resources/lang/nl/passwords.php b/lang/nl/passwords.php
similarity index 100%
rename from resources/lang/nl/passwords.php
rename to lang/nl/passwords.php
diff --git a/resources/lang/nl/samplecode.php b/lang/nl/samplecode.php
similarity index 100%
rename from resources/lang/nl/samplecode.php
rename to lang/nl/samplecode.php
diff --git a/resources/lang/nl/taxonomy.php b/lang/nl/taxonomy.php
similarity index 100%
rename from resources/lang/nl/taxonomy.php
rename to lang/nl/taxonomy.php
diff --git a/resources/lang/nl/validation.php b/lang/nl/validation.php
similarity index 100%
rename from resources/lang/nl/validation.php
rename to lang/nl/validation.php
From 7528224cdc8999d5b4e6a0384472e8c6d7ac8240 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:50 +0000
Subject: [PATCH 049/127] Shift registered middleware
---
app/Http/Kernel.php | 2 +-
app/Http/Middleware/ValidateSignature.php | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 app/Http/Middleware/ValidateSignature.php
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index ffcbb8cc..ac480245 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -32,7 +32,6 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
- // \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
@@ -53,6 +52,7 @@ class Kernel extends HttpKernel
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
+ 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php
new file mode 100644
index 00000000..093bf64a
--- /dev/null
+++ b/app/Http/Middleware/ValidateSignature.php
@@ -0,0 +1,22 @@
+
+ */
+ protected $except = [
+ // 'fbclid',
+ // 'utm_campaign',
+ // 'utm_content',
+ // 'utm_medium',
+ // 'utm_source',
+ // 'utm_term',
+ ];
+}
From 8fcf24be65ef8e09ba6d639904bc2948212f7a10 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:50 +0000
Subject: [PATCH 050/127] Remove `fruitcake/laravel-cors` dependency
---
app/Http/Kernel.php | 2 +-
composer.json | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index ac480245..cf026d75 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -19,7 +19,7 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
- \Fruitcake\Cors\HandleCors::class,
+ \Illuminate\Http\Middleware\HandleCors::class,
];
/**
diff --git a/composer.json b/composer.json
index b80188b4..aa20bb8e 100644
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,6 @@
"dyrynda/laravel-cascade-soft-deletes": "4.1",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
- "fruitcake/laravel-cors": "^2.0.4",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
From e74424c19b9a96dc5b099812f2c017bf6312d5e4 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:50 +0000
Subject: [PATCH 051/127] Streamline `$commands` property
---
app/Console/Kernel.php | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 61422433..20c28a7c 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -10,15 +10,6 @@
class Kernel extends ConsoleKernel
{
- /**
- * The Artisan commands provided by your application.
- *
- * @var array
- */
- protected $commands = [
- //
- ];
-
/**
* Define the application's command schedule.
*
From 4de094ee603d3ca0fa673a86eab0cf45b7954723 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:50 +0000
Subject: [PATCH 052/127] Upgrade to Flysystem 3.0
---
composer.json | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/composer.json b/composer.json
index aa20bb8e..cbbbbb5d 100644
--- a/composer.json
+++ b/composer.json
@@ -26,8 +26,7 @@
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.2",
- "league/flysystem-aws-s3-v3": "~1.0",
- "league/flysystem-cached-adapter": "~1.0",
+ "league/flysystem-aws-s3-v3": "^3.0",
"mcamara/laravel-localization": "^1.6",
"phpoffice/phpspreadsheet": "^1.2",
"predis/predis": "^2.2",
From e022b71bbfd2ec8449c7b59f85c7b139b52fcd86 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:51 +0000
Subject: [PATCH 053/127] Shift core files
---
app/Providers/EventServiceProvider.php | 11 ++++++
lang/en/validation.php | 55 ++++++++++++++++++--------
server.php | 19 ---------
3 files changed, 49 insertions(+), 36 deletions(-)
delete mode 100644 server.php
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 4a572335..7b2f9bb6 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -33,4 +33,15 @@ public function boot()
//
}
+
+ /**
+ * Determine if events and listeners should be automatically discovered.
+ *
+ * @return bool
+ */
+ public function shouldDiscoverEvents()
+ {
+ return false;
+ }
}
+
diff --git a/lang/en/validation.php b/lang/en/validation.php
index 783003cf..70407c9d 100755
--- a/lang/en/validation.php
+++ b/lang/en/validation.php
@@ -22,13 +22,14 @@
'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
'alpha_num' => 'The :attribute must only contain letters and numbers.',
'array' => 'The :attribute must be an array.',
+ 'ascii' => 'The :attribute must only contain single-byte alphanumeric characters and symbols.',
'before' => 'The :attribute must be a date before :date.',
'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
'between' => [
- 'numeric' => 'The :attribute must be between :min and :max.',
+ 'array' => 'The :attribute must have between :min and :max items.',
'file' => 'The :attribute must be between :min and :max kilobytes.',
+ 'numeric' => 'The :attribute must be between :min and :max.',
'string' => 'The :attribute must be between :min and :max characters.',
- 'array' => 'The :attribute must have between :min and :max items.',
],
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
@@ -36,6 +37,7 @@
'date' => 'The :attribute is not a valid date.',
'date_equals' => 'The :attribute must be a date equal to :date.',
'date_format' => 'The :attribute does not match the format :format.',
+ 'decimal' => 'The :attribute must have :decimal decimal places.',
'declined' => 'The :attribute must be declined.',
'declined_if' => 'The :attribute must be declined when :other is :value.',
'different' => 'The :attribute and :other must be different.',
@@ -43,6 +45,8 @@
'digits_between' => 'The :attribute must be between :min and :max digits.',
'dimensions' => 'The :attribute has invalid image dimensions.',
'distinct' => 'The :attribute field has a duplicate value.',
+ 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.',
+ 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.',
'email' => 'The :attribute must be a valid email address.',
'ends_with' => 'The :attribute must end with one of the following: :values.',
'enum' => 'The selected :attribute is invalid.',
@@ -50,16 +54,16 @@
'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.',
'gt' => [
- 'numeric' => 'The :attribute must be greater than :value.',
+ 'array' => 'The :attribute must have more than :value items.',
'file' => 'The :attribute must be greater than :value kilobytes.',
+ 'numeric' => 'The :attribute must be greater than :value.',
'string' => 'The :attribute must be greater than :value characters.',
- 'array' => 'The :attribute must have more than :value items.',
],
'gte' => [
- 'numeric' => 'The :attribute must be greater than or equal to :value.',
+ 'array' => 'The :attribute must have :value items or more.',
'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
+ 'numeric' => 'The :attribute must be greater than or equal to :value.',
'string' => 'The :attribute must be greater than or equal to :value characters.',
- 'array' => 'The :attribute must have :value items or more.',
],
'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.',
@@ -69,38 +73,52 @@
'ipv4' => 'The :attribute must be a valid IPv4 address.',
'ipv6' => 'The :attribute must be a valid IPv6 address.',
'json' => 'The :attribute must be a valid JSON string.',
+ 'lowercase' => 'The :attribute must be lowercase.',
'lt' => [
- 'numeric' => 'The :attribute must be less than :value.',
+ 'array' => 'The :attribute must have less than :value items.',
'file' => 'The :attribute must be less than :value kilobytes.',
+ 'numeric' => 'The :attribute must be less than :value.',
'string' => 'The :attribute must be less than :value characters.',
- 'array' => 'The :attribute must have less than :value items.',
],
'lte' => [
- 'numeric' => 'The :attribute must be less than or equal to :value.',
+ 'array' => 'The :attribute must not have more than :value items.',
'file' => 'The :attribute must be less than or equal to :value kilobytes.',
+ 'numeric' => 'The :attribute must be less than or equal to :value.',
'string' => 'The :attribute must be less than or equal to :value characters.',
- 'array' => 'The :attribute must not have more than :value items.',
],
'mac_address' => 'The :attribute must be a valid MAC address.',
'max' => [
- 'numeric' => 'The :attribute must not be greater than :max.',
+ 'array' => 'The :attribute must not have more than :max items.',
'file' => 'The :attribute must not be greater than :max kilobytes.',
+ 'numeric' => 'The :attribute must not be greater than :max.',
'string' => 'The :attribute must not be greater than :max characters.',
- 'array' => 'The :attribute must not have more than :max items.',
],
+ 'max_digits' => 'The :attribute must not have more than :max digits.',
'mimes' => 'The :attribute must be a file of type: :values.',
'mimetypes' => 'The :attribute must be a file of type: :values.',
'min' => [
- 'numeric' => 'The :attribute must be at least :min.',
+ 'array' => 'The :attribute must have at least :min items.',
'file' => 'The :attribute must be at least :min kilobytes.',
+ 'numeric' => 'The :attribute must be at least :min.',
'string' => 'The :attribute must be at least :min characters.',
- 'array' => 'The :attribute must have at least :min items.',
],
+ 'min_digits' => 'The :attribute must have at least :min digits.',
+ 'missing' => 'The :attribute field must be missing.',
+ 'missing_if' => 'The :attribute field must be missing when :other is :value.',
+ 'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
+ 'missing_with' => 'The :attribute field must be missing when :values is present.',
+ 'missing_with_all' => 'The :attribute field must be missing when :values are present.',
'multiple_of' => 'The :attribute must be a multiple of :value.',
'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.',
- 'password' => 'The password is incorrect.',
+ 'password' => [
+ 'letters' => 'The :attribute must contain at least one letter.',
+ 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.',
+ 'numbers' => 'The :attribute must contain at least one number.',
+ 'symbols' => 'The :attribute must contain at least one symbol.',
+ 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
+ ],
'present' => 'The :attribute field must be present.',
'prohibited' => 'The :attribute field is prohibited.',
'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
@@ -110,6 +128,7 @@
'required' => 'The :attribute field is required.',
'required_array_keys' => 'The :attribute field must contain entries for: :values.',
'required_if' => 'The :attribute field is required when :other is :value.',
+ 'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
'required_unless' => 'The :attribute field is required unless :other is in :values.',
'required_with' => 'The :attribute field is required when :values is present.',
'required_with_all' => 'The :attribute field is required when :values are present.',
@@ -117,17 +136,19 @@
'required_without_all' => 'The :attribute field is required when none of :values are present.',
'same' => 'The :attribute and :other must match.',
'size' => [
- 'numeric' => 'The :attribute must be :size.',
+ 'array' => 'The :attribute must contain :size items.',
'file' => 'The :attribute must be :size kilobytes.',
+ 'numeric' => 'The :attribute must be :size.',
'string' => 'The :attribute must be :size characters.',
- 'array' => 'The :attribute must contain :size items.',
],
'starts_with' => 'The :attribute must start with one of the following: :values.',
'string' => 'The :attribute must be a string.',
'timezone' => 'The :attribute must be a valid timezone.',
'unique' => 'The :attribute has already been taken.',
'uploaded' => 'The :attribute failed to upload.',
+ 'uppercase' => 'The :attribute must be uppercase.',
'url' => 'The :attribute must be a valid URL.',
+ 'ulid' => 'The :attribute must be a valid ULID.',
'uuid' => 'The :attribute must be a valid UUID.',
/*
diff --git a/server.php b/server.php
deleted file mode 100644
index b07fa44b..00000000
--- a/server.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
- */
-$uri = urldecode(
- parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
-);
-
-// This file allows us to emulate Apache's "mod_rewrite" functionality from the
-// built-in PHP web server. This provides a convenient way to test a Laravel
-// application without having installed a "real" web server software here.
-if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
- return false;
-}
-
-require_once __DIR__.'/public/index.php';
From 1e3b5ae7b16b0375f897d374c3ad0828fac8f479 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:52 +0000
Subject: [PATCH 054/127] Convert `optional()` to nullsafe operator
---
app/Providers/RouteServiceProvider.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 1e395f74..0ba5291f 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -46,7 +46,7 @@ public function boot()
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
- return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
+ return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
}
}
From a4693085ce6af8e159e1eb6c590a252ca58d767a Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:52 +0000
Subject: [PATCH 055/127] Use Faker methods
Accessing Faker properties was deprecated in Faker 1.14.
---
database/factories/HiveFactory.php | 4 ++--
database/factories/HiveLayerFactory.php | 2 +-
database/factories/LocationFactory.php | 12 ++++++------
database/factories/UserFactory.php | 4 ++--
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/database/factories/HiveFactory.php b/database/factories/HiveFactory.php
index b2208235..e43546cf 100644
--- a/database/factories/HiveFactory.php
+++ b/database/factories/HiveFactory.php
@@ -28,8 +28,8 @@ public function definition()
'user_id' => 1,
'location_id' => 1,
'hive_type_id' => 1,
- 'color' => $this->faker->hexcolor,
- 'name' => $this->faker->name,
+ 'color' => $this->faker->hexColor(),
+ 'name' => $this->faker->name(),
];
}
}
diff --git a/database/factories/HiveLayerFactory.php b/database/factories/HiveLayerFactory.php
index 8ba02cf0..f7f6c350 100644
--- a/database/factories/HiveLayerFactory.php
+++ b/database/factories/HiveLayerFactory.php
@@ -28,7 +28,7 @@ public function definition()
'hive_id' => 1,
'category_id' => 26,
'order' => $this->faker->numberBetween($min = 1, $max = 99),
- 'color' => $this->faker->hexcolor,
+ 'color' => $this->faker->hexColor(),
];
}
diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php
index 233e5ae8..dc2c0673 100644
--- a/database/factories/LocationFactory.php
+++ b/database/factories/LocationFactory.php
@@ -28,13 +28,13 @@ public function definition()
'user_id' => 1,
'continent_id' => 4, // eu
'category_id' => 36, // fixed
- 'name' => $this->faker->name,
- 'coordinate_lat' => $this->faker->latitude,
- 'coordinate_lon' => $this->faker->longitude,
- 'street' => $this->faker->streetName,
+ 'name' => $this->faker->name(),
+ 'coordinate_lat' => $this->faker->latitude(),
+ 'coordinate_lon' => $this->faker->longitude(),
+ 'street' => $this->faker->streetName(),
'street_no' => $this->faker->numberBetween($min = 1, $max = 99),
- 'postal_code' => $this->faker->postcode,
- 'country_code' => $this->faker->country,
+ 'postal_code' => $this->faker->postcode(),
+ 'country_code' => $this->faker->country(),
];
}
}
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index f1c91bf2..43266b29 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -28,8 +28,8 @@ public function definition()
static $password;
return [
- 'name' => $this->faker->name,
- 'email' => $this->faker->unique()->safeEmail,
+ 'name' => $this->faker->name(),
+ 'email' => $this->faker->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => Str::random(10),
From 9a1f343f76ada5882a19e94d3243b5f8a94e5b0c Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:57 +0000
Subject: [PATCH 056/127] Shift config files
---
config/database.php | 2 +-
config/filesystems.php | 2 +-
config/hashing.php | 6 +++---
config/mail.php | 14 +++++++++++---
config/session.php | 8 ++++----
5 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/config/database.php b/config/database.php
index f7bd4327..198090a2 100644
--- a/config/database.php
+++ b/config/database.php
@@ -105,7 +105,7 @@
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
- 'schema' => 'public',
+ 'search_path' => 'public',
'sslmode' => 'prefer',
],
diff --git a/config/filesystems.php b/config/filesystems.php
index f12247f6..a6fd2ab3 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -13,7 +13,7 @@
|
*/
- 'default' => env('FILESYSTEM_DRIVER', 'local'),
+ 'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
diff --git a/config/hashing.php b/config/hashing.php
index 84257708..bcd3be4c 100644
--- a/config/hashing.php
+++ b/config/hashing.php
@@ -44,9 +44,9 @@
*/
'argon' => [
- 'memory' => 1024,
- 'threads' => 2,
- 'time' => 2,
+ 'memory' => 65536,
+ 'threads' => 1,
+ 'time' => 4,
],
];
diff --git a/config/mail.php b/config/mail.php
index 54299aab..534395a3 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -29,7 +29,7 @@
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
- | "postmark", "log", "array"
+ | "postmark", "log", "array", "failover"
|
*/
@@ -42,7 +42,7 @@
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
- 'auth_mode' => null,
+ 'local_domain' => env('MAIL_EHLO_DOMAIN'),
],
'ses' => [
@@ -59,7 +59,7 @@
'sendmail' => [
'transport' => 'sendmail',
- 'path' => '/usr/sbin/sendmail -bs',
+ 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
],
'log' => [
@@ -70,6 +70,14 @@
'array' => [
'transport' => 'array',
],
+
+ 'failover' => [
+ 'transport' => 'failover',
+ 'mailers' => [
+ 'smtp',
+ 'log',
+ ],
+ ],
],
/*
diff --git a/config/session.php b/config/session.php
index 4e0f66cd..8fed97c0 100755
--- a/config/session.php
+++ b/config/session.php
@@ -72,7 +72,7 @@
|
*/
- 'connection' => env('SESSION_CONNECTION', null),
+ 'connection' => env('SESSION_CONNECTION'),
/*
|--------------------------------------------------------------------------
@@ -100,7 +100,7 @@
|
*/
- 'store' => env('SESSION_STORE', null),
+ 'store' => env('SESSION_STORE'),
/*
|--------------------------------------------------------------------------
@@ -155,7 +155,7 @@
|
*/
- 'domain' => env('SESSION_DOMAIN', null),
+ 'domain' => env('SESSION_DOMAIN'),
/*
|--------------------------------------------------------------------------
@@ -164,7 +164,7 @@
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
- | the cookie from being sent to you if it can not be done securely.
+ | the cookie from being sent to you when it can't be done securely.
|
*/
From ae89ddcfc372f02d7aa9301d0d778eb58951ddbc Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:59 +0000
Subject: [PATCH 057/127] Default config files
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
---
config/app.php | 49 +++++------------------------------------
config/auth.php | 4 ++--
config/broadcasting.php | 9 ++++++--
config/cache.php | 8 +++----
config/filesystems.php | 5 ++++-
config/logging.php | 3 ++-
config/services.php | 13 +++++++----
7 files changed, 34 insertions(+), 57 deletions(-)
diff --git a/config/app.php b/config/app.php
index 751e844b..7f986872 100644
--- a/config/app.php
+++ b/config/app.php
@@ -1,5 +1,7 @@
[
-
- 'App' => Illuminate\Support\Facades\App::class,
- 'Artisan' => Illuminate\Support\Facades\Artisan::class,
- 'Auth' => Illuminate\Support\Facades\Auth::class,
- 'Blade' => Illuminate\Support\Facades\Blade::class,
- 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
- 'Bus' => Illuminate\Support\Facades\Bus::class,
- 'Cache' => Illuminate\Support\Facades\Cache::class,
- 'Config' => Illuminate\Support\Facades\Config::class,
- 'Cookie' => Illuminate\Support\Facades\Cookie::class,
- 'Crypt' => Illuminate\Support\Facades\Crypt::class,
- 'Date' => Illuminate\Support\Facades\Date::class,
- 'DB' => Illuminate\Support\Facades\DB::class,
- 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
- 'Event' => Illuminate\Support\Facades\Event::class,
- 'File' => Illuminate\Support\Facades\File::class,
- 'Gate' => Illuminate\Support\Facades\Gate::class,
- 'Hash' => Illuminate\Support\Facades\Hash::class,
- 'Http' => Illuminate\Support\Facades\Http::class,
- 'Js' => Illuminate\Support\Js::class,
- 'Lang' => Illuminate\Support\Facades\Lang::class,
- 'Log' => Illuminate\Support\Facades\Log::class,
- 'Mail' => Illuminate\Support\Facades\Mail::class,
- 'Notification' => Illuminate\Support\Facades\Notification::class,
- 'Password' => Illuminate\Support\Facades\Password::class,
- 'Queue' => Illuminate\Support\Facades\Queue::class,
- 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
- 'Redirect' => Illuminate\Support\Facades\Redirect::class,
- 'Redis' => Illuminate\Support\Facades\Redis::class,
- 'Request' => Illuminate\Support\Facades\Request::class,
- 'Response' => Illuminate\Support\Facades\Response::class,
- 'Route' => Illuminate\Support\Facades\Route::class,
- 'Schema' => Illuminate\Support\Facades\Schema::class,
- 'Session' => Illuminate\Support\Facades\Session::class,
- 'Storage' => Illuminate\Support\Facades\Storage::class,
- 'Str' => Illuminate\Support\Str::class,
- 'URL' => Illuminate\Support\Facades\URL::class,
- 'Validator' => Illuminate\Support\Facades\Validator::class,
- 'View' => Illuminate\Support\Facades\View::class,
+ 'aliases' => Facade::defaultAliases()->merge([
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
+ 'Influx' => TrayLabs\InfluxDB\Facades\InfluxDB::class,
'InterventionImage' => Intervention\Image\Facades\Image::class,
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
- 'Influx' => TrayLabs\InfluxDB\Facades\InfluxDB::class,
- // 'Debugbar' => Barryvdh\Debugbar\Facade::class,
- ],
+ 'Redis' => Illuminate\Support\Facades\Redis::class,
+ ])->toArray(),
];
diff --git a/config/auth.php b/config/auth.php
index f554c077..2231b267 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -31,7 +31,7 @@
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
- | Supported: "session", "token"
+ | Supported: "session"
|
*/
@@ -40,12 +40,12 @@
'driver' => 'session',
'provider' => 'users',
],
+
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
-
],
/*
diff --git a/config/broadcasting.php b/config/broadcasting.php
index 62e5f921..9e4d4aa4 100644
--- a/config/broadcasting.php
+++ b/config/broadcasting.php
@@ -36,9 +36,14 @@
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
- 'cluster' => env('PUSHER_APP_CLUSTER'),
+ 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
+ 'port' => env('PUSHER_PORT', 443),
+ 'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
- 'useTLS' => true,
+ 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
+ ],
+ 'client_options' => [
+ // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],
diff --git a/config/cache.php b/config/cache.php
index 10f1c7b6..8268cc97 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -99,12 +99,12 @@
| Cache Key Prefix
|--------------------------------------------------------------------------
|
- | When utilizing a RAM based store such as APC or Memcached, there might
- | be other applications utilizing the same cache. So, we'll specify a
- | value to get prefixed to all our keys so we can avoid collisions.
+ | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
+ | stores there might be other applications using the same cache. For
+ | that reason, you may prefix every cache key to avoid collisions.
|
*/
- 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
+ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];
diff --git a/config/filesystems.php b/config/filesystems.php
index a6fd2ab3..5fe1f694 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -22,7 +22,7 @@
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
- | been setup for each driver as an example of the required options.
+ | been set up for each driver as an example of the required values.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
@@ -33,6 +33,7 @@
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
+ 'throw' => false,
],
'public' => [
@@ -40,6 +41,7 @@
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
+ 'throw' => false,
],
'icons' => [
@@ -70,6 +72,7 @@
],
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
+ 'throw' => false,
],
],
diff --git a/config/logging.php b/config/logging.php
index cdafce74..1cdf3f9a 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -78,10 +78,11 @@
'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
- 'handler' => SyslogUdpHandler::class,
+ 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
+ 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
],
diff --git a/config/services.php b/config/services.php
index 0ff801f5..dd7122d2 100755
--- a/config/services.php
+++ b/config/services.php
@@ -8,9 +8,9 @@
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
- | as Stripe, Mailgun, SparkPost and others. This file provides a sane
- | default location for this type of information, allowing packages
- | to have a conventional place to find your various credentials.
+ | as Mailgun, Postmark, AWS and more. This file provides the de facto
+ | location for this type of information, allowing packages to have
+ | a conventional file to locate the various service credentials.
|
*/
@@ -18,12 +18,17 @@
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
+ 'scheme' => 'https',
+ ],
+
+ 'postmark' => [
+ 'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
- 'region' => env('SES_REGION', 'us-east-1'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'sparkpost' => [
From 39ee269dff2589b62f5bb22298564b255abe1e82 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:59 +0000
Subject: [PATCH 058/127] Bump Composer dependencies
---
composer.json | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/composer.json b/composer.json
index cbbbbb5d..9979ca93 100644
--- a/composer.json
+++ b/composer.json
@@ -14,35 +14,35 @@
"license": "MIT",
"type": "project",
"require": {
- "php": ">=7.4",
+ "php": "^8.0",
"doctrine/dbal": "^2.13",
- "dyrynda/laravel-cascade-soft-deletes": "4.1",
+ "dyrynda/laravel-cascade-soft-deletes": "^4.2",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
- "guzzlehttp/guzzle": "^7.0.1",
+ "guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
- "laravel/framework": "^8.83",
- "laravel/tinker": "^2.5",
- "laravel/ui": "^3.0",
- "laravelcollective/html": "^6.2",
+ "laravel/framework": "^9.52",
+ "laravel/tinker": "^2.7",
+ "laravel/ui": "^3.3",
+ "laravelcollective/html": "^6.3",
"league/flysystem-aws-s3-v3": "^3.0",
- "mcamara/laravel-localization": "^1.6",
- "phpoffice/phpspreadsheet": "^1.2",
+ "mcamara/laravel-localization": "^1.7",
+ "phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
- "santigarcor/laratrust": "^6.3",
+ "santigarcor/laratrust": "^7.0",
"tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
- "appzcoder/crud-generator": "^3.2",
+ "appzcoder/crud-generator": "^3.3",
"barryvdh/laravel-debugbar": "^3.6",
- "filp/whoops": "^2.0",
+ "filp/whoops": "^2.8",
"knuckleswtf/scribe": "^3.29",
"mockery/mockery": "^1.4.4",
- "nunomaduro/collision": "^5.10",
+ "nunomaduro/collision": "^6.3",
"phpunit/phpunit": "^9.5.10",
- "facade/ignition": "^2.5",
- "fakerphp/faker": "^1.9.1"
+ "fakerphp/faker": "^1.9.1",
+ "spatie/laravel-ignition": "^1.4"
},
"config": {
"optimize-autoloader": true,
From 828be6cc53d239acaab97d9e81f351dc7fe5be44 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:41:59 +0000
Subject: [PATCH 059/127] Use `` tags for configuration
---
phpunit.xml | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/phpunit.xml b/phpunit.xml
index b392b271..d4a3c664 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,26 +1,14 @@
-
+
./tests/Unit
-
./tests/Feature
-
+
./app
@@ -32,6 +20,6 @@ backupGlobals="false"
-
+
-
\ No newline at end of file
+
From b045d2602a4bc3623789ad7580b81a9c108e5466 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:42:08 +0000
Subject: [PATCH 060/127] Adopt anonymous migrations
---
database/migrations/2014_10_12_000000_create_users_table.php | 4 ++--
.../2014_10_12_100000_create_password_resets_table.php | 4 ++--
.../migrations/2016_04_10_115211_create-category-table.php | 4 ++--
.../migrations/2016_04_14_174603_create-location-table.php | 4 ++--
database/migrations/2016_12_20_121758_create_settings.php | 4 ++--
database/migrations/2016_12_20_121819_create-hive-table.php | 4 ++--
database/migrations/2016_12_21_174159_create-sensor-table.php | 4 ++--
database/migrations/2017_03_21_114148_create_groups_table.php | 4 ++--
.../migrations/2017_03_21_114828_entrust_setup_tables.php | 4 ++--
database/migrations/2017_04_14_175011_create-queen-table.php | 4 ++--
.../migrations/2017_04_14_175022_create-production-table.php | 4 ++--
.../migrations/2017_07_17_095406_add_users_last_login.php | 4 ++--
.../2018_01_30_105927_add_category_nested_set_columns.php | 4 ++--
.../migrations/2018_01_31_174432_create_category_input.php | 4 ++--
database/migrations/2018_02_20_161831_add_category_old_id.php | 4 ++--
.../migrations/2018_03_12_223732_create-checklists-table.php | 4 ++--
.../migrations/2018_04_03_110731_create_inspections_table.php | 4 ++--
.../2018_04_03_112937_create_inspection_items_table.php | 4 ++--
.../2018_04_03_115056_add_checklist_category_order.php | 4 ++--
.../migrations/2018_04_24_124855_AddCategoryTypeIndex.php | 4 ++--
...2018_05_16_150929_add_location_hive_delete_foreign_key.php | 4 ++--
.../migrations/2018_05_18_091519_add_user_policy_check.php | 4 ++--
database/migrations/2018_06_03_110444_AddLanguageTwoChar.php | 4 ++--
.../2018_06_06_121927_convert_inspections_to_taxonomy.php | 4 ++--
.../2018_12_19_152505_add_email_token_to_user_table.php | 4 ++--
.../migrations/2019_01_08_101831_add_category_required.php | 4 ++--
database/migrations/2019_01_14_114237_add_group_extras.php | 4 ++--
database/migrations/2019_01_14_114804_create_group_hive.php | 4 ++--
.../migrations/2019_01_14_143937_add_group_user_admin.php | 4 ++--
.../2019_01_28_104628_create_measurements_table.php | 4 ++--
database/migrations/2019_01_28_223610_add_min_max_values.php | 4 ++--
database/migrations/2019_01_28_223654_add_high_low_values.php | 4 ++--
database/migrations/2019_11_21_153657_add_location_roofed.php | 4 ++--
.../migrations/2019_11_21_204213_create_researches_table.php | 4 ++--
database/migrations/2019_12_27_172844_create_images_table.php | 4 ++--
.../2020_01_05_153657_add_inspection_checklist_id.php | 4 ++--
.../2020_01_09_180741_change_sensors_hive_id_nullable.php | 4 ++--
.../migrations/2020_01_11_134447_add_dimensions_to_hive.php | 4 ++--
.../migrations/2020_01_11_135656_add_description_to_queen.php | 4 ++--
database/migrations/2020_01_11_140516_add_order_to_hive.php | 4 ++--
.../2020_01_11_173757_create_sensor_definitions_table.php | 4 ++--
.../2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php | 4 ++--
.../migrations/2020_01_15_110902_add_storage_to_image.php | 4 ++--
.../2020_01_15_120918_change_url_field_length_for_image.php | 4 ++--
.../migrations/2020_01_15_121511_add_image_to_inspection.php | 4 ++--
...0_01_27_205714_add_last_weather_time_stamp_to_location.php | 4 ++--
.../2020_02_19_152103_add_battery_voltage_to_device.php | 4 ++--
.../2020_02_19_152416_add_downlink_message_to_device.php | 4 ++--
database/migrations/2020_06_08_094741_add_locale_to_user.php | 4 ++--
.../2020_06_25_154728_create_sample_codes_table.php | 4 ++--
.../2020_08_04_114944_add_hex_color_to_location.php | 4 ++--
.../2020_10_01_142238_add_research_owner_and_viewers.php | 4 ++--
database/migrations/2021_02_09_170632_create_alerts_table.php | 4 ++--
.../migrations/2021_02_09_170935_create_alert_rules_table.php | 4 ++--
.../2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php | 4 ++--
.../2021_02_22_164840_add_alert_rules_last_calculated.php | 4 ++--
.../migrations/2021_02_24_095050_create_flash_logs_table.php | 4 ++--
.../migrations/2021_03_26_124313_add_flashlog_columns.php | 4 ++--
database/migrations/2021_04_09_180304_add_device_datetime.php | 4 ++--
.../2021_04_09_220304_add_device_datetime_offset.php | 4 ++--
.../2021_04_20_170653_add_queen_hive_delete_foreign_key.php | 4 ++--
...170800_add_device_sensor_definition_delete_foreign_key.php | 4 ++--
...021_05_03_101244_change_sensors_offset_float_to_double.php | 4 ++--
...21_05_05_133125_add_alert_on_occurences_to_alert_rules.php | 4 ++--
.../2021_05_12_191500_add_alert_rules_last_evaluated.php | 4 ++--
.../2021_05_27_143213_add_flashlog_time_percentage.php | 4 ++--
database/migrations/2021_09_20_150053_add_count_to_alerts.php | 4 ++--
.../2021_09_23_112134_add_show_in_alerts_to_measurements.php | 4 ++--
.../migrations/2021_09_27_122352_remove_unused_tables.php | 4 ++--
.../migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php | 4 ++--
.../2021_09_28_102346_correct_hive_b_b_depth_and_height.php | 4 ++--
.../2021_10_02_194618_add_weather_boolean_to_measurements.php | 4 ++--
.../migrations/2021_10_15_103342_add_rate_limit_to_user.php | 4 ++--
.../2021_10_29_134428_add_former_key_list_to_device.php | 4 ++--
.../2022_01_25_152440_add_persisted_days_to_flashlog.php | 4 ++--
.../2022_01_26_131359_add_default_user_ids_to_researches.php | 4 ++--
.../2022_02_23_094732_add_flashlog_persisted_block_ids.php | 4 ++--
.../migrations/2022_06_20_093325_add_queen_birth_date.php | 4 ++--
.../migrations/2022_06_20_123603_create_hive_tags_table.php | 4 ++--
.../migrations/2023_02_08_102518_add_visible_to_research.php | 4 ++--
.../2023_03_06_112218_add_on_invite_only_to_research.php | 4 ++--
.../2023_03_22_135520_create_dashboard_groups_table.php | 4 ++--
.../2023_04_03_083652_create_organizations_table.php | 4 ++--
..._add_user_type_to_role_user_and_permission_user_tables.php | 4 ++--
.../2023_05_10_120312_create_checklist_svgs_table.php | 4 ++--
.../2023_08_30_090001_create_alert_rule_formulas_table.php | 4 ++--
.../2023_08_30_135044_add_source_to_measurement.php | 4 ++--
.../2023_08_31_081247_add_future_to_alert_rule_formulas.php | 4 ++--
.../2023_09_06_090804_add_future_to_measurement.php | 4 ++--
.../2023_09_06_101511_add_app_version_to_checklist_svgs.php | 4 ++--
.../2023_09_25_154132_create_calculation_models_table.php | 4 ++--
...5_174447_add_evaluation_results_to_alert_rule_formulas.php | 4 ++--
database/migrations/2024_09_28_220019_add_rtc_to_devices.php | 4 ++--
...025_05_01_213400_add_recalculate_to_sensor_definitions.php | 4 ++--
database/migrations/2025_05_20_131603_add_flash_log_dates.php | 4 ++--
.../migrations/2025_05_26_094603_add_flash_log_meta_data.php | 4 ++--
.../2025_06_05_073900_add_log_validation_to_devices.php | 4 ++--
.../2025_09_16_235556_add_time_corrections_to_flashlog.php | 4 ++--
.../2025_11_28_141954_add_flash_log_valid_override.php | 4 ++--
99 files changed, 198 insertions(+), 198 deletions(-)
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index d5560e46..1d7c0b90 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateUsersTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -34,4 +34,4 @@ public function down()
{
Schema::dropIfExists('users');
}
-}
+};
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
index d741384b..99cc6b8f 100644
--- a/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreatePasswordResetsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
{
Schema::dropIfExists('password_resets');
}
-}
+};
diff --git a/database/migrations/2016_04_10_115211_create-category-table.php b/database/migrations/2016_04_10_115211_create-category-table.php
index 0313c646..646d2c8b 100644
--- a/database/migrations/2016_04_10_115211_create-category-table.php
+++ b/database/migrations/2016_04_10_115211_create-category-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateCategoryTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
{
Schema::dropIfExists('categories');
}
-}
+};
diff --git a/database/migrations/2016_04_14_174603_create-location-table.php b/database/migrations/2016_04_14_174603_create-location-table.php
index 44cbc6bc..59c8f3f8 100644
--- a/database/migrations/2016_04_14_174603_create-location-table.php
+++ b/database/migrations/2016_04_14_174603_create-location-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateLocationTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -56,4 +56,4 @@ public function down()
Schema::dropIfExists('locations');
Schema::dropIfExists('continents');
}
-}
+};
diff --git a/database/migrations/2016_12_20_121758_create_settings.php b/database/migrations/2016_12_20_121758_create_settings.php
index fac90160..19859a95 100644
--- a/database/migrations/2016_12_20_121758_create_settings.php
+++ b/database/migrations/2016_12_20_121758_create_settings.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateSettings extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -43,4 +43,4 @@ public function down()
Schema::dropIfExists('settings');
}
-}
+};
diff --git a/database/migrations/2016_12_20_121819_create-hive-table.php b/database/migrations/2016_12_20_121819_create-hive-table.php
index 8371204c..27e9236b 100644
--- a/database/migrations/2016_12_20_121819_create-hive-table.php
+++ b/database/migrations/2016_12_20_121819_create-hive-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateHiveTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -89,4 +89,4 @@ public function down()
Schema::dropIfExists('hives');
Schema::dropIfExists('hive_types');
}
-}
+};
diff --git a/database/migrations/2016_12_21_174159_create-sensor-table.php b/database/migrations/2016_12_21_174159_create-sensor-table.php
index e40bd6cd..f6c5146c 100644
--- a/database/migrations/2016_12_21_174159_create-sensor-table.php
+++ b/database/migrations/2016_12_21_174159_create-sensor-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateSensorTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -57,4 +57,4 @@ public function down()
Schema::dropIfExists('sensor_user');
Schema::dropIfExists('sensors');
}
-}
+};
diff --git a/database/migrations/2017_03_21_114148_create_groups_table.php b/database/migrations/2017_03_21_114148_create_groups_table.php
index 42efdf3e..b8d23fac 100644
--- a/database/migrations/2017_03_21_114148_create_groups_table.php
+++ b/database/migrations/2017_03_21_114148_create_groups_table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateGroupsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -59,4 +59,4 @@ public function down()
Schema::dropIfExists('group_user');
Schema::dropIfExists('groups');
}
-}
+};
diff --git a/database/migrations/2017_03_21_114828_entrust_setup_tables.php b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
index 0d1104ed..9f997bca 100644
--- a/database/migrations/2017_03_21_114828_entrust_setup_tables.php
+++ b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class EntrustSetupTables extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -69,4 +69,4 @@ public function down()
Schema::drop('role_user');
Schema::drop('roles');
}
-}
+};
diff --git a/database/migrations/2017_04_14_175011_create-queen-table.php b/database/migrations/2017_04_14_175011_create-queen-table.php
index 00750167..3e8b8ba2 100644
--- a/database/migrations/2017_04_14_175011_create-queen-table.php
+++ b/database/migrations/2017_04_14_175011_create-queen-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateQueenTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -61,4 +61,4 @@ public function down()
Schema::dropIfExists('queens');
Schema::dropIfExists('bee_races');
}
-}
+};
diff --git a/database/migrations/2017_04_14_175022_create-production-table.php b/database/migrations/2017_04_14_175022_create-production-table.php
index ffc60ba5..cc33d569 100644
--- a/database/migrations/2017_04_14_175022_create-production-table.php
+++ b/database/migrations/2017_04_14_175022_create-production-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateProductionTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -55,4 +55,4 @@ public function down()
Schema::dropIfExists('productions');
}
-}
+};
diff --git a/database/migrations/2017_07_17_095406_add_users_last_login.php b/database/migrations/2017_07_17_095406_add_users_last_login.php
index 0bd54842..da8c85cf 100644
--- a/database/migrations/2017_07_17_095406_add_users_last_login.php
+++ b/database/migrations/2017_07_17_095406_add_users_last_login.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddUsersLastLogin extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('last_login');
});
}
-}
+};
diff --git a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
index 66952f92..db4bab0f 100644
--- a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
+++ b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
@@ -5,7 +5,7 @@
use Illuminate\Support\Facades\Schema;
use Kalnoy\Nestedset\NestedSet;
-class AddCategoryNestedSetColumns extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -35,4 +35,4 @@ public function down()
NestedSet::dropColumns($table);
});
}
-}
+};
diff --git a/database/migrations/2018_01_31_174432_create_category_input.php b/database/migrations/2018_01_31_174432_create_category_input.php
index 1b83f6e8..14a9a8a6 100644
--- a/database/migrations/2018_01_31_174432_create_category_input.php
+++ b/database/migrations/2018_01_31_174432_create_category_input.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateCategoryInput extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -99,4 +99,4 @@ public function down()
Schema::dropIfExists('languages');
Schema::dropIfExists('category_inputs');
}
-}
+};
diff --git a/database/migrations/2018_02_20_161831_add_category_old_id.php b/database/migrations/2018_02_20_161831_add_category_old_id.php
index 82705ef1..661ec505 100644
--- a/database/migrations/2018_02_20_161831_add_category_old_id.php
+++ b/database/migrations/2018_02_20_161831_add_category_old_id.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddCategoryOldId extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -32,4 +32,4 @@ public function down()
$table->dropColumn('old_id');
});
}
-}
+};
diff --git a/database/migrations/2018_03_12_223732_create-checklists-table.php b/database/migrations/2018_03_12_223732_create-checklists-table.php
index 079a053d..6ee76618 100644
--- a/database/migrations/2018_03_12_223732_create-checklists-table.php
+++ b/database/migrations/2018_03_12_223732_create-checklists-table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateChecklistsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -98,4 +98,4 @@ public function down()
Schema::dropIfExists('checklist_category');
Schema::dropIfExists('checklists');
}
-}
+};
diff --git a/database/migrations/2018_04_03_110731_create_inspections_table.php b/database/migrations/2018_04_03_110731_create_inspections_table.php
index eb62821d..43e7e17a 100644
--- a/database/migrations/2018_04_03_110731_create_inspections_table.php
+++ b/database/migrations/2018_04_03_110731_create_inspections_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateInspectionsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -104,4 +104,4 @@ public function down()
Schema::dropIfExists('inspection_hive');
Schema::dropIfExists('inspections');
}
-}
+};
diff --git a/database/migrations/2018_04_03_112937_create_inspection_items_table.php b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
index 45c866ea..96e15deb 100644
--- a/database/migrations/2018_04_03_112937_create_inspection_items_table.php
+++ b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateInspectionItemsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -41,4 +41,4 @@ public function down()
Schema::dropIfExists('inspection_items');
}
-}
+};
diff --git a/database/migrations/2018_04_03_115056_add_checklist_category_order.php b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
index 73b07825..3a1d9cff 100644
--- a/database/migrations/2018_04_03_115056_add_checklist_category_order.php
+++ b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddChecklistCategoryOrder extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -36,4 +36,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
index 57860dac..06e8ad9e 100644
--- a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
+++ b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddCategoryTypeIndex extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -38,4 +38,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
index 96dfecaa..8791e2b1 100644
--- a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
+++ b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class AddLocationHiveDeleteForeignKey extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -30,4 +30,4 @@ public function down()
$table->foreign('location_id')->references('id')->on('locations')->onUpdate('cascade');
});
}
-}
+};
diff --git a/database/migrations/2018_05_18_091519_add_user_policy_check.php b/database/migrations/2018_05_18_091519_add_user_policy_check.php
index d474be6d..1d9ca685 100644
--- a/database/migrations/2018_05_18_091519_add_user_policy_check.php
+++ b/database/migrations/2018_05_18_091519_add_user_policy_check.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class AddUserPolicyCheck extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -28,4 +28,4 @@ public function down()
$table->dropColumn('policy_accepted');
});
}
-}
+};
diff --git a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
index cec0a811..3b494bab 100644
--- a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
+++ b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class AddLanguageTwoChar extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -41,4 +41,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
index 3c48b139..72e896d2 100644
--- a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
+++ b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
@@ -8,7 +8,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class ConvertInspectionsToTaxonomy extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -96,4 +96,4 @@ public function down()
{
//
}
-}
+};
diff --git a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
index 990cd02b..abebcdf4 100644
--- a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
+++ b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddEmailTokenToUserTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2019_01_08_101831_add_category_required.php b/database/migrations/2019_01_08_101831_add_category_required.php
index c0e2d560..f4454ba3 100644
--- a/database/migrations/2019_01_08_101831_add_category_required.php
+++ b/database/migrations/2019_01_08_101831_add_category_required.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddCategoryRequired extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -34,4 +34,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2019_01_14_114237_add_group_extras.php b/database/migrations/2019_01_14_114237_add_group_extras.php
index 8d5553cd..06436d43 100644
--- a/database/migrations/2019_01_14_114237_add_group_extras.php
+++ b/database/migrations/2019_01_14_114237_add_group_extras.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddGroupExtras extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
$table->dropColumn('hex_color');
});
}
-}
+};
diff --git a/database/migrations/2019_01_14_114804_create_group_hive.php b/database/migrations/2019_01_14_114804_create_group_hive.php
index 9877b49f..dcb1a042 100644
--- a/database/migrations/2019_01_14_114804_create_group_hive.php
+++ b/database/migrations/2019_01_14_114804_create_group_hive.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CreateGroupHive extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -46,4 +46,4 @@ public function down()
Schema::dropIfExists('group_hive');
}
}
-}
+};
diff --git a/database/migrations/2019_01_14_143937_add_group_user_admin.php b/database/migrations/2019_01_14_143937_add_group_user_admin.php
index f00da88e..a62ba00f 100644
--- a/database/migrations/2019_01_14_143937_add_group_user_admin.php
+++ b/database/migrations/2019_01_14_143937_add_group_user_admin.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddGroupUserAdmin extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -39,4 +39,4 @@ public function down()
$table->dropColumn('token');
});
}
-}
+};
diff --git a/database/migrations/2019_01_28_104628_create_measurements_table.php b/database/migrations/2019_01_28_104628_create_measurements_table.php
index 8f72c18c..7e6a9e2c 100644
--- a/database/migrations/2019_01_28_104628_create_measurements_table.php
+++ b/database/migrations/2019_01_28_104628_create_measurements_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateMeasurementsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -44,4 +44,4 @@ public function down()
}
}
-}
+};
diff --git a/database/migrations/2019_01_28_223610_add_min_max_values.php b/database/migrations/2019_01_28_223610_add_min_max_values.php
index b213b50c..87022a82 100644
--- a/database/migrations/2019_01_28_223610_add_min_max_values.php
+++ b/database/migrations/2019_01_28_223610_add_min_max_values.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddMinMaxValues extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -48,4 +48,4 @@ public function down()
});
}
-}
+};
diff --git a/database/migrations/2019_01_28_223654_add_high_low_values.php b/database/migrations/2019_01_28_223654_add_high_low_values.php
index 19500428..51f2be9b 100644
--- a/database/migrations/2019_01_28_223654_add_high_low_values.php
+++ b/database/migrations/2019_01_28_223654_add_high_low_values.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddHighLowValues extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -41,4 +41,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2019_11_21_153657_add_location_roofed.php b/database/migrations/2019_11_21_153657_add_location_roofed.php
index 11820220..2baa747e 100644
--- a/database/migrations/2019_11_21_153657_add_location_roofed.php
+++ b/database/migrations/2019_11_21_153657_add_location_roofed.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddLocationRoofed extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2019_11_21_204213_create_researches_table.php b/database/migrations/2019_11_21_204213_create_researches_table.php
index 8d8dc197..c4f0a633 100644
--- a/database/migrations/2019_11_21_204213_create_researches_table.php
+++ b/database/migrations/2019_11_21_204213_create_researches_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateResearchesTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -89,4 +89,4 @@ public function down()
Schema::drop('researches');
}
}
-}
+};
diff --git a/database/migrations/2019_12_27_172844_create_images_table.php b/database/migrations/2019_12_27_172844_create_images_table.php
index 9b7e9713..41bd5c00 100644
--- a/database/migrations/2019_12_27_172844_create_images_table.php
+++ b/database/migrations/2019_12_27_172844_create_images_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateImagesTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -60,4 +60,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
index 10fdf790..0d1822e6 100644
--- a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
+++ b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddInspectionChecklistId extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -37,4 +37,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
index 325b3d62..37e50d4b 100644
--- a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
+++ b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class ChangeSensorsHiveIdNullable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
}
});
}
-}
+};
diff --git a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
index f8d5669f..54105995 100644
--- a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
+++ b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDimensionsToHive extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -37,4 +37,4 @@ public function down()
$table->dropColumn('fr_height_cm');
});
}
-}
+};
diff --git a/database/migrations/2020_01_11_135656_add_description_to_queen.php b/database/migrations/2020_01_11_135656_add_description_to_queen.php
index cdfefa29..6769b714 100644
--- a/database/migrations/2020_01_11_135656_add_description_to_queen.php
+++ b/database/migrations/2020_01_11_135656_add_description_to_queen.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDescriptionToQueen extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('description');
});
}
-}
+};
diff --git a/database/migrations/2020_01_11_140516_add_order_to_hive.php b/database/migrations/2020_01_11_140516_add_order_to_hive.php
index 68a5cbf1..64557466 100644
--- a/database/migrations/2020_01_11_140516_add_order_to_hive.php
+++ b/database/migrations/2020_01_11_140516_add_order_to_hive.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddOrderToHive extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('order');
});
}
-}
+};
diff --git a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
index 43fbafe4..c0c742ab 100644
--- a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
+++ b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateSensorDefinitionsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -50,4 +50,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
index 9270d300..02e3008c 100644
--- a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
+++ b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddLastActiveAndHwIdToSensor extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -43,4 +43,4 @@ public function down()
$table->dropColumn('ble_pin');
});
}
-}
+};
diff --git a/database/migrations/2020_01_15_110902_add_storage_to_image.php b/database/migrations/2020_01_15_110902_add_storage_to_image.php
index 9b9f79ec..aec725fe 100644
--- a/database/migrations/2020_01_15_110902_add_storage_to_image.php
+++ b/database/migrations/2020_01_15_110902_add_storage_to_image.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddStorageToImage extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('storage');
});
}
-}
+};
diff --git a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
index 1167420f..6232faef 100644
--- a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
+++ b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class ChangeUrlFieldLengthForImage extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -47,4 +47,4 @@ public function down()
$table->string('value', 255)->change();
});
}
-}
+};
diff --git a/database/migrations/2020_01_15_121511_add_image_to_inspection.php b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
index b4fd0bf2..bc54bb3b 100644
--- a/database/migrations/2020_01_15_121511_add_image_to_inspection.php
+++ b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddImageToInspection extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('image_id');
});
}
-}
+};
diff --git a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
index de7658ee..492832c1 100644
--- a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
+++ b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddLastWeatherTimeStampToLocation extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('last_weather_time');
});
}
-}
+};
diff --git a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
index 370fb504..7d8df430 100644
--- a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
+++ b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddBatteryVoltageToDevice extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('battery_voltage');
});
}
-}
+};
diff --git a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
index 9c5b6e1a..342ee9ca 100644
--- a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
+++ b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDownlinkMessageToDevice extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -31,4 +31,4 @@ public function down()
$table->dropColumn('next_downlink_message');
});
}
-}
+};
diff --git a/database/migrations/2020_06_08_094741_add_locale_to_user.php b/database/migrations/2020_06_08_094741_add_locale_to_user.php
index 7509d44e..6f418ebf 100644
--- a/database/migrations/2020_06_08_094741_add_locale_to_user.php
+++ b/database/migrations/2020_06_08_094741_add_locale_to_user.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddLocaleToUser extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('locale');
});
}
-}
+};
diff --git a/database/migrations/2020_06_25_154728_create_sample_codes_table.php b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
index ece9439d..3a7460a1 100644
--- a/database/migrations/2020_06_25_154728_create_sample_codes_table.php
+++ b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateSampleCodesTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -54,4 +54,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
index 93bad7c1..e0f2d7ef 100644
--- a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
+++ b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddHexColorToLocation extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('hex_color');
});
}
-}
+};
diff --git a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
index 7c0b780a..0ca84a0c 100644
--- a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
+++ b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddResearchOwnerAndViewers extends Migration
+return new class extends Migration
{
public function up()
{
@@ -50,4 +50,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2021_02_09_170632_create_alerts_table.php b/database/migrations/2021_02_09_170632_create_alerts_table.php
index a038fe8c..62a6651e 100644
--- a/database/migrations/2021_02_09_170632_create_alerts_table.php
+++ b/database/migrations/2021_02_09_170632_create_alerts_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateAlertsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -43,4 +43,4 @@ public function down()
Schema::drop('alerts');
}
}
-}
+};
diff --git a/database/migrations/2021_02_09_170935_create_alert_rules_table.php b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
index 41788c61..29887d80 100644
--- a/database/migrations/2021_02_09_170935_create_alert_rules_table.php
+++ b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateAlertRulesTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -46,4 +46,4 @@ public function down()
Schema::drop('alert_rules');
}
}
-}
+};
diff --git a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
index 51271f1d..07b534d3 100644
--- a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
+++ b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddExcludeHiveIdsToAlertRules extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -34,4 +34,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
index fe127afa..989b3000 100644
--- a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
+++ b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddAlertRulesLastCalculated extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -35,4 +35,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2021_02_24_095050_create_flash_logs_table.php b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
index 932c86c3..7e4790f3 100644
--- a/database/migrations/2021_02_24_095050_create_flash_logs_table.php
+++ b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateFlashLogsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -42,4 +42,4 @@ public function down()
Schema::drop('flash_logs');
}
}
-}
+};
diff --git a/database/migrations/2021_03_26_124313_add_flashlog_columns.php b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
index 36c40fb8..5571150f 100644
--- a/database/migrations/2021_03_26_124313_add_flashlog_columns.php
+++ b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashlogColumns extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -31,4 +31,4 @@ public function down()
$table->dropColumn('log_erased');
});
}
-}
+};
diff --git a/database/migrations/2021_04_09_180304_add_device_datetime.php b/database/migrations/2021_04_09_180304_add_device_datetime.php
index 5e13490d..48854f9c 100644
--- a/database/migrations/2021_04_09_180304_add_device_datetime.php
+++ b/database/migrations/2021_04_09_180304_add_device_datetime.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDeviceDatetime extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('datetime');
});
}
-}
+};
diff --git a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
index b8321fce..40dab028 100644
--- a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
+++ b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDeviceDatetimeOffset extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('datetime_offset_sec');
});
}
-}
+};
diff --git a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
index c3b896c8..567df9c4 100644
--- a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class AddQueenHiveDeleteForeignKey extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -30,4 +30,4 @@ public function down()
$table->foreign('hive_id')->references('id')->on('hives')->onUpdate('cascade');
});
}
-}
+};
diff --git a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
index c326913e..d6a8626b 100644
--- a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class AddDeviceSensorDefinitionDeleteForeignKey extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -32,4 +32,4 @@ public function down()
$table->dropColumn('deleted_at');
});
}
-}
+};
diff --git a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
index 042af98f..47b86c35 100644
--- a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
+++ b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class ChangeSensorsOffsetFloatToDouble extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->float('datetime_offset_sec')->change();
});
}
-}
+};
diff --git a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
index 7abb844c..7966b18f 100644
--- a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
+++ b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddAlertOnOccurencesToAlertRules extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('alert_on_occurences');
});
}
-}
+};
diff --git a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
index 3fe9bc64..9c4edfde 100644
--- a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
+++ b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddAlertRulesLastEvaluated extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
index 47161ff1..77d3cbeb 100644
--- a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
+++ b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashlogTimePercentage extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('time_percentage');
});
}
-}
+};
diff --git a/database/migrations/2021_09_20_150053_add_count_to_alerts.php b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
index b7be8513..b965aae1 100644
--- a/database/migrations/2021_09_20_150053_add_count_to_alerts.php
+++ b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddCountToAlerts extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('count');
});
}
-}
+};
diff --git a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
index 300edfe4..b70438c5 100644
--- a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
+++ b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddShowInAlertsToMeasurements extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -31,4 +31,4 @@ public function down()
$table->dropColumn('show_in_alerts');
});
}
-}
+};
diff --git a/database/migrations/2021_09_27_122352_remove_unused_tables.php b/database/migrations/2021_09_27_122352_remove_unused_tables.php
index 8d90621e..babd016c 100644
--- a/database/migrations/2021_09_27_122352_remove_unused_tables.php
+++ b/database/migrations/2021_09_27_122352_remove_unused_tables.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
-class RemoveUnusedTables extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -27,4 +27,4 @@ public function down()
{
//
}
-}
+};
diff --git a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
index 5f5ee76e..b9f1a591 100644
--- a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
+++ b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
@@ -2,7 +2,7 @@
use Illuminate\Database\Migrations\Migration;
-class UpgradeDbToUtf8mb4 extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -122,4 +122,4 @@ private function dbExec($query, $dryRun, $connection)
\DB::connection($connection)->getPdo()->exec($query);
}
}
-}
+};
diff --git a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
index 13c14ef9..7eb55faa 100644
--- a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
+++ b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
@@ -5,7 +5,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class CorrectHiveBBDepthAndHeight extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -42,4 +42,4 @@ public function down()
//
});
}
-}
+};
diff --git a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
index 87ff2a45..00475237 100644
--- a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
+++ b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddWeatherBooleanToMeasurements extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('weather');
});
}
-}
+};
diff --git a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
index 3d75f59c..18a67b8b 100644
--- a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
+++ b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddRateLimitToUser extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('rate_limit_per_min');
});
}
-}
+};
diff --git a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
index b820b9cf..cd0e7492 100644
--- a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
+++ b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFormerKeyListToDevice extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('former_key_list');
});
}
-}
+};
diff --git a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
index 146a4de9..c62b09b8 100644
--- a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
+++ b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddPersistedDaysToFlashlog extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -31,4 +31,4 @@ public function down()
$table->dropColumn('persisted_measurements');
});
}
-}
+};
diff --git a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
index b4c22c09..0ea04339 100644
--- a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
+++ b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddDefaultUserIdsToResearches extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('default_user_ids');
});
}
-}
+};
diff --git a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
index d7c9ef5c..6e197f9d 100644
--- a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
+++ b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashlogPersistedBlockIds extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('persisted_block_ids');
});
}
-}
+};
diff --git a/database/migrations/2022_06_20_093325_add_queen_birth_date.php b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
index ec2a6fbe..38ea8eac 100644
--- a/database/migrations/2022_06_20_093325_add_queen_birth_date.php
+++ b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
@@ -5,7 +5,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddQueenBirthDate extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -40,4 +40,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2022_06_20_123603_create_hive_tags_table.php b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
index 75d4a218..c5482cdc 100644
--- a/database/migrations/2022_06_20_123603_create_hive_tags_table.php
+++ b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateHiveTagsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -32,4 +32,4 @@ public function down()
{
Schema::drop('hive_tags');
}
-}
+};
diff --git a/database/migrations/2023_02_08_102518_add_visible_to_research.php b/database/migrations/2023_02_08_102518_add_visible_to_research.php
index 288fc944..e3296eca 100644
--- a/database/migrations/2023_02_08_102518_add_visible_to_research.php
+++ b/database/migrations/2023_02_08_102518_add_visible_to_research.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddVisibleToResearch extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('visible');
});
}
-}
+};
diff --git a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
index 2b1d0ec3..faf749dd 100644
--- a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
+++ b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddOnInviteOnlyToResearch extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('on_invite_only');
});
}
-}
+};
diff --git a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
index f04dec1b..93d946e3 100644
--- a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
+++ b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateDashboardGroupsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -44,4 +44,4 @@ public function down()
});
Schema::dropIfExists('dashboard_groups');
}
-}
+};
diff --git a/database/migrations/2023_04_03_083652_create_organizations_table.php b/database/migrations/2023_04_03_083652_create_organizations_table.php
index e42438c1..892e1b34 100644
--- a/database/migrations/2023_04_03_083652_create_organizations_table.php
+++ b/database/migrations/2023_04_03_083652_create_organizations_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateOrganizationsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -148,4 +148,4 @@ public function down()
Schema::drop('organizations');
}
-}
+};
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index 3d691255..b8a4cf4b 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddUserTypeToRoleUserAndPermissionUserTables extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -75,4 +75,4 @@ public function down()
});
}
}
-}
+};
diff --git a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
index 04ae9e71..46d5e002 100644
--- a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
+++ b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateChecklistSvgsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
{
Schema::drop('checklist_svgs');
}
-}
+};
diff --git a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
index f514f11d..a2ba4947 100644
--- a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
+++ b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateAlertRuleFormulasTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -60,4 +60,4 @@ public function down()
{
Schema::drop('alert_rule_formulas');
}
-}
+};
diff --git a/database/migrations/2023_08_30_135044_add_source_to_measurement.php b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
index 33a691b5..c451f1a5 100644
--- a/database/migrations/2023_08_30_135044_add_source_to_measurement.php
+++ b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddSourceToMeasurement extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -33,4 +33,4 @@ public function down()
$table->dropColumn('data_repository_url');
});
}
-}
+};
diff --git a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
index 00f8d1ee..295f59b3 100644
--- a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
+++ b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFutureToAlertRuleFormulas extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -60,4 +60,4 @@ public function down()
$table->dropColumn('future');
});
}
-}
+};
diff --git a/database/migrations/2023_09_06_090804_add_future_to_measurement.php b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
index 9aea2651..410d2c1c 100644
--- a/database/migrations/2023_09_06_090804_add_future_to_measurement.php
+++ b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFutureToMeasurement extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('future');
});
}
-}
+};
diff --git a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
index 05f87986..fd8d192d 100644
--- a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
+++ b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddAppVersionToChecklistSvgs extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('app_version');
});
}
-}
+};
diff --git a/database/migrations/2023_09_25_154132_create_calculation_models_table.php b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
index 6a388339..d5402532 100644
--- a/database/migrations/2023_09_25_154132_create_calculation_models_table.php
+++ b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
@@ -3,7 +3,7 @@
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
-class CreateCalculationModelsTable extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -40,4 +40,4 @@ public function down()
{
Schema::drop('calculation_models');
}
-}
+};
diff --git a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
index 350b5feb..21c8ea3c 100644
--- a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
+++ b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddEvaluationResultsToAlertRuleFormulas extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -35,4 +35,4 @@ public function down()
$table->dropColumn('last_evaluated_at');
});
}
-}
+};
diff --git a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
index 8d648430..a2e4ae22 100644
--- a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
+++ b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
@@ -5,7 +5,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddRtcToDevices extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -38,4 +38,4 @@ public function down()
$table->dropColumn('rtc');
});
}
-}
+};
diff --git a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
index d434c484..789dd812 100644
--- a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
+++ b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddRecalculateToSensorDefinitions extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('recalculate');
});
}
-}
+};
diff --git a/database/migrations/2025_05_20_131603_add_flash_log_dates.php b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
index 34eb02e2..14322183 100644
--- a/database/migrations/2025_05_20_131603_add_flash_log_dates.php
+++ b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashLogDates extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -35,4 +35,4 @@ public function down()
$table->dropColumn('csv_url');
});
}
-}
+};
diff --git a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
index 90893464..419df800 100644
--- a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
+++ b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashLogMetaData extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('meta_data');
});
}
-}
+};
diff --git a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
index cd22d8ba..7837dc12 100644
--- a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
+++ b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddLogValidationToDevices extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('log_file_info');
});
}
-}
+};
diff --git a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
index 5d3eb83d..866c65df 100644
--- a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
+++ b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddTimeCorrectionsToFlashlog extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('time_corrections');
});
}
-}
+};
diff --git a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
index 777ad8de..07c2ca75 100644
--- a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
+++ b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
@@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
-class AddFlashLogValidOverride extends Migration
+return new class extends Migration
{
/**
* Run the migrations.
@@ -29,4 +29,4 @@ public function down()
$table->dropColumn('valid_override')->nullable();
});
}
-}
+};
From 342418eee37b48b8e25ad1922a081f864f368484 Mon Sep 17 00:00:00 2001
From: Shift
Date: Thu, 28 May 2026 14:42:10 +0000
Subject: [PATCH 061/127] Shift cleanup
---
app/Providers/EventServiceProvider.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 7b2f9bb6..267bf8c3 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -44,4 +44,3 @@ public function shouldDiscoverEvents()
return false;
}
}
-
From 893595293f6badaece27c4f7f1425620775e376c Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Mon, 1 Jun 2026 15:13:44 +0200
Subject: [PATCH 062/127] composer install with php upgraded to 8.0.30 in
composer.json
---
composer.json | 2 +-
composer.lock | 3013 +++++++++++++++++++++++++++----------------------
2 files changed, 1636 insertions(+), 1379 deletions(-)
diff --git a/composer.json b/composer.json
index 9979ca93..5b9ce8b6 100644
--- a/composer.json
+++ b/composer.json
@@ -49,7 +49,7 @@
"preferred-install": "dist",
"sort-packages": true,
"platform": {
- "php": "7.4"
+ "php": "8.0.30"
},
"allow-plugins": {
"kylekatarnls/update-helper": true,
diff --git a/composer.lock b/composer.lock
index b4c87e37..e52e68cd 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,64 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "6cd218ac8731ae9d161724db8af584ff",
+ "content-hash": "4cbeae6cac4f7d690906027a497fafa7",
"packages": [
- {
- "name": "asm89/stack-cors",
- "version": "v2.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/asm89/stack-cors.git",
- "reference": "33dcc9955bd5c683e1246f0162f48df73fe799f6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/asm89/stack-cors/zipball/33dcc9955bd5c683e1246f0162f48df73fe799f6",
- "reference": "33dcc9955bd5c683e1246f0162f48df73fe799f6",
- "shasum": ""
- },
- "require": {
- "php": "^7.3|^8.0",
- "symfony/http-foundation": "^5.3|^6|^7|^8",
- "symfony/http-kernel": "^5.3|^6|^7|^8"
- },
- "require-dev": {
- "phpunit/phpunit": "^9",
- "squizlabs/php_codesniffer": "^3.5"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.2-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Asm89\\Stack\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Alexander",
- "email": "iam.asm89@gmail.com"
- }
- ],
- "description": "Cross-origin resource sharing library and stack middleware",
- "homepage": "https://github.com/asm89/stack-cors",
- "keywords": [
- "cors",
- "stack"
- ],
- "support": {
- "issues": "https://github.com/asm89/stack-cors/issues",
- "source": "https://github.com/asm89/stack-cors/tree/v2.4.0"
- },
- "time": "2026-01-28T13:08:04+00:00"
- },
{
"name": "aws/aws-crt-php",
"version": "v1.2.7",
@@ -216,26 +160,25 @@
},
{
"name": "brick/math",
- "version": "0.9.3",
+ "version": "0.11.0",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
- "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae"
+ "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae",
- "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae",
+ "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478",
+ "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478",
"shasum": ""
},
"require": {
- "ext-json": "*",
- "php": "^7.1 || ^8.0"
+ "php": "^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
- "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0",
- "vimeo/psalm": "4.9.2"
+ "phpunit/phpunit": "^9.0",
+ "vimeo/psalm": "5.0.0"
},
"type": "library",
"autoload": {
@@ -260,19 +203,15 @@
],
"support": {
"issues": "https://github.com/brick/math/issues",
- "source": "https://github.com/brick/math/tree/0.9.3"
+ "source": "https://github.com/brick/math/tree/0.11.0"
},
"funding": [
{
"url": "https://github.com/BenMorel",
"type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/brick/math",
- "type": "tidelift"
}
],
- "time": "2021-08-15T20:50:18+00:00"
+ "time": "2023-01-15T23:15:59+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
@@ -343,6 +282,85 @@
],
"time": "2023-10-01T12:35:29+00:00"
},
+ {
+ "name": "composer/pcre",
+ "version": "3.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2",
+ "phpunit/phpunit": "^8 || ^9"
+ },
+ "type": "library",
+ "extra": {
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
+ },
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-11-12T16:29:46+00:00"
+ },
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@@ -853,31 +871,33 @@
},
{
"name": "doctrine/lexer",
- "version": "1.2.3",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229"
+ "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229",
- "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
+ "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
"shasum": ""
},
"require": {
+ "doctrine/deprecations": "^1.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^9.0",
+ "doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "^1.3",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.11"
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
+ "psalm/plugin-phpunit": "^0.18.3",
+ "vimeo/psalm": "^4.11 || ^5.21"
},
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ "Doctrine\\Common\\Lexer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -909,7 +929,7 @@
],
"support": {
"issues": "https://github.com/doctrine/lexer/issues",
- "source": "https://github.com/doctrine/lexer/tree/1.2.3"
+ "source": "https://github.com/doctrine/lexer/tree/2.1.1"
},
"funding": [
{
@@ -925,7 +945,7 @@
"type": "tidelift"
}
],
- "time": "2022-02-28T11:07:21+00:00"
+ "time": "2024-02-05T11:35:39+00:00"
},
{
"name": "dragonmantank/cron-expression",
@@ -993,21 +1013,21 @@
},
{
"name": "dyrynda/laravel-cascade-soft-deletes",
- "version": "4.1.0",
+ "version": "4.2.1",
"source": {
"type": "git",
"url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "dcfd120af3467901444a155ece03d8326efb53b3"
+ "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/dcfd120af3467901444a155ece03d8326efb53b3",
- "reference": "dcfd120af3467901444a155ece03d8326efb53b3",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
+ "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
"shasum": ""
},
"require": {
- "illuminate/database": "^8.12",
- "illuminate/events": "^8.12",
+ "illuminate/database": "^8.12|^9.0",
+ "illuminate/events": "^8.12|^9.0",
"php": "^7.3|^8.0"
},
"require-dev": {
@@ -1033,33 +1053,32 @@
"description": "Cascading deletes for Eloquent models that implement soft deletes",
"support": {
"issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.1.0"
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.2.1"
},
- "time": "2020-12-01T02:43:25+00:00"
+ "time": "2022-11-22T03:11:30+00:00"
},
{
"name": "egulias/email-validator",
- "version": "2.1.25",
+ "version": "3.2.6",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
- "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4"
+ "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4",
- "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4",
+ "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
+ "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
"shasum": ""
},
"require": {
- "doctrine/lexer": "^1.0.1",
- "php": ">=5.5",
- "symfony/polyfill-intl-idn": "^1.10"
+ "doctrine/lexer": "^1.2|^2",
+ "php": ">=7.2",
+ "symfony/polyfill-intl-idn": "^1.15"
},
"require-dev": {
- "dominicsayers/isemail": "^3.0.7",
- "phpunit/phpunit": "^4.8.36|^7.5.15",
- "satooshi/php-coveralls": "^1.0.1"
+ "phpunit/phpunit": "^8.5.8|^9.3.3",
+ "vimeo/psalm": "^4"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
@@ -1067,7 +1086,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.1.x-dev"
+ "dev-master": "3.0.x-dev"
}
},
"autoload": {
@@ -1095,7 +1114,7 @@
],
"support": {
"issues": "https://github.com/egulias/EmailValidator/issues",
- "source": "https://github.com/egulias/EmailValidator/tree/2.1.25"
+ "source": "https://github.com/egulias/EmailValidator/tree/3.2.6"
},
"funding": [
{
@@ -1103,7 +1122,7 @@
"type": "github"
}
],
- "time": "2020-12-29T14:50:06+00:00"
+ "time": "2023-06-01T07:04:22+00:00"
},
{
"name": "ellipsesynergie/api-response",
@@ -1169,6 +1188,67 @@
},
"time": "2016-07-14T12:33:35+00:00"
},
+ {
+ "name": "ezyang/htmlpurifier",
+ "version": "v4.19.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ezyang/htmlpurifier.git",
+ "reference": "b287d2a16aceffbf6e0295559b39662612b77fcf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/b287d2a16aceffbf6e0295559b39662612b77fcf",
+ "reference": "b287d2a16aceffbf6e0295559b39662612b77fcf",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
+ },
+ "require-dev": {
+ "cerdic/css-tidy": "^1.7 || ^2.0",
+ "simpletest/simpletest": "dev-master"
+ },
+ "suggest": {
+ "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
+ "ext-bcmath": "Used for unit conversion and imagecrash protection",
+ "ext-iconv": "Converts text to and from non-UTF-8 encodings",
+ "ext-tidy": "Used for pretty-printing HTML"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "library/HTMLPurifier.composer.php"
+ ],
+ "psr-0": {
+ "HTMLPurifier": "library/"
+ },
+ "exclude-from-classmap": [
+ "/library/HTMLPurifier/Language/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Edward Z. Yang",
+ "email": "admin@htmlpurifier.org",
+ "homepage": "http://ezyang.com"
+ }
+ ],
+ "description": "Standards compliant HTML filter written in PHP",
+ "homepage": "http://htmlpurifier.org/",
+ "keywords": [
+ "html"
+ ],
+ "support": {
+ "issues": "https://github.com/ezyang/htmlpurifier/issues",
+ "source": "https://github.com/ezyang/htmlpurifier/tree/v4.19.0"
+ },
+ "time": "2025-10-17T16:34:55+00:00"
+ },
{
"name": "fightbulc/moment",
"version": "1.35.0",
@@ -1227,40 +1307,32 @@
"time": "2025-07-27T08:46:28+00:00"
},
{
- "name": "fruitcake/laravel-cors",
- "version": "v2.2.0",
+ "name": "fruitcake/php-cors",
+ "version": "v1.3.0",
"source": {
"type": "git",
- "url": "https://github.com/fruitcake/laravel-cors.git",
- "reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534"
+ "url": "https://github.com/fruitcake/php-cors.git",
+ "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/laravel-cors/zipball/783a74f5e3431d7b9805be8afb60fd0a8f743534",
- "reference": "783a74f5e3431d7b9805be8afb60fd0a8f743534",
+ "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b",
+ "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b",
"shasum": ""
},
"require": {
- "asm89/stack-cors": "^2.0.1",
- "illuminate/contracts": "^6|^7|^8|^9",
- "illuminate/support": "^6|^7|^8|^9",
- "php": ">=7.2"
+ "php": "^7.4|^8.0",
+ "symfony/http-foundation": "^4.4|^5.4|^6|^7"
},
"require-dev": {
- "laravel/framework": "^6|^7.24|^8",
- "orchestra/testbench-dusk": "^4|^5|^6|^7",
- "phpunit/phpunit": "^6|^7|^8|^9",
+ "phpstan/phpstan": "^1.4",
+ "phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.1-dev"
- },
- "laravel": {
- "providers": [
- "Fruitcake\\Cors\\CorsServiceProvider"
- ]
+ "dev-master": "1.2-dev"
}
},
"autoload": {
@@ -1278,20 +1350,20 @@
"homepage": "https://fruitcake.nl"
},
{
- "name": "Barry vd. Heuvel",
+ "name": "Barryvdh",
"email": "barryvdh@gmail.com"
}
],
- "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application",
+ "description": "Cross-origin resource sharing library for the Symfony HttpFoundation",
+ "homepage": "https://github.com/fruitcake/php-cors",
"keywords": [
- "api",
"cors",
- "crossdomain",
- "laravel"
+ "laravel",
+ "symfony"
],
"support": {
- "issues": "https://github.com/fruitcake/laravel-cors/issues",
- "source": "https://github.com/fruitcake/laravel-cors/tree/v2.2.0"
+ "issues": "https://github.com/fruitcake/php-cors/issues",
+ "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0"
},
"funding": [
{
@@ -1303,8 +1375,7 @@
"type": "github"
}
],
- "abandoned": true,
- "time": "2022-02-23T14:25:13+00:00"
+ "time": "2023-10-12T05:21:21+00:00"
},
{
"name": "graham-campbell/result-type",
@@ -1370,16 +1441,16 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.10.5",
+ "version": "7.10.6",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "7c8d84b39e680315f687e8662a9d6fb0865c5148"
+ "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7c8d84b39e680315f687e8662a9d6fb0865c5148",
- "reference": "7c8d84b39e680315f687e8662a9d6fb0865c5148",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e7412b3180912c01650cc66647f18c1d1cbe9b94",
+ "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94",
"shasum": ""
},
"require": {
@@ -1477,7 +1548,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.10.5"
+ "source": "https://github.com/guzzle/guzzle/tree/7.10.6"
},
"funding": [
{
@@ -1493,7 +1564,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-27T11:53:46+00:00"
+ "time": "2026-06-01T13:06:22+00:00"
},
{
"name": "guzzlehttp/promises",
@@ -1580,16 +1651,16 @@
},
{
"name": "guzzlehttp/psr7",
- "version": "2.10.3",
+ "version": "2.10.4",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "7c1472269227dc6f18930bd903d7a88fe6c52130"
+ "reference": "d2a1a094e396da8957e797489fddaf860c340cfc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/7c1472269227dc6f18930bd903d7a88fe6c52130",
- "reference": "7c1472269227dc6f18930bd903d7a88fe6c52130",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/d2a1a094e396da8957e797489fddaf860c340cfc",
+ "reference": "d2a1a094e396da8957e797489fddaf860c340cfc",
"shasum": ""
},
"require": {
@@ -1677,7 +1748,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.10.3"
+ "source": "https://github.com/guzzle/psr7/tree/2.10.4"
},
"funding": [
{
@@ -1693,7 +1764,93 @@
"type": "tidelift"
}
],
- "time": "2026-05-27T11:48:20+00:00"
+ "time": "2026-05-29T12:59:07+00:00"
+ },
+ {
+ "name": "guzzlehttp/uri-template",
+ "version": "v1.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/guzzle/uri-template.git",
+ "reference": "eef7f87bab6f204eba3c39224d8075c70c637946"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/guzzle/uri-template/zipball/eef7f87bab6f204eba3c39224d8075c70c637946",
+ "reference": "eef7f87bab6f204eba3c39224d8075c70c637946",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "symfony/polyfill-php80": "^1.24"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.8.2",
+ "phpunit/phpunit": "^8.5.52 || ^9.6.34",
+ "uri-template/tests": "1.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": true,
+ "forward-command": false
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "GuzzleHttp\\UriTemplate\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ "email": "hello@gjcampbell.co.uk",
+ "homepage": "https://github.com/GrahamCampbell"
+ },
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ },
+ {
+ "name": "George Mponos",
+ "email": "gmponos@gmail.com",
+ "homepage": "https://github.com/gmponos"
+ },
+ {
+ "name": "Tobias Nyholm",
+ "email": "tobias.nyholm@gmail.com",
+ "homepage": "https://github.com/Nyholm"
+ }
+ ],
+ "description": "A polyfill class for uri_template of PHP",
+ "keywords": [
+ "guzzlehttp",
+ "uri-template"
+ ],
+ "support": {
+ "issues": "https://github.com/guzzle/uri-template/issues",
+ "source": "https://github.com/guzzle/uri-template/tree/v1.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/Nyholm",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-23T22:00:21+00:00"
},
{
"name": "influxdb/influxdb-php",
@@ -1848,26 +2005,26 @@
},
{
"name": "kalnoy/nestedset",
- "version": "v6.0.5",
+ "version": "v6.0.7",
"source": {
"type": "git",
"url": "https://github.com/lazychaser/laravel-nestedset.git",
- "reference": "fa3f77bb96709eb6b394f66b54eb08f0d8d47d63"
+ "reference": "e73b872bc9c5419512e5b69829c0ba09d2dd6b2b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/fa3f77bb96709eb6b394f66b54eb08f0d8d47d63",
- "reference": "fa3f77bb96709eb6b394f66b54eb08f0d8d47d63",
+ "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/e73b872bc9c5419512e5b69829c0ba09d2dd6b2b",
+ "reference": "e73b872bc9c5419512e5b69829c0ba09d2dd6b2b",
"shasum": ""
},
"require": {
- "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/events": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "php": "^7.2.5|^8.0"
+ "illuminate/database": ">=7.0,<=12.0",
+ "illuminate/events": ">=7.0,<=12.0",
+ "illuminate/support": ">=7.0,<=12.0",
+ "php": "^8.0"
},
"require-dev": {
- "phpunit/phpunit": "7.*|8.*|9.*|^10.5"
+ "phpunit/phpunit": ">=7.0"
},
"type": "library",
"extra": {
@@ -1905,30 +2062,30 @@
],
"support": {
"issues": "https://github.com/lazychaser/laravel-nestedset/issues",
- "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.5"
+ "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.7"
},
- "time": "2025-02-25T11:09:07+00:00"
+ "time": "2026-04-11T13:39:46+00:00"
},
{
"name": "kkszymanowski/traitor",
- "version": "0.2.5",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/KKSzymanowski/Traitor.git",
- "reference": "9770fc7de72ff585601dc9c42b31715d9fc40a24"
+ "reference": "97d12e2b045fcc4e132fed5ddee3b1dcff409989"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/KKSzymanowski/Traitor/zipball/9770fc7de72ff585601dc9c42b31715d9fc40a24",
- "reference": "9770fc7de72ff585601dc9c42b31715d9fc40a24",
+ "url": "https://api.github.com/repos/KKSzymanowski/Traitor/zipball/97d12e2b045fcc4e132fed5ddee3b1dcff409989",
+ "reference": "97d12e2b045fcc4e132fed5ddee3b1dcff409989",
"shasum": ""
},
"require": {
- "nikic/php-parser": "^1.0|^2.0|^3.0|^4.0",
+ "nikic/php-parser": "^1.0|^2.0|^3.0|^4.0|^5.0",
"php": ">=5.4"
},
"require-dev": {
- "phpunit/phpunit": "~4.1"
+ "phpunit/phpunit": "8.*"
},
"type": "library",
"autoload": {
@@ -1957,60 +2114,68 @@
"issues": "https://github.com/kkszymanowski/traitor/issues",
"source": "https://github.com/kkszymanowski/traitor"
},
- "time": "2018-04-19T12:24:36+00:00"
+ "time": "2024-01-29T09:23:11+00:00"
},
{
"name": "laravel/framework",
- "version": "v8.83.29",
+ "version": "v9.52.21",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "d841a226a50c715431952a10260ba4fac9e91cc4"
+ "reference": "6055d9594c9da265ddbf1e27e7dd8f09624568bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/d841a226a50c715431952a10260ba4fac9e91cc4",
- "reference": "d841a226a50c715431952a10260ba4fac9e91cc4",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/6055d9594c9da265ddbf1e27e7dd8f09624568bc",
+ "reference": "6055d9594c9da265ddbf1e27e7dd8f09624568bc",
"shasum": ""
},
"require": {
- "doctrine/inflector": "^1.4|^2.0",
- "dragonmantank/cron-expression": "^3.0.2",
- "egulias/email-validator": "^2.1.10",
- "ext-json": "*",
+ "brick/math": "^0.9.3|^0.10.2|^0.11",
+ "doctrine/inflector": "^2.0.5",
+ "dragonmantank/cron-expression": "^3.3.2",
+ "egulias/email-validator": "^3.2.1|^4.0",
+ "ext-ctype": "*",
+ "ext-filter": "*",
+ "ext-hash": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
- "laravel/serializable-closure": "^1.0",
- "league/commonmark": "^1.3|^2.0.2",
- "league/flysystem": "^1.1",
+ "ext-session": "*",
+ "ext-tokenizer": "*",
+ "fruitcake/php-cors": "^1.2",
+ "guzzlehttp/uri-template": "^1.0",
+ "laravel/serializable-closure": "^1.2.2",
+ "league/commonmark": "^2.2.1",
+ "league/flysystem": "^3.8.0",
"monolog/monolog": "^2.0",
- "nesbot/carbon": "^2.53.1",
- "opis/closure": "^3.6",
- "php": "^7.3|^8.0",
- "psr/container": "^1.0",
- "psr/log": "^1.0|^2.0",
- "psr/simple-cache": "^1.0",
- "ramsey/uuid": "^4.2.2",
- "swiftmailer/swiftmailer": "^6.3",
- "symfony/console": "^5.4",
- "symfony/error-handler": "^5.4",
- "symfony/finder": "^5.4",
- "symfony/http-foundation": "^5.4",
- "symfony/http-kernel": "^5.4",
- "symfony/mime": "^5.4",
- "symfony/process": "^5.4",
- "symfony/routing": "^5.4",
- "symfony/var-dumper": "^5.4",
- "tijsverkoyen/css-to-inline-styles": "^2.2.2",
+ "nesbot/carbon": "^2.62.1",
+ "nunomaduro/termwind": "^1.13",
+ "php": "^8.0.2",
+ "psr/container": "^1.1.1|^2.0.1",
+ "psr/log": "^1.0|^2.0|^3.0",
+ "psr/simple-cache": "^1.0|^2.0|^3.0",
+ "ramsey/uuid": "^4.7",
+ "symfony/console": "^6.0.9",
+ "symfony/error-handler": "^6.0",
+ "symfony/finder": "^6.0",
+ "symfony/http-foundation": "^6.0",
+ "symfony/http-kernel": "^6.0",
+ "symfony/mailer": "^6.0",
+ "symfony/mime": "^6.0",
+ "symfony/process": "^6.0",
+ "symfony/routing": "^6.0",
+ "symfony/uid": "^6.0",
+ "symfony/var-dumper": "^6.0",
+ "tijsverkoyen/css-to-inline-styles": "^2.2.5",
"vlucas/phpdotenv": "^5.4.1",
- "voku/portable-ascii": "^1.6.1"
+ "voku/portable-ascii": "^2.0"
},
"conflict": {
"tightenco/collect": "<5.5.33"
},
"provide": {
- "psr/container-implementation": "1.0",
- "psr/simple-cache-implementation": "1.0"
+ "psr/container-implementation": "1.1|2.0",
+ "psr/simple-cache-implementation": "1.0|2.0|3.0"
},
"replace": {
"illuminate/auth": "self.version",
@@ -2018,6 +2183,7 @@
"illuminate/bus": "self.version",
"illuminate/cache": "self.version",
"illuminate/collections": "self.version",
+ "illuminate/conditionable": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/container": "self.version",
@@ -2046,53 +2212,68 @@
"illuminate/view": "self.version"
},
"require-dev": {
- "aws/aws-sdk-php": "^3.198.1",
+ "ably/ably-php": "^1.0",
+ "aws/aws-sdk-php": "^3.235.5",
"doctrine/dbal": "^2.13.3|^3.1.4",
- "filp/whoops": "^2.14.3",
- "guzzlehttp/guzzle": "^6.5.5|^7.0.1",
- "league/flysystem-cached-adapter": "^1.0",
- "mockery/mockery": "^1.4.4",
- "orchestra/testbench-core": "^6.27",
+ "ext-gmp": "*",
+ "fakerphp/faker": "^1.21",
+ "guzzlehttp/guzzle": "^7.5",
+ "league/flysystem-aws-s3-v3": "^3.0",
+ "league/flysystem-ftp": "^3.0",
+ "league/flysystem-path-prefixing": "^3.3",
+ "league/flysystem-read-only": "^3.3",
+ "league/flysystem-sftp-v3": "^3.0",
+ "mockery/mockery": "^1.5.1",
+ "orchestra/testbench-core": "^7.24",
"pda/pheanstalk": "^4.0",
- "phpunit/phpunit": "^8.5.19|^9.5.8",
- "predis/predis": "^1.1.9",
- "symfony/cache": "^5.4"
+ "phpstan/phpdoc-parser": "^1.15",
+ "phpstan/phpstan": "^1.4.7",
+ "phpunit/phpunit": "^9.5.8",
+ "predis/predis": "^1.1.9|^2.0.2",
+ "symfony/cache": "^6.0",
+ "symfony/http-client": "^6.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
- "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).",
+ "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).",
"brianium/paratest": "Required to run tests in parallel (^6.0).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).",
- "ext-bcmath": "Required to use the multiple_of validation rule.",
+ "ext-apcu": "Required to use the APC cache driver.",
+ "ext-fileinfo": "Required to use the Filesystem class.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
"ext-memcached": "Required to use the memcache cache driver.",
- "ext-pcntl": "Required to use all features of the queue worker.",
+ "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.",
+ "ext-pdo": "Required to use all database features.",
"ext-posix": "Required to use all features of the queue worker.",
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
- "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).",
+ "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
- "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
- "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
- "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
- "mockery/mockery": "Required to use mocking (^1.4.4).",
+ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).",
+ "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
+ "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).",
+ "league/flysystem-read-only": "Required to use read-only disks (^3.3)",
+ "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
+ "mockery/mockery": "Required to use mocking (^1.5.1).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
- "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).",
- "predis/predis": "Required to use the predis connector (^1.1.9).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).",
+ "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
- "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0|^7.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^5.4).",
- "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).",
- "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).",
- "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)."
+ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^6.0).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).",
+ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).",
+ "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).",
+ "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).",
+ "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "8.x-dev"
+ "dev-master": "9.x-dev"
}
},
"autoload": {
@@ -2106,7 +2287,8 @@
"Illuminate\\": "src/Illuminate/",
"Illuminate\\Support\\": [
"src/Illuminate/Macroable/",
- "src/Illuminate/Collections/"
+ "src/Illuminate/Collections/",
+ "src/Illuminate/Conditionable/"
]
}
},
@@ -2130,7 +2312,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2024-11-20T15:55:41+00:00"
+ "time": "2025-09-30T14:57:50+00:00"
},
{
"name": "laravel/serializable-closure",
@@ -2584,54 +2766,55 @@
},
{
"name": "league/flysystem",
- "version": "1.1.10",
+ "version": "3.34.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1"
+ "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1",
- "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1",
+ "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e",
+ "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e",
"shasum": ""
},
"require": {
- "ext-fileinfo": "*",
- "league/mime-type-detection": "^1.3",
- "php": "^7.2.5 || ^8.0"
+ "league/flysystem-local": "^3.0.0",
+ "league/mime-type-detection": "^1.0.0",
+ "php": "^8.0.2"
},
"conflict": {
- "league/flysystem-sftp": "<1.0.6"
+ "async-aws/core": "<1.19.0",
+ "async-aws/s3": "<1.14.0",
+ "aws/aws-sdk-php": "3.209.31 || 3.210.0",
+ "guzzlehttp/guzzle": "<7.0",
+ "guzzlehttp/ringphp": "<1.1.1",
+ "phpseclib/phpseclib": "3.0.15",
+ "symfony/http-client": "<5.2"
},
"require-dev": {
- "phpspec/prophecy": "^1.11.1",
- "phpunit/phpunit": "^8.5.8"
- },
- "suggest": {
- "ext-ftp": "Allows you to use FTP server storage",
- "ext-openssl": "Allows you to use FTPS server storage",
- "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
- "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
- "league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
- "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
- "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
- "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
- "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
- "league/flysystem-webdav": "Allows you to use WebDAV storage",
- "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
- "spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
- "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
+ "async-aws/s3": "^1.5 || ^2.0",
+ "async-aws/simple-s3": "^1.1 || ^2.0",
+ "aws/aws-sdk-php": "^3.295.10",
+ "composer/semver": "^3.0",
+ "ext-fileinfo": "*",
+ "ext-ftp": "*",
+ "ext-mongodb": "^1.3|^2",
+ "ext-zip": "*",
+ "friendsofphp/php-cs-fixer": "^3.5",
+ "google/cloud-storage": "^1.23",
+ "guzzlehttp/psr7": "^2.6",
+ "microsoft/azure-storage-blob": "^1.1",
+ "mongodb/mongodb": "^1.2|^2",
+ "phpseclib/phpseclib": "^3.0.36",
+ "phpstan/phpstan": "^1.10",
+ "phpunit/phpunit": "^9.5.11|^10.0",
+ "sabre/dav": "^4.6.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1-dev"
- }
- },
"autoload": {
"psr-4": {
- "League\\Flysystem\\": "src/"
+ "League\\Flysystem\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2641,73 +2824,57 @@
"authors": [
{
"name": "Frank de Jonge",
- "email": "info@frenky.net"
+ "email": "info@frankdejonge.nl"
}
],
- "description": "Filesystem abstraction: Many filesystems, one API.",
+ "description": "File storage abstraction for PHP",
"keywords": [
- "Cloud Files",
"WebDAV",
- "abstraction",
"aws",
"cloud",
- "copy.com",
- "dropbox",
- "file systems",
+ "file",
"files",
"filesystem",
"filesystems",
"ftp",
- "rackspace",
- "remote",
"s3",
"sftp",
"storage"
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
- "source": "https://github.com/thephpleague/flysystem/tree/1.1.10"
+ "source": "https://github.com/thephpleague/flysystem/tree/3.34.0"
},
- "funding": [
- {
- "url": "https://offset.earth/frankdejonge",
- "type": "other"
- }
- ],
- "time": "2022-10-04T09:16:37+00:00"
+ "time": "2026-05-14T10:28:08+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
- "version": "1.0.30",
+ "version": "3.32.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
- "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d"
+ "reference": "a1979df7c9784d334ea6df356aed3d18ac6673d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/af286f291ebab6877bac0c359c6c2cb017eb061d",
- "reference": "af286f291ebab6877bac0c359c6c2cb017eb061d",
+ "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/a1979df7c9784d334ea6df356aed3d18ac6673d0",
+ "reference": "a1979df7c9784d334ea6df356aed3d18ac6673d0",
"shasum": ""
},
"require": {
- "aws/aws-sdk-php": "^3.20.0",
- "league/flysystem": "^1.0.40",
- "php": ">=5.5.0"
+ "aws/aws-sdk-php": "^3.295.10",
+ "league/flysystem": "^3.10.0",
+ "league/mime-type-detection": "^1.0.0",
+ "php": "^8.0.2"
},
- "require-dev": {
- "henrikbjorn/phpspec-code-coverage": "~1.0.1",
- "phpspec/phpspec": "^2.0.0"
+ "conflict": {
+ "guzzlehttp/guzzle": "<7.0",
+ "guzzlehttp/ringphp": "<1.1.1"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
"autoload": {
"psr-4": {
- "League\\Flysystem\\AwsS3v3\\": "src/"
+ "League\\Flysystem\\AwsS3V3\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2717,62 +2884,48 @@
"authors": [
{
"name": "Frank de Jonge",
- "email": "info@frenky.net"
+ "email": "info@frankdejonge.nl"
}
],
- "description": "Flysystem adapter for the AWS S3 SDK v3.x",
- "support": {
- "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues",
- "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.30"
- },
- "funding": [
- {
- "url": "https://offset.earth/frankdejonge",
- "type": "custom"
- },
- {
- "url": "https://github.com/frankdejonge",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/league/flysystem",
- "type": "tidelift"
- }
+ "description": "AWS S3 filesystem adapter for Flysystem.",
+ "keywords": [
+ "Flysystem",
+ "aws",
+ "file",
+ "files",
+ "filesystem",
+ "s3",
+ "storage"
],
- "time": "2022-07-02T13:51:38+00:00"
+ "support": {
+ "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.32.0"
+ },
+ "time": "2026-02-25T16:46:44+00:00"
},
{
- "name": "league/flysystem-cached-adapter",
- "version": "1.1.0",
+ "name": "league/flysystem-local",
+ "version": "3.31.0",
"source": {
"type": "git",
- "url": "https://github.com/thephpleague/flysystem-cached-adapter.git",
- "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff"
+ "url": "https://github.com/thephpleague/flysystem-local.git",
+ "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
- "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
+ "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079",
+ "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079",
"shasum": ""
},
"require": {
- "league/flysystem": "~1.0",
- "psr/cache": "^1.0.0"
- },
- "require-dev": {
- "mockery/mockery": "~0.9",
- "phpspec/phpspec": "^3.4",
- "phpunit/phpunit": "^5.7",
- "predis/predis": "~1.0",
- "tedivm/stash": "~0.12"
- },
- "suggest": {
- "ext-phpredis": "Pure C implemented extension for PHP"
+ "ext-fileinfo": "*",
+ "league/flysystem": "^3.0.0",
+ "league/mime-type-detection": "^1.0.0",
+ "php": "^8.0.2"
},
"type": "library",
"autoload": {
"psr-4": {
- "League\\Flysystem\\Cached\\": "src/"
+ "League\\Flysystem\\Local\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2781,16 +2934,22 @@
],
"authors": [
{
- "name": "frankdejonge",
- "email": "info@frenky.net"
+ "name": "Frank de Jonge",
+ "email": "info@frankdejonge.nl"
}
],
- "description": "An adapter decorator to enable meta-data caching.",
+ "description": "Local filesystem adapter for Flysystem.",
+ "keywords": [
+ "Flysystem",
+ "file",
+ "files",
+ "filesystem",
+ "local"
+ ],
"support": {
- "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues",
- "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master"
+ "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0"
},
- "time": "2020-07-25T15:56:04+00:00"
+ "time": "2026-01-23T15:30:45+00:00"
},
{
"name": "league/fractal",
@@ -2915,79 +3074,109 @@
],
"time": "2024-09-21T08:32:55+00:00"
},
+ {
+ "name": "maennchen/zipstream-php",
+ "version": "2.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/maennchen/ZipStream-PHP.git",
+ "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3",
+ "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "myclabs/php-enum": "^1.5",
+ "php": "^8.0",
+ "psr/http-message": "^1.0"
+ },
+ "require-dev": {
+ "ext-zip": "*",
+ "friendsofphp/php-cs-fixer": "^3.9",
+ "guzzlehttp/guzzle": "^6.5.3 || ^7.2.0",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.4",
+ "phpunit/phpunit": "^8.5.8 || ^9.4.2",
+ "vimeo/psalm": "^5.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "ZipStream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paul Duncan",
+ "email": "pabs@pablotron.org"
+ },
+ {
+ "name": "Jonatan Männchen",
+ "email": "jonatan@maennchen.ch"
+ },
+ {
+ "name": "Jesse Donat",
+ "email": "donatj@gmail.com"
+ },
+ {
+ "name": "András Kolesár",
+ "email": "kolesar@kolesar.hu"
+ }
+ ],
+ "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+ "keywords": [
+ "stream",
+ "zip"
+ ],
+ "support": {
+ "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/maennchen",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/zipstream",
+ "type": "open_collective"
+ }
+ ],
+ "time": "2022-12-08T12:29:14+00:00"
+ },
{
"name": "markbaker/complex",
- "version": "1.5.0",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
- "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2"
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/c3131244e29c08d44fefb49e0dd35021e9e39dd2",
- "reference": "c3131244e29c08d44fefb49e0dd35021e9e39dd2",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
- "php": "^5.6.0|^7.0"
+ "php": "^7.2 || ^8.0"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
- "phpcompatibility/php-compatibility": "^9.0",
- "phpdocumentor/phpdocumentor": "2.*",
- "phploc/phploc": "^4.0|^5.0|^6.0|^7.0",
- "phpmd/phpmd": "2.*",
- "phpunit/phpunit": "^4.8.35|^5.0|^6.0|^7.0",
- "sebastian/phpcpd": "2.*",
- "squizlabs/php_codesniffer": "^3.4.0"
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
- "files": [
- "classes/src/functions/abs.php",
- "classes/src/functions/acos.php",
- "classes/src/functions/acosh.php",
- "classes/src/functions/acot.php",
- "classes/src/functions/acoth.php",
- "classes/src/functions/acsc.php",
- "classes/src/functions/acsch.php",
- "classes/src/functions/argument.php",
- "classes/src/functions/asec.php",
- "classes/src/functions/asech.php",
- "classes/src/functions/asin.php",
- "classes/src/functions/asinh.php",
- "classes/src/functions/atan.php",
- "classes/src/functions/atanh.php",
- "classes/src/functions/conjugate.php",
- "classes/src/functions/cos.php",
- "classes/src/functions/cosh.php",
- "classes/src/functions/cot.php",
- "classes/src/functions/coth.php",
- "classes/src/functions/csc.php",
- "classes/src/functions/csch.php",
- "classes/src/functions/exp.php",
- "classes/src/functions/inverse.php",
- "classes/src/functions/ln.php",
- "classes/src/functions/log2.php",
- "classes/src/functions/log10.php",
- "classes/src/functions/negative.php",
- "classes/src/functions/pow.php",
- "classes/src/functions/rho.php",
- "classes/src/functions/sec.php",
- "classes/src/functions/sech.php",
- "classes/src/functions/sin.php",
- "classes/src/functions/sinh.php",
- "classes/src/functions/sqrt.php",
- "classes/src/functions/tan.php",
- "classes/src/functions/tanh.php",
- "classes/src/functions/theta.php",
- "classes/src/operations/add.php",
- "classes/src/operations/subtract.php",
- "classes/src/operations/multiply.php",
- "classes/src/operations/divideby.php",
- "classes/src/operations/divideinto.php"
- ],
"psr-4": {
"Complex\\": "classes/src/"
}
@@ -3010,56 +3199,39 @@
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
- "source": "https://github.com/MarkBaker/PHPComplex/tree/1.5.0"
+ "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
- "time": "2020-08-26T19:47:57+00:00"
+ "time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
- "version": "1.2.3",
+ "version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
- "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d"
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/44bb1ab01811116f01fe216ab37d921dccc6c10d",
- "reference": "44bb1ab01811116f01fe216ab37d921dccc6c10d",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
- "php": "^5.6.0|^7.0.0"
+ "php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
- "phpcompatibility/php-compatibility": "dev-master",
- "phploc/phploc": "^4",
- "phpmd/phpmd": "dev-master",
- "phpunit/phpunit": "^5.7|^6.0|7.0",
- "sebastian/phpcpd": "^3.0",
- "squizlabs/php_codesniffer": "^3.0@dev"
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "^4.0",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "sebastian/phpcpd": "^4.0",
+ "squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
- "files": [
- "classes/src/Functions/adjoint.php",
- "classes/src/Functions/antidiagonal.php",
- "classes/src/Functions/cofactors.php",
- "classes/src/Functions/determinant.php",
- "classes/src/Functions/diagonal.php",
- "classes/src/Functions/identity.php",
- "classes/src/Functions/inverse.php",
- "classes/src/Functions/minors.php",
- "classes/src/Functions/trace.php",
- "classes/src/Functions/transpose.php",
- "classes/src/Operations/add.php",
- "classes/src/Operations/directsum.php",
- "classes/src/Operations/subtract.php",
- "classes/src/Operations/multiply.php",
- "classes/src/Operations/divideby.php",
- "classes/src/Operations/divideinto.php"
- ],
"psr-4": {
"Matrix\\": "classes/src/"
}
@@ -3071,7 +3243,7 @@
"authors": [
{
"name": "Mark Baker",
- "email": "mark@lange.demon.co.uk"
+ "email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
@@ -3083,9 +3255,9 @@
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
- "source": "https://github.com/MarkBaker/PHPMatrix/tree/1.2.3"
+ "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
- "time": "2021-01-26T14:36:01+00:00"
+ "time": "2022-12-02T22:17:43+00:00"
},
{
"name": "mcamara/laravel-localization",
@@ -3331,6 +3503,69 @@
},
"time": "2024-09-04T18:46:31+00:00"
},
+ {
+ "name": "myclabs/php-enum",
+ "version": "1.8.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/php-enum.git",
+ "reference": "e7be26966b7398204a234f8673fdad5ac6277802"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802",
+ "reference": "e7be26966b7398204a234f8673fdad5ac6277802",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": "^7.3 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.5",
+ "squizlabs/php_codesniffer": "1.*",
+ "vimeo/psalm": "^4.6.2 || ^5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "MyCLabs\\Enum\\": "src/"
+ },
+ "classmap": [
+ "stubs/Stringable.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP Enum contributors",
+ "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
+ }
+ ],
+ "description": "PHP Enum implementation",
+ "homepage": "https://github.com/myclabs/php-enum",
+ "keywords": [
+ "enum"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/php-enum/issues",
+ "source": "https://github.com/myclabs/php-enum/tree/1.8.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/mnapoli",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-01-14T11:49:03+00:00"
+ },
{
"name": "nesbot/carbon",
"version": "2.73.0",
@@ -3502,29 +3737,30 @@
},
{
"name": "nette/utils",
- "version": "v3.2.10",
+ "version": "v4.0.10",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
- "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2"
+ "reference": "2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/utils/zipball/a4175c62652f2300c8017fb7e640f9ccb11648d2",
- "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2",
+ "url": "https://api.github.com/repos/nette/utils/zipball/2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3",
+ "reference": "2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3",
"shasum": ""
},
"require": {
- "php": ">=7.2 <8.4"
+ "php": "8.0 - 8.5"
},
"conflict": {
- "nette/di": "<3.0.6"
+ "nette/finder": "<3",
+ "nette/schema": "<1.2.2"
},
"require-dev": {
- "jetbrains/phpstorm-attributes": "dev-master",
- "nette/tester": "~2.0",
- "phpstan/phpstan": "^1.0",
- "tracy/tracy": "^2.3"
+ "jetbrains/phpstorm-attributes": "^1.2",
+ "nette/tester": "^2.5",
+ "phpstan/phpstan-nette": "^2.0@stable",
+ "tracy/tracy": "^2.9"
},
"suggest": {
"ext-gd": "to use Image",
@@ -3532,16 +3768,18 @@
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
"ext-json": "to use Nette\\Utils\\Json",
"ext-mbstring": "to use Strings::lower() etc...",
- "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()",
- "ext-xml": "to use Strings::length() etc. when mbstring is not available"
+ "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
+ "psr-4": {
+ "Nette\\": "src"
+ },
"classmap": [
"src/"
]
@@ -3582,9 +3820,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
- "source": "https://github.com/nette/utils/tree/v3.2.10"
+ "source": "https://github.com/nette/utils/tree/v4.0.10"
},
- "time": "2023-07-30T15:38:18+00:00"
+ "time": "2025-12-01T17:30:42+00:00"
},
{
"name": "nikic/php-parser",
@@ -3638,38 +3876,50 @@
"time": "2025-12-06T11:45:25+00:00"
},
{
- "name": "opis/closure",
- "version": "3.7.0",
+ "name": "nunomaduro/termwind",
+ "version": "v1.15.1",
"source": {
"type": "git",
- "url": "https://github.com/opis/closure.git",
- "reference": "b1a22a6be71c1263f3ca6e68f00b3fd4d394abc4"
+ "url": "https://github.com/nunomaduro/termwind.git",
+ "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/opis/closure/zipball/b1a22a6be71c1263f3ca6e68f00b3fd4d394abc4",
- "reference": "b1a22a6be71c1263f3ca6e68f00b3fd4d394abc4",
+ "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
+ "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
"shasum": ""
},
"require": {
- "php": "^5.4 || ^7.0 || ^8.0"
+ "ext-mbstring": "*",
+ "php": "^8.0",
+ "symfony/console": "^5.3.0|^6.0.0"
},
"require-dev": {
- "jeremeamia/superclosure": "^2.0",
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
+ "ergebnis/phpstan-rules": "^1.0.",
+ "illuminate/console": "^8.0|^9.0",
+ "illuminate/support": "^8.0|^9.0",
+ "laravel/pint": "^1.0.0",
+ "pestphp/pest": "^1.21.0",
+ "pestphp/pest-plugin-mock": "^1.0",
+ "phpstan/phpstan": "^1.4.6",
+ "phpstan/phpstan-strict-rules": "^1.1.0",
+ "symfony/var-dumper": "^5.2.7|^6.0.0",
+ "thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-master": "3.6.x-dev"
+ "laravel": {
+ "providers": [
+ "Termwind\\Laravel\\TermwindServiceProvider"
+ ]
}
},
"autoload": {
"files": [
- "functions.php"
+ "src/Functions.php"
],
"psr-4": {
- "Opis\\Closure\\": "src/"
+ "Termwind\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -3678,45 +3928,55 @@
],
"authors": [
{
- "name": "Marius Sarca",
- "email": "marius.sarca@gmail.com"
- },
- {
- "name": "Sorin Sarca",
- "email": "sarca_sorin@hotmail.com"
+ "name": "Nuno Maduro",
+ "email": "enunomaduro@gmail.com"
}
],
- "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.",
- "homepage": "https://opis.io/closure",
+ "description": "Its like Tailwind CSS, but for the console.",
"keywords": [
- "anonymous functions",
- "closure",
- "function",
- "serializable",
- "serialization",
- "serialize"
+ "cli",
+ "console",
+ "css",
+ "package",
+ "php",
+ "style"
],
"support": {
- "issues": "https://github.com/opis/closure/issues",
- "source": "https://github.com/opis/closure/tree/3.7.0"
+ "issues": "https://github.com/nunomaduro/termwind/issues",
+ "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1"
},
- "time": "2025-07-08T20:30:08+00:00"
+ "funding": [
+ {
+ "url": "https://www.paypal.com/paypalme/enunomaduro",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/nunomaduro",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/xiCO2k",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-08T01:06:31+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
- "version": "1.12.0",
+ "version": "1.30.5",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
- "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd"
+ "reference": "97bcabd32a64924688487dcd64aceaf158affb5c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/f79611d6dc1f6b7e8e30b738fc371b392001dbfd",
- "reference": "f79611d6dc1f6b7e8e30b738fc371b392001dbfd",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/97bcabd32a64924688487dcd64aceaf158affb5c",
+ "reference": "97bcabd32a64924688487dcd64aceaf158affb5c",
"shasum": ""
},
"require": {
+ "composer/pcre": "^1||^2||^3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
@@ -3730,24 +3990,31 @@
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
- "markbaker/complex": "^1.4",
- "markbaker/matrix": "^1.2",
- "php": "^7.1",
- "psr/simple-cache": "^1.0"
+ "ezyang/htmlpurifier": "^4.15",
+ "maennchen/zipstream-php": "^2.1 || ^3.0",
+ "markbaker/complex": "^3.0",
+ "markbaker/matrix": "^3.0",
+ "php": ">=7.4.0 <8.5.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
- "dompdf/dompdf": "^0.8.3",
- "friendsofphp/php-cs-fixer": "^2.16",
- "jpgraph/jpgraph": "^4.0",
- "mpdf/mpdf": "^8.0",
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+ "doctrine/instantiator": "^1.5",
+ "dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "mitoteam/jpgraph": "^10.3",
+ "mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
- "phpunit/phpunit": "^7.5",
- "squizlabs/php_codesniffer": "^3.5",
- "tecnickcom/tcpdf": "^6.3"
+ "phpstan/phpstan": "^1.1",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^8.5 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7",
+ "tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
- "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+ "ext-intl": "PHP Internationalization Functions",
+ "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
@@ -3779,6 +4046,9 @@
},
{
"name": "Adrien Crivelli"
+ },
+ {
+ "name": "Owen Leibman"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
@@ -3795,9 +4065,9 @@
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
- "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.12.0"
+ "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.30.5"
},
- "time": "2020-04-27T08:12:48+00:00"
+ "time": "2026-05-31T05:13:11+00:00"
},
{
"name": "phpoption/phpoption",
@@ -3936,55 +4206,6 @@
],
"time": "2025-11-12T18:00:11+00:00"
},
- {
- "name": "psr/cache",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/cache.git",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
- "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Cache\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for caching libraries",
- "keywords": [
- "cache",
- "psr",
- "psr-6"
- ],
- "support": {
- "source": "https://github.com/php-fig/cache/tree/master"
- },
- "time": "2016-08-06T20:24:11+00:00"
- },
{
"name": "psr/clock",
"version": "1.0.0",
@@ -4035,22 +4256,27 @@
},
{
"name": "psr/container",
- "version": "1.1.2",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
"shasum": ""
},
"require": {
"php": ">=7.4.0"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
@@ -4077,9 +4303,9 @@
],
"support": {
"issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.2"
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
},
- "time": "2021-11-05T16:50:12+00:00"
+ "time": "2021-11-05T16:47:00+00:00"
},
{
"name": "psr/event-dispatcher",
@@ -4240,16 +4466,16 @@
},
{
"name": "psr/http-message",
- "version": "2.0",
+ "version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
- "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
+ "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
- "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
+ "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"shasum": ""
},
"require": {
@@ -4258,7 +4484,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -4273,7 +4499,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
+ "homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
@@ -4287,36 +4513,36 @@
"response"
],
"support": {
- "source": "https://github.com/php-fig/http-message/tree/2.0"
+ "source": "https://github.com/php-fig/http-message/tree/1.1"
},
- "time": "2023-04-04T09:54:51+00:00"
+ "time": "2023-04-04T09:50:52+00:00"
},
{
"name": "psr/log",
- "version": "1.1.4",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
- "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Log\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -4337,31 +4563,31 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/1.1.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
- "time": "2021-05-03T11:20:27+00:00"
+ "time": "2024-09-11T13:17:53+00:00"
},
{
"name": "psr/simple-cache",
- "version": "1.0.1",
+ "version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
- "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
- "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "3.0.x-dev"
}
},
"autoload": {
@@ -4376,7 +4602,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
@@ -4388,9 +4614,9 @@
"simple-cache"
],
"support": {
- "source": "https://github.com/php-fig/simple-cache/tree/master"
+ "source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
},
- "time": "2017-10-23T01:57:42+00:00"
+ "time": "2021-10-29T13:26:27+00:00"
},
{
"name": "psy/psysh",
@@ -4607,54 +4833,47 @@
},
{
"name": "ramsey/uuid",
- "version": "4.2.3",
+ "version": "4.9.2",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
- "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df"
+ "reference": "8429c78ca35a09f27565311b98101e2826affde0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df",
- "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df",
+ "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0",
+ "reference": "8429c78ca35a09f27565311b98101e2826affde0",
"shasum": ""
},
"require": {
- "brick/math": "^0.8 || ^0.9",
- "ext-json": "*",
- "php": "^7.2 || ^8.0",
- "ramsey/collection": "^1.0",
- "symfony/polyfill-ctype": "^1.8",
- "symfony/polyfill-php80": "^1.14"
+ "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14",
+ "php": "^8.0",
+ "ramsey/collection": "^1.2 || ^2.0"
},
"replace": {
"rhumsaa/uuid": "self.version"
},
"require-dev": {
- "captainhook/captainhook": "^5.10",
+ "captainhook/captainhook": "^5.25",
"captainhook/plugin-composer": "^5.3",
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
- "doctrine/annotations": "^1.8",
- "ergebnis/composer-normalize": "^2.15",
- "mockery/mockery": "^1.3",
- "moontoast/math": "^1.1",
+ "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
+ "ergebnis/composer-normalize": "^2.47",
+ "mockery/mockery": "^1.6",
"paragonie/random-lib": "^2",
- "php-mock/php-mock": "^2.2",
- "php-mock/php-mock-mockery": "^1.3",
- "php-parallel-lint/php-parallel-lint": "^1.1",
- "phpbench/phpbench": "^1.0",
- "phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12",
- "phpstan/phpstan-mockery": "^0.12",
- "phpstan/phpstan-phpunit": "^0.12",
- "phpunit/phpunit": "^8.5 || ^9",
- "slevomat/coding-standard": "^7.0",
- "squizlabs/php_codesniffer": "^3.5",
- "vimeo/psalm": "^4.9"
+ "php-mock/php-mock": "^2.6",
+ "php-mock/php-mock-mockery": "^1.5",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
+ "phpbench/phpbench": "^1.2.14",
+ "phpstan/extension-installer": "^1.4",
+ "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan-mockery": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpunit/phpunit": "^9.6",
+ "slevomat/coding-standard": "^8.18",
+ "squizlabs/php_codesniffer": "^3.13"
},
"suggest": {
"ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.",
- "ext-ctype": "Enables faster processing of character classification using ctype functions.",
"ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.",
"ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.",
"paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter",
@@ -4664,9 +4883,6 @@
"extra": {
"captainhook": {
"force-install": true
- },
- "branch-alias": {
- "dev-main": "4.x-dev"
}
},
"autoload": {
@@ -4689,42 +4905,32 @@
],
"support": {
"issues": "https://github.com/ramsey/uuid/issues",
- "source": "https://github.com/ramsey/uuid/tree/4.2.3"
+ "source": "https://github.com/ramsey/uuid/tree/4.9.2"
},
- "funding": [
- {
- "url": "https://github.com/ramsey",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid",
- "type": "tidelift"
- }
- ],
- "time": "2021-09-25T23:10:38+00:00"
+ "time": "2025-12-14T04:43:48+00:00"
},
{
"name": "santigarcor/laratrust",
- "version": "6.4.0",
+ "version": "7.2.1",
"source": {
"type": "git",
"url": "https://github.com/santigarcor/laratrust.git",
- "reference": "81206ca3aab9bcbd4bed9b2c0b93158c8c1fb568"
+ "reference": "26e254161d2249163dede61fce89a02f952d8907"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/81206ca3aab9bcbd4bed9b2c0b93158c8c1fb568",
- "reference": "81206ca3aab9bcbd4bed9b2c0b93158c8c1fb568",
+ "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/26e254161d2249163dede61fce89a02f952d8907",
+ "reference": "26e254161d2249163dede61fce89a02f952d8907",
"shasum": ""
},
"require": {
- "kkszymanowski/traitor": "^0.2.0",
- "laravel/framework": "~6.0|~7.0|~8.0",
+ "kkszymanowski/traitor": "^1.0",
+ "laravel/framework": "~6.0|~7.0|~8.0|^9.0|^10.0",
"php": ">=7.2"
},
"require-dev": {
"mockery/mockery": "^1.3.2",
- "orchestra/testbench": "4.*|5.*|6.*",
+ "orchestra/testbench": "4.*|5.*|6.*|7.*|^8.0",
"phpunit/phpunit": "^7.5.15|^8.4|^9.0"
},
"type": "library",
@@ -4768,7 +4974,7 @@
],
"support": {
"issues": "https://github.com/santigarcor/laratrust/issues",
- "source": "https://github.com/santigarcor/laratrust/tree/6.4.0"
+ "source": "https://github.com/santigarcor/laratrust/tree/7.2.1"
},
"funding": [
{
@@ -4776,126 +4982,46 @@
"type": "github"
}
],
- "time": "2022-02-09T17:17:44+00:00"
+ "time": "2023-02-20T23:23:08+00:00"
},
{
- "name": "swiftmailer/swiftmailer",
- "version": "v6.3.0",
+ "name": "symfony/console",
+ "version": "v6.0.19",
"source": {
"type": "git",
- "url": "https://github.com/swiftmailer/swiftmailer.git",
- "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c"
+ "url": "https://github.com/symfony/console.git",
+ "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8a5d5072dca8f48460fce2f4131fcc495eec654c",
- "reference": "8a5d5072dca8f48460fce2f4131fcc495eec654c",
+ "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
+ "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
"shasum": ""
},
"require": {
- "egulias/email-validator": "^2.0|^3.1",
- "php": ">=7.0.0",
- "symfony/polyfill-iconv": "^1.0",
- "symfony/polyfill-intl-idn": "^1.10",
- "symfony/polyfill-mbstring": "^1.0"
+ "php": ">=8.0.2",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.4|^6.0"
},
- "require-dev": {
- "mockery/mockery": "^1.0",
- "symfony/phpunit-bridge": "^4.4|^5.4"
- },
- "suggest": {
- "ext-intl": "Needed to support internationalized email addresses"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "6.2-dev"
- }
- },
- "autoload": {
- "files": [
- "lib/swift_required.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Chris Corbyn"
- },
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- }
- ],
- "description": "Swiftmailer, free feature-rich PHP mailer",
- "homepage": "https://swiftmailer.symfony.com",
- "keywords": [
- "email",
- "mail",
- "mailer"
- ],
- "support": {
- "issues": "https://github.com/swiftmailer/swiftmailer/issues",
- "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.3.0"
- },
- "funding": [
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/swiftmailer/swiftmailer",
- "type": "tidelift"
- }
- ],
- "abandoned": "symfony/mailer",
- "time": "2021-10-18T15:26:12+00:00"
- },
- {
- "name": "symfony/console",
- "version": "v5.4.47",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed",
- "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.9",
- "symfony/polyfill-php80": "^1.16",
- "symfony/service-contracts": "^1.1|^2|^3",
- "symfony/string": "^5.1|^6.0"
- },
- "conflict": {
- "psr/log": ">=3",
- "symfony/dependency-injection": "<4.4",
- "symfony/dotenv": "<5.1",
- "symfony/event-dispatcher": "<4.4",
- "symfony/lock": "<4.4",
- "symfony/process": "<4.4"
+ "conflict": {
+ "symfony/dependency-injection": "<5.4",
+ "symfony/dotenv": "<5.4",
+ "symfony/event-dispatcher": "<5.4",
+ "symfony/lock": "<5.4",
+ "symfony/process": "<5.4"
},
"provide": {
- "psr/log-implementation": "1.0|2.0"
+ "psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
- "psr/log": "^1|^2",
- "symfony/config": "^4.4|^5.0|^6.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
- "symfony/lock": "^4.4|^5.0|^6.0",
- "symfony/process": "^4.4|^5.0|^6.0",
- "symfony/var-dumper": "^4.4|^5.0|^6.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/lock": "^5.4|^6.0",
+ "symfony/process": "^5.4|^6.0",
+ "symfony/var-dumper": "^5.4|^6.0"
},
"suggest": {
"psr/log": "For using the console logger",
@@ -4930,12 +5056,12 @@
"homepage": "https://symfony.com",
"keywords": [
"cli",
- "command-line",
+ "command line",
"console",
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.4.47"
+ "source": "https://github.com/symfony/console/tree/v6.0.19"
},
"funding": [
{
@@ -4951,25 +5077,24 @@
"type": "tidelift"
}
],
- "time": "2024-11-06T11:30:55+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v5.4.45",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097"
+ "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/4f7f3c35fba88146b56d0025d20ace3f3901f097",
- "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/f1d00bddb83a4cb2138564b2150001cb6ce272b1",
+ "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -5001,7 +5126,7 @@
"description": "Converts CSS selectors to XPath expressions",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/css-selector/tree/v5.4.45"
+ "source": "https://github.com/symfony/css-selector/tree/v6.0.19"
},
"funding": [
{
@@ -5017,24 +5142,24 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v2.5.4",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918"
+ "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918",
- "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
+ "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=8.0.2"
},
"type": "library",
"extra": {
@@ -5043,7 +5168,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "2.5-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -5068,7 +5193,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2"
},
"funding": [
{
@@ -5084,31 +5209,31 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2022-01-02T09:55:41+00:00"
},
{
"name": "symfony/error-handler",
- "version": "v5.4.46",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
- "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363"
+ "reference": "c7df52182f43a68522756ac31a532dd5b1e6db67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363",
- "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363",
+ "url": "https://api.github.com/repos/symfony/error-handler/zipball/c7df52182f43a68522756ac31a532dd5b1e6db67",
+ "reference": "c7df52182f43a68522756ac31a532dd5b1e6db67",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"psr/log": "^1|^2|^3",
- "symfony/var-dumper": "^4.4|^5.0|^6.0"
+ "symfony/var-dumper": "^5.4|^6.0"
},
"require-dev": {
"symfony/deprecation-contracts": "^2.1|^3",
- "symfony/http-kernel": "^4.4|^5.0|^6.0",
- "symfony/serializer": "^4.4|^5.0|^6.0"
+ "symfony/http-kernel": "^5.4|^6.0",
+ "symfony/serializer": "^5.4|^6.0"
},
"bin": [
"Resources/bin/patch-type-declarations"
@@ -5139,7 +5264,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/error-handler/tree/v5.4.46"
+ "source": "https://github.com/symfony/error-handler/tree/v6.0.19"
},
"funding": [
{
@@ -5155,44 +5280,42 @@
"type": "tidelift"
}
],
- "time": "2024-11-05T14:17:06+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v5.4.45",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9"
+ "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9",
- "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a",
+ "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/event-dispatcher-contracts": "^2|^3",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2",
+ "symfony/event-dispatcher-contracts": "^2|^3"
},
"conflict": {
- "symfony/dependency-injection": "<4.4"
+ "symfony/dependency-injection": "<5.4"
},
"provide": {
"psr/event-dispatcher-implementation": "1.0",
- "symfony/event-dispatcher-implementation": "2.0"
+ "symfony/event-dispatcher-implementation": "2.0|3.0"
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^4.4|^5.0|^6.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/error-handler": "^4.4|^5.0|^6.0",
- "symfony/expression-language": "^4.4|^5.0|^6.0",
- "symfony/http-foundation": "^4.4|^5.0|^6.0",
+ "symfony/config": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/error-handler": "^5.4|^6.0",
+ "symfony/expression-language": "^5.4|^6.0",
+ "symfony/http-foundation": "^5.4|^6.0",
"symfony/service-contracts": "^1.1|^2|^3",
- "symfony/stopwatch": "^4.4|^5.0|^6.0"
+ "symfony/stopwatch": "^5.4|^6.0"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -5224,7 +5347,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45"
+ "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19"
},
"funding": [
{
@@ -5240,24 +5363,24 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
- "version": "v2.5.4",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
- "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f"
+ "reference": "7bc61cc2db649b4637d331240c5346dcc7708051"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f",
- "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051",
+ "reference": "7bc61cc2db649b4637d331240c5346dcc7708051",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"psr/event-dispatcher": "^1"
},
"suggest": {
@@ -5270,7 +5393,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "2.5-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -5303,7 +5426,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.4"
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2"
},
"funding": [
{
@@ -5319,26 +5442,24 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2022-01-02T09:55:41+00:00"
},
{
"name": "symfony/finder",
- "version": "v5.4.45",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "63741784cd7b9967975eec610b256eed3ede022b"
+ "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b",
- "reference": "63741784cd7b9967975eec610b256eed3ede022b",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11",
+ "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -5366,7 +5487,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v5.4.45"
+ "source": "https://github.com/symfony/finder/tree/v6.0.19"
},
"funding": [
{
@@ -5382,35 +5503,34 @@
"type": "tidelift"
}
],
- "time": "2024-09-28T13:32:08+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v5.4.50",
+ "version": "v6.0.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609"
+ "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1a0706e8b8041046052ea2695eb8aeee04f97609",
- "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e16b2676a4b3b1fa12378a20b29c364feda2a8d6",
+ "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-mbstring": "~1.1",
- "symfony/polyfill-php80": "^1.16"
+ "symfony/polyfill-mbstring": "~1.1"
},
"require-dev": {
- "predis/predis": "^1.0|^2.0",
- "symfony/cache": "^4.4|^5.0|^6.0",
+ "predis/predis": "~1.0",
+ "symfony/cache": "^5.4|^6.0",
"symfony/dependency-injection": "^5.4|^6.0",
- "symfony/expression-language": "^4.4|^5.0|^6.0",
+ "symfony/expression-language": "^5.4|^6.0",
"symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4",
- "symfony/mime": "^4.4|^5.0|^6.0",
+ "symfony/mime": "^5.4|^6.0",
"symfony/rate-limiter": "^5.2|^6.0"
},
"suggest": {
@@ -5442,7 +5562,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-foundation/tree/v5.4.50"
+ "source": "https://github.com/symfony/http-foundation/tree/v6.0.20"
},
"funding": [
{
@@ -5453,78 +5573,70 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2025-11-03T12:58:48+00:00"
+ "time": "2023-01-30T15:41:07+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v5.4.53",
+ "version": "v6.0.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "ff18e126cc514769d03f1b2487567a4b85fc7ca6"
+ "reference": "6dc70833fd0ef5e861e17c7854c12d7d86679349"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ff18e126cc514769d03f1b2487567a4b85fc7ca6",
- "reference": "ff18e126cc514769d03f1b2487567a4b85fc7ca6",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6dc70833fd0ef5e861e17c7854c12d7d86679349",
+ "reference": "6dc70833fd0ef5e861e17c7854c12d7d86679349",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "psr/log": "^1|^2",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/error-handler": "^4.4|^5.0|^6.0",
- "symfony/event-dispatcher": "^5.0|^6.0",
- "symfony/http-foundation": "^5.4.21|^6.2.7",
- "symfony/polyfill-ctype": "^1.8",
- "symfony/polyfill-php73": "^1.9",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2",
+ "psr/log": "^1|^2|^3",
+ "symfony/error-handler": "^5.4|^6.0",
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/http-foundation": "^5.4|^6.0",
+ "symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/browser-kit": "<5.4",
- "symfony/cache": "<5.0",
- "symfony/config": "<5.0",
- "symfony/console": "<4.4",
- "symfony/dependency-injection": "<5.3",
- "symfony/doctrine-bridge": "<5.0",
- "symfony/form": "<5.0",
- "symfony/http-client": "<5.0",
- "symfony/mailer": "<5.0",
- "symfony/messenger": "<5.0",
- "symfony/translation": "<5.0",
- "symfony/twig-bridge": "<5.0",
- "symfony/validator": "<5.0",
+ "symfony/cache": "<5.4",
+ "symfony/config": "<5.4",
+ "symfony/console": "<5.4",
+ "symfony/dependency-injection": "<5.4",
+ "symfony/doctrine-bridge": "<5.4",
+ "symfony/form": "<5.4",
+ "symfony/http-client": "<5.4",
+ "symfony/mailer": "<5.4",
+ "symfony/messenger": "<5.4",
+ "symfony/translation": "<5.4",
+ "symfony/twig-bridge": "<5.4",
+ "symfony/validator": "<5.4",
"twig/twig": "<2.13"
},
"provide": {
- "psr/log-implementation": "1.0|2.0"
+ "psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
"psr/cache": "^1.0|^2.0|^3.0",
"symfony/browser-kit": "^5.4|^6.0",
- "symfony/config": "^5.0|^6.0",
- "symfony/console": "^4.4|^5.0|^6.0",
- "symfony/css-selector": "^4.4|^5.0|^6.0",
- "symfony/dependency-injection": "^5.3|^6.0",
- "symfony/dom-crawler": "^4.4|^5.0|^6.0",
- "symfony/expression-language": "^4.4|^5.0|^6.0",
- "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/config": "^5.4|^6.0",
+ "symfony/console": "^5.4|^6.0",
+ "symfony/css-selector": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/dom-crawler": "^5.4|^6.0",
+ "symfony/expression-language": "^5.4|^6.0",
+ "symfony/finder": "^5.4|^6.0",
"symfony/http-client-contracts": "^1.1|^2|^3",
- "symfony/process": "^4.4|^5.0|^6.0",
- "symfony/routing": "^4.4|^5.0|^6.0",
- "symfony/stopwatch": "^4.4|^5.0|^6.0",
- "symfony/translation": "^4.4|^5.0|^6.0",
+ "symfony/process": "^5.4|^6.0",
+ "symfony/routing": "^5.4|^6.0",
+ "symfony/stopwatch": "^5.4|^6.0",
+ "symfony/translation": "^5.4|^6.0",
"symfony/translation-contracts": "^1.1|^2|^3",
- "symfony/var-dumper": "^4.4.31|^5.4",
"twig/twig": "^2.13|^3.0.4"
},
"suggest": {
@@ -5559,7 +5671,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v5.4.53"
+ "source": "https://github.com/symfony/http-kernel/tree/v6.0.20"
},
"funding": [
{
@@ -5570,58 +5682,47 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-05-27T08:14:55+00:00"
+ "time": "2023-02-01T08:22:55+00:00"
},
{
- "name": "symfony/mime",
- "version": "v5.4.52",
+ "name": "symfony/mailer",
+ "version": "v6.0.19",
"source": {
"type": "git",
- "url": "https://github.com/symfony/mime.git",
- "reference": "8f89d3a319b92486b0bcc43c0479d19fdb0e2f64"
+ "url": "https://github.com/symfony/mailer.git",
+ "reference": "cd60799210c488f545ddde2444dc1aa548322872"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/8f89d3a319b92486b0bcc43c0479d19fdb0e2f64",
- "reference": "8f89d3a319b92486b0bcc43c0479d19fdb0e2f64",
+ "url": "https://api.github.com/repos/symfony/mailer/zipball/cd60799210c488f545ddde2444dc1aa548322872",
+ "reference": "cd60799210c488f545ddde2444dc1aa548322872",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-intl-idn": "^1.10",
- "symfony/polyfill-mbstring": "^1.0",
- "symfony/polyfill-php80": "^1.16"
+ "egulias/email-validator": "^2.1.10|^3|^4",
+ "php": ">=8.0.2",
+ "psr/event-dispatcher": "^1",
+ "psr/log": "^1|^2|^3",
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/mime": "^5.4|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3"
},
"conflict": {
- "egulias/email-validator": "~3.0.0",
- "phpdocumentor/reflection-docblock": "<3.2.2",
- "phpdocumentor/type-resolver": "<1.4.0",
- "symfony/mailer": "<4.4",
- "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3"
+ "symfony/http-kernel": "<5.4"
},
"require-dev": {
- "egulias/email-validator": "^2.1.10|^3.1|^4",
- "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/process": "^5.4|^6.4",
- "symfony/property-access": "^4.4|^5.1|^6.0",
- "symfony/property-info": "^4.4|^5.1|^6.0",
- "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3"
+ "symfony/http-client-contracts": "^1.1|^2|^3",
+ "symfony/messenger": "^5.4|^6.0"
},
"type": "library",
"autoload": {
"psr-4": {
- "Symfony\\Component\\Mime\\": ""
+ "Symfony\\Component\\Mailer\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -5641,14 +5742,10 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Allows manipulating MIME messages",
+ "description": "Helps sending emails",
"homepage": "https://symfony.com",
- "keywords": [
- "mime",
- "mime-type"
- ],
"support": {
- "source": "https://github.com/symfony/mime/tree/v5.4.52"
+ "source": "https://github.com/symfony/mailer/tree/v6.0.19"
},
"funding": [
{
@@ -5659,54 +5756,55 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-05-05T14:35:32+00:00"
+ "time": "2023-01-11T11:50:03+00:00"
},
{
- "name": "symfony/polyfill-ctype",
- "version": "v1.37.0",
+ "name": "symfony/mime",
+ "version": "v6.0.19",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "141046a8f9477948ff284fa65be2095baafb94f2"
+ "url": "https://github.com/symfony/mime.git",
+ "reference": "d7052547a0070cbeadd474e172b527a00d657301"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2",
- "reference": "141046a8f9477948ff284fa65be2095baafb94f2",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/d7052547a0070cbeadd474e172b527a00d657301",
+ "reference": "d7052547a0070cbeadd474e172b527a00d657301",
"shasum": ""
},
"require": {
- "php": ">=7.2"
+ "php": ">=8.0.2",
+ "symfony/polyfill-intl-idn": "^1.10",
+ "symfony/polyfill-mbstring": "^1.0"
},
- "provide": {
- "ext-ctype": "*"
+ "conflict": {
+ "egulias/email-validator": "~3.0.0",
+ "phpdocumentor/reflection-docblock": "<3.2.2",
+ "phpdocumentor/type-resolver": "<1.4.0",
+ "symfony/mailer": "<5.4",
+ "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6"
},
- "suggest": {
- "ext-ctype": "For best performance"
+ "require-dev": {
+ "egulias/email-validator": "^2.1.10|^3.1|^4",
+ "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/property-access": "^5.4|^6.0",
+ "symfony/property-info": "^5.4|^6.0",
+ "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6"
},
"type": "library",
- "extra": {
- "thanks": {
- "url": "https://github.com/symfony/polyfill",
- "name": "symfony/polyfill"
- }
- },
"autoload": {
- "files": [
- "bootstrap.php"
- ],
"psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- }
+ "Symfony\\Component\\Mime\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -5714,24 +5812,22 @@
],
"authors": [
{
- "name": "Gert de Pagter",
- "email": "BackEndTea@gmail.com"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for ctype functions",
+ "description": "Allows manipulating MIME messages",
"homepage": "https://symfony.com",
"keywords": [
- "compatibility",
- "ctype",
- "polyfill",
- "portable"
+ "mime",
+ "mime-type"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
+ "source": "https://github.com/symfony/mime/tree/v6.0.19"
},
"funding": [
{
@@ -5742,39 +5838,35 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-04-10T16:19:22+00:00"
+ "time": "2023-01-11T11:50:03+00:00"
},
{
- "name": "symfony/polyfill-iconv",
+ "name": "symfony/polyfill-ctype",
"version": "v1.37.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-iconv.git",
- "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57"
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/2c5729fd241b4b22f6e4b436bc3354a4f262df57",
- "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2",
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"provide": {
- "ext-iconv": "*"
+ "ext-ctype": "*"
},
"suggest": {
- "ext-iconv": "For best performance"
+ "ext-ctype": "For best performance"
},
"type": "library",
"extra": {
@@ -5788,7 +5880,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Iconv\\": ""
+ "Symfony\\Polyfill\\Ctype\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -5797,25 +5889,24 @@
],
"authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for the Iconv extension",
+ "description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
- "iconv",
+ "ctype",
"polyfill",
- "portable",
- "shim"
+ "portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-iconv/tree/v1.37.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
},
"funding": [
{
@@ -6177,17 +6268,17 @@
"time": "2026-05-26T12:51:13+00:00"
},
{
- "name": "symfony/polyfill-php73",
+ "name": "symfony/polyfill-php80",
"version": "v1.37.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb"
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
- "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
+ "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
"shasum": ""
},
"require": {
@@ -6205,7 +6296,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php73\\": ""
+ "Symfony\\Polyfill\\Php80\\": ""
},
"classmap": [
"Resources/stubs"
@@ -6216,6 +6307,10 @@
"MIT"
],
"authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@@ -6225,7 +6320,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -6234,7 +6329,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.37.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"
},
"funding": [
{
@@ -6254,20 +6349,20 @@
"type": "tidelift"
}
],
- "time": "2024-09-09T11:45:10+00:00"
+ "time": "2026-04-10T16:19:22+00:00"
},
{
- "name": "symfony/polyfill-php80",
- "version": "v1.37.0",
+ "name": "symfony/polyfill-php81",
+ "version": "v1.38.1",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411"
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
- "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
+ "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
"shasum": ""
},
"require": {
@@ -6285,7 +6380,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
+ "Symfony\\Polyfill\\Php81\\": ""
},
"classmap": [
"Resources/stubs"
@@ -6296,10 +6391,6 @@
"MIT"
],
"authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@@ -6309,7 +6400,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -6318,7 +6409,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1"
},
"funding": [
{
@@ -6338,25 +6429,31 @@
"type": "tidelift"
}
],
- "time": "2026-04-10T16:19:22+00:00"
+ "time": "2026-05-26T12:45:58+00:00"
},
{
- "name": "symfony/polyfill-php81",
- "version": "v1.38.1",
+ "name": "symfony/polyfill-uuid",
+ "version": "v1.37.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7"
+ "url": "https://github.com/symfony/polyfill-uuid.git",
+ "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
- "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
+ "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
+ "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
+ "provide": {
+ "ext-uuid": "*"
+ },
+ "suggest": {
+ "ext-uuid": "For best performance"
+ },
"type": "library",
"extra": {
"thanks": {
@@ -6369,11 +6466,8 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php81\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
+ "Symfony\\Polyfill\\Uuid\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -6381,24 +6475,24 @@
],
"authors": [
{
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
+ "name": "Grégoire Pineau",
+ "email": "lyrixx@lyrixx.info"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "description": "Symfony polyfill for uuid functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
- "shim"
+ "uuid"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1"
+ "source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0"
},
"funding": [
{
@@ -6418,25 +6512,24 @@
"type": "tidelift"
}
],
- "time": "2026-05-26T12:45:58+00:00"
+ "time": "2026-04-10T16:19:22+00:00"
},
{
"name": "symfony/process",
- "version": "v5.4.51",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "467bfc56f18f5ef6d5ccb09324d7e988c1c0a98f"
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/467bfc56f18f5ef6d5ccb09324d7e988c1c0a98f",
- "reference": "467bfc56f18f5ef6d5ccb09324d7e988c1c0a98f",
+ "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4",
+ "reference": "2114fd60f26a296cc403a7939ab91478475a33d4",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"type": "library",
"autoload": {
@@ -6464,7 +6557,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v5.4.51"
+ "source": "https://github.com/symfony/process/tree/v6.0.19"
},
"funding": [
{
@@ -6475,50 +6568,44 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-01-26T15:53:37+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/routing",
- "version": "v5.4.53",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "f4ca0c533854c26e3b27e981da760807f89e1a42"
+ "reference": "e56ca9b41c1ec447193474cd86ad7c0b547755ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/f4ca0c533854c26e3b27e981da760807f89e1a42",
- "reference": "f4ca0c533854c26e3b27e981da760807f89e1a42",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/e56ca9b41c1ec447193474cd86ad7c0b547755ac",
+ "reference": "e56ca9b41c1ec447193474cd86ad7c0b547755ac",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"conflict": {
"doctrine/annotations": "<1.12",
- "symfony/config": "<5.3",
- "symfony/dependency-injection": "<4.4",
- "symfony/yaml": "<4.4"
+ "symfony/config": "<5.4",
+ "symfony/dependency-injection": "<5.4",
+ "symfony/yaml": "<5.4"
},
"require-dev": {
"doctrine/annotations": "^1.12|^2",
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.3|^6.0",
- "symfony/dependency-injection": "^4.4|^5.0|^6.0",
- "symfony/expression-language": "^4.4|^5.0|^6.0",
- "symfony/http-foundation": "^4.4|^5.0|^6.0",
- "symfony/yaml": "^4.4|^5.0|^6.0"
+ "symfony/config": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/expression-language": "^5.4|^6.0",
+ "symfony/http-foundation": "^5.4|^6.0",
+ "symfony/yaml": "^5.4|^6.0"
},
"suggest": {
"symfony/config": "For using the all-in-one router or any loader",
@@ -6558,7 +6645,7 @@
"url"
],
"support": {
- "source": "https://github.com/symfony/routing/tree/v5.4.53"
+ "source": "https://github.com/symfony/routing/tree/v6.0.19"
},
"funding": [
{
@@ -6569,35 +6656,30 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-05-22T19:02:28+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v2.5.4",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "f37b419f7aea2e9abf10abd261832cace12e3300"
+ "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300",
- "reference": "f37b419f7aea2e9abf10abd261832cace12e3300",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66",
+ "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "psr/container": "^1.1",
- "symfony/deprecation-contracts": "^2.1|^3"
+ "php": ">=8.0.2",
+ "psr/container": "^2.0"
},
"conflict": {
"ext-psr": "<1.1|>=2"
@@ -6612,7 +6694,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "2.5-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -6645,7 +6727,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v2.5.4"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.0.2"
},
"funding": [
{
@@ -6661,38 +6743,37 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2022-05-30T19:17:58+00:00"
},
{
"name": "symfony/string",
- "version": "v5.4.47",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "136ca7d72f72b599f2631aca474a4f8e26719799"
+ "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799",
- "reference": "136ca7d72f72b599f2631aca474a4f8e26719799",
+ "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a",
+ "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "~1.15"
+ "symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/translation-contracts": ">=3.0"
+ "symfony/translation-contracts": "<2.0"
},
"require-dev": {
- "symfony/error-handler": "^4.4|^5.0|^6.0",
- "symfony/http-client": "^4.4|^5.0|^6.0",
- "symfony/translation-contracts": "^1.1|^2",
- "symfony/var-exporter": "^4.4|^5.0|^6.0"
+ "symfony/error-handler": "^5.4|^6.0",
+ "symfony/http-client": "^5.4|^6.0",
+ "symfony/translation-contracts": "^2.0|^3.0",
+ "symfony/var-exporter": "^5.4|^6.0"
},
"type": "library",
"autoload": {
@@ -6731,7 +6812,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.4.47"
+ "source": "https://github.com/symfony/string/tree/v6.0.19"
},
"funding": [
{
@@ -6747,52 +6828,50 @@
"type": "tidelift"
}
],
- "time": "2024-11-10T20:33:58+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/translation",
- "version": "v5.4.45",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed"
+ "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/98f26acc99341ca4bab345fb14d7b1d7cb825bed",
- "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f",
+ "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
+ "php": ">=8.0.2",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "^1.16",
- "symfony/translation-contracts": "^2.3"
+ "symfony/translation-contracts": "^2.3|^3.0"
},
"conflict": {
- "symfony/config": "<4.4",
- "symfony/console": "<5.3",
- "symfony/dependency-injection": "<5.0",
- "symfony/http-kernel": "<5.0",
- "symfony/twig-bundle": "<5.0",
- "symfony/yaml": "<4.4"
+ "symfony/config": "<5.4",
+ "symfony/console": "<5.4",
+ "symfony/dependency-injection": "<5.4",
+ "symfony/http-kernel": "<5.4",
+ "symfony/twig-bundle": "<5.4",
+ "symfony/yaml": "<5.4"
},
"provide": {
- "symfony/translation-implementation": "2.3"
+ "symfony/translation-implementation": "2.3|3.0"
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/config": "^5.4|^6.0",
"symfony/console": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.0|^6.0",
- "symfony/finder": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/finder": "^5.4|^6.0",
"symfony/http-client-contracts": "^1.1|^2.0|^3.0",
- "symfony/http-kernel": "^5.0|^6.0",
- "symfony/intl": "^4.4|^5.0|^6.0",
+ "symfony/http-kernel": "^5.4|^6.0",
+ "symfony/intl": "^5.4|^6.0",
"symfony/polyfill-intl-icu": "^1.21",
"symfony/service-contracts": "^1.1.2|^2|^3",
- "symfony/yaml": "^4.4|^5.0|^6.0"
+ "symfony/yaml": "^5.4|^6.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
@@ -6828,7 +6907,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v5.4.45"
+ "source": "https://github.com/symfony/translation/tree/v6.0.19"
},
"funding": [
{
@@ -6844,24 +6923,24 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/translation-contracts",
- "version": "v2.5.4",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
- "reference": "450d4172653f38818657022252f9d81be89ee9a8"
+ "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8",
- "reference": "450d4172653f38818657022252f9d81be89ee9a8",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282",
+ "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282",
"shasum": ""
},
"require": {
- "php": ">=7.2.5"
+ "php": ">=8.0.2"
},
"suggest": {
"symfony/translation-implementation": ""
@@ -6873,7 +6952,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "2.5-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -6906,7 +6985,81 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/translation-contracts/tree/v2.5.4"
+ "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-06-27T17:10:44+00:00"
+ },
+ {
+ "name": "symfony/uid",
+ "version": "v6.0.19",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/uid.git",
+ "reference": "6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/uid/zipball/6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d",
+ "reference": "6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.2",
+ "symfony/polyfill-uuid": "^1.15"
+ },
+ "require-dev": {
+ "symfony/console": "^5.4|^6.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Uid\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Grégoire Pineau",
+ "email": "lyrixx@lyrixx.info"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an object-oriented API to generate and represent UIDs",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "UID",
+ "ulid",
+ "uuid"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/uid/tree/v6.0.19"
},
"funding": [
{
@@ -6922,36 +7075,35 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2023-01-01T08:36:10+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v5.4.48",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8"
+ "reference": "eb980457fa6899840fe1687e8627a03a7d8a3d52"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8",
- "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eb980457fa6899840fe1687e8627a03a7d8a3d52",
+ "reference": "eb980457fa6899840fe1687e8627a03a7d8a3d52",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2",
+ "symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/console": "<4.4"
+ "phpunit/phpunit": "<5.4.3",
+ "symfony/console": "<5.4"
},
"require-dev": {
"ext-iconv": "*",
- "symfony/console": "^4.4|^5.0|^6.0",
- "symfony/http-kernel": "^4.4|^5.0|^6.0",
- "symfony/process": "^4.4|^5.0|^6.0",
- "symfony/uid": "^5.1|^6.0",
+ "symfony/console": "^5.4|^6.0",
+ "symfony/process": "^5.4|^6.0",
+ "symfony/uid": "^5.4|^6.0",
"twig/twig": "^2.13|^3.0.4"
},
"suggest": {
@@ -6995,7 +7147,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v5.4.48"
+ "source": "https://github.com/symfony/var-dumper/tree/v6.0.19"
},
"funding": [
{
@@ -7011,7 +7163,7 @@
"type": "tidelift"
}
],
- "time": "2024-11-08T15:21:10+00:00"
+ "time": "2023-01-20T17:44:14+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@@ -7205,23 +7357,23 @@
},
{
"name": "voku/portable-ascii",
- "version": "1.6.1",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/voku/portable-ascii.git",
- "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a"
+ "reference": "8e1051fe39379367aecf014f41744ce7539a856f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a",
- "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a",
+ "url": "https://api.github.com/repos/voku/portable-ascii/zipball/8e1051fe39379367aecf014f41744ce7539a856f",
+ "reference": "8e1051fe39379367aecf014f41744ce7539a856f",
"shasum": ""
},
"require": {
- "php": ">=7.0.0"
+ "php": ">=7.1.0"
},
"require-dev": {
- "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
+ "phpunit/phpunit": "~8.5 || ~9.6 || ~10.5 || ~11.5"
},
"suggest": {
"ext-intl": "Use Intl for transliterator_transliterate() support"
@@ -7239,7 +7391,7 @@
"authors": [
{
"name": "Lars Moelleken",
- "homepage": "http://www.moelleken.org/"
+ "homepage": "https://www.moelleken.org/"
}
],
"description": "Portable ASCII library - performance optimized (ascii) string functions for php.",
@@ -7251,7 +7403,7 @@
],
"support": {
"issues": "https://github.com/voku/portable-ascii/issues",
- "source": "https://github.com/voku/portable-ascii/tree/1.6.1"
+ "source": "https://github.com/voku/portable-ascii/tree/2.1.1"
},
"funding": [
{
@@ -7275,7 +7427,7 @@
"type": "tidelift"
}
],
- "time": "2022-01-24T18:55:24+00:00"
+ "time": "2026-04-26T05:33:54+00:00"
}
],
"packages-dev": [
@@ -7346,30 +7498,30 @@
},
{
"name": "barryvdh/laravel-debugbar",
- "version": "v3.7.0",
+ "version": "v3.14.10",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
- "reference": "3372ed65e6d2039d663ed19aa699956f9d346271"
+ "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/3372ed65e6d2039d663ed19aa699956f9d346271",
- "reference": "3372ed65e6d2039d663ed19aa699956f9d346271",
+ "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/56b9bd235e3fe62e250124804009ce5bab97cc63",
+ "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63",
"shasum": ""
},
"require": {
- "illuminate/routing": "^7|^8|^9",
- "illuminate/session": "^7|^8|^9",
- "illuminate/support": "^7|^8|^9",
- "maximebf/debugbar": "^1.17.2",
- "php": ">=7.2.5",
- "symfony/finder": "^5|^6"
+ "illuminate/routing": "^9|^10|^11",
+ "illuminate/session": "^9|^10|^11",
+ "illuminate/support": "^9|^10|^11",
+ "maximebf/debugbar": "~1.23.0",
+ "php": "^8.0",
+ "symfony/finder": "^6|^7"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
- "orchestra/testbench-dusk": "^5|^6|^7",
- "phpunit/phpunit": "^8.5|^9.0",
+ "orchestra/testbench-dusk": "^5|^6|^7|^8|^9",
+ "phpunit/phpunit": "^9.6|^10.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
@@ -7383,7 +7535,7 @@
]
},
"branch-alias": {
- "dev-master": "3.6-dev"
+ "dev-master": "3.14-dev"
}
},
"autoload": {
@@ -7414,7 +7566,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
- "source": "https://github.com/fruitcake/laravel-debugbar/tree/v3.7.0"
+ "source": "https://github.com/fruitcake/laravel-debugbar/tree/v3.14.10"
},
"funding": [
{
@@ -7426,7 +7578,7 @@
"type": "github"
}
],
- "time": "2022-07-11T09:26:42+00:00"
+ "time": "2024-12-23T10:10:42+00:00"
},
{
"name": "doctrine/instantiator",
@@ -7493,230 +7645,36 @@
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
- "type": "tidelift"
- }
- ],
- "time": "2022-12-30T00:15:36+00:00"
- },
- {
- "name": "erusev/parsedown",
- "version": "1.7.4",
- "source": {
- "type": "git",
- "url": "https://github.com/erusev/parsedown.git",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
- "shasum": ""
- },
- "require": {
- "ext-mbstring": "*",
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Parsedown": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Emanuil Rusev",
- "email": "hello@erusev.com",
- "homepage": "http://erusev.com"
- }
- ],
- "description": "Parser for Markdown.",
- "homepage": "http://parsedown.org",
- "keywords": [
- "markdown",
- "parser"
- ],
- "support": {
- "issues": "https://github.com/erusev/parsedown/issues",
- "source": "https://github.com/erusev/parsedown/tree/1.7.x"
- },
- "time": "2019-12-30T22:54:17+00:00"
- },
- {
- "name": "facade/flare-client-php",
- "version": "1.10.0",
- "source": {
- "type": "git",
- "url": "https://github.com/facade/flare-client-php.git",
- "reference": "213fa2c69e120bca4c51ba3e82ed1834ef3f41b8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/facade/flare-client-php/zipball/213fa2c69e120bca4c51ba3e82ed1834ef3f41b8",
- "reference": "213fa2c69e120bca4c51ba3e82ed1834ef3f41b8",
- "shasum": ""
- },
- "require": {
- "facade/ignition-contracts": "~1.0",
- "illuminate/pipeline": "^5.5|^6.0|^7.0|^8.0",
- "php": "^7.1|^8.0",
- "symfony/http-foundation": "^3.3|^4.1|^5.0",
- "symfony/mime": "^3.4|^4.0|^5.1",
- "symfony/var-dumper": "^3.4|^4.0|^5.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^2.14",
- "phpunit/phpunit": "^7.5",
- "spatie/phpunit-snapshot-assertions": "^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "files": [
- "src/helpers.php"
- ],
- "psr-4": {
- "Facade\\FlareClient\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Send PHP errors to Flare",
- "homepage": "https://github.com/facade/flare-client-php",
- "keywords": [
- "exception",
- "facade",
- "flare",
- "reporting"
- ],
- "support": {
- "issues": "https://github.com/facade/flare-client-php/issues",
- "source": "https://github.com/facade/flare-client-php/tree/1.10.0"
- },
- "funding": [
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "time": "2022-08-09T11:23:57+00:00"
- },
- {
- "name": "facade/ignition",
- "version": "2.17.7",
- "source": {
- "type": "git",
- "url": "https://github.com/facade/ignition.git",
- "reference": "b4f5955825bb4b74cba0f94001761c46335c33e9"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/facade/ignition/zipball/b4f5955825bb4b74cba0f94001761c46335c33e9",
- "reference": "b4f5955825bb4b74cba0f94001761c46335c33e9",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "ext-json": "*",
- "ext-mbstring": "*",
- "facade/flare-client-php": "^1.9.1",
- "facade/ignition-contracts": "^1.0.2",
- "illuminate/support": "^7.0|^8.0",
- "monolog/monolog": "^2.0",
- "php": "^7.2.5|^8.0",
- "symfony/console": "^5.0",
- "symfony/var-dumper": "^5.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "^2.14",
- "livewire/livewire": "^2.4",
- "mockery/mockery": "^1.3",
- "orchestra/testbench": "^5.0|^6.0",
- "psalm/plugin-laravel": "^1.2"
- },
- "suggest": {
- "laravel/telescope": "^3.1"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "aliases": {
- "Flare": "Facade\\Ignition\\Facades\\Flare"
- },
- "providers": [
- "Facade\\Ignition\\IgnitionServiceProvider"
- ]
- },
- "branch-alias": {
- "dev-master": "2.x-dev"
- }
- },
- "autoload": {
- "files": [
- "src/helpers.php"
- ],
- "psr-4": {
- "Facade\\Ignition\\": "src"
+ "type": "tidelift"
}
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "A beautiful error page for Laravel applications.",
- "homepage": "https://github.com/facade/ignition",
- "keywords": [
- "error",
- "flare",
- "laravel",
- "page"
],
- "support": {
- "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction",
- "forum": "https://twitter.com/flareappio",
- "issues": "https://github.com/facade/ignition/issues",
- "source": "https://github.com/facade/ignition"
- },
- "time": "2023-01-26T12:34:59+00:00"
+ "time": "2022-12-30T00:15:36+00:00"
},
{
- "name": "facade/ignition-contracts",
- "version": "1.0.2",
+ "name": "erusev/parsedown",
+ "version": "1.7.4",
"source": {
"type": "git",
- "url": "https://github.com/facade/ignition-contracts.git",
- "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267"
+ "url": "https://github.com/erusev/parsedown.git",
+ "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
- "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
+ "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
"shasum": ""
},
"require": {
- "php": "^7.3|^8.0"
+ "ext-mbstring": "*",
+ "php": ">=5.3.0"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "^v2.15.8",
- "phpunit/phpunit": "^9.3.11",
- "vimeo/psalm": "^3.17.1"
+ "phpunit/phpunit": "^4.8.35"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Facade\\IgnitionContracts\\": "src"
+ "psr-0": {
+ "Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -7725,24 +7683,22 @@
],
"authors": [
{
- "name": "Freek Van der Herten",
- "email": "freek@spatie.be",
- "homepage": "https://flareapp.io",
- "role": "Developer"
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
}
],
- "description": "Solution contracts for Ignition",
- "homepage": "https://github.com/facade/ignition-contracts",
+ "description": "Parser for Markdown.",
+ "homepage": "http://parsedown.org",
"keywords": [
- "contracts",
- "flare",
- "ignition"
+ "markdown",
+ "parser"
],
"support": {
- "issues": "https://github.com/facade/ignition-contracts/issues",
- "source": "https://github.com/facade/ignition-contracts/tree/1.0.2"
+ "issues": "https://github.com/erusev/parsedown/issues",
+ "source": "https://github.com/erusev/parsedown/tree/1.7.x"
},
- "time": "2020-10-16T08:27:54+00:00"
+ "time": "2019-12-30T22:54:17+00:00"
},
{
"name": "fakerphp/faker",
@@ -8292,34 +8248,32 @@
},
{
"name": "nunomaduro/collision",
- "version": "v5.11.0",
+ "version": "v6.4.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
- "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461"
+ "reference": "f05978827b9343cba381ca05b8c7deee346b6015"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/collision/zipball/8b610eef8582ccdc05d8f2ab23305e2d37049461",
- "reference": "8b610eef8582ccdc05d8f2ab23305e2d37049461",
+ "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f05978827b9343cba381ca05b8c7deee346b6015",
+ "reference": "f05978827b9343cba381ca05b8c7deee346b6015",
"shasum": ""
},
"require": {
- "facade/ignition-contracts": "^1.0",
- "filp/whoops": "^2.14.3",
- "php": "^7.3 || ^8.0",
- "symfony/console": "^5.0"
+ "filp/whoops": "^2.14.5",
+ "php": "^8.0.0",
+ "symfony/console": "^6.0.2"
},
"require-dev": {
- "brianium/paratest": "^6.1",
- "fideloper/proxy": "^4.4.1",
- "fruitcake/laravel-cors": "^2.0.3",
- "laravel/framework": "8.x-dev",
- "nunomaduro/larastan": "^0.6.2",
- "nunomaduro/mock-final-classes": "^1.0",
- "orchestra/testbench": "^6.0",
- "phpstan/phpstan": "^0.12.64",
- "phpunit/phpunit": "^9.5.0"
+ "brianium/paratest": "^6.4.1",
+ "laravel/framework": "^9.26.1",
+ "laravel/pint": "^1.1.1",
+ "nunomaduro/larastan": "^1.0.3",
+ "nunomaduro/mock-final-classes": "^1.1.0",
+ "orchestra/testbench": "^7.7",
+ "phpunit/phpunit": "^9.5.23",
+ "spatie/ignition": "^1.4.1"
},
"type": "library",
"extra": {
@@ -8327,6 +8281,9 @@
"providers": [
"NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider"
]
+ },
+ "branch-alias": {
+ "dev-develop": "6.x-dev"
}
},
"autoload": {
@@ -8375,7 +8332,7 @@
"type": "patreon"
}
],
- "time": "2022-01-10T16:22:52+00:00"
+ "time": "2023-01-03T12:54:54+00:00"
},
{
"name": "phar-io/manifest",
@@ -9985,22 +9942,22 @@
},
{
"name": "shalvah/upgrader",
- "version": "0.2.1",
+ "version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/shalvah/upgrader.git",
- "reference": "cad9bea6ac6584bf05e58dbc8af43bcb636370e6"
+ "reference": "e1ee67cc411ca9af61375548431e2f38f694ea85"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/shalvah/upgrader/zipball/cad9bea6ac6584bf05e58dbc8af43bcb636370e6",
- "reference": "cad9bea6ac6584bf05e58dbc8af43bcb636370e6",
+ "url": "https://api.github.com/repos/shalvah/upgrader/zipball/e1ee67cc411ca9af61375548431e2f38f694ea85",
+ "reference": "e1ee67cc411ca9af61375548431e2f38f694ea85",
"shasum": ""
},
"require": {
- "illuminate/support": "^6.0|^7.0|^8.0|^9.0",
- "nikic/php-parser": "^4.13",
- "php": ">=7.4"
+ "illuminate/support": ">=8.0",
+ "nikic/php-parser": "^4.13|^5.0",
+ "php": ">=8.0"
},
"require-dev": {
"dms/phpunit-arraysubset-asserts": "^0.2.0",
@@ -10031,7 +9988,7 @@
],
"support": {
"issues": "https://github.com/shalvah/upgrader/issues",
- "source": "https://github.com/shalvah/upgrader/tree/0.2.1"
+ "source": "https://github.com/shalvah/upgrader/tree/0.5.0"
},
"funding": [
{
@@ -10039,30 +9996,94 @@
"type": "patreon"
}
],
- "time": "2022-09-10T02:11:25+00:00"
+ "time": "2024-02-20T11:48:40+00:00"
+ },
+ {
+ "name": "spatie/backtrace",
+ "version": "1.8.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/backtrace.git",
+ "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/backtrace/zipball/8ffe78be5ed355b5009e3dd989d183433e9a5adc",
+ "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3 || ^8.0"
+ },
+ "require-dev": {
+ "ext-json": "*",
+ "laravel/serializable-closure": "^1.3 || ^2.0",
+ "phpunit/phpunit": "^9.3 || ^11.4.3",
+ "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1.6",
+ "symfony/var-dumper": "^5.1|^6.0|^7.0|^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Spatie\\Backtrace\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Freek Van de Herten",
+ "email": "freek@spatie.be",
+ "homepage": "https://spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "A better backtrace",
+ "homepage": "https://github.com/spatie/backtrace",
+ "keywords": [
+ "Backtrace",
+ "spatie"
+ ],
+ "support": {
+ "issues": "https://github.com/spatie/backtrace/issues",
+ "source": "https://github.com/spatie/backtrace/tree/1.8.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/spatie",
+ "type": "github"
+ },
+ {
+ "url": "https://spatie.be/open-source/support-us",
+ "type": "other"
+ }
+ ],
+ "time": "2026-03-11T13:48:28+00:00"
},
{
"name": "spatie/data-transfer-object",
- "version": "2.8.4",
+ "version": "3.9.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/data-transfer-object.git",
- "reference": "167ebbe56ead65ef23abcfae7b75f932afd496a4"
+ "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/167ebbe56ead65ef23abcfae7b75f932afd496a4",
- "reference": "167ebbe56ead65ef23abcfae7b75f932afd496a4",
+ "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
+ "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
"shasum": ""
},
"require": {
- "php": "^7.4|^8.0"
+ "php": "^8.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
- },
- "suggest": {
- "phpstan/phpstan": "Take advantage of checkUninitializedProperties with \\Spatie\\DataTransferObject\\PHPstan\\PropertiesAreAlwaysInitializedExtension"
+ "illuminate/collections": "^8.36",
+ "jetbrains/phpstorm-attributes": "^1.0",
+ "larapack/dd": "^1.1",
+ "phpunit/phpunit": "^9.5.5"
},
"type": "library",
"autoload": {
@@ -10090,7 +10111,7 @@
],
"support": {
"issues": "https://github.com/spatie/data-transfer-object/issues",
- "source": "https://github.com/spatie/data-transfer-object/tree/2.8.4"
+ "source": "https://github.com/spatie/data-transfer-object/tree/3.9.1"
},
"funding": [
{
@@ -10103,28 +10124,269 @@
}
],
"abandoned": "spatie/laravel-data",
- "time": "2021-12-07T05:41:11+00:00"
+ "time": "2022-09-16T13:34:38+00:00"
+ },
+ {
+ "name": "spatie/flare-client-php",
+ "version": "1.11.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/flare-client-php.git",
+ "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/53f41b08a27cc039e1a8ed2be9a202e924f31bad",
+ "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
+ "php": "^8.0",
+ "spatie/backtrace": "^1.6.1",
+ "symfony/http-foundation": "^5.2|^6.0|^7.0|^8.0",
+ "symfony/mime": "^5.2|^6.0|^7.0|^8.0",
+ "symfony/process": "^5.2|^6.0|^7.0|^8.0",
+ "symfony/var-dumper": "^5.2|^6.0|^7.0|^8.0"
+ },
+ "require-dev": {
+ "dms/phpunit-arraysubset-asserts": "^0.5.0",
+ "pestphp/pest": "^1.20|^2.0",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "spatie/pest-plugin-snapshots": "^1.0|^2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.3.x-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/helpers.php"
+ ],
+ "psr-4": {
+ "Spatie\\FlareClient\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Send PHP errors to Flare",
+ "homepage": "https://github.com/spatie/flare-client-php",
+ "keywords": [
+ "exception",
+ "flare",
+ "reporting",
+ "spatie"
+ ],
+ "support": {
+ "issues": "https://github.com/spatie/flare-client-php/issues",
+ "source": "https://github.com/spatie/flare-client-php/tree/1.11.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/spatie",
+ "type": "github"
+ }
+ ],
+ "time": "2026-05-15T09:31:32+00:00"
+ },
+ {
+ "name": "spatie/ignition",
+ "version": "1.14.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/ignition.git",
+ "reference": "5e11c11f675bb5251f061491a493e04a1a571532"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/ignition/zipball/5e11c11f675bb5251f061491a493e04a1a571532",
+ "reference": "5e11c11f675bb5251f061491a493e04a1a571532",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "php": "^8.0",
+ "spatie/backtrace": "^1.5.3",
+ "spatie/flare-client-php": "^1.4.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ },
+ "require-dev": {
+ "illuminate/cache": "^9.52|^10.0|^11.0",
+ "mockery/mockery": "^1.4",
+ "pestphp/pest": "^1.20|^2.0",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "psr/simple-cache-implementation": "*",
+ "symfony/cache": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "vlucas/phpdotenv": "^5.5"
+ },
+ "suggest": {
+ "openai-php/client": "Require get solutions from OpenAI",
+ "simple-cache-implementation": "To cache solutions from OpenAI"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Spatie\\Ignition\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Spatie",
+ "email": "info@spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "A beautiful error page for PHP applications.",
+ "homepage": "https://flareapp.io/ignition",
+ "keywords": [
+ "error",
+ "flare",
+ "laravel",
+ "page"
+ ],
+ "support": {
+ "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction",
+ "forum": "https://twitter.com/flareappio",
+ "issues": "https://github.com/spatie/ignition/issues",
+ "source": "https://github.com/spatie/ignition"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/spatie",
+ "type": "github"
+ }
+ ],
+ "time": "2024-05-29T08:10:20+00:00"
+ },
+ {
+ "name": "spatie/laravel-ignition",
+ "version": "1.7.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/laravel-ignition.git",
+ "reference": "30fd8f91deadba03da4d33237d624e824536c35a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/30fd8f91deadba03da4d33237d624e824536c35a",
+ "reference": "30fd8f91deadba03da4d33237d624e824536c35a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "illuminate/support": "^8.77|^9.27",
+ "monolog/monolog": "^2.3",
+ "php": "^8.0",
+ "spatie/flare-client-php": "^1.0.1",
+ "spatie/ignition": ">=1.4.1 <=1.14.2",
+ "symfony/console": "^5.0|^6.0",
+ "symfony/var-dumper": "^5.0|^6.0"
+ },
+ "require-dev": {
+ "filp/whoops": "^2.14",
+ "livewire/livewire": "^2.8|dev-develop",
+ "mockery/mockery": "^1.4",
+ "nunomaduro/larastan": "^1.0",
+ "orchestra/testbench": "^6.23|^7.0",
+ "pestphp/pest": "^1.20",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan-deprecation-rules": "^1.0",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "spatie/laravel-ray": "^1.27"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "aliases": {
+ "Flare": "Spatie\\LaravelIgnition\\Facades\\Flare"
+ },
+ "providers": [
+ "Spatie\\LaravelIgnition\\IgnitionServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/helpers.php"
+ ],
+ "psr-4": {
+ "Spatie\\LaravelIgnition\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Spatie",
+ "email": "info@spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "A beautiful error page for Laravel applications.",
+ "homepage": "https://flareapp.io/ignition",
+ "keywords": [
+ "error",
+ "flare",
+ "laravel",
+ "page"
+ ],
+ "support": {
+ "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction",
+ "forum": "https://twitter.com/flareappio",
+ "issues": "https://github.com/spatie/laravel-ignition/issues",
+ "source": "https://github.com/spatie/laravel-ignition"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/spatie",
+ "type": "github"
+ }
+ ],
+ "time": "2026-03-17T15:56:37+00:00"
},
{
"name": "symfony/var-exporter",
- "version": "v5.4.45",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
- "reference": "862700068db0ddfd8c5b850671e029a90246ec75"
+ "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/862700068db0ddfd8c5b850671e029a90246ec75",
- "reference": "862700068db0ddfd8c5b850671e029a90246ec75",
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
+ "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/polyfill-php80": "^1.16"
+ "php": ">=8.0.2"
},
"require-dev": {
- "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0"
+ "symfony/var-dumper": "^5.4|^6.0"
},
"type": "library",
"autoload": {
@@ -10160,7 +10422,7 @@
"serialize"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v5.4.45"
+ "source": "https://github.com/symfony/var-exporter/tree/v6.0.19"
},
"funding": [
{
@@ -10176,32 +10438,31 @@
"type": "tidelift"
}
],
- "time": "2024-09-25T14:11:13+00:00"
+ "time": "2023-01-13T08:34:10+00:00"
},
{
"name": "symfony/yaml",
- "version": "v5.4.53",
+ "version": "v6.0.19",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77"
+ "reference": "deec3a812a0305a50db8ae689b183f43d915c884"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77",
- "reference": "ae0bbb46f77ff56591d0a0259c7f458f4b3e1f77",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884",
+ "reference": "deec3a812a0305a50db8ae689b183f43d915c884",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1|^3",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
- "symfony/console": "<5.3"
+ "symfony/console": "<5.4"
},
"require-dev": {
- "symfony/console": "^5.3|^6.0"
+ "symfony/console": "^5.4|^6.0"
},
"suggest": {
"symfony/console": "For validating YAML files using the lint command"
@@ -10235,7 +10496,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/yaml/tree/v5.4.53"
+ "source": "https://github.com/symfony/yaml/tree/v6.0.19"
},
"funding": [
{
@@ -10246,16 +10507,12 @@
"url": "https://github.com/fabpot",
"type": "github"
},
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2026-05-20T17:13:41+00:00"
+ "time": "2023-01-11T11:50:03+00:00"
},
{
"name": "theseer/tokenizer",
@@ -10314,11 +10571,11 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": ">=7.4"
+ "php": "^8.0"
},
"platform-dev": [],
"platform-overrides": {
- "php": "7.4"
+ "php": "8.0.30"
},
"plugin-api-version": "2.6.0"
}
From 7201a3a11a130e9703021fec35c4c24ae20151d1 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:13 +0000
Subject: [PATCH 063/127] Slim `lang` files
---
lang/en/auth.php | 20 -----
lang/en/pagination.php | 19 -----
lang/en/passwords.php | 4 +-
lang/en/validation.php | 184 -----------------------------------------
4 files changed, 2 insertions(+), 225 deletions(-)
delete mode 100755 lang/en/auth.php
delete mode 100755 lang/en/pagination.php
delete mode 100755 lang/en/validation.php
diff --git a/lang/en/auth.php b/lang/en/auth.php
deleted file mode 100755
index 6598e2c0..00000000
--- a/lang/en/auth.php
+++ /dev/null
@@ -1,20 +0,0 @@
- 'These credentials do not match our records.',
- 'password' => 'The provided password is incorrect.',
- 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
-
-];
diff --git a/lang/en/pagination.php b/lang/en/pagination.php
deleted file mode 100755
index d4814118..00000000
--- a/lang/en/pagination.php
+++ /dev/null
@@ -1,19 +0,0 @@
- '« Previous',
- 'next' => 'Next »',
-
-];
diff --git a/lang/en/passwords.php b/lang/en/passwords.php
index 86309753..57706719 100755
--- a/lang/en/passwords.php
+++ b/lang/en/passwords.php
@@ -14,9 +14,9 @@
*/
'password' => 'Passwords must be at least 8 characters and match the confirmation.',
- 'reset' => 'Your password has been reset!',
+
'sent' => 'We have e-mailed your password reset link!',
- 'token' => 'This password reset token is invalid.',
+
'user' => "We can't find a user with that e-mail address.",
];
diff --git a/lang/en/validation.php b/lang/en/validation.php
deleted file mode 100755
index 70407c9d..00000000
--- a/lang/en/validation.php
+++ /dev/null
@@ -1,184 +0,0 @@
- 'The :attribute must be accepted.',
- 'accepted_if' => 'The :attribute must be accepted when :other is :value.',
- 'active_url' => 'The :attribute is not a valid URL.',
- 'after' => 'The :attribute must be a date after :date.',
- 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
- 'alpha' => 'The :attribute must only contain letters.',
- 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
- 'alpha_num' => 'The :attribute must only contain letters and numbers.',
- 'array' => 'The :attribute must be an array.',
- 'ascii' => 'The :attribute must only contain single-byte alphanumeric characters and symbols.',
- 'before' => 'The :attribute must be a date before :date.',
- 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
- 'between' => [
- 'array' => 'The :attribute must have between :min and :max items.',
- 'file' => 'The :attribute must be between :min and :max kilobytes.',
- 'numeric' => 'The :attribute must be between :min and :max.',
- 'string' => 'The :attribute must be between :min and :max characters.',
- ],
- 'boolean' => 'The :attribute field must be true or false.',
- 'confirmed' => 'The :attribute confirmation does not match.',
- 'current_password' => 'The password is incorrect.',
- 'date' => 'The :attribute is not a valid date.',
- 'date_equals' => 'The :attribute must be a date equal to :date.',
- 'date_format' => 'The :attribute does not match the format :format.',
- 'decimal' => 'The :attribute must have :decimal decimal places.',
- 'declined' => 'The :attribute must be declined.',
- 'declined_if' => 'The :attribute must be declined when :other is :value.',
- 'different' => 'The :attribute and :other must be different.',
- 'digits' => 'The :attribute must be :digits digits.',
- 'digits_between' => 'The :attribute must be between :min and :max digits.',
- 'dimensions' => 'The :attribute has invalid image dimensions.',
- 'distinct' => 'The :attribute field has a duplicate value.',
- 'doesnt_end_with' => 'The :attribute may not end with one of the following: :values.',
- 'doesnt_start_with' => 'The :attribute may not start with one of the following: :values.',
- 'email' => 'The :attribute must be a valid email address.',
- 'ends_with' => 'The :attribute must end with one of the following: :values.',
- 'enum' => 'The selected :attribute is invalid.',
- 'exists' => 'The selected :attribute is invalid.',
- 'file' => 'The :attribute must be a file.',
- 'filled' => 'The :attribute field must have a value.',
- 'gt' => [
- 'array' => 'The :attribute must have more than :value items.',
- 'file' => 'The :attribute must be greater than :value kilobytes.',
- 'numeric' => 'The :attribute must be greater than :value.',
- 'string' => 'The :attribute must be greater than :value characters.',
- ],
- 'gte' => [
- 'array' => 'The :attribute must have :value items or more.',
- 'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
- 'numeric' => 'The :attribute must be greater than or equal to :value.',
- 'string' => 'The :attribute must be greater than or equal to :value characters.',
- ],
- 'image' => 'The :attribute must be an image.',
- 'in' => 'The selected :attribute is invalid.',
- 'in_array' => 'The :attribute field does not exist in :other.',
- 'integer' => 'The :attribute must be an integer.',
- 'ip' => 'The :attribute must be a valid IP address.',
- 'ipv4' => 'The :attribute must be a valid IPv4 address.',
- 'ipv6' => 'The :attribute must be a valid IPv6 address.',
- 'json' => 'The :attribute must be a valid JSON string.',
- 'lowercase' => 'The :attribute must be lowercase.',
- 'lt' => [
- 'array' => 'The :attribute must have less than :value items.',
- 'file' => 'The :attribute must be less than :value kilobytes.',
- 'numeric' => 'The :attribute must be less than :value.',
- 'string' => 'The :attribute must be less than :value characters.',
- ],
- 'lte' => [
- 'array' => 'The :attribute must not have more than :value items.',
- 'file' => 'The :attribute must be less than or equal to :value kilobytes.',
- 'numeric' => 'The :attribute must be less than or equal to :value.',
- 'string' => 'The :attribute must be less than or equal to :value characters.',
- ],
- 'mac_address' => 'The :attribute must be a valid MAC address.',
- 'max' => [
- 'array' => 'The :attribute must not have more than :max items.',
- 'file' => 'The :attribute must not be greater than :max kilobytes.',
- 'numeric' => 'The :attribute must not be greater than :max.',
- 'string' => 'The :attribute must not be greater than :max characters.',
- ],
- 'max_digits' => 'The :attribute must not have more than :max digits.',
- 'mimes' => 'The :attribute must be a file of type: :values.',
- 'mimetypes' => 'The :attribute must be a file of type: :values.',
- 'min' => [
- 'array' => 'The :attribute must have at least :min items.',
- 'file' => 'The :attribute must be at least :min kilobytes.',
- 'numeric' => 'The :attribute must be at least :min.',
- 'string' => 'The :attribute must be at least :min characters.',
- ],
- 'min_digits' => 'The :attribute must have at least :min digits.',
- 'missing' => 'The :attribute field must be missing.',
- 'missing_if' => 'The :attribute field must be missing when :other is :value.',
- 'missing_unless' => 'The :attribute field must be missing unless :other is :value.',
- 'missing_with' => 'The :attribute field must be missing when :values is present.',
- 'missing_with_all' => 'The :attribute field must be missing when :values are present.',
- 'multiple_of' => 'The :attribute must be a multiple of :value.',
- 'not_in' => 'The selected :attribute is invalid.',
- 'not_regex' => 'The :attribute format is invalid.',
- 'numeric' => 'The :attribute must be a number.',
- 'password' => [
- 'letters' => 'The :attribute must contain at least one letter.',
- 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.',
- 'numbers' => 'The :attribute must contain at least one number.',
- 'symbols' => 'The :attribute must contain at least one symbol.',
- 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.',
- ],
- 'present' => 'The :attribute field must be present.',
- 'prohibited' => 'The :attribute field is prohibited.',
- 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
- 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
- 'prohibits' => 'The :attribute field prohibits :other from being present.',
- 'regex' => 'The :attribute format is invalid.',
- 'required' => 'The :attribute field is required.',
- 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
- 'required_if' => 'The :attribute field is required when :other is :value.',
- 'required_if_accepted' => 'The :attribute field is required when :other is accepted.',
- 'required_unless' => 'The :attribute field is required unless :other is in :values.',
- 'required_with' => 'The :attribute field is required when :values is present.',
- 'required_with_all' => 'The :attribute field is required when :values are present.',
- 'required_without' => 'The :attribute field is required when :values is not present.',
- 'required_without_all' => 'The :attribute field is required when none of :values are present.',
- 'same' => 'The :attribute and :other must match.',
- 'size' => [
- 'array' => 'The :attribute must contain :size items.',
- 'file' => 'The :attribute must be :size kilobytes.',
- 'numeric' => 'The :attribute must be :size.',
- 'string' => 'The :attribute must be :size characters.',
- ],
- 'starts_with' => 'The :attribute must start with one of the following: :values.',
- 'string' => 'The :attribute must be a string.',
- 'timezone' => 'The :attribute must be a valid timezone.',
- 'unique' => 'The :attribute has already been taken.',
- 'uploaded' => 'The :attribute failed to upload.',
- 'uppercase' => 'The :attribute must be uppercase.',
- 'url' => 'The :attribute must be a valid URL.',
- 'ulid' => 'The :attribute must be a valid ULID.',
- 'uuid' => 'The :attribute must be a valid UUID.',
-
- /*
- |--------------------------------------------------------------------------
- | Custom Validation Language Lines
- |--------------------------------------------------------------------------
- |
- | Here you may specify custom validation messages for attributes using the
- | convention "attribute.rule" to name the lines. This makes it quick to
- | specify a specific custom language line for a given attribute rule.
- |
- */
-
- 'custom' => [
- 'attribute-name' => [
- 'rule-name' => 'custom-message',
- ],
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Custom Validation Attributes
- |--------------------------------------------------------------------------
- |
- | The following language lines are used to swap our attribute placeholder
- | with something more reader friendly such as "E-Mail Address" instead
- | of "email". This simply helps us make our message more expressive.
- |
- */
-
- 'attributes' => [],
-
-];
From 99346435e49037a103b8be25edfe3b99118445ec Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:13 +0000
Subject: [PATCH 064/127] Remove explicit call to register policies
---
app/Providers/AuthServiceProvider.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 9e68caa6..78b7ad0a 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -22,8 +22,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
- $this->registerPolicies();
-
//
}
}
From 0deef5c993bf1277315761ec46f2539d51fd68e1 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:20 +0000
Subject: [PATCH 065/127] Shift core files
---
app/Exceptions/Handler.php | 9 ------
app/Http/Controllers/Controller.php | 3 +-
app/Http/Kernel.php | 7 +++--
app/Http/Middleware/Authenticate.php | 10 ++-----
.../Middleware/RedirectIfAuthenticated.php | 7 ++---
app/Http/Middleware/TrustHosts.php | 2 +-
app/Providers/BroadcastServiceProvider.php | 11 ++-----
app/Providers/RouteServiceProvider.php | 30 ++++++-------------
phpunit.xml | 1 +
9 files changed, 24 insertions(+), 56 deletions(-)
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index b343d648..e9f0aa70 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -8,15 +8,6 @@
class Handler extends ExceptionHandler
{
- /**
- * A list of the exception types that should not be reported.
- *
- * @var array
- */
- protected $dontReport = [
- //
- ];
-
/**
* A list of the inputs that are never flashed for validation exceptions.
*
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index a0a2a8a3..77ec359a 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -3,11 +3,10 @@
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+ use AuthorizesRequests, ValidatesRequests;
}
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index cf026d75..5f15e6a3 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -43,19 +43,20 @@ class Kernel extends HttpKernel
];
/**
- * The application's route middleware.
+ * The application's middleware aliases.
*
- * These middleware may be assigned to groups or used individually.
+ * Aliases may be used to conveniently assign middleware to routes and groups.
*
* @var array
*/
- protected $routeMiddleware = [
+ protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
+ 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
index a4be5c58..d4ef6447 100644
--- a/app/Http/Middleware/Authenticate.php
+++ b/app/Http/Middleware/Authenticate.php
@@ -3,19 +3,15 @@
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
+use Illuminate\Http\Request;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
- *
- * @param \Illuminate\Http\Request $request
- * @return string
*/
- protected function redirectTo($request)
+ protected function redirectTo(Request $request): ?string
{
- if (! $request->expectsJson()) {
- return route('login');
- }
+ return $request->expectsJson() ? null : route('login');
}
}
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
index 4e7c24b7..afc78c4e 100644
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -6,17 +6,16 @@
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
+use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
- * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
- * @param string|null ...$guards
- * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
+ * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
- public function handle(Request $request, Closure $next, ...$guards)
+ public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;
diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php
index 7186414c..c9c58bdd 100644
--- a/app/Http/Middleware/TrustHosts.php
+++ b/app/Http/Middleware/TrustHosts.php
@@ -11,7 +11,7 @@ class TrustHosts extends Middleware
*
* @return array
*/
- public function hosts()
+ public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php
index dc3007b5..2be04f5d 100644
--- a/app/Providers/BroadcastServiceProvider.php
+++ b/app/Providers/BroadcastServiceProvider.php
@@ -9,18 +9,11 @@ class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
- *
- * @return void
*/
- public function boot()
+ public function boot(): void
{
Broadcast::routes();
- /*
- * Authenticate the user's personal channel...
- */
- Broadcast::channel('App.User.*', function ($user, $userId) {
- return (int) $user->id === (int) $userId;
- });
+ require base_path('routes/channels.php');
}
}
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 0ba5291f..1cf5f15c 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -11,42 +11,30 @@
class RouteServiceProvider extends ServiceProvider
{
/**
- * The path to the "home" route for your application.
+ * The path to your application's "home" route.
*
- * This is used by Laravel authentication to redirect users after login.
+ * Typically, users are redirected here after authentication.
*
* @var string
*/
public const HOME = '/home';
/**
- * Define your route model bindings, pattern filters, etc.
- *
- * @return void
+ * Define your route model bindings, pattern filters, and other route configuration.
*/
- public function boot()
+ public function boot(): void
{
- $this->configureRateLimiting();
+ RateLimiter::for('api', function (Request $request) {
+ return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
+ });
$this->routes(function () {
- Route::prefix('api')
- ->middleware('api')
+ Route::middleware('api')
+ ->prefix('api')
->group(base_path('routes/api.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
-
- /**
- * Configure the rate limiters for the application.
- *
- * @return void
- */
- protected function configureRateLimiting()
- {
- RateLimiter::for('api', function (Request $request) {
- return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
- });
- }
}
diff --git a/phpunit.xml b/phpunit.xml
index d4a3c664..dbd66120 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -21,5 +21,6 @@
+
From cd0b027c123fb480a9ccf608515adeed37b12dde Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:25 +0000
Subject: [PATCH 066/127] Shift config files
---
config/broadcasting.php | 1 +
config/hashing.php | 4 +++-
config/mail.php | 28 ++++++++++++++++++++++------
config/session.php | 13 +++++++++++++
4 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/config/broadcasting.php b/config/broadcasting.php
index 9e4d4aa4..24104853 100644
--- a/config/broadcasting.php
+++ b/config/broadcasting.php
@@ -36,6 +36,7 @@
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
+ 'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
diff --git a/config/hashing.php b/config/hashing.php
index bcd3be4c..0e8a0bb3 100644
--- a/config/hashing.php
+++ b/config/hashing.php
@@ -29,7 +29,8 @@
*/
'bcrypt' => [
- 'rounds' => env('BCRYPT_ROUNDS', 10),
+ 'rounds' => env('BCRYPT_ROUNDS', 12),
+ 'verify' => true,
],
/*
@@ -47,6 +48,7 @@
'memory' => 65536,
'threads' => 1,
'time' => 4,
+ 'verify' => true,
],
];
diff --git a/config/mail.php b/config/mail.php
index 534395a3..e894b2e5 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -28,14 +28,15 @@
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
- | Supported: "smtp", "sendmail", "mailgun", "ses",
- | "postmark", "log", "array", "failover"
+ | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
+ | "postmark", "log", "array", "failover", "roundrobin"
|
*/
'mailers' => [
'smtp' => [
'transport' => 'smtp',
+ 'url' => env('MAIL_URL'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
@@ -49,12 +50,19 @@
'transport' => 'ses',
],
- 'mailgun' => [
- 'transport' => 'mailgun',
- ],
-
'postmark' => [
'transport' => 'postmark',
+ // 'message_stream_id' => null,
+ // 'client' => [
+ // 'timeout' => 5,
+ // ],
+ ],
+
+ 'mailgun' => [
+ 'transport' => 'mailgun',
+ // 'client' => [
+ // 'timeout' => 5,
+ // ],
],
'sendmail' => [
@@ -78,6 +86,14 @@
'log',
],
],
+
+ 'roundrobin' => [
+ 'transport' => 'roundrobin',
+ 'mailers' => [
+ 'ses',
+ 'postmark',
+ ],
+ ],
],
/*
diff --git a/config/session.php b/config/session.php
index 8fed97c0..e738cb3e 100755
--- a/config/session.php
+++ b/config/session.php
@@ -198,4 +198,17 @@
'same_site' => 'lax',
+ /*
+ |--------------------------------------------------------------------------
+ | Partitioned Cookies
+ |--------------------------------------------------------------------------
+ |
+ | Setting this value to true will tie the cookie to the top-level site for
+ | a cross-site context. Partitioned cookies are accepted by the browser
+ | when flagged "secure" and the Same-Site attribute is set to "none".
+ |
+ */
+
+ 'partitioned' => false,
+
];
From 51e4298c65c2e3c05dac54251a51d31ffe5c598a Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:27 +0000
Subject: [PATCH 067/127] Default config files
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
---
config/app.php | 33 +++------------------------------
config/auth.php | 6 +++++-
config/cache.php | 1 +
config/database.php | 30 ++++++++++++++++++------------
config/logging.php | 9 +++++++++
5 files changed, 36 insertions(+), 43 deletions(-)
diff --git a/config/app.php b/config/app.php
index 7f986872..90c93782 100644
--- a/config/app.php
+++ b/config/app.php
@@ -1,5 +1,6 @@
[
-
- /*
- * Laravel Framework Service Providers...
- */
- Illuminate\Auth\AuthServiceProvider::class,
- Illuminate\Broadcasting\BroadcastServiceProvider::class,
- Illuminate\Bus\BusServiceProvider::class,
- Illuminate\Cache\CacheServiceProvider::class,
- Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
- Illuminate\Cookie\CookieServiceProvider::class,
- Illuminate\Database\DatabaseServiceProvider::class,
- Illuminate\Encryption\EncryptionServiceProvider::class,
- Illuminate\Filesystem\FilesystemServiceProvider::class,
- Illuminate\Foundation\Providers\FoundationServiceProvider::class,
- Illuminate\Hashing\HashServiceProvider::class,
- Illuminate\Mail\MailServiceProvider::class,
- Illuminate\Notifications\NotificationServiceProvider::class,
- Illuminate\Pagination\PaginationServiceProvider::class,
- Illuminate\Pipeline\PipelineServiceProvider::class,
- Illuminate\Queue\QueueServiceProvider::class,
- Illuminate\Redis\RedisServiceProvider::class,
- Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
- Illuminate\Session\SessionServiceProvider::class,
- Illuminate\Translation\TranslationServiceProvider::class,
- Illuminate\Validation\ValidationServiceProvider::class,
- Illuminate\View\ViewServiceProvider::class,
-
+ 'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
@@ -183,8 +157,7 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
-
- ],
+ ])->toArray(),
/*
|--------------------------------------------------------------------------
diff --git a/config/auth.php b/config/auth.php
index 2231b267..6080ddb2 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -86,10 +86,14 @@
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
- | The expire time is the number of minutes that each reset token will be
+ | The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
+ | The throttle setting is the number of seconds a user must wait before
+ | generating more password reset tokens. This prevents the user from
+ | quickly generating a very large amount of password reset tokens.
+ |
*/
'passwords' => [
diff --git a/config/cache.php b/config/cache.php
index 8268cc97..791b02ba 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -52,6 +52,7 @@
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
+ 'lock_path' => storage_path('framework/cache/data'),
],
'memcached' => [
diff --git a/config/database.php b/config/database.php
index 198090a2..b598ccd3 100644
--- a/config/database.php
+++ b/config/database.php
@@ -37,16 +37,16 @@
'sqlite' => [
'driver' => 'sqlite',
+ 'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
-
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
- 'host' => env('DB_HOST', 'localhost'),
+ 'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
@@ -97,7 +97,8 @@
'pgsql' => [
'driver' => 'pgsql',
- 'host' => env('DB_HOST', 'localhost'),
+ 'url' => env('DATABASE_URL'),
+ 'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
@@ -111,6 +112,7 @@
'sqlsrv' => [
'driver' => 'sqlsrv',
+ 'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
@@ -119,6 +121,8 @@
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
+ // 'encrypt' => env('DB_ENCRYPT', 'yes'),
+ // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],
],
@@ -142,34 +146,36 @@
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
- | provides a richer set of commands than a typical key-value systems
+ | provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
- 'client' => env('REDIS_CLIENT', 'predis'),
+ 'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
- 'cluster' => env('REDIS_CLUSTER', 'predis'),
+ 'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
- 'password' => env('REDIS_PASSWORD', null),
- 'port' => env('REDIS_PORT', 6379),
- 'database' => env('REDIS_DB', 0),
+ 'username' => env('REDIS_USERNAME'),
+ 'password' => env('REDIS_PASSWORD'),
+ 'port' => env('REDIS_PORT', '6379'),
+ 'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
- 'password' => env('REDIS_PASSWORD', null),
- 'port' => env('REDIS_PORT', 6379),
- 'database' => env('REDIS_CACHE_DB', 1),
+ 'username' => env('REDIS_USERNAME'),
+ 'password' => env('REDIS_PASSWORD'),
+ 'port' => env('REDIS_PORT', '6379'),
+ 'database' => env('REDIS_CACHE_DB', '1'),
],
],
diff --git a/config/logging.php b/config/logging.php
index 1cdf3f9a..dd32d43e 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -1,5 +1,6 @@
'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
+ 'replace_placeholders' => true,
],
'daily' => [
@@ -65,6 +67,7 @@
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
+ 'replace_placeholders' => true,
],
'slack' => [
@@ -73,6 +76,7 @@
'username' => env('APP_NAME'),
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
+ 'replace_placeholders' => true,
],
'papertrail' => [
@@ -84,6 +88,7 @@
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
+ 'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
@@ -94,16 +99,20 @@
'with' => [
'stream' => 'php://stderr',
],
+ 'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
+ 'facility' => LOG_USER,
+ 'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
+ 'replace_placeholders' => true,
],
'null' => [
From 2fadbb7bdba0d68dc12153f020b8bb6f71c94fd1 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:27 +0000
Subject: [PATCH 068/127] Bump Composer dependencies
---
composer.json | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/composer.json b/composer.json
index 5b9ce8b6..7a49146f 100644
--- a/composer.json
+++ b/composer.json
@@ -14,35 +14,35 @@
"license": "MIT",
"type": "project",
"require": {
- "php": "^8.0",
- "doctrine/dbal": "^2.13",
- "dyrynda/laravel-cascade-soft-deletes": "^4.2",
+ "php": "^8.1",
+ "doctrine/dbal": "^3.5",
+ "dyrynda/laravel-cascade-soft-deletes": "^4.3",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
"guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
- "laravel/framework": "^9.52",
- "laravel/tinker": "^2.7",
- "laravel/ui": "^3.3",
- "laravelcollective/html": "^6.3",
+ "laravel/framework": "^10.48",
+ "laravel/tinker": "^2.8",
+ "laravel/ui": "^4.2",
+ "laravelcollective/html": "^6.4",
"league/flysystem-aws-s3-v3": "^3.0",
"mcamara/laravel-localization": "^1.7",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
- "santigarcor/laratrust": "^7.0",
+ "santigarcor/laratrust": "^7.2",
"tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
- "appzcoder/crud-generator": "^3.3",
- "barryvdh/laravel-debugbar": "^3.6",
+ "appzcoder/crud-generator": "^4.0",
+ "barryvdh/laravel-debugbar": "^3.8",
"filp/whoops": "^2.8",
- "knuckleswtf/scribe": "^3.29",
+ "knuckleswtf/scribe": "^4.15",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.3",
"phpunit/phpunit": "^9.5.10",
"fakerphp/faker": "^1.9.1",
- "spatie/laravel-ignition": "^1.4"
+ "spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
@@ -73,7 +73,7 @@
"Tests\\": "tests/"
}
},
- "minimum-stability": "dev",
+ "minimum-stability": "stable",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
From b0e67774681ff92378e3d1ca46ec35276fda1702 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:31 +0000
Subject: [PATCH 069/127] Rename `password_resets` table
---
config/auth.php | 2 +-
...01_000000_rename_password_resets_table.php | 28 +++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
create mode 100644 database/migrations/2026_06_01_000000_rename_password_resets_table.php
diff --git a/config/auth.php b/config/auth.php
index 6080ddb2..0628b650 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -99,7 +99,7 @@
'passwords' => [
'users' => [
'provider' => 'users',
- 'table' => 'password_resets',
+ 'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
diff --git a/database/migrations/2026_06_01_000000_rename_password_resets_table.php b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
new file mode 100644
index 00000000..7ea51cef
--- /dev/null
+++ b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
@@ -0,0 +1,28 @@
+
Date: Mon, 1 Jun 2026 13:24:39 +0000
Subject: [PATCH 070/127] Add type hints for Laravel 10
---
app/Category.php | 8 ++--
app/CategoryInput.php | 3 +-
app/Checklist.php | 9 ++--
app/Console/Kernel.php | 4 +-
app/Device.php | 12 +++---
app/Group.php | 5 ++-
app/Hive.php | 25 ++++++-----
app/HiveLayer.php | 8 ++--
app/HiveLayerFrame.php | 5 ++-
.../EnsureWebappEmailIsVerified.php | 3 +-
app/Http/Requests/PostCategoryRequest.php | 4 +-
app/Http/Requests/PostHiveRequest.php | 4 +-
app/Http/Requests/PostLocationRequest.php | 4 +-
app/Http/Requests/PostSensorRequest.php | 4 +-
app/Http/Resources/InspectionCollection.php | 2 +-
app/Image.php | 9 ++--
app/Inspection.php | 16 ++++---
app/InspectionItem.php | 5 ++-
app/Language.php | 3 +-
app/Listeners/LogSuccessfulLogin.php | 2 +-
app/Location.php | 19 +++++---
app/Measurement.php | 3 +-
app/Models/Alert.php | 13 +++---
app/Models/AlertRule.php | 10 +++--
app/Models/AlertRuleFormula.php | 5 ++-
app/Models/CalculationModel.php | 5 ++-
app/Models/ChecklistSvg.php | 5 ++-
app/Models/DashboardGroup.php | 3 +-
app/Models/FlashLog.php | 7 +--
app/Models/HiveTag.php | 5 ++-
app/Notifications/ResetPassword.php | 4 +-
app/PhysicalQuantity.php | 5 ++-
app/Providers/AppServiceProvider.php | 4 +-
app/Providers/AuthServiceProvider.php | 2 +-
app/Providers/EventServiceProvider.php | 4 +-
app/Queen.php | 8 ++--
app/Research.php | 12 +++---
app/SampleCode.php | 7 +--
app/SensorDefinition.php | 7 +--
app/Setting.php | 5 ++-
app/Taxonomy.php | 8 ++--
app/Translation.php | 3 +-
app/User.php | 43 ++++++++++---------
database/factories/HiveFactory.php | 2 +-
database/factories/HiveLayerFactory.php | 2 +-
database/factories/HiveLayerFrameFactory.php | 2 +-
database/factories/LocationFactory.php | 2 +-
database/factories/UserFactory.php | 2 +-
.../2014_10_12_000000_create_users_table.php | 4 +-
...12_100000_create_password_resets_table.php | 4 +-
...016_04_10_115211_create-category-table.php | 4 +-
...016_04_14_174603_create-location-table.php | 4 +-
.../2016_12_20_121758_create_settings.php | 4 +-
.../2016_12_20_121819_create-hive-table.php | 4 +-
.../2016_12_21_174159_create-sensor-table.php | 4 +-
.../2017_03_21_114148_create_groups_table.php | 4 +-
...2017_03_21_114828_entrust_setup_tables.php | 4 +-
.../2017_04_14_175011_create-queen-table.php | 4 +-
...7_04_14_175022_create-production-table.php | 4 +-
...2017_07_17_095406_add_users_last_login.php | 4 +-
...105927_add_category_nested_set_columns.php | 4 +-
...018_01_31_174432_create_category_input.php | 4 +-
.../2018_02_20_161831_add_category_old_id.php | 4 +-
...8_03_12_223732_create-checklists-table.php | 4 +-
..._04_03_110731_create_inspections_table.php | 4 +-
...3_112937_create_inspection_items_table.php | 4 +-
...03_115056_add_checklist_category_order.php | 4 +-
...2018_04_24_124855_AddCategoryTypeIndex.php | 4 +-
...9_add_location_hive_delete_foreign_key.php | 4 +-
...018_05_18_091519_add_user_policy_check.php | 4 +-
.../2018_06_03_110444_AddLanguageTwoChar.php | 4 +-
...121927_convert_inspections_to_taxonomy.php | 4 +-
...9_152505_add_email_token_to_user_table.php | 4 +-
...019_01_08_101831_add_category_required.php | 4 +-
.../2019_01_14_114237_add_group_extras.php | 4 +-
.../2019_01_14_114804_create_group_hive.php | 4 +-
...2019_01_14_143937_add_group_user_admin.php | 4 +-
...01_28_104628_create_measurements_table.php | 4 +-
.../2019_01_28_223610_add_min_max_values.php | 4 +-
.../2019_01_28_223654_add_high_low_values.php | 4 +-
.../2019_11_21_153657_add_location_roofed.php | 4 +-
...9_11_21_204213_create_researches_table.php | 4 +-
.../2019_12_27_172844_create_images_table.php | 4 +-
..._05_153657_add_inspection_checklist_id.php | 4 +-
...180741_change_sensors_hive_id_nullable.php | 4 +-
...20_01_11_134447_add_dimensions_to_hive.php | 4 +-
..._01_11_135656_add_description_to_queen.php | 4 +-
.../2020_01_11_140516_add_order_to_hive.php | 4 +-
...173757_create_sensor_definitions_table.php | 4 +-
...03_add_last_active_and_hw_id_to_sensor.php | 4 +-
...2020_01_15_110902_add_storage_to_image.php | 4 +-
...0918_change_url_field_length_for_image.php | 4 +-
...0_01_15_121511_add_image_to_inspection.php | 4 +-
...dd_last_weather_time_stamp_to_location.php | 4 +-
...9_152103_add_battery_voltage_to_device.php | 4 +-
..._152416_add_downlink_message_to_device.php | 4 +-
.../2020_06_08_094741_add_locale_to_user.php | 4 +-
...06_25_154728_create_sample_codes_table.php | 4 +-
...08_04_114944_add_hex_color_to_location.php | 4 +-
..._142238_add_research_owner_and_viewers.php | 4 +-
.../2021_02_09_170632_create_alerts_table.php | 4 +-
..._02_09_170935_create_alert_rules_table.php | 4 +-
...44_add_exclude_hive_ids_to_alert_rules.php | 4 +-
...164840_add_alert_rules_last_calculated.php | 4 +-
...1_02_24_095050_create_flash_logs_table.php | 4 +-
...2021_03_26_124313_add_flashlog_columns.php | 4 +-
.../2021_04_09_180304_add_device_datetime.php | 4 +-
...4_09_220304_add_device_datetime_offset.php | 4 +-
...0653_add_queen_hive_delete_foreign_key.php | 4 +-
...e_sensor_definition_delete_foreign_key.php | 4 +-
..._change_sensors_offset_float_to_double.php | 4 +-
...add_alert_on_occurences_to_alert_rules.php | 4 +-
..._191500_add_alert_rules_last_evaluated.php | 4 +-
...27_143213_add_flashlog_time_percentage.php | 4 +-
.../2021_09_20_150053_add_count_to_alerts.php | 4 +-
...134_add_show_in_alerts_to_measurements.php | 4 +-
...2021_09_27_122352_remove_unused_tables.php | 4 +-
...021_09_27_134729_upgrade_db_to_utf8mb4.php | 4 +-
...2346_correct_hive_b_b_depth_and_height.php | 4 +-
...18_add_weather_boolean_to_measurements.php | 4 +-
...21_10_15_103342_add_rate_limit_to_user.php | 4 +-
...9_134428_add_former_key_list_to_device.php | 4 +-
..._152440_add_persisted_days_to_flashlog.php | 4 +-
...359_add_default_user_ids_to_researches.php | 4 +-
...94732_add_flashlog_persisted_block_ids.php | 4 +-
...2022_06_20_093325_add_queen_birth_date.php | 4 +-
...22_06_20_123603_create_hive_tags_table.php | 4 +-
...3_02_08_102518_add_visible_to_research.php | 4 +-
..._112218_add_on_invite_only_to_research.php | 4 +-
...2_135520_create_dashboard_groups_table.php | 4 +-
...4_03_083652_create_organizations_table.php | 4 +-
...o_role_user_and_permission_user_tables.php | 4 +-
..._10_120312_create_checklist_svgs_table.php | 4 +-
...90001_create_alert_rule_formulas_table.php | 4 +-
...08_30_135044_add_source_to_measurement.php | 4 +-
...1247_add_future_to_alert_rule_formulas.php | 4 +-
...09_06_090804_add_future_to_measurement.php | 4 +-
...1511_add_app_version_to_checklist_svgs.php | 4 +-
...154132_create_calculation_models_table.php | 4 +-
...luation_results_to_alert_rule_formulas.php | 4 +-
.../2024_09_28_220019_add_rtc_to_devices.php | 4 +-
..._add_recalculate_to_sensor_definitions.php | 4 +-
.../2025_05_20_131603_add_flash_log_dates.php | 4 +-
...5_05_26_094603_add_flash_log_meta_data.php | 4 +-
...5_073900_add_log_validation_to_devices.php | 4 +-
...35556_add_time_corrections_to_flashlog.php | 4 +-
...28_141954_add_flash_log_valid_override.php | 4 +-
...01_000000_rename_password_resets_table.php | 4 +-
database/seeders/DatabaseSeeder.php | 2 +-
database/seeders/DeviceCorrectionSeeder.php | 2 +-
database/seeders/MeasurementSeeder.php | 2 +-
database/seeders/UserSeeder.php | 2 +-
tests/ExampleTest.php | 2 +-
153 files changed, 397 insertions(+), 345 deletions(-)
diff --git a/app/Category.php b/app/Category.php
index 86d9b67b..d4c6ad99 100644
--- a/app/Category.php
+++ b/app/Category.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Illuminate\Database\Eloquent\Model;
use Kalnoy\Nestedset\NodeTrait;
@@ -139,17 +141,17 @@ public function getPhysicalQuantityNameAttribute()
return null;
}
- public function physicalQuantity()
+ public function physicalQuantity(): HasOne
{
return $this->hasOne(PhysicalQuantity::class, 'id', 'physical_quantity_id');
}
- public function checklists()
+ public function checklists(): BelongsToMany
{
return $this->belongsToMany(Checklist::class, 'checklist_category');
}
- public function inputType()
+ public function inputType(): HasOne
{
return $this->hasOne(CategoryInput::class, 'id', 'category_input_id');
}
diff --git a/app/CategoryInput.php b/app/CategoryInput.php
index 573ccf34..5423c8f1 100644
--- a/app/CategoryInput.php
+++ b/app/CategoryInput.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
use LaravelLocalization;
@@ -17,7 +18,7 @@ class CategoryInput extends Model
// Relations
- public function category()
+ public function category(): BelongsTo
{
return $this->belongsTo(Category::class, 'category_id');
}
diff --git a/app/Checklist.php b/app/Checklist.php
index 5ab63c5f..8e6f865b 100644
--- a/app/Checklist.php
+++ b/app/Checklist.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Auth;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -68,7 +69,7 @@ public function getResearchesAttribute()
return $this->researches()->pluck('name');
}
- public function categories()
+ public function categories(): BelongsToMany
{
return $this->belongsToMany(Category::class, 'checklist_category')->withPivot('order')->orderBy('order');
}
@@ -78,17 +79,17 @@ public function categoryIdArray()
return $this->categories()->pluck('id')->toArray();
}
- public function users()
+ public function users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'checklist_user');
}
- public function hives()
+ public function hives(): BelongsToMany
{
return $this->belongsToMany(Hive::class, 'checklist_hive');
}
- public function researches()
+ public function researches(): BelongsToMany
{
return $this->belongsToMany(Research::class, 'checklist_research');
}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 20c28a7c..45162d41 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -15,7 +15,7 @@ class Kernel extends ConsoleKernel
*
* @return void
*/
- protected function schedule(Schedule $schedule)
+ protected function schedule(Schedule $schedule): void
{
$schedule->call(
function () {
@@ -41,7 +41,7 @@ function () {
*
* @return void
*/
- protected function commands()
+ protected function commands(): void
{
$this->load(__DIR__.'/Commands');
diff --git a/app/Device.php b/app/Device.php
index ec13f266..9fe27b41 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\Alert;
use App\Models\FlashLog;
use Auth;
@@ -249,7 +251,7 @@ public function addFormerKey($key)
return false;
}
- public function sensorDefinitions()
+ public function sensorDefinitions(): HasMany
{
return $this->hasMany(SensorDefinition::class);
}
@@ -306,7 +308,7 @@ public function activeTypeDateSensorDefinitions($input_measurement_id, $output_m
return $this->sensorDefinitions()->whereIn('id', $sd_ids)->orderBy('updated_at', 'desc')->get();
}
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
@@ -320,7 +322,7 @@ public function location()
return null;
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
@@ -330,12 +332,12 @@ public function researches()
return $this->user->researches();
}
- public function alerts()
+ public function alerts(): HasMany
{
return $this->hasMany(Alert::class);
}
- public function flashLogs()
+ public function flashLogs(): HasMany
{
return $this->hasMany(FlashLog::class);
}
diff --git a/app/Group.php b/app/Group.php
index 216e7b3d..42861c05 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Auth;
use Cache;
use DB;
@@ -98,12 +99,12 @@ public function getCreatorAttribute()
return (bool) ($this->getUsersAttribute()->where('id', Auth::user()->id)->where('creator', 1)->count() > 0); // myself
}
- public function group_users()
+ public function group_users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'group_user');
}
- public function group_hives()
+ public function group_hives(): BelongsToMany
{
return $this->belongsToMany(Hive::class, 'group_hive');
}
diff --git a/app/Hive.php b/app/Hive.php
index fb215f42..19f25361 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -2,6 +2,11 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
@@ -244,53 +249,53 @@ public function getEditableAttribute()
return false;
}
- public function queen()
+ public function queen(): HasOne
{
return $this->hasOne(Queen::class);
}
- public function type()
+ public function type(): BelongsTo
{
return $this->belongsTo(Category::class, 'hive_type_id');
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function groups()
+ public function groups(): BelongsToMany
{
return $this->belongsToMany(Group::class, 'group_hive');
}
- public function checklists()
+ public function checklists(): BelongsToMany
{
return $this->belongsToMany(Checklist::class, 'checklist_hive');
}
- public function inspections()
+ public function inspections(): BelongsToMany
{
return $this->belongsToMany(Inspection::class, 'inspection_hive');
}
// Hive buildup
- public function location()
+ public function location(): BelongsTo
{
return $this->belongsTo(Location::class);
}
- public function layers()
+ public function layers(): HasMany
{
return $this->hasMany(HiveLayer::class);
}
- public function frames()
+ public function frames(): HasManyThrough
{
return $this->hasManyThrough(HiveLayerFrame::class, HiveLayer::class, 'hive_id', 'layer_id');
}
- public function devices()
+ public function devices(): HasMany
{
return $this->hasMany(Device::class);
}
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index 80828174..11c62c43 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Cache;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
@@ -63,17 +65,17 @@ public function getTypeAttribute()
});
}
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function type()
+ public function type(): BelongsTo
{
return $this->belongsTo(Category::class);
}
- public function frames()
+ public function frames(): HasMany
{
return $this->hasMany(HiveLayerFrame::class, 'layer_id');
}
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index b1e87e5f..1e9c80d1 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -27,12 +28,12 @@ public function getTypeAttribute()
return Category::find($this->category_id)->name;
}
- public function layer()
+ public function layer(): BelongsTo
{
return $this->belongsTo(HiveLayer::class, 'layer_id');
}
- public function type()
+ public function type(): BelongsTo
{
return $this->belongsTo(Category::class);
}
diff --git a/app/Http/Middleware/EnsureWebappEmailIsVerified.php b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
index a6a80e18..265f12ac 100644
--- a/app/Http/Middleware/EnsureWebappEmailIsVerified.php
+++ b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
@@ -2,6 +2,7 @@
namespace App\Http\Middleware;
+use Illuminate\Http\Request;
use Closure;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Response;
@@ -14,7 +15,7 @@ class EnsureWebappEmailIsVerified
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
- public function handle($request, Closure $next)
+ public function handle(Request $request, Closure $next): \Symfony\Component\HttpFoundation\Response
{
if (! $request->user()) {
return Response::json('invalid_user', 400);
diff --git a/app/Http/Requests/PostCategoryRequest.php b/app/Http/Requests/PostCategoryRequest.php
index 990ce808..a4ecb6e7 100755
--- a/app/Http/Requests/PostCategoryRequest.php
+++ b/app/Http/Requests/PostCategoryRequest.php
@@ -9,7 +9,7 @@ class PostCategoryRequest extends Request
*
* @return bool
*/
- public function authorize()
+ public function authorize(): bool
{
return true;
}
@@ -19,7 +19,7 @@ public function authorize()
*
* @return array
*/
- public function rules()
+ public function rules(): array
{
return [
'name' => 'nullable|required_without:names|string',
diff --git a/app/Http/Requests/PostHiveRequest.php b/app/Http/Requests/PostHiveRequest.php
index d5794179..ac84f208 100644
--- a/app/Http/Requests/PostHiveRequest.php
+++ b/app/Http/Requests/PostHiveRequest.php
@@ -9,7 +9,7 @@ class PostHiveRequest extends Request
*
* @return bool
*/
- public function authorize()
+ public function authorize(): bool
{
return true;
}
@@ -19,7 +19,7 @@ public function authorize()
*
* @return array
*/
- public function rules()
+ public function rules(): array
{
return [
'name' => 'required|string',
diff --git a/app/Http/Requests/PostLocationRequest.php b/app/Http/Requests/PostLocationRequest.php
index 86135a9b..3fda55d0 100644
--- a/app/Http/Requests/PostLocationRequest.php
+++ b/app/Http/Requests/PostLocationRequest.php
@@ -9,7 +9,7 @@ class PostLocationRequest extends Request
*
* @return bool
*/
- public function authorize()
+ public function authorize(): bool
{
return true;
}
@@ -19,7 +19,7 @@ public function authorize()
*
* @return array
*/
- public function rules()
+ public function rules(): array
{
return [
'name' => 'required|string',
diff --git a/app/Http/Requests/PostSensorRequest.php b/app/Http/Requests/PostSensorRequest.php
index 2131355b..46e52e64 100644
--- a/app/Http/Requests/PostSensorRequest.php
+++ b/app/Http/Requests/PostSensorRequest.php
@@ -9,7 +9,7 @@ class PostSensorRequest extends Request
*
* @return bool
*/
- public function authorize()
+ public function authorize(): bool
{
return true;
}
@@ -19,7 +19,7 @@ public function authorize()
*
* @return array
*/
- public function rules()
+ public function rules(): array
{
return [
'id' => 'nullable|integer|unique:sensors,id,'.$this->input('id'),
diff --git a/app/Http/Resources/InspectionCollection.php b/app/Http/Resources/InspectionCollection.php
index 26aa6ab1..04b9ec17 100644
--- a/app/Http/Resources/InspectionCollection.php
+++ b/app/Http/Resources/InspectionCollection.php
@@ -12,7 +12,7 @@ class InspectionCollection extends ResourceCollection
* @param \Illuminate\Http\Request $request
* @return array
*/
- public function toArray($request)
+ public function toArray($request): array
{
return parent::toArray($request);
}
diff --git a/app/Image.php b/app/Image.php
index e796103a..fd6a82de 100644
--- a/app/Image.php
+++ b/app/Image.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
@@ -46,22 +47,22 @@ class Image extends Model
protected $hidden = ['storage', 'user_id'];
- public function category()
+ public function category(): BelongsTo
{
return $this->belongsTo(Category::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function inspection()
+ public function inspection(): BelongsTo
{
return $this->belongsTo(Inspection::class);
}
diff --git a/app/Inspection.php b/app/Inspection.php
index ea22b083..2dd5daad 100644
--- a/app/Inspection.php
+++ b/app/Inspection.php
@@ -2,6 +2,10 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
@@ -148,32 +152,32 @@ public function getSearchableAttribute()
}
// Relations
- public function users()
+ public function users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'inspection_user');
}
- public function hives()
+ public function hives(): BelongsToMany
{
return $this->belongsToMany(Hive::class, 'inspection_hive');
}
- public function locations()
+ public function locations(): BelongsToMany
{
return $this->belongsToMany(Location::class, 'inspection_location');
}
- public function items()
+ public function items(): HasMany
{
return $this->hasMany(InspectionItem::class);
}
- public function checklist()
+ public function checklist(): HasOne
{
return $this->hasOne(Checklist::class);
}
- public function image()
+ public function image(): BelongsTo
{
return $this->belongsTo(Image::class);
}
diff --git a/app/InspectionItem.php b/app/InspectionItem.php
index 1a46674e..d4b52a43 100644
--- a/app/InspectionItem.php
+++ b/app/InspectionItem.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -79,12 +80,12 @@ public function inputType()
return null;
}
- public function inspection()
+ public function inspection(): HasOne
{
return $this->hasOne(Inspection::class, 'id', 'inspection_id');
}
- public function category()
+ public function category(): HasOne
{
return $this->hasOne(Category::class, 'id', 'category_id');
}
diff --git a/app/Language.php b/app/Language.php
index 6aae6855..e0fcd132 100644
--- a/app/Language.php
+++ b/app/Language.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Model;
class Language extends Model
@@ -18,7 +19,7 @@ public function getLangAttribute()
}
// Relations
- public function translations()
+ public function translations(): BelongsToMany
{
return $this->belongsToMany(Translation::class);
}
diff --git a/app/Listeners/LogSuccessfulLogin.php b/app/Listeners/LogSuccessfulLogin.php
index 00ad810b..f0206b21 100644
--- a/app/Listeners/LogSuccessfulLogin.php
+++ b/app/Listeners/LogSuccessfulLogin.php
@@ -21,7 +21,7 @@ public function __construct()
*
* @return void
*/
- public function handle(Login $event)
+ public function handle(Login $event): void
{
$event->user->last_login = date('Y-m-d H:i:s');
$event->user->save();
diff --git a/app/Location.php b/app/Location.php
index 4284e5d1..2468fc94 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -2,6 +2,11 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
@@ -81,37 +86,37 @@ public function getOwnerAttribute()
return false;
}
- public function hives()
+ public function hives(): HasMany
{
return $this->hasMany(Hive::class);
}
- public function inspections()
+ public function inspections(): BelongsToMany
{
return $this->belongsToMany(Inspection::class, 'inspection_location');
}
- public function layers()
+ public function layers(): HasManyThrough
{
return $this->hasManyThrough(HiveLayer::class, Hive::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function type()
+ public function type(): BelongsTo
{
return $this->belongsTo(Category::class);
}
- public function device_count()
+ public function device_count(): HasManyThrough
{
return $this->hasManyThrough(Device::class, Hive::class)->count();
}
- public function continent()
+ public function continent(): HasOne
{
return $this->hasOne(Continent::class);
}
diff --git a/app/Measurement.php b/app/Measurement.php
index 63b1a94a..2651d7c1 100644
--- a/app/Measurement.php
+++ b/app/Measurement.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Illuminate\Database\Eloquent\Model;
use LaravelLocalization;
@@ -119,7 +120,7 @@ public function getHighValueAttribute()
return $this->physical_quantity()->value('high_value');
}
- public function physical_quantity()
+ public function physical_quantity(): HasOne
{
return $this->hasOne(PhysicalQuantity::class, 'id', 'physical_quantity_id');
}
diff --git a/app/Models/Alert.php b/app/Models/Alert.php
index 1be52ba8..b83c0f7f 100644
--- a/app/Models/Alert.php
+++ b/app/Models/Alert.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Hive;
use App\Location;
@@ -46,32 +47,32 @@ public function getAlertRuleNameAttribute()
return null;
}
- public function alert_rule()
+ public function alert_rule(): BelongsTo
{
return $this->belongsTo(AlertRule::class);
}
- public function measurement()
+ public function measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
- public function location()
+ public function location(): BelongsTo
{
return $this->belongsTo(Location::class);
}
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function device()
+ public function device(): BelongsTo
{
return $this->belongsTo(Device::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
diff --git a/app/Models/AlertRule.php b/app/Models/AlertRule.php
index 79773ee6..accf3e41 100644
--- a/app/Models/AlertRule.php
+++ b/app/Models/AlertRule.php
@@ -2,6 +2,8 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Device;
use App\Mail\AlertMail;
use App\Measurement;
@@ -150,22 +152,22 @@ public function getPq($abbr = false)
}
}
- public function measurement()
+ public function measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function alert_rule_formulas()
+ public function alert_rule_formulas(): HasMany
{
return $this->hasMany(AlertRuleFormula::class);
}
- public function alerts()
+ public function alerts(): HasMany
{
return $this->hasMany(Alert::class);
}
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index e56810d6..d3ac712a 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Measurement;
use Cache;
use Illuminate\Database\Eloquent\Model;
@@ -44,12 +45,12 @@ class AlertRuleFormula extends Model
public static $logicals = ['or' => 'Or', 'and' => 'And'];
- public function alert_rule()
+ public function alert_rule(): BelongsTo
{
return $this->belongsTo(AlertRule::class);
}
- public function measurement()
+ public function measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 0ebe5d3f..32df1663 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Measurement;
use Cache;
@@ -59,12 +60,12 @@ class CalculationModel extends Model
public static $calculations = ['model_cumulative_daily_weight_anomaly' => 'Cumulative daily hive weight anomaly',
'model_colony_failure_weight_history' => 'Colony failure weight history (AWS Lambda)'];
- public function input_measurement()
+ public function input_measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class, 'data_measurement_id');
}
- public function measurement()
+ public function measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
diff --git a/app/Models/ChecklistSvg.php b/app/Models/ChecklistSvg.php
index b3d617a7..7925f947 100644
--- a/app/Models/ChecklistSvg.php
+++ b/app/Models/ChecklistSvg.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Checklist;
use App\User;
use Illuminate\Database\Eloquent\Model;
@@ -29,12 +30,12 @@ class ChecklistSvg extends Model
*/
protected $fillable = ['user_id', 'checklist_id', 'name', 'svg', 'pages', 'last_print', 'app_version'];
- public function checklist()
+ public function checklist(): BelongsTo
{
return $this->belongsTo(Checklist::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index 2ac59a5d..4aec589a 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\User;
use Illuminate\Database\Eloquent\Model;
@@ -43,7 +44,7 @@ public function hives()
return collect();
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index e1af6b52..fd65e2c9 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Hive;
use App\Measurement;
@@ -53,17 +54,17 @@ class FlashLog extends Model
protected $casts = ['meta_data' => 'array', 'time_corrections' => 'array'];
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function device()
+ public function device(): BelongsTo
{
return $this->belongsTo(Device::class)->withTrashed();
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index 42cb1e33..f98f30bc 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -2,6 +2,7 @@
namespace App\Models;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Hive;
use App\User;
use Illuminate\Database\Eloquent\Model;
@@ -33,12 +34,12 @@ class HiveTag extends Model
protected $casts = ['router_link' => 'array'];
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php
index 64d9f7c3..e287ea52 100644
--- a/app/Notifications/ResetPassword.php
+++ b/app/Notifications/ResetPassword.php
@@ -39,7 +39,7 @@ public function __construct($token)
* @param mixed $notifiable
* @return array|string
*/
- public function via($notifiable)
+ public function via($notifiable): array
{
return ['mail'];
}
@@ -50,7 +50,7 @@ public function via($notifiable)
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
- public function toMail($notifiable)
+ public function toMail($notifiable): MailMessage
{
if (static::$toMailCallback) {
return call_user_func(static::$toMailCallback, $notifiable, $this->token);
diff --git a/app/PhysicalQuantity.php b/app/PhysicalQuantity.php
index 86a4969f..7e61889d 100644
--- a/app/PhysicalQuantity.php
+++ b/app/PhysicalQuantity.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Cache;
use DB;
use Illuminate\Database\Eloquent\Model;
@@ -50,12 +51,12 @@ public function forgetCache()
}
// Relations
- public function categories()
+ public function categories(): HasMany
{
return $this->hasMany(Category::class);
}
- public function measurements()
+ public function measurements(): HasMany
{
return $this->hasMany(Measurement::class);
}
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index ac87aa8c..02414582 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -15,7 +15,7 @@ class AppServiceProvider extends ServiceProvider
*
* @return void
*/
- public function boot()
+ public function boot(): void
{
/**
* Paginate a standard Laravel Collection.
@@ -55,7 +55,7 @@ public function boot()
*
* @return void
*/
- public function register()
+ public function register(): void
{
$this->app->singleton(HiveFactory::class, function () {
return new HiveFactory;
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 78b7ad0a..a119d6f9 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -20,7 +20,7 @@ class AuthServiceProvider extends ServiceProvider
*
* @return void
*/
- public function boot()
+ public function boot(): void
{
//
}
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index 267bf8c3..cbbc4405 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -28,7 +28,7 @@ class EventServiceProvider extends ServiceProvider
*
* @return void
*/
- public function boot()
+ public function boot(): void
{
//
@@ -39,7 +39,7 @@ public function boot()
*
* @return bool
*/
- public function shouldDiscoverEvents()
+ public function shouldDiscoverEvents(): bool
{
return false;
}
diff --git a/app/Queen.php b/app/Queen.php
index 1c24a14f..add6e825 100644
--- a/app/Queen.php
+++ b/app/Queen.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
@@ -67,17 +69,17 @@ public function getMotherAttribute()
return isset($this->mother_id) ? Queen::find($this->mother_id)->name : '';
}
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function race()
+ public function race(): HasOne
{
return $this->hasOne(Category::class, 'race_id');
}
- public function mother()
+ public function mother(): HasOne
{
return $this->hasOne(Queen::class, 'mother_id');
}
diff --git a/app/Research.php b/app/Research.php
index fe09e630..dd350745 100644
--- a/app/Research.php
+++ b/app/Research.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use DB;
use Illuminate\Database\Eloquent\Model;
@@ -74,27 +76,27 @@ public function getThumbUrlAttribute()
return null;
}
- public function owner()
+ public function owner(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function users()
+ public function users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'research_user')->distinct('user_id');
}
- public function viewers()
+ public function viewers(): BelongsToMany
{
return $this->belongsToMany(User::class, 'research_viewer');
}
- public function checklists()
+ public function checklists(): BelongsToMany
{
return $this->belongsToMany(Checklist::class, 'checklist_research');
}
- public function image()
+ public function image(): BelongsTo
{
return $this->belongsTo(Image::class);
}
diff --git a/app/SampleCode.php b/app/SampleCode.php
index eb7e92b6..af1cb1d7 100644
--- a/app/SampleCode.php
+++ b/app/SampleCode.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
class SampleCode extends Model
@@ -27,17 +28,17 @@ class SampleCode extends Model
*/
protected $fillable = ['sample_code', 'sample_note', 'sample_date', 'test_result', 'test', 'test_date', 'test_lab_name', 'user_id', 'hive_id', 'queen_id'];
- public function hive()
+ public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function queen()
+ public function queen(): BelongsTo
{
return $this->belongsTo(Queen::class);
}
diff --git a/app/SensorDefinition.php b/app/SensorDefinition.php
index a6e67375..450107dd 100644
--- a/app/SensorDefinition.php
+++ b/app/SensorDefinition.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Cache;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -98,17 +99,17 @@ public function getInsideAttribute($value)
return null;
}
- public function input_measurement()
+ public function input_measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
- public function output_measurement()
+ public function output_measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class);
}
- public function device()
+ public function device(): BelongsTo
{
return $this->belongsTo(Device::class);
}
diff --git a/app/Setting.php b/app/Setting.php
index d6cfb3be..0cd2c8fd 100644
--- a/app/Setting.php
+++ b/app/Setting.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
@@ -21,12 +22,12 @@ public function getTypeAttribute()
return Category::find($this->category_id)->name;
}
- public function user()
+ public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
- public function type()
+ public function type(): BelongsTo
{
return $this->belongsTo(Category::class);
}
diff --git a/app/Taxonomy.php b/app/Taxonomy.php
index f1f64a09..0137478b 100644
--- a/app/Taxonomy.php
+++ b/app/Taxonomy.php
@@ -2,6 +2,8 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Kalnoy\Nestedset\NodeTrait;
@@ -93,17 +95,17 @@ public function getUnitAttribute()
return null;
}
- public function physicalQuantity()
+ public function physicalQuantity(): HasOne
{
return $this->hasOne(PhysicalQuantity::class, 'id', 'physical_quantity_id');
}
- public function checklists()
+ public function checklists(): BelongsToMany
{
return $this->belongsToMany(Checklist::class, 'checklist_category');
}
- public function inputType()
+ public function inputType(): HasOne
{
return $this->hasOne(CategoryInput::class, 'id', 'category_input_id');
}
diff --git a/app/Translation.php b/app/Translation.php
index a3d8a1ad..654d4841 100644
--- a/app/Translation.php
+++ b/app/Translation.php
@@ -2,6 +2,7 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use LaravelLocalization;
@@ -36,7 +37,7 @@ public function forgetCache()
// Relations
- public function language()
+ public function language(): HasOne
{
return $this->hasOne(Language::class, 'id', 'language_id');
}
diff --git a/app/User.php b/app/User.php
index 2c91669b..f38df651 100644
--- a/app/User.php
+++ b/app/User.php
@@ -2,6 +2,9 @@
namespace App;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\Alert;
use App\Models\AlertRule;
use App\Models\ChecklistSvg;
@@ -133,12 +136,12 @@ public function getPermissionsAttribute()
}
// links
- public function images()
+ public function images(): HasMany
{
return $this->hasMany(Image::class);
}
- public function hives()
+ public function hives(): HasMany
{
return $this->hasMany(Hive::class);
}
@@ -182,17 +185,17 @@ public function allHives($editable = false) // Including Group hives
return Hive::whereIn('id', $all_ids);
}
- public function hive_tags()
+ public function hive_tags(): HasMany
{
return $this->hasMany(HiveTag::class);
}
- public function checklists()
+ public function checklists(): BelongsToMany
{
return $this->belongsToMany(Checklist::class, 'checklist_user');
}
- public function inspections()
+ public function inspections(): BelongsToMany
{
return $this->belongsToMany(Inspection::class, 'inspection_user');
}
@@ -212,17 +215,17 @@ public function allInspections($editable = false) // Including Group hive locati
return Inspection::whereIn('id', $all_ids);
}
- public function researches()
+ public function researches(): BelongsToMany
{
return $this->belongsToMany(Research::class, 'research_user');
}
- public function researchesOwned()
+ public function researchesOwned(): HasMany
{
return $this->hasMany(Research::class);
}
- public function flashlogs()
+ public function flashlogs(): HasMany
{
return $this->hasMany(FlashLog::class);
}
@@ -237,7 +240,7 @@ public function allFlashlogs($editable = true) // Including (only) editable grou
return FlashLog::whereIn('id', $all_ids);
}
- public function researchesVisible()
+ public function researchesVisible(): BelongsToMany
{
return $this->belongsToMany(Research::class, 'research_viewer');
}
@@ -268,7 +271,7 @@ public function allResearches() // all Researches visible
return Research::whereIn('id', $all_ids);
}
- public function devices()
+ public function devices(): HasMany
{
return $this->hasMany(Device::class);
}
@@ -288,32 +291,32 @@ public function allDevices($editable = false) // Including Group hive locations
return Device::whereIn('id', $all_ids);
}
- public function groups()
+ public function groups(): BelongsToMany
{
return $this->belongsToMany(Group::class, 'group_user')->whereNotNull('accepted');
}
- public function dashboardGroups()
+ public function dashboardGroups(): HasMany
{
return $this->hasMany(DashboardGroup::class);
}
- public function checklistSvgs()
+ public function checklistSvgs(): HasMany
{
return $this->hasMany(ChecklistSvg::class);
}
- public function settings()
+ public function settings(): HasMany
{
return $this->hasMany(Setting::class);
}
- public function samplecodes()
+ public function samplecodes(): HasMany
{
return $this->hasMany(SampleCode::class);
}
- public function queens()
+ public function queens(): HasManyThrough
{
return $this->hasManyThrough(Queen::class, Hive::class, 'user_id', 'hive_id');
}
@@ -337,7 +340,7 @@ public function allChecklists()
return Checklist::whereIn('id', $checklist_ids);
}
- public function locations()
+ public function locations(): HasMany
{
return $this->hasMany(Location::class);
}
@@ -370,7 +373,7 @@ public function allApiaries()
});
}
- public function groupInvitations()
+ public function groupInvitations(): BelongsToMany
{
$user_id = $this->id;
@@ -397,12 +400,12 @@ public function groupsAndInvites()
});
}
- public function alert_rules()
+ public function alert_rules(): HasMany
{
return $this->hasMany(AlertRule::class);
}
- public function alerts()
+ public function alerts(): HasMany
{
return $this->hasMany(Alert::class);
}
diff --git a/database/factories/HiveFactory.php b/database/factories/HiveFactory.php
index e43546cf..85b1ddb7 100644
--- a/database/factories/HiveFactory.php
+++ b/database/factories/HiveFactory.php
@@ -22,7 +22,7 @@ class HiveFactory extends Factory
*
* @return array
*/
- public function definition()
+ public function definition(): array
{
return [
'user_id' => 1,
diff --git a/database/factories/HiveLayerFactory.php b/database/factories/HiveLayerFactory.php
index f7f6c350..5127d12f 100644
--- a/database/factories/HiveLayerFactory.php
+++ b/database/factories/HiveLayerFactory.php
@@ -22,7 +22,7 @@ class HiveLayerFactory extends Factory
*
* @return array
*/
- public function definition()
+ public function definition(): array
{
return [
'hive_id' => 1,
diff --git a/database/factories/HiveLayerFrameFactory.php b/database/factories/HiveLayerFrameFactory.php
index 5198ab10..4bbaaef4 100644
--- a/database/factories/HiveLayerFrameFactory.php
+++ b/database/factories/HiveLayerFrameFactory.php
@@ -22,7 +22,7 @@ class HiveLayerFrameFactory extends Factory
*
* @return array
*/
- public function definition()
+ public function definition(): array
{
return [
'layer_id' => 1,
diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php
index dc2c0673..bd5355a8 100644
--- a/database/factories/LocationFactory.php
+++ b/database/factories/LocationFactory.php
@@ -22,7 +22,7 @@ class LocationFactory extends Factory
*
* @return array
*/
- public function definition()
+ public function definition(): array
{
return [
'user_id' => 1,
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index 43266b29..6a038473 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -23,7 +23,7 @@ class UserFactory extends Factory
*
* @return array
*/
- public function definition()
+ public function definition(): array
{
static $password;
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index 1d7c0b90..18ffb5b5 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
@@ -30,7 +30,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::dropIfExists('users');
}
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
index 99cc6b8f..a0cecb22 100644
--- a/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::dropIfExists('password_resets');
}
diff --git a/database/migrations/2016_04_10_115211_create-category-table.php b/database/migrations/2016_04_10_115211_create-category-table.php
index 646d2c8b..e9c326f1 100644
--- a/database/migrations/2016_04_10_115211_create-category-table.php
+++ b/database/migrations/2016_04_10_115211_create-category-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('categories', function (Blueprint $table) {
$table->increments('id')->index();
@@ -29,7 +29,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::dropIfExists('categories');
}
diff --git a/database/migrations/2016_04_14_174603_create-location-table.php b/database/migrations/2016_04_14_174603_create-location-table.php
index 59c8f3f8..7a6f55af 100644
--- a/database/migrations/2016_04_14_174603_create-location-table.php
+++ b/database/migrations/2016_04_14_174603_create-location-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('continents', function (Blueprint $table) {
$table->increments('id')->index();
@@ -45,7 +45,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->dropForeign(['user_id']);
diff --git a/database/migrations/2016_12_20_121758_create_settings.php b/database/migrations/2016_12_20_121758_create_settings.php
index 19859a95..00aab0be 100644
--- a/database/migrations/2016_12_20_121758_create_settings.php
+++ b/database/migrations/2016_12_20_121758_create_settings.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::enableForeignKeyConstraints();
@@ -34,7 +34,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('settings', function (Blueprint $table) {
$table->dropForeign(['user_id']);
diff --git a/database/migrations/2016_12_20_121819_create-hive-table.php b/database/migrations/2016_12_20_121819_create-hive-table.php
index 27e9236b..1840f17f 100644
--- a/database/migrations/2016_12_20_121819_create-hive-table.php
+++ b/database/migrations/2016_12_20_121819_create-hive-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('hive_types', function (Blueprint $table) {
$table->increments('id')->index();
@@ -69,7 +69,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('hive_layer_frames', function (Blueprint $table) {
$table->dropForeign(['layer_id']);
diff --git a/database/migrations/2016_12_21_174159_create-sensor-table.php b/database/migrations/2016_12_21_174159_create-sensor-table.php
index f6c5146c..8a8c4397 100644
--- a/database/migrations/2016_12_21_174159_create-sensor-table.php
+++ b/database/migrations/2016_12_21_174159_create-sensor-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('sensors', function (Blueprint $table) {
$table->increments('id')->index();
@@ -46,7 +46,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropForeign(['user_id']);
diff --git a/database/migrations/2017_03_21_114148_create_groups_table.php b/database/migrations/2017_03_21_114148_create_groups_table.php
index b8d23fac..b05d4440 100644
--- a/database/migrations/2017_03_21_114148_create_groups_table.php
+++ b/database/migrations/2017_03_21_114148_create_groups_table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('groups', function (Blueprint $table) {
$table->increments('id')->index();
@@ -53,7 +53,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::dropIfExists('group_sensor');
Schema::dropIfExists('group_user');
diff --git a/database/migrations/2017_03_21_114828_entrust_setup_tables.php b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
index 9f997bca..2e01c2a4 100644
--- a/database/migrations/2017_03_21_114828_entrust_setup_tables.php
+++ b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
// Create table for storing roles
Schema::create('roles', function (Blueprint $table) {
@@ -62,7 +62,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::drop('permission_role');
Schema::drop('permissions');
diff --git a/database/migrations/2017_04_14_175011_create-queen-table.php b/database/migrations/2017_04_14_175011_create-queen-table.php
index 3e8b8ba2..d99d35a0 100644
--- a/database/migrations/2017_04_14_175011_create-queen-table.php
+++ b/database/migrations/2017_04_14_175011_create-queen-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('bee_races', function (Blueprint $table) {
$table->increments('id')->index();
@@ -51,7 +51,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('queens', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
diff --git a/database/migrations/2017_04_14_175022_create-production-table.php b/database/migrations/2017_04_14_175022_create-production-table.php
index cc33d569..bc56365e 100644
--- a/database/migrations/2017_04_14_175022_create-production-table.php
+++ b/database/migrations/2017_04_14_175022_create-production-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('productions', function (Blueprint $table) {
$table->increments('id')->index();
@@ -45,7 +45,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('productions', function (Blueprint $table) {
$table->dropForeign(['hive_id']);
diff --git a/database/migrations/2017_07_17_095406_add_users_last_login.php b/database/migrations/2017_07_17_095406_add_users_last_login.php
index da8c85cf..56778b0c 100644
--- a/database/migrations/2017_07_17_095406_add_users_last_login.php
+++ b/database/migrations/2017_07_17_095406_add_users_last_login.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->timestamp('last_login')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('last_login');
diff --git a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
index db4bab0f..564c2666 100644
--- a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
+++ b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
@@ -12,7 +12,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('categories', function (Blueprint $table) {
if (Schema::hasColumn('categories', NestedSet::LFT) == false) {
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->dropForeign(['parent_id']);
diff --git a/database/migrations/2018_01_31_174432_create_category_input.php b/database/migrations/2018_01_31_174432_create_category_input.php
index 14a9a8a6..e92aca89 100644
--- a/database/migrations/2018_01_31_174432_create_category_input.php
+++ b/database/migrations/2018_01_31_174432_create_category_input.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('category_inputs')) {
Schema::create('category_inputs', function (Blueprint $table) {
@@ -76,7 +76,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
diff --git a/database/migrations/2018_02_20_161831_add_category_old_id.php b/database/migrations/2018_02_20_161831_add_category_old_id.php
index 661ec505..5ded8254 100644
--- a/database/migrations/2018_02_20_161831_add_category_old_id.php
+++ b/database/migrations/2018_02_20_161831_add_category_old_id.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('categories', function (Blueprint $table) {
if (Schema::hasColumn('categories', 'old_id') == false) {
@@ -26,7 +26,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
$table->dropColumn('old_id');
diff --git a/database/migrations/2018_03_12_223732_create-checklists-table.php b/database/migrations/2018_03_12_223732_create-checklists-table.php
index 6ee76618..eb6543d9 100644
--- a/database/migrations/2018_03_12_223732_create-checklists-table.php
+++ b/database/migrations/2018_03_12_223732_create-checklists-table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('checklists')) {
Schema::create('checklists', function (Blueprint $table) {
@@ -75,7 +75,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('checklist_user')) {
Schema::table('checklist_user', function (Blueprint $table) {
diff --git a/database/migrations/2018_04_03_110731_create_inspections_table.php b/database/migrations/2018_04_03_110731_create_inspections_table.php
index 43e7e17a..85bc34e0 100644
--- a/database/migrations/2018_04_03_110731_create_inspections_table.php
+++ b/database/migrations/2018_04_03_110731_create_inspections_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('inspections')) {
Schema::create('inspections', function (Blueprint $table) {
@@ -76,7 +76,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('inspection_user')) {
Schema::table('inspection_user', function (Blueprint $table) {
diff --git a/database/migrations/2018_04_03_112937_create_inspection_items_table.php b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
index 96e15deb..6a5cb603 100644
--- a/database/migrations/2018_04_03_112937_create_inspection_items_table.php
+++ b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('inspection_items')) {
Schema::create('inspection_items', function (Blueprint $table) {
@@ -30,7 +30,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('inspection_items')) {
Schema::table('inspection_items', function (Blueprint $table) {
diff --git a/database/migrations/2018_04_03_115056_add_checklist_category_order.php b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
index 3a1d9cff..2c802c0e 100644
--- a/database/migrations/2018_04_03_115056_add_checklist_category_order.php
+++ b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('checklist_category')) {
Schema::table('checklist_category', function (Blueprint $table) {
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('checklist_category')) {
Schema::table('checklist_category', function (Blueprint $table) {
diff --git a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
index 06e8ad9e..fb2175e5 100644
--- a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
+++ b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('categories')) {
Schema::table('categories', function (Blueprint $table) {
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('categories')) {
Schema::table('categories', function (Blueprint $table) {
diff --git a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
index 8791e2b1..651a052d 100644
--- a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
+++ b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('hives', function ($table) {
$table->dropForeign(['location_id']);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('hives', function ($table) {
$table->dropForeign(['location_id']);
diff --git a/database/migrations/2018_05_18_091519_add_user_policy_check.php b/database/migrations/2018_05_18_091519_add_user_policy_check.php
index 1d9ca685..0262ec3d 100644
--- a/database/migrations/2018_05_18_091519_add_user_policy_check.php
+++ b/database/migrations/2018_05_18_091519_add_user_policy_check.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('users', function ($table) {
$table->string('policy_accepted')->nullable();
@@ -22,7 +22,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('users', function ($table) {
$table->dropColumn('policy_accepted');
diff --git a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
index 3b494bab..d7df4213 100644
--- a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
+++ b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('languages', function ($table) {
if (! Schema::hasColumn('languages', 'twochar')) {
@@ -33,7 +33,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('languages', function ($table) {
if (Schema::hasColumn('languages', 'twochar')) {
diff --git a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
index 72e896d2..4b02c641 100644
--- a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
+++ b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
@@ -21,7 +21,7 @@ public function __construct()
$this->debug = false;
}
- public function up()
+ public function up(): void
{
if (Schema::hasTable('categories')) {
echo "ConvertInspectionsToTaxonomy disableForeignKeyConstraints...\r\n";
@@ -92,7 +92,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
//
}
diff --git a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
index abebcdf4..51e68b4c 100644
--- a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
+++ b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('users', function (Blueprint $table) {
if (! Schema::hasColumn('users', 'email_verified_at')) {
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'email_verified_at')) {
diff --git a/database/migrations/2019_01_08_101831_add_category_required.php b/database/migrations/2019_01_08_101831_add_category_required.php
index f4454ba3..aab62491 100644
--- a/database/migrations/2019_01_08_101831_add_category_required.php
+++ b/database/migrations/2019_01_08_101831_add_category_required.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('categories', function (Blueprint $table) {
if (Schema::hasColumn('categories', 'required') == false) {
@@ -26,7 +26,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('categories', function (Blueprint $table) {
if (Schema::hasColumn('categories', 'required') == true) {
diff --git a/database/migrations/2019_01_14_114237_add_group_extras.php b/database/migrations/2019_01_14_114237_add_group_extras.php
index 06436d43..b6fea7fd 100644
--- a/database/migrations/2019_01_14_114237_add_group_extras.php
+++ b/database/migrations/2019_01_14_114237_add_group_extras.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('groups', function (Blueprint $table) {
$table->text('description')->nullable();
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('groups', function (Blueprint $table) {
$table->dropColumn('description');
diff --git a/database/migrations/2019_01_14_114804_create_group_hive.php b/database/migrations/2019_01_14_114804_create_group_hive.php
index dcb1a042..14531c85 100644
--- a/database/migrations/2019_01_14_114804_create_group_hive.php
+++ b/database/migrations/2019_01_14_114804_create_group_hive.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('group_hive')) {
Schema::create('group_hive', function (Blueprint $table) {
@@ -36,7 +36,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('group_hive')) {
Schema::table('group_hive', function (Blueprint $table) {
diff --git a/database/migrations/2019_01_14_143937_add_group_user_admin.php b/database/migrations/2019_01_14_143937_add_group_user_admin.php
index a62ba00f..38a72ba6 100644
--- a/database/migrations/2019_01_14_143937_add_group_user_admin.php
+++ b/database/migrations/2019_01_14_143937_add_group_user_admin.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('group_user', function (Blueprint $table) {
$table->boolean('creator')->default(false);
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('group_user', function (Blueprint $table) {
$table->dropColumn('creator');
diff --git a/database/migrations/2019_01_28_104628_create_measurements_table.php b/database/migrations/2019_01_28_104628_create_measurements_table.php
index 7e6a9e2c..f240aae6 100644
--- a/database/migrations/2019_01_28_104628_create_measurements_table.php
+++ b/database/migrations/2019_01_28_104628_create_measurements_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('measurements')) {
Schema::create('measurements', function (Blueprint $table) {
@@ -33,7 +33,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('measurements')) {
Schema::table('measurements', function (Blueprint $table) {
diff --git a/database/migrations/2019_01_28_223610_add_min_max_values.php b/database/migrations/2019_01_28_223610_add_min_max_values.php
index 87022a82..a4567c67 100644
--- a/database/migrations/2019_01_28_223610_add_min_max_values.php
+++ b/database/migrations/2019_01_28_223610_add_min_max_values.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('measurements', function (Blueprint $table) {
if (! Schema::hasColumn('measurements', 'min_value')) {
@@ -31,7 +31,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('measurements', function (Blueprint $table) {
if (Schema::hasColumn('measurements', 'min_value')) {
diff --git a/database/migrations/2019_01_28_223654_add_high_low_values.php b/database/migrations/2019_01_28_223654_add_high_low_values.php
index 51f2be9b..6bdca272 100644
--- a/database/migrations/2019_01_28_223654_add_high_low_values.php
+++ b/database/migrations/2019_01_28_223654_add_high_low_values.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('physical_quantities', function (Blueprint $table) {
if (! Schema::hasColumn('physical_quantities', 'low_value')) {
@@ -29,7 +29,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('physical_quantities', function (Blueprint $table) {
if (Schema::hasColumn('physical_quantities', 'low_value')) {
diff --git a/database/migrations/2019_11_21_153657_add_location_roofed.php b/database/migrations/2019_11_21_153657_add_location_roofed.php
index 2baa747e..7a2214f8 100644
--- a/database/migrations/2019_11_21_153657_add_location_roofed.php
+++ b/database/migrations/2019_11_21_153657_add_location_roofed.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('locations', function (Blueprint $table) {
if (! Schema::hasColumn('locations', 'roofed')) {
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
if (Schema::hasColumn('locations', 'roofed')) {
diff --git a/database/migrations/2019_11_21_204213_create_researches_table.php b/database/migrations/2019_11_21_204213_create_researches_table.php
index c4f0a633..6f20ec72 100644
--- a/database/migrations/2019_11_21_204213_create_researches_table.php
+++ b/database/migrations/2019_11_21_204213_create_researches_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('researches')) {
Schema::create('researches', function (Blueprint $table) {
@@ -67,7 +67,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('research_user')) {
Schema::table('research_user', function (Blueprint $table) {
diff --git a/database/migrations/2019_12_27_172844_create_images_table.php b/database/migrations/2019_12_27_172844_create_images_table.php
index 41bd5c00..4de1e223 100644
--- a/database/migrations/2019_12_27_172844_create_images_table.php
+++ b/database/migrations/2019_12_27_172844_create_images_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('images', function (Blueprint $table) {
$table->increments('id');
@@ -48,7 +48,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('images')) {
Schema::table('images', function (Blueprint $table) {
diff --git a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
index 0d1822e6..b2d8bdd5 100644
--- a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
+++ b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('inspections', function (Blueprint $table) {
if (! Schema::hasColumn('inspections', 'checklist_id')) {
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('inspections', function (Blueprint $table) {
if (Schema::hasColumn('inspections', 'checklist_id')) {
diff --git a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
index 37e50d4b..e28ff49a 100644
--- a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
+++ b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
if (Schema::hasColumn('sensors', 'hive_id')) {
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
if (Schema::hasColumn('sensors', 'hive_id')) {
diff --git a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
index 54105995..d403b1c9 100644
--- a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
+++ b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('hives', function (Blueprint $table) {
$table->decimal('bb_width_cm', 6, 1)->unsigned()->nullable();
@@ -27,7 +27,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('hives', function (Blueprint $table) {
$table->dropColumn('bb_width_cm');
diff --git a/database/migrations/2020_01_11_135656_add_description_to_queen.php b/database/migrations/2020_01_11_135656_add_description_to_queen.php
index 6769b714..ab4a8219 100644
--- a/database/migrations/2020_01_11_135656_add_description_to_queen.php
+++ b/database/migrations/2020_01_11_135656_add_description_to_queen.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('queens', function (Blueprint $table) {
$table->string('description')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('queens', function (Blueprint $table) {
$table->dropColumn('description');
diff --git a/database/migrations/2020_01_11_140516_add_order_to_hive.php b/database/migrations/2020_01_11_140516_add_order_to_hive.php
index 64557466..30122e4e 100644
--- a/database/migrations/2020_01_11_140516_add_order_to_hive.php
+++ b/database/migrations/2020_01_11_140516_add_order_to_hive.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('hives', function (Blueprint $table) {
$table->integer('order')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('hives', function (Blueprint $table) {
$table->dropColumn('order');
diff --git a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
index c0c742ab..f14ab09b 100644
--- a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
+++ b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('sensor_definitions', function (Blueprint $table) {
$table->increments('id');
@@ -39,7 +39,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('sensor_definitions')) {
Schema::table('sensor_definitions', function (Blueprint $table) {
diff --git a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
index 02e3008c..a65e926d 100644
--- a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
+++ b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->timestamp('last_message_received')->nullable();
@@ -30,7 +30,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('last_message_received');
diff --git a/database/migrations/2020_01_15_110902_add_storage_to_image.php b/database/migrations/2020_01_15_110902_add_storage_to_image.php
index aec725fe..666ddf3d 100644
--- a/database/migrations/2020_01_15_110902_add_storage_to_image.php
+++ b/database/migrations/2020_01_15_110902_add_storage_to_image.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('images', function (Blueprint $table) {
$table->string('storage');
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('images', function (Blueprint $table) {
$table->dropColumn('storage');
diff --git a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
index 6232faef..a71cff27 100644
--- a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
+++ b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('images', function (Blueprint $table) {
$table->string('image_url', 1024)->change();
@@ -33,7 +33,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('images', function (Blueprint $table) {
$table->string('image_url', 255)->change();
diff --git a/database/migrations/2020_01_15_121511_add_image_to_inspection.php b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
index bc54bb3b..d1de122f 100644
--- a/database/migrations/2020_01_15_121511_add_image_to_inspection.php
+++ b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('inspections', function (Blueprint $table) {
$table->integer('image_id')->unsigned()->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('inspections', function (Blueprint $table) {
$table->dropColumn('image_id');
diff --git a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
index 492832c1..0b36f8dd 100644
--- a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
+++ b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->timestamp('last_weather_time')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->dropColumn('last_weather_time');
diff --git a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
index 7d8df430..bcb18008 100644
--- a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
+++ b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->float('battery_voltage')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('battery_voltage');
diff --git a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
index 342ee9ca..6c7eac91 100644
--- a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
+++ b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->text('next_downlink_message')->nullable();
@@ -24,7 +24,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('last_downlink_result');
diff --git a/database/migrations/2020_06_08_094741_add_locale_to_user.php b/database/migrations/2020_06_08_094741_add_locale_to_user.php
index 6f418ebf..2560d760 100644
--- a/database/migrations/2020_06_08_094741_add_locale_to_user.php
+++ b/database/migrations/2020_06_08_094741_add_locale_to_user.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->string('locale')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('locale');
diff --git a/database/migrations/2020_06_25_154728_create_sample_codes_table.php b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
index 3a7460a1..f20d26ea 100644
--- a/database/migrations/2020_06_25_154728_create_sample_codes_table.php
+++ b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('sample_codes', function (Blueprint $table) {
$table->increments('id');
@@ -43,7 +43,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('sample_codes')) {
Schema::table('sample_codes', function (Blueprint $table) {
diff --git a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
index e0f2d7ef..d27752cd 100644
--- a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
+++ b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->string('hex_color')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('locations', function (Blueprint $table) {
$table->dropColumn('hex_color');
diff --git a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
index 0ca84a0c..f8c35b1e 100644
--- a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
+++ b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
@@ -6,7 +6,7 @@
return new class extends Migration
{
- public function up()
+ public function up(): void
{
if (Schema::hasTable('researches')) {
Schema::table('researches', function (Blueprint $table) {
@@ -34,7 +34,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('research_viewer')) {
Schema::table('research_viewer', function (Blueprint $table) {
diff --git a/database/migrations/2021_02_09_170632_create_alerts_table.php b/database/migrations/2021_02_09_170632_create_alerts_table.php
index 62a6651e..581620fe 100644
--- a/database/migrations/2021_02_09_170632_create_alerts_table.php
+++ b/database/migrations/2021_02_09_170632_create_alerts_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('alerts')) {
Schema::create('alerts', function (Blueprint $table) {
@@ -37,7 +37,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('alerts')) {
Schema::drop('alerts');
diff --git a/database/migrations/2021_02_09_170935_create_alert_rules_table.php b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
index 29887d80..3cee6632 100644
--- a/database/migrations/2021_02_09_170935_create_alert_rules_table.php
+++ b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('alert_rules')) {
Schema::create('alert_rules', function (Blueprint $table) {
@@ -40,7 +40,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::drop('alert_rules');
diff --git a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
index 07b534d3..f8de729c 100644
--- a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
+++ b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
@@ -26,7 +26,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
diff --git a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
index 989b3000..6e1671c1 100644
--- a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
+++ b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
@@ -26,7 +26,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
diff --git a/database/migrations/2021_02_24_095050_create_flash_logs_table.php b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
index 7e4790f3..986e8325 100644
--- a/database/migrations/2021_02_24_095050_create_flash_logs_table.php
+++ b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('flash_logs')) {
Schema::create('flash_logs', function (Blueprint $table) {
@@ -36,7 +36,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('flash_logs')) {
Schema::drop('flash_logs');
diff --git a/database/migrations/2021_03_26_124313_add_flashlog_columns.php b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
index 5571150f..408f3601 100644
--- a/database/migrations/2021_03_26_124313_add_flashlog_columns.php
+++ b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->integer('log_size_bytes')->unsigned()->nullable();
@@ -24,7 +24,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('log_size_bytes');
diff --git a/database/migrations/2021_04_09_180304_add_device_datetime.php b/database/migrations/2021_04_09_180304_add_device_datetime.php
index 48854f9c..a2583fc8 100644
--- a/database/migrations/2021_04_09_180304_add_device_datetime.php
+++ b/database/migrations/2021_04_09_180304_add_device_datetime.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->timestamp('datetime')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('datetime');
diff --git a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
index 40dab028..e919b716 100644
--- a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
+++ b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->float('datetime_offset_sec')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('datetime_offset_sec');
diff --git a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
index 567df9c4..7cfdeb94 100644
--- a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('queens', function ($table) {
$table->dropForeign(['hive_id']);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('queens', function ($table) {
$table->dropForeign(['hive_id']);
diff --git a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
index d6a8626b..f8f23160 100644
--- a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensor_definitions', function ($table) {
$table->dropForeign(['device_id']);
@@ -24,7 +24,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensor_definitions', function ($table) {
$table->dropForeign(['device_id']);
diff --git a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
index 47b86c35..0c5cad3c 100644
--- a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
+++ b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
DB::statement('ALTER TABLE `sensors` MODIFY COLUMN `datetime_offset_sec` DOUBLE NULL;');
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->float('datetime_offset_sec')->change();
diff --git a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
index 7966b18f..668f6909 100644
--- a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
+++ b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('alert_rules', function (Blueprint $table) {
$table->integer('alert_on_occurences')->default(1);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('alert_rules', function (Blueprint $table) {
$table->dropColumn('alert_on_occurences');
diff --git a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
index 9c4edfde..f9e34ed5 100644
--- a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
+++ b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('alert_rules')) {
Schema::table('alert_rules', function (Blueprint $table) {
diff --git a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
index 77d3cbeb..952b526b 100644
--- a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
+++ b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->float('time_percentage')->unsigned()->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('time_percentage');
diff --git a/database/migrations/2021_09_20_150053_add_count_to_alerts.php b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
index b965aae1..5838577b 100644
--- a/database/migrations/2021_09_20_150053_add_count_to_alerts.php
+++ b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('alerts', function (Blueprint $table) {
$table->integer('count')->default(1);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('alerts', function (Blueprint $table) {
$table->dropColumn('count');
diff --git a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
index b70438c5..c505228a 100644
--- a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
+++ b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->boolean('show_in_dials')->default(false);
@@ -24,7 +24,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->dropColumn('show_in_dials');
diff --git a/database/migrations/2021_09_27_122352_remove_unused_tables.php b/database/migrations/2021_09_27_122352_remove_unused_tables.php
index babd016c..a74f5950 100644
--- a/database/migrations/2021_09_27_122352_remove_unused_tables.php
+++ b/database/migrations/2021_09_27_122352_remove_unused_tables.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::dropIfExists('actions');
Schema::dropIfExists('conditions');
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
//
}
diff --git a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
index b9f1a591..bc41e939 100644
--- a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
+++ b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
@@ -9,7 +9,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
$dryRun = false;
$this->convertDb('mysql', 'utf8mb4', 'utf8mb4_unicode_ci', $dryRun);
@@ -20,7 +20,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
$dryRun = false;
$this->convertDb('mysql', 'utf8', 'utf8_unicode_ci', $dryRun);
diff --git a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
index 7eb55faa..4c026320 100644
--- a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
+++ b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
@@ -12,7 +12,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('hives', function (Blueprint $table) {
$hives_bb_error = Hive::withTrashed()->whereRaw('bb_depth_cm < bb_height_cm')->get();
@@ -36,7 +36,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('hives', function (Blueprint $table) {
//
diff --git a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
index 00475237..3cfb5a32 100644
--- a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
+++ b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->boolean('weather')->default(false);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->dropColumn('weather');
diff --git a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
index 18a67b8b..f2067031 100644
--- a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
+++ b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->integer('rate_limit_per_min')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('rate_limit_per_min');
diff --git a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
index cd0e7492..549fa049 100644
--- a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
+++ b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->string('former_key_list')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('former_key_list');
diff --git a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
index c62b09b8..4b92a56a 100644
--- a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
+++ b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->float('persisted_days')->nullable();
@@ -24,7 +24,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('persisted_days');
diff --git a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
index 0ea04339..61760572 100644
--- a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
+++ b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->json('default_user_ids')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->dropColumn('default_user_ids');
diff --git a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
index 6e197f9d..7cd6fedc 100644
--- a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
+++ b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->string('persisted_block_ids')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('persisted_block_ids');
diff --git a/database/migrations/2022_06_20_093325_add_queen_birth_date.php b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
index 38ea8eac..b4b0a99e 100644
--- a/database/migrations/2022_06_20_093325_add_queen_birth_date.php
+++ b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
@@ -12,7 +12,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('queens') && ! Schema::hasColumn('queens', 'birth_date')) {
Schema::table('queens', function (Blueprint $table) {
@@ -32,7 +32,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('queens') && Schema::hasColumn('queens', 'birth_date')) {
Schema::table('queens', function (Blueprint $table) {
diff --git a/database/migrations/2022_06_20_123603_create_hive_tags_table.php b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
index c5482cdc..fc1a6b05 100644
--- a/database/migrations/2022_06_20_123603_create_hive_tags_table.php
+++ b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('hive_tags', function (Blueprint $table) {
$table->increments('id');
@@ -28,7 +28,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::drop('hive_tags');
}
diff --git a/database/migrations/2023_02_08_102518_add_visible_to_research.php b/database/migrations/2023_02_08_102518_add_visible_to_research.php
index e3296eca..e7458295 100644
--- a/database/migrations/2023_02_08_102518_add_visible_to_research.php
+++ b/database/migrations/2023_02_08_102518_add_visible_to_research.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->boolean('visible')->default(true);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->dropColumn('visible');
diff --git a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
index faf749dd..7b7093a7 100644
--- a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
+++ b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->boolean('on_invite_only')->default(false);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('researches', function (Blueprint $table) {
$table->dropColumn('on_invite_only');
diff --git a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
index 93d946e3..8b6b2d10 100644
--- a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
+++ b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('dashboard_groups', function (Blueprint $table) {
$table->increments('id');
@@ -37,7 +37,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('dashboard_groups', function (Blueprint $table) {
$table->dropForeign(['user_id']);
diff --git a/database/migrations/2023_04_03_083652_create_organizations_table.php b/database/migrations/2023_04_03_083652_create_organizations_table.php
index 892e1b34..d586b091 100644
--- a/database/migrations/2023_04_03_083652_create_organizations_table.php
+++ b/database/migrations/2023_04_03_083652_create_organizations_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('organizations')) {
Schema::create('organizations', function (Blueprint $table) {
@@ -87,7 +87,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('users') && Schema::hasColumn('users', 'organization_id')) {
Schema::table('users', function (Blueprint $table) {
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index b8a4cf4b..93c5c402 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('role_user') && ! Schema::hasColumn('role_user', 'organization_id')) {
@@ -54,7 +54,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
if (Schema::hasTable('permission_user')) {
Schema::table('permission_user', function (Blueprint $table) {
diff --git a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
index 46d5e002..d0ce38a1 100644
--- a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
+++ b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('checklist_svgs', function (Blueprint $table) {
$table->increments('id');
@@ -29,7 +29,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::drop('checklist_svgs');
}
diff --git a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
index a2ba4947..351a8dee 100644
--- a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
+++ b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (! Schema::hasTable('alert_rule_formulas')) {
@@ -56,7 +56,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::drop('alert_rule_formulas');
}
diff --git a/database/migrations/2023_08_30_135044_add_source_to_measurement.php b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
index c451f1a5..be018cb4 100644
--- a/database/migrations/2023_08_30_135044_add_source_to_measurement.php
+++ b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->string('data_source_type')->default('db_influx');
@@ -25,7 +25,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->dropColumn('data_source_type');
diff --git a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
index 295f59b3..cc218708 100644
--- a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
+++ b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('alert_rule_formulas') && Schema::hasColumn('alert_rule_formulas', 'future') == false) {
@@ -54,7 +54,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('alert_rule_formulas', function (Blueprint $table) {
$table->dropColumn('future');
diff --git a/database/migrations/2023_09_06_090804_add_future_to_measurement.php b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
index 410d2c1c..f3807602 100644
--- a/database/migrations/2023_09_06_090804_add_future_to_measurement.php
+++ b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->boolean('future')->default(false);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('measurements', function (Blueprint $table) {
$table->dropColumn('future');
diff --git a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
index fd8d192d..8cb18163 100644
--- a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
+++ b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('checklist_svgs', function (Blueprint $table) {
$table->string('app_version')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('checklist_svgs', function (Blueprint $table) {
$table->dropColumn('app_version');
diff --git a/database/migrations/2023_09_25_154132_create_calculation_models_table.php b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
index d5402532..5d077aad 100644
--- a/database/migrations/2023_09_25_154132_create_calculation_models_table.php
+++ b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
@@ -10,7 +10,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::create('calculation_models', function (Blueprint $table) {
$table->increments('id');
@@ -36,7 +36,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::drop('calculation_models');
}
diff --git a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
index 21c8ea3c..11e82069 100644
--- a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
+++ b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
if (Schema::hasTable('alert_rule_formulas')) {
Schema::table('alert_rule_formulas', function (Blueprint $table) {
@@ -27,7 +27,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('alert_rule_formulas', function (Blueprint $table) {
$table->dropColumn('last_result_value');
diff --git a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
index a2e4ae22..6867998e 100644
--- a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
+++ b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
@@ -12,7 +12,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->boolean('rtc')->nullable();
@@ -32,7 +32,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('rtc');
diff --git a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
index 789dd812..d1723087 100644
--- a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
+++ b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensor_definitions', function (Blueprint $table) {
$table->boolean('recalculate')->default(false);
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensor_definitions', function (Blueprint $table) {
$table->dropColumn('recalculate');
diff --git a/database/migrations/2025_05_20_131603_add_flash_log_dates.php b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
index 14322183..3cd3358a 100644
--- a/database/migrations/2025_05_20_131603_add_flash_log_dates.php
+++ b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->datetime('log_date_start')->nullable();
@@ -26,7 +26,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('log_date_start');
diff --git a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
index 419df800..dc7e425a 100644
--- a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
+++ b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->json('meta_data')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('meta_data');
diff --git a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
index 7837dc12..aa2180f2 100644
--- a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
+++ b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->json('log_file_info')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('sensors', function (Blueprint $table) {
$table->dropColumn('log_file_info');
diff --git a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
index 866c65df..2f618ba2 100644
--- a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
+++ b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->json('time_corrections')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('time_corrections');
diff --git a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
index 07c2ca75..2653aadc 100644
--- a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
+++ b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->boolean('valid_override')->nullable();
@@ -23,7 +23,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::table('flash_logs', function (Blueprint $table) {
$table->dropColumn('valid_override')->nullable();
diff --git a/database/migrations/2026_06_01_000000_rename_password_resets_table.php b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
index 7ea51cef..ab300e6e 100644
--- a/database/migrations/2026_06_01_000000_rename_password_resets_table.php
+++ b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
@@ -11,7 +11,7 @@
*
* @return void
*/
- public function up()
+ public function up(): void
{
Schema::rename('password_resets', 'password_reset_tokens');
}
@@ -21,7 +21,7 @@ public function up()
*
* @return void
*/
- public function down()
+ public function down(): void
{
Schema::rename('password_reset_tokens', 'password_resets');
}
diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php
index 6fe425ef..e2ca138a 100644
--- a/database/seeders/DatabaseSeeder.php
+++ b/database/seeders/DatabaseSeeder.php
@@ -11,7 +11,7 @@ class DatabaseSeeder extends Seeder
*
* @return void
*/
- public function run()
+ public function run(): void
{
$this->call(DeviceCorrectionSeeder::class);
// $this->call(UserSeeder::class);
diff --git a/database/seeders/DeviceCorrectionSeeder.php b/database/seeders/DeviceCorrectionSeeder.php
index 46d21bec..417e4ddd 100644
--- a/database/seeders/DeviceCorrectionSeeder.php
+++ b/database/seeders/DeviceCorrectionSeeder.php
@@ -9,7 +9,7 @@
class DeviceCorrectionSeeder extends Seeder
{
- public function run()
+ public function run(): void
{
/*
1. Get BEEP type devices from DB, that have a 20 character long hardware_id that starts with '0e'
diff --git a/database/seeders/MeasurementSeeder.php b/database/seeders/MeasurementSeeder.php
index 6516bd73..53a4c2e6 100644
--- a/database/seeders/MeasurementSeeder.php
+++ b/database/seeders/MeasurementSeeder.php
@@ -94,7 +94,7 @@ class MeasurementSeeder extends Seeder
's_bin537_586Hz',
];
- public function run()
+ public function run(): void
{
if (PhysicalQuantity::where('abbreviation', '-')->count() == 0) {
PhysicalQuantity::create(['abbreviation' => 'hPa', 'name' => 'Pressure', 'unit' => 'hPa']);
diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php
index 40f85e61..9a34d261 100644
--- a/database/seeders/UserSeeder.php
+++ b/database/seeders/UserSeeder.php
@@ -12,7 +12,7 @@ class UserSeeder extends Seeder
*
* @return void
*/
- public function run()
+ public function run(): void
{
$users = User::all();
foreach ($users as $user) {
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
index 9319a1b9..a2777b2d 100644
--- a/tests/ExampleTest.php
+++ b/tests/ExampleTest.php
@@ -7,7 +7,7 @@ class ExampleTest extends TestCase
*
* @return void
*/
- public function test_basic_example()
+ public function test_basic_example(): void
{
$this->visit('/')
->see('Laravel');
From 1a75ec4f6271fb51041aebb68b7d05db4e8692cf Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:45 +0000
Subject: [PATCH 071/127] Add type hints from DocBlocks
---
app/Http/Controllers/AlertController.php | 16 +++++++------
app/Http/Controllers/AlertRuleController.php | 18 +++++++-------
.../AlertRuleFormulaController.php | 16 +++++++------
app/Http/Controllers/Api/AlertController.php | 9 +++----
.../Controllers/Api/AlertRuleController.php | 9 +++----
.../Api/Auth/VerificationController.php | 3 ++-
.../Controllers/Api/CategoryController.php | 7 +++---
.../Controllers/Api/ChecklistController.php | 11 +++++----
.../Api/ChecklistSvgController.php | 7 +++---
.../Api/DashboardGroupController.php | 9 +++----
app/Http/Controllers/Api/DeviceController.php | 21 ++++++++--------
app/Http/Controllers/Api/ExportController.php | 3 ++-
.../Controllers/Api/FlashLogController.php | 9 +++----
app/Http/Controllers/Api/GroupController.php | 9 +++----
app/Http/Controllers/Api/HiveController.php | 11 +++++----
.../Controllers/Api/HiveTagsController.php | 5 ++--
app/Http/Controllers/Api/ImageController.php | 11 +++++----
.../Controllers/Api/InspectionsController.php | 9 +++----
.../Controllers/Api/LocationController.php | 5 ++--
.../Controllers/Api/MeasurementController.php | 15 ++++++------
app/Http/Controllers/Api/QueenController.php | 9 +++----
.../Controllers/Api/ResearchController.php | 9 +++----
.../Api/ResearchDataController.php | 9 +++----
.../Controllers/Api/SampleCodeController.php | 7 +++---
.../Api/SensorDefinitionController.php | 11 +++++----
.../Controllers/Api/SettingController.php | 3 ++-
app/Http/Controllers/Api/UserController.php | 13 +++++-----
.../Controllers/Api/WeatherController.php | 3 ++-
app/Http/Controllers/Auth/LoginController.php | 3 ++-
.../Controllers/Auth/RegisterController.php | 4 ++--
.../CalculationModelController.php | 18 +++++++-------
app/Http/Controllers/CategoriesController.php | 24 ++++++++++---------
.../Controllers/CategoryInputsController.php | 16 +++++++------
app/Http/Controllers/ChecklistController.php | 18 +++++++-------
.../Controllers/ChecklistSvgController.php | 16 +++++++------
app/Http/Controllers/DashboardController.php | 3 ++-
.../Controllers/DashboardGroupController.php | 16 +++++++------
app/Http/Controllers/DeviceController.php | 20 +++++++++-------
app/Http/Controllers/FlashLogController.php | 18 +++++++-------
app/Http/Controllers/GroupController.php | 16 +++++++------
app/Http/Controllers/HiveTagsController.php | 16 +++++++------
app/Http/Controllers/HomeController.php | 4 +++-
app/Http/Controllers/ImageController.php | 16 +++++++------
.../Controllers/InspectionItemsController.php | 16 +++++++------
.../Controllers/InspectionsController.php | 16 +++++++------
app/Http/Controllers/LanguageController.php | 16 +++++++------
.../Controllers/MeasurementController.php | 16 +++++++------
app/Http/Controllers/PermissionController.php | 16 +++++++------
.../PhysicalQuantityController.php | 16 +++++++------
app/Http/Controllers/ResearchController.php | 20 +++++++++-------
app/Http/Controllers/RoleController.php | 16 +++++++------
app/Http/Controllers/SampleCodeController.php | 24 ++++++++++---------
.../SensorDefinitionController.php | 16 +++++++------
app/Http/Controllers/TaxonomyController.php | 3 ++-
.../Controllers/TranslationController.php | 12 ++++++----
app/Http/Controllers/UserController.php | 16 +++++++------
app/Http/Resources/InspectionCollection.php | 3 ++-
app/Mail/AlertMail.php | 2 +-
app/Mail/DataExport.php | 2 +-
app/Mail/GroupAcceptation.php | 2 +-
app/Mail/GroupInvitation.php | 2 +-
app/Mail/GroupRefusal.php | 2 +-
app/Mail/SampleCodeMail.php | 2 +-
app/Notifications/ResetPassword.php | 5 ++--
app/Notifications/VerifyEmail.php | 2 +-
65 files changed, 392 insertions(+), 308 deletions(-)
diff --git a/app/Http/Controllers/AlertController.php b/app/Http/Controllers/AlertController.php
index b06e93a0..2e9799ae 100644
--- a/app/Http/Controllers/AlertController.php
+++ b/app/Http/Controllers/AlertController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\Alert;
use App\User;
use Illuminate\Http\Request;
@@ -13,7 +15,7 @@ class AlertController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$rule_id = $request->input('rule_id');
$device_id = $request->input('device_id');
@@ -46,7 +48,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$alert = new Alert;
@@ -59,7 +61,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'alert_rule_id' => 'required',
@@ -80,7 +82,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$alert = Alert::findOrFail($id);
@@ -93,7 +95,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$alert = Alert::findOrFail($id);
@@ -106,7 +108,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'alert_rule_id' => 'required',
@@ -128,7 +130,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Alert::destroy($id);
diff --git a/app/Http/Controllers/AlertRuleController.php b/app/Http/Controllers/AlertRuleController.php
index 5583736c..097f242d 100644
--- a/app/Http/Controllers/AlertRuleController.php
+++ b/app/Http/Controllers/AlertRuleController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\AlertRule;
use App\User;
use Cache;
@@ -15,7 +17,7 @@ class AlertRuleController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$perPage = 100;
$user_id = $request->input('user_id');
@@ -46,7 +48,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$alertrule = new AlertRule;
@@ -56,7 +58,7 @@ public function create()
/**
* Parse AR
*/
- public function parse(Request $request, $id)
+ public function parse(Request $request, $id): RedirectResponse
{
$alertrule = AlertRule::findOrFail($id);
$alertrule->last_evaluated_at = null;
@@ -79,7 +81,7 @@ public function parse(Request $request, $id)
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'measurement_id' => 'required',
@@ -123,7 +125,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$alertrule = AlertRule::findOrFail($id);
@@ -136,7 +138,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$alertrule = AlertRule::findOrFail($id);
@@ -149,7 +151,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'measurement_id' => 'required',
@@ -194,7 +196,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
AlertRule::destroy($id);
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index a4ef9254..98867ae8 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\AlertRuleFormula;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class AlertRuleFormulaController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 25;
@@ -39,7 +41,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$alertruleformula = new AlertRuleFormula;
@@ -52,7 +54,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'alert_rule_id' => 'required',
@@ -75,7 +77,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$alertruleformula = AlertRuleFormula::findOrFail($id);
@@ -88,7 +90,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$alertruleformula = AlertRuleFormula::findOrFail($id);
@@ -101,7 +103,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'alert_rule_id' => 'required',
@@ -125,7 +127,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
AlertRuleFormula::destroy($id);
diff --git a/app/Http/Controllers/Api/AlertController.php b/app/Http/Controllers/Api/AlertController.php
index ec5e71ef..202834c1 100644
--- a/app/Http/Controllers/Api/AlertController.php
+++ b/app/Http/Controllers/Api/AlertController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Models\Alert;
use Auth;
@@ -23,7 +24,7 @@ class AlertController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->user()->alerts()->count() > 0) {
return response()->json(['alerts' => $request->user()->alerts()->get()]);
@@ -45,7 +46,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$this->validate($request, [
'alert_rule_id' => 'required|integer|exists:alert_rules,id',
@@ -82,7 +83,7 @@ public function show($id)
*
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$alert = Auth::user()->alerts()->findOrFail($id);
$alert->update($request->except('user_id'));
@@ -98,7 +99,7 @@ public function update(Request $request, $id)
*
* @return \Illuminate\Http\Response
*/
- public function destroy(Request $request, $id)
+ public function destroy(Request $request, $id): JsonResponse
{
if ($request->filled('alert_ids')) {
Auth::user()->alerts()->whereIn('id', $request->input('alert_ids'))->delete();
diff --git a/app/Http/Controllers/Api/AlertRuleController.php b/app/Http/Controllers/Api/AlertRuleController.php
index f514dfb9..92a5b0e7 100644
--- a/app/Http/Controllers/Api/AlertRuleController.php
+++ b/app/Http/Controllers/Api/AlertRuleController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Models\AlertRule;
use App\Models\AlertRuleFormula;
@@ -27,7 +28,7 @@ class AlertRuleController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->user()->alert_rules()->count() > 0) {
return response()->json(['alert_rules' => $request->user()->alert_rules()->get()]);
@@ -86,7 +87,7 @@ public function default_rules(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$validator = Validator::make($request->all(), [
'name' => 'nullable|string',
@@ -208,7 +209,7 @@ public function show($id)
*
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$validator = Validator::make($request->all(), [
'name' => 'nullable|string',
@@ -311,7 +312,7 @@ public function update(Request $request, $id)
*
* @return \Illuminate\Http\Response
*/
- public function destroy($id)
+ public function destroy($id): JsonResponse
{
Auth::user()->alert_rules()->findOrFail($id)->delete();
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index 803da308..dcadc38e 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api\Auth;
+use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Auth\Events\Verified;
@@ -60,7 +61,7 @@ public function show()
*
* @return \Illuminate\Http\Response
*/
- public function verify(Request $request)
+ public function verify(Request $request): RedirectResponse
{
$user = null;
diff --git a/app/Http/Controllers/Api/CategoryController.php b/app/Http/Controllers/Api/CategoryController.php
index b9e89d13..6abb68c6 100644
--- a/app/Http/Controllers/Api/CategoryController.php
+++ b/app/Http/Controllers/Api/CategoryController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\CategoryInput;
use App\Http\Controllers\Controller;
@@ -49,7 +50,7 @@ class CategoryController extends Controller
}
]
*/
- public function inputs(Request $request)
+ public function inputs(Request $request): JsonResponse
{
// die($category);
return response()->json(CategoryInput::all());
@@ -63,7 +64,7 @@ public function inputs(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function show(Request $request, Category $category)
+ public function show(Request $request, Category $category): JsonResponse
{
// die($category);
return response()->json($category);
@@ -1506,7 +1507,7 @@ public function show(Request $request, Category $category)
}
]
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
return response()->json(Category::whereIsRoot()->with('children')->get());
}
diff --git a/app/Http/Controllers/Api/ChecklistController.php b/app/Http/Controllers/Api/ChecklistController.php
index 8e0c40ad..8e9ad814 100644
--- a/app/Http/Controllers/Api/ChecklistController.php
+++ b/app/Http/Controllers/Api/ChecklistController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Checklist;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
@@ -19,14 +20,14 @@ class ChecklistController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
$checklists = $request->user()->allChecklists()->orderBy('name')->get();
return response()->json($checklists);
}
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$requestData = $request->except(['user_id']);
$checklist = Checklist::create($requestData);
@@ -40,7 +41,7 @@ public function store(Request $request)
return response()->json(['checklist_id' => $checklist->id], 201);
}
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$checklist = $request->user()->allChecklists()->find($id);
if ($checklist) {
@@ -53,7 +54,7 @@ public function show(Request $request, $id)
return response()->json(null, 404);
}
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$requestData = $request->except(['user_id']);
@@ -73,7 +74,7 @@ public function update(Request $request, $id)
return response()->json('Nothing updated', 500);
}
- public function destroy(Request $request, $id)
+ public function destroy(Request $request, $id): JsonResponse
{
return response()->json($request->user()->checklists()->findOrFail($id)->delete());
}
diff --git a/app/Http/Controllers/Api/ChecklistSvgController.php b/app/Http/Controllers/Api/ChecklistSvgController.php
index 96b31693..2e5cfdac 100644
--- a/app/Http/Controllers/Api/ChecklistSvgController.php
+++ b/app/Http/Controllers/Api/ChecklistSvgController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
@@ -35,7 +36,7 @@ public function index(Request $request)
@bodyParam last_print datetime The last print datetime
@authenticated
**/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$checklist_svg = $request->user()->checklistSvgs()->create($request->all());
@@ -60,7 +61,7 @@ public function show($id)
Edit an SVG inspection
@authenticated
**/
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$checklist_svg = $request->user()->checklistSvgs()->findOrFail($id);
@@ -74,7 +75,7 @@ public function update(Request $request, $id)
Delete an SVG inspection
@authenticated
**/
- public function destroy($id)
+ public function destroy($id): JsonResponse
{
$request->user()->checklistSvgs()->destroy($id);
diff --git a/app/Http/Controllers/Api/DashboardGroupController.php b/app/Http/Controllers/Api/DashboardGroupController.php
index d9560b19..14a3ecbc 100644
--- a/app/Http/Controllers/Api/DashboardGroupController.php
+++ b/app/Http/Controllers/Api/DashboardGroupController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Hive;
use App\Http\Controllers\Controller;
use App\Measurement;
@@ -25,7 +26,7 @@ class DashboardGroupController extends Controller
List all user Dashboard groups
@authenticated
**/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
$dgroup = $request->user()->dashboardGroups;
@@ -141,7 +142,7 @@ public function public(Request $request, string $code)
return response()->json($out);
}
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$validator = Validator::make($request->input(), [
'hive_ids.*' => 'required|exists:hives,id',
@@ -173,7 +174,7 @@ public function show($id)
return $dgroup;
}
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$validator = Validator::make($request->input(), [
'hive_ids.*' => 'required|exists:hives,id',
@@ -204,7 +205,7 @@ public function update(Request $request, $id)
return response()->json($dgroup, 200);
}
- public function destroy(Request $request, $id)
+ public function destroy(Request $request, $id): JsonResponse
{
$g = $request->user()->dashboardGroups()->findOrFail($id);
diff --git a/app/Http/Controllers/Api/DeviceController.php b/app/Http/Controllers/Api/DeviceController.php
index d3033a63..0f32ba9a 100644
--- a/app/Http/Controllers/Api/DeviceController.php
+++ b/app/Http/Controllers/Api/DeviceController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Device;
use App\Inspection;
@@ -90,7 +91,7 @@ private function doTTNRequest($deviceId = null, $type = 'GET', $data = null, $se
}
]
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->filled('hardware_id')) {
@@ -135,7 +136,7 @@ public function index(Request $request)
Get a BEEP TTS Cloud Device by Device ID (BEEP hardware_id)
@authenticated
*/
- public function getTTNDevice(Request $request, $dev_id)
+ public function getTTNDevice(Request $request, $dev_id): JsonResponse
{
if ($this->canUserClaimDeviceFromRequest($request, false, '/devices/ttn/'.$dev_id) === false) {
return Response::json('device_not_yours', 403);
@@ -151,7 +152,7 @@ public function getTTNDevice(Request $request, $dev_id)
Create a BEEP TTS Cloud Device by Device ID, lorawan_device.dev_eui, and lorawan_device.app_key
@authenticated
*/
- public function postTTNDevice(Request $request, $dev_id)
+ public function postTTNDevice(Request $request, $dev_id): JsonResponse
{
$validator = Validator::make($request->input(), [
'lorawan_device.dev_eui' => 'required|alpha-num|size:16',
@@ -179,7 +180,7 @@ public function postTTNDevice(Request $request, $dev_id)
Debug BEEP TTS Cloud Device by lorawan_device.device_id, and lorawan_device.dev_eui
@authenticated
*/
- public function debugTtsDevice(Request $request, $step, $dev_id, $dev_eui, $app_key = null)
+ public function debugTtsDevice(Request $request, $step, $dev_id, $dev_eui, $app_key = null): JsonResponse
{
if ($request->user()->hasRole('superadmin')) {
$response = null;
@@ -474,7 +475,7 @@ private function canUserClaimDeviceFromRequest(Request $request, $undeleteTrashe
List one Device by id
@authenticated
*/
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$device = $request->user()->allDevices()->with('sensorDefinitions')->findOrFail($id);
@@ -508,7 +509,7 @@ public function show(Request $request, $id)
@bodyParam create_ttn_device boolean If true, create a new LoRaWAN device in the BEEP TTN console. If succesfull, create the device.
@bodyParam app_key string BEEP base LoRaWAN application key that you would like to store in TTN
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$device_array = $request->input();
@@ -628,7 +629,7 @@ public function storeMultiple(Request $request)
@bodyParam next_downlink_message string Hex string to send via downlink at next connection (LoRaWAN port 6)
@bodyParam last_downlink_result string Result received from BEEP base after downlink message (LoRaWAN port 5)
*/
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$result = null;
$timeZone = $request->input('timezone', 'UTC');
@@ -858,7 +859,7 @@ public function updateOrCreateDevice($device, $timeZone)
* "timestamp": 1705327800
* }
*/
- public function clocksync(Request $request)
+ public function clocksync(Request $request): JsonResponse
{
// Validate the request
$validator = Validator::make($request->all(), [
@@ -992,7 +993,7 @@ public function clocksync(Request $request)
* "payload": "940D"
* }
*/
- public function lora_reset(Request $request)
+ public function lora_reset(Request $request): JsonResponse
{
// Validate the request
$validator = Validator::make($request->all(), [
@@ -1096,7 +1097,7 @@ public function lora_reset(Request $request)
* "payload": "9D010F"
* }
*/
- public function interval(Request $request)
+ public function interval(Request $request): JsonResponse
{
// Validate the request
$validator = Validator::make($request->all(), [
diff --git a/app/Http/Controllers/Api/ExportController.php b/app/Http/Controllers/Api/ExportController.php
index fcc98fd3..27a18617 100644
--- a/app/Http/Controllers/Api/ExportController.php
+++ b/app/Http/Controllers/Api/ExportController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Device;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -68,7 +69,7 @@ private function cacheRequestRate($name)
@bodyParam sensordata boolean 1: also include measurement data in export. 0, of not filled: do not add measurement data. Default: set in environment settings. Example: 0
@bodyParam link boolean 1: Save the export to a file and provide the link, 0, or not filled means: send the Excel as an attachment to an email to the user's email address. Default: 0. Example: 1
**/
- public function all(Request $request)
+ public function all(Request $request): JsonResponse
{
$fileName = strtolower(env('APP_NAME')).'-export-user-'.$request->user()->id;
$user = $request->user();
diff --git a/app/Http/Controllers/Api/FlashLogController.php b/app/Http/Controllers/Api/FlashLogController.php
index faafba85..49b80365 100644
--- a/app/Http/Controllers/Api/FlashLogController.php
+++ b/app/Http/Controllers/Api/FlashLogController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Device;
use App\Http\Controllers\Controller;
use App\Measurement;
@@ -91,7 +92,7 @@ private function getUserFlashlogs($id = null)
*
* @authenticated
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
return response()->json($this->getUserFlashlogs());
}
@@ -115,7 +116,7 @@ public function index(Request $request)
* @bodyParam csv integer Save the Flashlog block_id data as a CSV file (1) and return a link. Default: 0. Example: 0
* @bodyParam json integer Save the Flashlog block_id data as a JSON file (1) and return a link. Default: 0. Example: 0
*/
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$out = $this->parse($request, $id);
@@ -137,7 +138,7 @@ public function show(Request $request, $id)
* @bodyParam from_cache boolean get Flashlog parse result from cache (24 hours). Default: true. Example: false
* @bodyParam save_result boolean Flashlog save the parsed result as new log_file_parsed. Default: false. Example: false
*/
- public function persist(Request $request, $id)
+ public function persist(Request $request, $id): JsonResponse
{
$out = $this->parse($request, $id, true);
@@ -812,7 +813,7 @@ private function parse(Request $request, $id, $persist = false, $delete = false)
return $out;
}
- public function destroy(Request $request, $id)
+ public function destroy(Request $request, $id): JsonResponse
{
return response()->json($request->user()->flashlogs()->findOrFail($id)->delete());
}
diff --git a/app/Http/Controllers/Api/GroupController.php b/app/Http/Controllers/Api/GroupController.php
index 6a760cf4..e89e7faa 100644
--- a/app/Http/Controllers/Api/GroupController.php
+++ b/app/Http/Controllers/Api/GroupController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Group;
use App\Http\Controllers\Controller;
use App\Mail\GroupAcceptation;
@@ -31,7 +32,7 @@ class GroupController extends Controller
*
* @urlParam ids string P
*/
- public function index(Request $request, $code = 200, $message = null, $error = null)
+ public function index(Request $request, $code = 200, $message = null, $error = null): JsonResponse
{
if ($request->filled('ids')) {
$group_ids = $request->input('ids');
@@ -62,7 +63,7 @@ public function index(Request $request, $code = 200, $message = null, $error = n
*
* @return \Illuminate\Http\Response
*/
- public function checktoken(Request $request)
+ public function checktoken(Request $request): JsonResponse
{
$validator = Validator::make($request->only('token', 'group_id', 'decline'), [
'token' => 'required|exists:group_user,token',
@@ -144,7 +145,7 @@ public function store(Request $request)
return $this->index($request, 201, __('group.Created').$requestData['name']);
}
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$group = $request->user()->groups()->find($id);
if ($group) {
@@ -188,7 +189,7 @@ public function update(Request $request, $id)
return response()->json('no_group_found', 404);
}
- public function detach(Request $request, $id)
+ public function detach(Request $request, $id): JsonResponse
{
$group = $request->user()->groups()->findOrFail($id);
if ($group) {
diff --git a/app/Http/Controllers/Api/HiveController.php b/app/Http/Controllers/Api/HiveController.php
index b16926a3..a19c1a88 100644
--- a/app/Http/Controllers/Api/HiveController.php
+++ b/app/Http/Controllers/Api/HiveController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Hive;
use App\HiveFactory;
@@ -112,7 +113,7 @@ private function saveQueen(Request $request, $hive)
}
]}
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->user()->hives()->count() > 0) {
return response()->json(['hives' => $request->user()->hives()->with('layers.frames', 'queen')->get()]);
@@ -130,7 +131,7 @@ public function index(Request $request)
* @param \App\Requests\PostHiveRequest $request
* @return \App\Hive
*/
- public function store(PostHiveRequest $request)
+ public function store(PostHiveRequest $request): Hive
{
$user_id = $request->user()->id;
@@ -164,7 +165,7 @@ public function store(PostHiveRequest $request)
*
* @return \App\Hive
*/
- public function show(Request $request, Hive $hive)
+ public function show(Request $request, Hive $hive): JsonResponse
{
return response()->json(['hives' => [$request->user()->allhives()->orderBy('name')->with('layers.frames', 'queen')->findOrFail($hive->id)]]);
}
@@ -178,7 +179,7 @@ public function show(Request $request, Hive $hive)
* @param \App\Requests\PostHiveRequest $request
* @return \App\Hive
*/
- public function update(PostHiveRequest $request, Hive $hive)
+ public function update(PostHiveRequest $request, Hive $hive): Hive
{
$hive = $request->user()->allhives(true)->findOrFail($hive->id);
$location = $request->user()->allLocations(true)->findOrFail($request->input('location_id'));
@@ -211,7 +212,7 @@ public function update(PostHiveRequest $request, Hive $hive)
*
* @return \Illuminate\Http\Response
*/
- public function destroy(Request $request, Hive $hive)
+ public function destroy(Request $request, Hive $hive): JsonResponse
{
$hive = $request->user()->hives()->findOrFail($hive->id);
$hive->delete();
diff --git a/app/Http/Controllers/Api/HiveTagsController.php b/app/Http/Controllers/Api/HiveTagsController.php
index 7d674b21..0eac42da 100644
--- a/app/Http/Controllers/Api/HiveTagsController.php
+++ b/app/Http/Controllers/Api/HiveTagsController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Validator;
@@ -72,7 +73,7 @@ public function show(Request $request, $tag)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $tag)
+ public function update(Request $request, $tag): JsonResponse
{
$data = $request->all();
$validator = Validator::make($data, [
@@ -101,7 +102,7 @@ public function update(Request $request, $tag)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroy(Request $request, $tag)
+ public function destroy(Request $request, $tag): JsonResponse
{
$request->user()->hive_tags()->where('tag', $tag)->delete();
diff --git a/app/Http/Controllers/Api/ImageController.php b/app/Http/Controllers/Api/ImageController.php
index 098f1f83..68ae07bb 100644
--- a/app/Http/Controllers/Api/ImageController.php
+++ b/app/Http/Controllers/Api/ImageController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Image;
use Auth;
@@ -20,7 +21,7 @@ class ImageController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
$images = Auth::user()->images()->get();
@@ -37,7 +38,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
if ($request->has('file') && $request->hasFile('file')) {
@@ -55,7 +56,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function show($id)
+ public function show(int $id)
{
$image = Auth::user()->images()->findOrFail($id);
@@ -68,7 +69,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): JsonResponse
{
$image = Auth::user()->images()->findOrFail($id);
@@ -83,7 +84,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroyByUrl(Request $request)
+ public function destroyByUrl(Request $request): JsonResponse
{
if ($request->filled('image_url')) {
$image_url = $request->input('image_url');
diff --git a/app/Http/Controllers/Api/InspectionsController.php b/app/Http/Controllers/Api/InspectionsController.php
index 7274ac13..b51420b4 100644
--- a/app/Http/Controllers/Api/InspectionsController.php
+++ b/app/Http/Controllers/Api/InspectionsController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -120,7 +121,7 @@ public function index(Request $request)
]
}
**/
- public function lists(Request $request)
+ public function lists(Request $request): JsonResponse
{
$out = [];
$checklists = $request->user()->allChecklists();
@@ -249,7 +250,7 @@ public function lists(Request $request)
]
}
*/
- public function hive(Request $request, $hive_id)
+ public function hive(Request $request, $hive_id): JsonResponse
{
$hive = $request->user()->allHives()->findOrFail($hive_id);
$locale = $request->filled('locale') ? $request->input('locale') : LaravelLocalization::getCurrentLocale();
@@ -263,7 +264,7 @@ public function hive(Request $request, $hive_id)
@authenticated
@urlParam id required The id of the inspection.
**/
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$inspection = $request->user()->allInspections()->find($id);
if (isset($inspection) == false) {
@@ -293,7 +294,7 @@ public function show(Request $request, $id)
@bodyParam notes string Textual value of the notes fields. Example: This is an inspection note
@bodyParam checklist_id integer Id of the user checklist for generating this inspection. Example: 829
**/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$validator = Validator::make($request->input(),
[
diff --git a/app/Http/Controllers/Api/LocationController.php b/app/Http/Controllers/Api/LocationController.php
index 85e58434..b6fbac57 100644
--- a/app/Http/Controllers/Api/LocationController.php
+++ b/app/Http/Controllers/Api/LocationController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Continent;
use App\HiveFactory;
@@ -34,7 +35,7 @@ public function __construct(HiveFactory $hiveFactory)
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->filled('ids')) {
if (gettype($request->input('ids')) == 'array') {
@@ -130,7 +131,7 @@ public function store(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function show(Request $request, Location $location)
+ public function show(Request $request, Location $location): JsonResponse
{
$location = $request->user()->locations()->with('hives.layers.frames', 'hives.queen')->findOrFail($location->id);
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index e9d6d6e7..8671bfde 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Device;
use App\Measurement;
@@ -361,7 +362,7 @@ private function storeMeasurements($data_array)
Request all currently available sensor measurement types that can be POSTed to
@queryParam locale string Two digit locale to get translated sensor measurement types. Example: en
*/
- public function sensor_measurement_types(Request $request)
+ public function sensor_measurement_types(Request $request): JsonResponse
{
$locale = null;
if ($request->filled('locale')) {
@@ -371,7 +372,7 @@ public function sensor_measurement_types(Request $request)
return Response::json(Measurement::getValidMeasurements(false, false, $locale));
}
- public function sensor_measurement_types_available(Request $request)
+ public function sensor_measurement_types_available(Request $request): JsonResponse
{
$device_id = $request->input('device_id');
$device = $this->get_user_device($request);
@@ -411,7 +412,7 @@ public function sensor_measurement_types_available(Request $request)
@bodyParam id integer ID to look up the Device
@bodyParam hive_id integer Hive ID to look up the Device
*/
- public function lastvalues(Request $request)
+ public function lastvalues(Request $request): JsonResponse
{
$this->cacheRequestRate('get-measurements-last');
@@ -990,7 +991,7 @@ public function storeMeasurementData(Request $request)
"erase_type":"fatfs"
}
*/
- public function flashlog(Request $request)
+ public function flashlog(Request $request): JsonResponse
{
$user = $request->user();
$inp = $request->all();
@@ -1122,7 +1123,7 @@ public function flashlog(Request $request)
return Response::json($result, $parsed ? 200 : 500);
}
- public function decode_beep_lora_payload(Request $request, $port, $payload)
+ public function decode_beep_lora_payload(Request $request, $port, $payload): JsonResponse
{
return Response::json($this->decode_beep_payload($payload, $port));
}
@@ -1368,7 +1369,7 @@ private function compareinterval(Request $request, $relative_interval = false, $
@bodyParam weather integer Load corresponding weather data from the weather database (1) or not (0). Example: 1
@bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
*/
- public function data(Request $request)
+ public function data(Request $request): JsonResponse
{
$this->cacheRequestRate('get-measurements');
@@ -1596,7 +1597,7 @@ public function data(Request $request)
@bodyParam weather integer Load corresponding weather data from the weather database (1) or not (0). Example: 1
@bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
*/
- public function comparedata(Request $request)
+ public function comparedata(Request $request): JsonResponse
{
$this->cacheRequestRate('get-measurements');
diff --git a/app/Http/Controllers/Api/QueenController.php b/app/Http/Controllers/Api/QueenController.php
index 20876cec..ed129610 100644
--- a/app/Http/Controllers/Api/QueenController.php
+++ b/app/Http/Controllers/Api/QueenController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Queen;
use Illuminate\Http\Request;
@@ -19,7 +20,7 @@ class QueenController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
if ($request->user()->queens()->count() > 0) {
return response()->json(['queens' => $request->user()->queens()->get()]);
@@ -33,7 +34,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
$race_id = $request->filled('race_id') ? $request->input('race_id') : Category::findCategoryIdByParentAndName('subspecies', 'other');
$date = $request->filled('birth_date') ? date('Y-m-d', strtotime($request->input('birth_date'))) : null;
@@ -58,7 +59,7 @@ public function store(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function show(Request $request, Queen $queen)
+ public function show(Request $request, Queen $queen): JsonResponse
{
return response()->json($request->user()->queens()->findorFail($queen->id));
}
@@ -78,7 +79,7 @@ public function update(Request $request, Queen $queen)
*
* @return \Illuminate\Http\Response
*/
- public function destroy(Request $request, Queen $queen)
+ public function destroy(Request $request, Queen $queen): JsonResponse
{
$queen = $request->user()->queens()->findorFail($queen->id);
$queen->delete();
diff --git a/app/Http/Controllers/Api/ResearchController.php b/app/Http/Controllers/Api/ResearchController.php
index 82e8d0ca..c9b284c3 100644
--- a/app/Http/Controllers/Api/ResearchController.php
+++ b/app/Http/Controllers/Api/ResearchController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Research;
use DB;
@@ -47,17 +48,17 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function add_consent(Request $request, $id)
+ public function add_consent(Request $request, $id): JsonResponse
{
return response()->json($this->save_consent($request, $id, true), 200);
}
- public function remove_consent(Request $request, $id)
+ public function remove_consent(Request $request, $id): JsonResponse
{
return response()->json($this->save_consent($request, $id, false), 200);
}
- public function edit_consent(Request $request, $id, $consent_id)
+ public function edit_consent(Request $request, $id, $consent_id): JsonResponse
{
$consent = DB::table('research_user')->where('user_id', $request->user()->id)->where('research_id', $id)->find($consent_id);
@@ -71,7 +72,7 @@ public function edit_consent(Request $request, $id, $consent_id)
return response()->json($saved, $saved ? 200 : 500);
}
- public function delete_no_consent(Request $request, $id, $consent_id)
+ public function delete_no_consent(Request $request, $id, $consent_id): JsonResponse
{
$consent = DB::table('research_user')->where('user_id', $request->user()->id)->where('research_id', $id)->find($consent_id);
diff --git a/app/Http/Controllers/Api/ResearchDataController.php b/app/Http/Controllers/Api/ResearchDataController.php
index 9849b581..330d68e0 100644
--- a/app/Http/Controllers/Api/ResearchDataController.php
+++ b/app/Http/Controllers/Api/ResearchDataController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Device;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -162,7 +163,7 @@ private function cacheRequestRate($name)
}
]
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
$auth = $this->checkAuthorization($request);
if ($auth == false) {
@@ -293,7 +294,7 @@ public function index(Request $request)
]
}
*/
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$auth = $this->checkAuthorization($request, $id);
if ($auth == false) {
@@ -483,7 +484,7 @@ public function show(Request $request, $id)
}
]
*/
- public function user_data(Request $request, $id, $user_id, $item)
+ public function user_data(Request $request, $id, $user_id, $item): JsonResponse
{
$auth = $this->checkAuthorization($request, $id);
if ($auth == false) {
@@ -721,7 +722,7 @@ public function user_data(Request $request, $id, $user_id, $item)
@bodyParam timezone string Provide the front-end timezone to correct the time from UTC to front-end time. Example: Europe/Amsterdam
@bodyParam output_csv_links boolean Optionally provide true if you want the data to be returned as an array of CSV files in stead of JSON data.
*/
- public function research_data(Request $request, $id, $item)
+ public function research_data(Request $request, $id, $item): JsonResponse
{
$auth = $this->checkAuthorization($request, $id);
if ($auth == false) {
diff --git a/app/Http/Controllers/Api/SampleCodeController.php b/app/Http/Controllers/Api/SampleCodeController.php
index 3b847310..b67f7d2e 100644
--- a/app/Http/Controllers/Api/SampleCodeController.php
+++ b/app/Http/Controllers/Api/SampleCodeController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\SampleCode;
use Auth;
use Illuminate\Http\Request;
@@ -19,7 +20,7 @@ class SampleCodeController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index()
+ public function index(): JsonResponse
{
$code = Auth::user()->samplecodes()->get();
@@ -35,7 +36,7 @@ public function index()
Create a sample code for lab results
@authenticated
**/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
if ($request->filled('hive_id') && $request->user()->allHives()->find($request->input('hive_id'))) {
try {
@@ -77,7 +78,7 @@ public function update(Request $request, SampleCode $sampleCode)
* @param \App\SampleCode $sampleCode
* @return \Illuminate\Http\Response
*/
- public function destroy(Request $request)
+ public function destroy(Request $request): JsonResponse
{
if ($request->filled('sample_code')) {
$code = $request->user()->samplecodes()->where('sample_code', $request->input('sample_code'))->first();
diff --git a/app/Http/Controllers/Api/SensorDefinitionController.php b/app/Http/Controllers/Api/SensorDefinitionController.php
index d9aaadd0..bc17e083 100644
--- a/app/Http/Controllers/Api/SensorDefinitionController.php
+++ b/app/Http/Controllers/Api/SensorDefinitionController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Measurement;
use App\SensorDefinition;
@@ -114,7 +115,7 @@ private function makeRequestDataArray(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
$device = $this->getDeviceFromRequest($request);
@@ -163,7 +164,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): JsonResponse
{
// Log::debug('sensordefinition_post');
// Log::debug($request->input());
@@ -194,7 +195,7 @@ public function store(Request $request)
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
*/
- public function show(Request $request, $id)
+ public function show(Request $request, $id): JsonResponse
{
$device = $this->getDeviceFromRequest($request);
if ($device) {
@@ -216,7 +217,7 @@ public function show(Request $request, $id)
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
*/
- public function update(Request $request, $id)
+ public function update(Request $request, $id): JsonResponse
{
$device = $this->getDeviceFromRequest($request);
if ($device) {
@@ -260,7 +261,7 @@ public function update(Request $request, $id)
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
*/
- public function destroy(Request $request, $id)
+ public function destroy(Request $request, $id): JsonResponse
{
$device = $this->getDeviceFromRequest($request);
if ($device) {
diff --git a/app/Http/Controllers/Api/SettingController.php b/app/Http/Controllers/Api/SettingController.php
index 75b6daa6..047fd4a4 100644
--- a/app/Http/Controllers/Api/SettingController.php
+++ b/app/Http/Controllers/Api/SettingController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\Category;
use App\Http\Controllers\Controller;
use App\Setting;
@@ -63,7 +64,7 @@ public function store(Request $request)
return Response::json('no named settings to save', 400);
}
- public function index(Request $request)
+ public function index(Request $request): JsonResponse
{
// die(print_r($request->user()->settings()->get()));
return Response::json($request->user()->settings()->groupBy('name', 'number')->get());
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index 4f8f02f1..477577f2 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\Http\JsonResponse;
use App\ChecklistFactory;
use App\User;
use Auth;
@@ -98,12 +99,12 @@ public function login(Request $request)
}
}
- public function notVerified(Request $request)
+ public function notVerified(Request $request): JsonResponse
{
return Response::json('email_not_verified', 400);
}
- public function notAuthenticated(Request $request)
+ public function notAuthenticated(Request $request): JsonResponse
{
return Response::json(['message' => 'invalid_user'], 400);
}
@@ -121,7 +122,7 @@ private function returnToken($request)
@bodyParam password_confirmation string required Password confirmation of the user. Example: testtest
@bodyParam policy_accepted string required Name of the privacy policy that has been accepted by the user by ticking the accept terms box. Example: beep_terms_2018_05_25_avg_v1
*/
- public function register(Request $request)
+ public function register(Request $request): JsonResponse
{
$validator = Validator::make(
@@ -278,7 +279,7 @@ public function reset(Request $request)
Destroy the logged in user and all its data in the database
@authenticated
*/
- public function destroy(Request $request)
+ public function destroy(Request $request): JsonResponse
{
$user = $request->user();
$validator = Validator::make(
@@ -311,7 +312,7 @@ public function destroy(Request $request)
@bodyParam policy_accepted string Name of the privacy policy that has been accepted by the user by ticking the accept terms box. Example: beep_terms_2018_05_25_avg_v1
@bodyParam locale string Locale string to define locale. Example: en
*/
- public function edit(Request $request)
+ public function edit(Request $request): JsonResponse
{
$user = $request->user();
$save = false;
@@ -407,7 +408,7 @@ public function edit(Request $request)
@authenticated
@bodyParam locale string Two digit country string to define locale
*/
- public function userlocale(Request $request)
+ public function userlocale(Request $request): JsonResponse
{
$user = $request->user();
$save = false;
diff --git a/app/Http/Controllers/Api/WeatherController.php b/app/Http/Controllers/Api/WeatherController.php
index 12bc2794..c80f9ea5 100644
--- a/app/Http/Controllers/Api/WeatherController.php
+++ b/app/Http/Controllers/Api/WeatherController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
+use Illuminate\View\View;
use App\Http\Controllers\Controller;
use App\Weather;
use Illuminate\Http\Request;
@@ -18,7 +19,7 @@ class WeatherController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$lat = $request->filled('lat') ? $request->input('lat') : null;
$lon = $request->filled('lon') ? $request->input('lon') : null;
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 87e997ff..5d3ad215 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
@@ -38,7 +39,7 @@ public function __construct()
$this->middleware('guest')->except('logout');
}
- public function logout()
+ public function logout(): RedirectResponse
{
Auth::logout();
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index e72d4467..e1da5d4c 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -46,7 +46,7 @@ public function __construct()
*
* @return \Illuminate\Contracts\Validation\Validator
*/
- protected function validator(array $data)
+ protected function validator(array $data): \Illuminate\Contracts\Validation\Validator
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
@@ -61,7 +61,7 @@ protected function validator(array $data)
*
* @return \App\User
*/
- protected function create(array $data)
+ protected function create(array $data): User
{
return User::create([
'name' => $data['name'],
diff --git a/app/Http/Controllers/CalculationModelController.php b/app/Http/Controllers/CalculationModelController.php
index ba77fc52..56cb66ee 100644
--- a/app/Http/Controllers/CalculationModelController.php
+++ b/app/Http/Controllers/CalculationModelController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\CalculationModel;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class CalculationModelController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 25;
@@ -42,7 +44,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$calculationmodel = new CalculationModel;
@@ -55,7 +57,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -71,14 +73,14 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$calculationmodel = CalculationModel::findOrFail($id);
return view('calculation-model.show', compact('calculationmodel'));
}
- public function run(Request $request, $id)
+ public function run(Request $request, $id): View
{
$calculationmodel = CalculationModel::findOrFail($id);
$model_result = $calculationmodel->run_model($request->user());
@@ -92,7 +94,7 @@ public function run(Request $request, $id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$calculationmodel = CalculationModel::findOrFail($id);
@@ -105,7 +107,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -122,7 +124,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
CalculationModel::destroy($id);
diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.php
index 03a8d219..435c2936 100755
--- a/app/Http/Controllers/CategoriesController.php
+++ b/app/Http/Controllers/CategoriesController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Category;
use App\CategoryFactory;
use App\CategoryInput;
@@ -27,7 +29,7 @@ public function __construct(CategoryFactory $categoryFactory)
$this->categoryFactory = $categoryFactory;
}
- public function index()
+ public function index(): View
{
// $tax = $this->categoryFactory->parse_taxonomy();
// die(print_r($tax));
@@ -43,7 +45,7 @@ public function index()
*
* @return Response
*/
- public function create(Request $input)
+ public function create(Request $input): View
{
$data = $input->only('parent_id');
$tree = Category::all()->toTree();
@@ -59,7 +61,7 @@ public function create(Request $input)
*
* @return Response
*/
- public function store(PostCategoryRequest $input)
+ public function store(PostCategoryRequest $input): RedirectResponse
{
$category = null;
@@ -261,7 +263,7 @@ private function parseLinesToArray($list, $indentation = "\t")
* @param int $id
* @return Response
*/
- public function show($id)
+ public function show(int $id): View
{
$cats = Category::all();
$count = $cats->count();
@@ -278,7 +280,7 @@ public function show($id)
* @param int $id
* @return Response
*/
- public function edit($id)
+ public function edit(int $id): View
{
$cats = Category::all();
$count = $cats->count();
@@ -296,7 +298,7 @@ public function edit($id)
* @param int $id
* @return Response
*/
- public function update(PostCategoryRequest $input, $id)
+ public function update(PostCategoryRequest $input, int $id): RedirectResponse
{
$category = Category::findOrFail($id);
@@ -370,7 +372,7 @@ public function update(PostCategoryRequest $input, $id)
return redirect()->route('categories.show', [$id])->with('error', 'Category name is required!');
}
- public function duplicate($id)
+ public function duplicate($id): RedirectResponse
{
$category = Category::findOrFail($id);
@@ -397,7 +399,7 @@ function ($c) use ($copy_cat) {
return redirect()->route('categories.index')->with('success', 'Category duplicated');
}
- public function fix($id)
+ public function fix($id): RedirectResponse
{
$inputTypeListId = CategoryInput::where('type', 'list')->value('id');
$inputTypeLisItemtId = CategoryInput::where('type', 'list_item')->value('id');
@@ -515,7 +517,7 @@ public function pop($id)
return $this->destroy($id);
}
- public function destroy($id)
+ public function destroy($id): RedirectResponse
{
$category = Category::findOrFail($id);
@@ -538,7 +540,7 @@ public function destroy($id)
/**
* @return static
*/
- protected function makeOptions(Collection $items)
+ protected function makeOptions(Collection $items): static
{
$options = ['' => 'Root'];
@@ -553,7 +555,7 @@ protected function makeOptions(Collection $items)
* @param Category $except
* @return CategoriesController
*/
- protected function getCategoryOptions($except = null)
+ protected function getCategoryOptions(Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
$query = Category::select('id', 'name')->withDepth();
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index fa99bdfb..5fbdf33d 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\CategoryInput;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
@@ -13,7 +15,7 @@ class CategoryInputsController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 1000;
@@ -32,7 +34,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$categoryinput = new CategoryInput;
@@ -45,7 +47,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request,
[
@@ -69,7 +71,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$categoryinput = CategoryInput::findOrFail($id);
@@ -82,7 +84,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$categoryinput = CategoryInput::findOrFail($id);
@@ -95,7 +97,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request,
[
@@ -120,7 +122,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
CategoryInput::destroy($id);
diff --git a/app/Http/Controllers/ChecklistController.php b/app/Http/Controllers/ChecklistController.php
index b1ac81ec..6662a665 100644
--- a/app/Http/Controllers/ChecklistController.php
+++ b/app/Http/Controllers/ChecklistController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Category;
use App\CategoryFactory;
use App\Checklist;
@@ -23,7 +25,7 @@ public function __construct(CategoryFactory $categoryFactory)
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
if (Auth::user()->hasRole('superadmin')) {
@@ -40,7 +42,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$taxonomy = Category::getTaxonomy();
$selected = $this->categoryFactory->get_old_ids_array();
@@ -57,7 +59,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->except(['user_id']);
@@ -79,7 +81,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$checklist = $this->getUserChecklists()->find($id);
$items = $checklist->categories()->get()->toTree();
@@ -94,7 +96,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$locale = LaravelLocalization::getCurrentLocale();
$checklist = $this->getUserChecklists()->find($id);
@@ -121,7 +123,7 @@ private function addChecklistToUsers(Request $request, $checklist)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->except(['user_id']);
@@ -145,14 +147,14 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
$this->getUserChecklists()->find($id)->delete();
return redirect('checklists')->with('flash_message', 'Checklist deleted!');
}
- public function destroyCopies()
+ public function destroyCopies(): RedirectResponse
{
Checklist::where('type', 'like', '%_copy%')->forceDelete();
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index 55c6f035..c48857b4 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\ChecklistSvg;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class ChecklistSvgController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 25;
@@ -37,7 +39,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$checklistsvg = new ChecklistSvg;
@@ -50,7 +52,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'user_id' => 'required',
@@ -69,7 +71,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$checklistsvg = ChecklistSvg::findOrFail($id);
@@ -82,7 +84,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$checklistsvg = ChecklistSvg::findOrFail($id);
@@ -95,7 +97,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'user_id' => 'required',
@@ -115,7 +117,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
ChecklistSvg::destroy($id);
diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php
index b5b47e33..6a84c4fb 100644
--- a/app/Http/Controllers/DashboardController.php
+++ b/app/Http/Controllers/DashboardController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
use App\Category;
use App\Checklist;
use App\Device;
@@ -56,7 +57,7 @@ private function cacheRequestGetArray($name)
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$moment = new Moment;
$last_hour = $moment->subtractHours(1)->format('Y-m-d H:i:s');
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index 4c689aff..f4e3b33a 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\DashboardGroup;
use Auth;
use Cache;
@@ -16,7 +18,7 @@ class DashboardGroupController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 100;
@@ -46,7 +48,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$dashboardgroup = new DashboardGroup;
$dashboardgroup->user_id = Auth::user()->id;
@@ -62,7 +64,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'code' => 'required|string|min:6',
@@ -89,7 +91,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$dashboardgroup = DashboardGroup::findOrFail($id);
@@ -102,7 +104,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$dashboardgroup = DashboardGroup::findOrFail($id);
$hive_ids = Auth::user()->hives()->pluck('name', 'id')->toArray();
@@ -116,7 +118,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'code' => 'required|string|min:6',
@@ -152,7 +154,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
DashboardGroup::destroy($id);
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index 97a63339..3d8c60e1 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Device;
use App\Hive;
@@ -21,7 +23,7 @@ class DeviceController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$search_user = $request->get('user');
@@ -88,7 +90,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function data(Request $request)
+ public function data(Request $request): View
{
$keyword = $request->get('search');
$search_user = $request->get('user');
@@ -210,7 +212,7 @@ public function data(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function create()
+ public function create(): View
{
$types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name', 'id');
$users = User::all()->sortBy('name')->pluck('name', 'id');
@@ -223,7 +225,7 @@ public function create()
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'name' => 'required',
@@ -263,7 +265,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function show($id)
+ public function show(int $id): View
{
$item = Device::find($id);
@@ -400,7 +402,7 @@ public function flashlog(Request $request, $id, $fl_id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function edit($id)
+ public function edit(int $id): View
{
$item = Device::find($id);
$types = Category::descendentsByRootParentAndName('hive', 'app', 'sensor')->pluck('name', 'id');
@@ -423,7 +425,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'name' => 'required',
@@ -461,7 +463,7 @@ public function update(Request $request, $id)
}
// /devices/{id}/undelete
- public function undelete($id)
+ public function undelete($id): RedirectResponse
{
Device::withTrashed()->findOrFail($id)->restore();
@@ -475,7 +477,7 @@ public function undelete($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Device::find($id)->delete();
diff --git a/app/Http/Controllers/FlashLogController.php b/app/Http/Controllers/FlashLogController.php
index e401235a..e4c0f433 100644
--- a/app/Http/Controllers/FlashLogController.php
+++ b/app/Http/Controllers/FlashLogController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Models\CalculationModel;
use App\Models\FlashLog;
@@ -18,7 +20,7 @@ class FlashLogController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$bytes = $request->filled('mb') ? intval($request->get('mb') * 1024 * 1024) : null;
$log_parsed = $request->filled('log_parsed') ? boolval($request->get('log_parsed')) : null;
@@ -86,7 +88,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$flashlog = new FlashLog;
@@ -99,7 +101,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -115,7 +117,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show(Request $request, $id)
+ public function show(Request $request, int $id): View
{
$flashlog = FlashLog::findOrFail($id);
@@ -192,7 +194,7 @@ public function show(Request $request, $id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function parse(Request $request, $id)
+ public function parse(Request $request, int $id): RedirectResponse
{
$fill_time = $request->filled('no_fill') && $request->input('no_fill') == 1 ? false : true;
$fill_sdef = $request->filled('no_sensor_def') && $request->input('no_sensor_def') == 1 ? false : true;
@@ -276,7 +278,7 @@ public function parse(Request $request, $id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$flashlog = FlashLog::findOrFail($id);
@@ -289,7 +291,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id)
{
$request->validate([
'created_at' => 'required|date',
@@ -332,7 +334,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
FlashLog::destroy($id);
diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php
index 34233f1b..32ab9a2f 100644
--- a/app/Http/Controllers/GroupController.php
+++ b/app/Http/Controllers/GroupController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Group;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class GroupController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$groups = Group::orderBy('id', 'DESC')->paginate(10);
@@ -25,7 +27,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function create()
+ public function create(): View
{
return view('groups.create');
}
@@ -35,7 +37,7 @@ public function create()
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'name' => 'required',
@@ -54,7 +56,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function show($id)
+ public function show(int $id): View
{
$item = Group::find($id);
@@ -67,7 +69,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function edit($id)
+ public function edit(int $id): View
{
$item = Group::find($id);
@@ -80,7 +82,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'name' => 'required',
@@ -99,7 +101,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Group::find($id)->delete();
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index 65581816..96e13aef 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Models\HiveTag;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class HiveTagsController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 25;
@@ -37,7 +39,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$hivetag = new HiveTag;
@@ -50,7 +52,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'tag' => 'required',
@@ -69,7 +71,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$hivetag = HiveTag::findOrFail($id);
@@ -82,7 +84,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$hivetag = HiveTag::findOrFail($id);
@@ -95,7 +97,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'tag' => 'required',
@@ -115,7 +117,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
HiveTag::destroy($id);
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 6c50be36..1b18a58c 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+
class HomeController extends Controller
{
/**
@@ -19,7 +21,7 @@ public function __construct()
*
* @return \Illuminate\Contracts\Support\Renderable
*/
- public function index()
+ public function index(): View
{
return view('home');
}
diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php
index 9643ad88..99983190 100644
--- a/app/Http/Controllers/ImageController.php
+++ b/app/Http/Controllers/ImageController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Image;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class ImageController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 25;
@@ -38,7 +40,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('image.create');
}
@@ -49,7 +51,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -65,7 +67,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$image = Image::findOrFail($id);
@@ -78,7 +80,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$image = Image::findOrFail($id);
@@ -91,7 +93,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -108,7 +110,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Image::findOrFail($id)->delete();
diff --git a/app/Http/Controllers/InspectionItemsController.php b/app/Http/Controllers/InspectionItemsController.php
index c169154f..f9b9f789 100644
--- a/app/Http/Controllers/InspectionItemsController.php
+++ b/app/Http/Controllers/InspectionItemsController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\InspectionItem;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class InspectionItemsController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 100;
@@ -34,7 +36,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('inspection-items.create');
}
@@ -45,7 +47,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -61,7 +63,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$inspectionitem = InspectionItem::findOrFail($id);
@@ -74,7 +76,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$inspectionitem = InspectionItem::findOrFail($id);
@@ -87,7 +89,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -104,7 +106,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
InspectionItem::destroy($id);
diff --git a/app/Http/Controllers/InspectionsController.php b/app/Http/Controllers/InspectionsController.php
index e344ebeb..eaee6ec9 100644
--- a/app/Http/Controllers/InspectionsController.php
+++ b/app/Http/Controllers/InspectionsController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Inspection;
use Auth;
use Illuminate\Http\Request;
@@ -13,7 +15,7 @@ class InspectionsController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
// if (Auth::user()->hasRole('superadmin'))
// $inspections = Inspection::all();
@@ -28,7 +30,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('inspections.create');
}
@@ -39,7 +41,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -55,7 +57,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
if (Auth::user()->hasRole(['admin', 'superadmin'])) {
$inspection = Inspection::find($id);
@@ -79,7 +81,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$inspection = $this->getUserInspections()->find($id);
@@ -92,7 +94,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -109,7 +111,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
$this->getUserInspections()->find($id)->delete();
diff --git a/app/Http/Controllers/LanguageController.php b/app/Http/Controllers/LanguageController.php
index f7428478..f6837db1 100644
--- a/app/Http/Controllers/LanguageController.php
+++ b/app/Http/Controllers/LanguageController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Language;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class LanguageController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 1000;
@@ -31,7 +33,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('languages.create');
}
@@ -42,7 +44,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -58,7 +60,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$language = Language::findOrFail($id);
@@ -71,7 +73,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$language = Language::findOrFail($id);
@@ -84,7 +86,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -101,7 +103,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Language::destroy($id);
diff --git a/app/Http/Controllers/MeasurementController.php b/app/Http/Controllers/MeasurementController.php
index f3655946..d1d585f9 100644
--- a/app/Http/Controllers/MeasurementController.php
+++ b/app/Http/Controllers/MeasurementController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Measurement;
use Cache;
use Illuminate\Http\Request;
@@ -13,7 +15,7 @@ class MeasurementController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
@@ -31,7 +33,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('measurement.create');
}
@@ -42,7 +44,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -60,7 +62,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$measurement = Measurement::findOrFail($id);
@@ -73,7 +75,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$measurement = Measurement::findOrFail($id);
@@ -86,7 +88,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -107,7 +109,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Measurement::destroy($id);
diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php
index ac13483c..b0a9ced7 100644
--- a/app/Http/Controllers/PermissionController.php
+++ b/app/Http/Controllers/PermissionController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Permission;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class PermissionController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 1000;
@@ -31,7 +33,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('permissions.create');
}
@@ -42,7 +44,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -58,7 +60,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$permission = Permission::findOrFail($id);
@@ -71,7 +73,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$permission = Permission::findOrFail($id);
@@ -84,7 +86,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -101,7 +103,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
Permission::destroy($id);
diff --git a/app/Http/Controllers/PhysicalQuantityController.php b/app/Http/Controllers/PhysicalQuantityController.php
index a1177a40..0e733319 100644
--- a/app/Http/Controllers/PhysicalQuantityController.php
+++ b/app/Http/Controllers/PhysicalQuantityController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\PhysicalQuantity;
use Illuminate\Http\Request;
@@ -12,7 +14,7 @@ class PhysicalQuantityController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$keyword = $request->get('search');
$perPage = 1000;
@@ -31,7 +33,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
return view('physicalquantity.create');
}
@@ -42,7 +44,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$requestData = $request->all();
@@ -58,7 +60,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$physicalquantity = PhysicalQuantity::findOrFail($id);
@@ -71,7 +73,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$physicalquantity = PhysicalQuantity::findOrFail($id);
@@ -84,7 +86,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$requestData = $request->all();
@@ -101,7 +103,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
PhysicalQuantity::destroy($id);
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index 6a6f493a..c73d66a9 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Hive;
use App\Inspection;
@@ -66,7 +68,7 @@ private function checkAuthorization(Request $request)
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$this->checkAuthorization($request);
@@ -79,7 +81,7 @@ public function index(Request $request)
return view('research.index', compact('research'));
}
- public function consent($id, Request $request)
+ public function consent($id, Request $request): View
{
$this->checkAuthorization($request);
@@ -152,7 +154,7 @@ public function consent_edit($id, $c_id, Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
if (Auth::user()->hasRole('superadmin') == false) {
return redirect('dashboard')->with('error', 'Unauthorized');
@@ -169,7 +171,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->checkAuthorization($request);
@@ -224,7 +226,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id, Request $request)
+ public function show(int $id, Request $request): View
{
$this->checkAuthorization($request);
@@ -988,7 +990,7 @@ public function show($id, Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function data($id, Request $request)
+ public function data(int $id, Request $request): View
{
$this->checkAuthorization($request);
@@ -1722,7 +1724,7 @@ private function addDbDataToDataArray(&$data_array, $device, $from_date, $until_
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
if (Auth::user()->hasRole('superadmin')) {
$research = Research::findOrFail($id);
@@ -1739,7 +1741,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->checkAuthorization($request);
@@ -1800,7 +1802,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
if (Auth::user()->hasRole('superadmin')) {
Research::destroy($id);
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index 4042aeb8..c29040cb 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Permission;
use App\Role;
use DB;
@@ -14,7 +16,7 @@ class RoleController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$roles = Role::orderBy('id', 'DESC')->paginate(10);
@@ -27,7 +29,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function create()
+ public function create(): View
{
$permission = Permission::get();
@@ -39,7 +41,7 @@ public function create()
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'name' => 'required|unique:roles,name',
@@ -68,7 +70,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function show($id)
+ public function show(int $id): View
{
$role = Role::find($id);
$rolePermissions = Permission::join('permission_role', 'permission_role.permission_id', '=', 'permissions.id')
@@ -84,7 +86,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function edit($id)
+ public function edit(int $id): View
{
$role = Role::find($id);
$permission = Permission::get();
@@ -102,7 +104,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'display_name' => 'required',
@@ -132,7 +134,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
DB::table('roles')->where('id', $id)->delete();
diff --git a/app/Http/Controllers/SampleCodeController.php b/app/Http/Controllers/SampleCodeController.php
index f3499bec..f0f5be50 100644
--- a/app/Http/Controllers/SampleCodeController.php
+++ b/app/Http/Controllers/SampleCodeController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Inspection;
use App\InspectionItem;
@@ -22,13 +24,13 @@
class SampleCodeController extends Controller
{
// Open routes
- public function code()
+ public function code(): View
{
return view('sample-code.code');
}
// Get excel template to fill out
- public function upload()
+ public function upload(): View
{
$template_url = $this->createExcelTemplate();
$data = Session::get('data');
@@ -38,7 +40,7 @@ public function upload()
}
// Upload filled excel template to input
- public function upload_store(Request $request)
+ public function upload_store(Request $request): RedirectResponse
{
$msg = 'No file found';
$res = 'error';
@@ -602,7 +604,7 @@ public function check(Request $request)
return redirect('code')->with('error', 'Sample code not found');
}
- public function resultsave(Request $request)
+ public function resultsave(Request $request): RedirectResponse
{
$samplecode = SampleCode::where('sample_code', $request->input('samplecode'))->first();
@@ -637,7 +639,7 @@ public function resultsave(Request $request)
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$samplecode = SampleCode::all();
@@ -649,7 +651,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$samplecode = new SampleCode;
$samplecode->sample_code = SampleCode::generate_code();
@@ -666,7 +668,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'sample_code' => 'required',
@@ -685,7 +687,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$samplecode = SampleCode::findOrFail($id);
@@ -698,7 +700,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$samplecode = SampleCode::findOrFail($id);
@@ -711,7 +713,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'sample_code' => 'required',
@@ -731,7 +733,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
SampleCode::destroy($id);
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index e5681731..88c74c7e 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Measurement;
use App\SensorDefinition;
@@ -15,7 +17,7 @@ class SensorDefinitionController extends Controller
*
* @return \Illuminate\View\View
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$page = $request->get('page');
$keyword = $request->get('search');
@@ -82,7 +84,7 @@ public function index(Request $request)
*
* @return \Illuminate\View\View
*/
- public function create()
+ public function create(): View
{
$devices_select = Device::selectList();
$measurement_select = Measurement::selectList();
@@ -96,7 +98,7 @@ public function create()
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
$this->validate($request, [
'device_id' => 'required|integer|exists:sensors,id',
@@ -118,7 +120,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\View\View
*/
- public function show($id)
+ public function show(int $id): View
{
$sensordefinition = SensorDefinition::findOrFail($id);
@@ -131,7 +133,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\View\View
*/
- public function edit($id)
+ public function edit(int $id): View
{
$sensordefinition = SensorDefinition::findOrFail($id);
$devices_select = Device::selectList();
@@ -146,7 +148,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
$this->validate($request, [
'device_id' => 'required|integer|exists:sensors,id',
@@ -170,7 +172,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
SensorDefinition::destroy($id);
diff --git a/app/Http/Controllers/TaxonomyController.php b/app/Http/Controllers/TaxonomyController.php
index 7c571d37..3bd25f0f 100644
--- a/app/Http/Controllers/TaxonomyController.php
+++ b/app/Http/Controllers/TaxonomyController.php
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
use App\Category;
use LaravelLocalization;
@@ -25,7 +26,7 @@ private function removeKeys($array)
}, ARRAY_FILTER_USE_BOTH);
}
- public function display()
+ public function display(): View
{
$fixed = Category::fixTree(); // kalnoy/nestedset: to fix the tree to fill _lft and _rgt columns
diff --git a/app/Http/Controllers/TranslationController.php b/app/Http/Controllers/TranslationController.php
index c69dd456..6def20e9 100644
--- a/app/Http/Controllers/TranslationController.php
+++ b/app/Http/Controllers/TranslationController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Language;
use App\Measurement;
@@ -13,12 +15,12 @@
class TranslationController extends Controller
{
- public function index()
+ public function index(): View
{
return view('translations.index');
}
- public function edit(Language $language, Request $request)
+ public function edit(Language $language, Request $request): View
{
$output_csv = boolval($request->input('csv', 0));
@@ -30,7 +32,7 @@ public function edit(Language $language, Request $request)
return view('translations.edit', compact('measurements', 'language', 'physical_quantities', 'alert_rules', 'output_csv', 'categories'));
}
- public function update(Language $language, Request $request)
+ public function update(Language $language, Request $request): RedirectResponse
{
$translation_measurement = $request->input('translation_measurement');
$translation_category = $request->input('translation_category');
@@ -107,7 +109,7 @@ public function update(Language $language, Request $request)
/**
* @return static
*/
- protected function makeOptions(Collection $items)
+ protected function makeOptions(Collection $items): static
{
$options = [];
@@ -122,7 +124,7 @@ protected function makeOptions(Collection $items)
* @param Category $except
* @return CategoriesController
*/
- protected function getCategoryOptions($except = null)
+ protected function getCategoryOptions(Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
$query = Category::select('id', 'name')->withDepth();
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index d915b661..e3b9df79 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
+use Illuminate\View\View;
+use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Role;
use App\User;
@@ -20,7 +22,7 @@ class UserController extends Controller
*
* @return \Illuminate\Http\Response
*/
- public function index(Request $request)
+ public function index(Request $request): View
{
$page = $request->input('page');
$show_stats = $request->filled('stats');
@@ -51,7 +53,7 @@ public function index(Request $request)
*
* @return \Illuminate\Http\Response
*/
- public function create()
+ public function create(): View
{
$roles = $this->getMyPermittedRoles(Auth::user());
$sensors = Device::all()->pluck('name', 'id');
@@ -64,7 +66,7 @@ public function create()
*
* @return \Illuminate\Http\Response
*/
- public function store(Request $request)
+ public function store(Request $request): RedirectResponse
{
if ($this->checkRoleAuthorization($request, 'user-create') == false) {
return redirect()->route('users.index')->with('error', 'You are not allowed to create this type of user');
@@ -126,7 +128,7 @@ public function store(Request $request)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function show($id)
+ public function show(int $id): View
{
$user = User::find($id);
$sensors = []; // DB::table('sensors')->join('sensor_user', 'sensors.id', '=', 'sensor_user.sensor_id')->where('user_id',$id)->orderBy('name','asc')->pluck('name','id');
@@ -140,7 +142,7 @@ public function show($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function edit($id)
+ public function edit(int $id): View
{
$user = User::find($id);
$roles = $this->getMyPermittedRoles($user);
@@ -157,7 +159,7 @@ public function edit($id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function update(Request $request, $id)
+ public function update(Request $request, int $id): RedirectResponse
{
if ($this->checkRoleAuthorization($request, 'user-edit', $id) == false) {
return redirect()->route('users.index')->with('error', 'You are not allowed to edit this user');
@@ -228,7 +230,7 @@ public function update(Request $request, $id)
* @param int $id
* @return \Illuminate\Http\Response
*/
- public function destroy($id)
+ public function destroy(int $id): RedirectResponse
{
if ($this->checkRoleAuthorization(null, 'user-delete', $id) == false) {
return redirect()->route('users.index')->with('error', 'User not deleted, you have no permission');
diff --git a/app/Http/Resources/InspectionCollection.php b/app/Http/Resources/InspectionCollection.php
index 04b9ec17..ebc4999b 100644
--- a/app/Http/Resources/InspectionCollection.php
+++ b/app/Http/Resources/InspectionCollection.php
@@ -2,6 +2,7 @@
namespace App\Http\Resources;
+use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\ResourceCollection;
class InspectionCollection extends ResourceCollection
@@ -12,7 +13,7 @@ class InspectionCollection extends ResourceCollection
* @param \Illuminate\Http\Request $request
* @return array
*/
- public function toArray($request): array
+ public function toArray(Request $request): array
{
return parent::toArray($request);
}
diff --git a/app/Mail/AlertMail.php b/app/Mail/AlertMail.php
index c3411541..c9c121b9 100644
--- a/app/Mail/AlertMail.php
+++ b/app/Mail/AlertMail.php
@@ -29,7 +29,7 @@ public function __construct(Alert $alert, $name, $last_values_string, $display_d
*
* @return $this
*/
- public function build()
+ public function build(): static
{
$subject = __('alert.subject').($this->alert->alert_rule_name !== null ? ' - '.$this->alert->alert_rule_name : '').($this->alert->hive_name !== null ? ' - '.__('beep.Hive').': '.$this->alert->hive_name : '');
diff --git a/app/Mail/DataExport.php b/app/Mail/DataExport.php
index 25e7da9f..365c45a0 100644
--- a/app/Mail/DataExport.php
+++ b/app/Mail/DataExport.php
@@ -27,7 +27,7 @@ public function __construct($user, $attachment_disk, $attachment_path)
*
* @return $this
*/
- public function build()
+ public function build(): static
{
return $this->markdown('emails.export', ['name' => $this->user->name])->attachFromStorageDisk($this->attachment_disk, $this->attachment_path);
}
diff --git a/app/Mail/GroupAcceptation.php b/app/Mail/GroupAcceptation.php
index ca34f85d..ccd293b3 100644
--- a/app/Mail/GroupAcceptation.php
+++ b/app/Mail/GroupAcceptation.php
@@ -27,7 +27,7 @@ public function __construct($name, $group, $user)
*
* @return $this
*/
- public function build()
+ public function build(): static
{
return $this->markdown(
'emails.group_acceptation',
diff --git a/app/Mail/GroupInvitation.php b/app/Mail/GroupInvitation.php
index 91793b0b..eb720fb7 100644
--- a/app/Mail/GroupInvitation.php
+++ b/app/Mail/GroupInvitation.php
@@ -31,7 +31,7 @@ public function __construct(Group $group, $name, $admin, $token, $invited_by)
*
* @return $this
*/
- public function build()
+ public function build(): static
{
return $this->markdown(
'emails.group_invitation',
diff --git a/app/Mail/GroupRefusal.php b/app/Mail/GroupRefusal.php
index 6ece6292..94c25a83 100644
--- a/app/Mail/GroupRefusal.php
+++ b/app/Mail/GroupRefusal.php
@@ -27,7 +27,7 @@ public function __construct($name, $group, $user)
*
* @return $this
*/
- public function build()
+ public function build(): static
{
return $this->markdown(
'emails.group_refusal',
diff --git a/app/Mail/SampleCodeMail.php b/app/Mail/SampleCodeMail.php
index 93986b13..2073f909 100644
--- a/app/Mail/SampleCodeMail.php
+++ b/app/Mail/SampleCodeMail.php
@@ -28,7 +28,7 @@ public function __construct($name, $code, $hive, $link)
*
* @return $this
*/
- public function build()
+ public function build(): static
{
$subject = __('samplecode.subject').' ('.$this->code.')'.($this->hive !== null ? ' - '.__('samplecode.Hive', ['hive' => $this->hive]) : '');
diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php
index e287ea52..17d46de5 100644
--- a/app/Notifications/ResetPassword.php
+++ b/app/Notifications/ResetPassword.php
@@ -2,6 +2,7 @@
namespace App\Notifications;
+use Closure;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification as NotificationBase;
use Illuminate\Support\Facades\Lang;
@@ -28,7 +29,7 @@ class ResetPassword extends NotificationBase
* @param string $token
* @return void
*/
- public function __construct($token)
+ public function __construct(string $token)
{
$this->token = $token;
}
@@ -72,7 +73,7 @@ public function toMail($notifiable): MailMessage
* @param \Closure $callback
* @return void
*/
- public static function toMailUsing($callback)
+ public static function toMailUsing(Closure $callback): void
{
static::$toMailCallback = $callback;
}
diff --git a/app/Notifications/VerifyEmail.php b/app/Notifications/VerifyEmail.php
index d4ab4bd2..3b9d3d85 100644
--- a/app/Notifications/VerifyEmail.php
+++ b/app/Notifications/VerifyEmail.php
@@ -15,7 +15,7 @@ class VerifyEmail extends VerifyEmailBase
* @param mixed $notifiable
* @return string
*/
- protected function verificationUrl($notifiable)
+ protected function verificationUrl($notifiable): string
{
$temporarySignedURL = URL::temporarySignedRoute(
'apiverification.verify',
From 52fee5fe63248558c6b37893293d83b5dfe161d2 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:24:47 +0000
Subject: [PATCH 072/127] Remove redundant typing from DocBlocks
---
app/Console/Kernel.php | 4 ----
app/Http/Controllers/AlertController.php | 12 -----------
app/Http/Controllers/AlertRuleController.php | 12 -----------
.../AlertRuleFormulaController.php | 12 -----------
app/Http/Controllers/Api/AlertController.php | 8 -------
.../Controllers/Api/AlertRuleController.php | 8 -------
.../Api/Auth/VerificationController.php | 2 --
.../Controllers/Api/CategoryController.php | 2 --
.../Controllers/Api/ChecklistController.php | 2 --
app/Http/Controllers/Api/GroupController.php | 2 --
app/Http/Controllers/Api/HiveController.php | 11 ----------
.../Controllers/Api/HiveTagsController.php | 2 --
app/Http/Controllers/Api/ImageController.php | 10 ---------
.../Controllers/Api/LocationController.php | 5 -----
app/Http/Controllers/Api/QueenController.php | 8 -------
.../Controllers/Api/ResearchController.php | 2 --
.../Controllers/Api/SampleCodeController.php | 3 ---
.../Api/SensorDefinitionController.php | 4 ----
.../Controllers/Api/WeatherController.php | 2 --
.../Controllers/Auth/RegisterController.php | 4 ----
.../CalculationModelController.php | 12 -----------
app/Http/Controllers/CategoriesController.php | 21 -------------------
.../Controllers/CategoryInputsController.php | 12 -----------
app/Http/Controllers/ChecklistController.php | 12 -----------
.../Controllers/ChecklistSvgController.php | 12 -----------
app/Http/Controllers/DashboardController.php | 2 --
.../Controllers/DashboardGroupController.php | 12 -----------
app/Http/Controllers/DeviceController.php | 20 ------------------
app/Http/Controllers/FlashLogController.php | 15 -------------
app/Http/Controllers/GroupController.php | 18 ----------------
app/Http/Controllers/HiveTagsController.php | 12 -----------
app/Http/Controllers/HomeController.php | 2 --
app/Http/Controllers/ImageController.php | 12 -----------
.../Controllers/InspectionItemsController.php | 12 -----------
.../Controllers/InspectionsController.php | 12 -----------
app/Http/Controllers/LanguageController.php | 12 -----------
.../Controllers/MeasurementController.php | 12 -----------
app/Http/Controllers/PermissionController.php | 12 -----------
.../PhysicalQuantityController.php | 12 -----------
app/Http/Controllers/ResearchController.php | 15 -------------
app/Http/Controllers/RoleController.php | 18 ----------------
app/Http/Controllers/SampleCodeController.php | 12 -----------
.../SensorDefinitionController.php | 12 -----------
.../Controllers/TranslationController.php | 7 -------
app/Http/Controllers/UserController.php | 18 ----------------
.../EnsureWebappEmailIsVerified.php | 3 ---
.../Middleware/RedirectIfAuthenticated.php | 2 +-
app/Http/Requests/PostCategoryRequest.php | 4 ----
app/Http/Requests/PostHiveRequest.php | 4 ----
app/Http/Requests/PostLocationRequest.php | 4 ----
app/Http/Requests/PostSensorRequest.php | 4 ----
app/Http/Resources/InspectionCollection.php | 3 ---
app/Listeners/LogSuccessfulLogin.php | 2 --
app/Notifications/ResetPassword.php | 5 -----
app/Notifications/VerifyEmail.php | 1 -
app/Providers/AppServiceProvider.php | 4 ----
app/Providers/AuthServiceProvider.php | 2 --
app/Providers/EventServiceProvider.php | 4 ----
database/factories/HiveFactory.php | 2 --
database/factories/HiveLayerFactory.php | 2 --
database/factories/HiveLayerFrameFactory.php | 2 --
database/factories/LocationFactory.php | 2 --
database/factories/UserFactory.php | 2 --
.../2014_10_12_000000_create_users_table.php | 4 ----
...12_100000_create_password_resets_table.php | 4 ----
...016_04_10_115211_create-category-table.php | 4 ----
...016_04_14_174603_create-location-table.php | 4 ----
.../2016_12_20_121758_create_settings.php | 4 ----
.../2016_12_20_121819_create-hive-table.php | 4 ----
.../2016_12_21_174159_create-sensor-table.php | 4 ----
.../2017_03_21_114148_create_groups_table.php | 4 ----
...2017_03_21_114828_entrust_setup_tables.php | 4 ----
.../2017_04_14_175011_create-queen-table.php | 4 ----
...7_04_14_175022_create-production-table.php | 4 ----
...2017_07_17_095406_add_users_last_login.php | 4 ----
...105927_add_category_nested_set_columns.php | 4 ----
...018_01_31_174432_create_category_input.php | 4 ----
.../2018_02_20_161831_add_category_old_id.php | 4 ----
...8_03_12_223732_create-checklists-table.php | 4 ----
..._04_03_110731_create_inspections_table.php | 4 ----
...3_112937_create_inspection_items_table.php | 4 ----
...03_115056_add_checklist_category_order.php | 4 ----
...2018_04_24_124855_AddCategoryTypeIndex.php | 4 ----
...9_add_location_hive_delete_foreign_key.php | 4 ----
...018_05_18_091519_add_user_policy_check.php | 4 ----
.../2018_06_03_110444_AddLanguageTwoChar.php | 4 ----
...121927_convert_inspections_to_taxonomy.php | 2 --
...9_152505_add_email_token_to_user_table.php | 4 ----
...019_01_08_101831_add_category_required.php | 4 ----
.../2019_01_14_114237_add_group_extras.php | 4 ----
.../2019_01_14_114804_create_group_hive.php | 4 ----
...2019_01_14_143937_add_group_user_admin.php | 4 ----
...01_28_104628_create_measurements_table.php | 4 ----
.../2019_01_28_223610_add_min_max_values.php | 4 ----
.../2019_01_28_223654_add_high_low_values.php | 4 ----
.../2019_11_21_153657_add_location_roofed.php | 4 ----
...9_11_21_204213_create_researches_table.php | 4 ----
.../2019_12_27_172844_create_images_table.php | 4 ----
..._05_153657_add_inspection_checklist_id.php | 4 ----
...180741_change_sensors_hive_id_nullable.php | 4 ----
...20_01_11_134447_add_dimensions_to_hive.php | 4 ----
..._01_11_135656_add_description_to_queen.php | 4 ----
.../2020_01_11_140516_add_order_to_hive.php | 4 ----
...173757_create_sensor_definitions_table.php | 4 ----
...03_add_last_active_and_hw_id_to_sensor.php | 4 ----
...2020_01_15_110902_add_storage_to_image.php | 4 ----
...0918_change_url_field_length_for_image.php | 4 ----
...0_01_15_121511_add_image_to_inspection.php | 4 ----
...dd_last_weather_time_stamp_to_location.php | 4 ----
...9_152103_add_battery_voltage_to_device.php | 4 ----
..._152416_add_downlink_message_to_device.php | 4 ----
.../2020_06_08_094741_add_locale_to_user.php | 4 ----
...06_25_154728_create_sample_codes_table.php | 4 ----
...08_04_114944_add_hex_color_to_location.php | 4 ----
..._142238_add_research_owner_and_viewers.php | 2 --
.../2021_02_09_170632_create_alerts_table.php | 4 ----
..._02_09_170935_create_alert_rules_table.php | 4 ----
...44_add_exclude_hive_ids_to_alert_rules.php | 4 ----
...164840_add_alert_rules_last_calculated.php | 4 ----
...1_02_24_095050_create_flash_logs_table.php | 4 ----
...2021_03_26_124313_add_flashlog_columns.php | 4 ----
.../2021_04_09_180304_add_device_datetime.php | 4 ----
...4_09_220304_add_device_datetime_offset.php | 4 ----
...0653_add_queen_hive_delete_foreign_key.php | 4 ----
...e_sensor_definition_delete_foreign_key.php | 4 ----
..._change_sensors_offset_float_to_double.php | 4 ----
...add_alert_on_occurences_to_alert_rules.php | 4 ----
..._191500_add_alert_rules_last_evaluated.php | 4 ----
...27_143213_add_flashlog_time_percentage.php | 4 ----
.../2021_09_20_150053_add_count_to_alerts.php | 4 ----
...134_add_show_in_alerts_to_measurements.php | 4 ----
...2021_09_27_122352_remove_unused_tables.php | 4 ----
...021_09_27_134729_upgrade_db_to_utf8mb4.php | 4 ----
...2346_correct_hive_b_b_depth_and_height.php | 4 ----
...18_add_weather_boolean_to_measurements.php | 4 ----
...21_10_15_103342_add_rate_limit_to_user.php | 4 ----
...9_134428_add_former_key_list_to_device.php | 4 ----
..._152440_add_persisted_days_to_flashlog.php | 4 ----
...359_add_default_user_ids_to_researches.php | 4 ----
...94732_add_flashlog_persisted_block_ids.php | 4 ----
...2022_06_20_093325_add_queen_birth_date.php | 4 ----
...22_06_20_123603_create_hive_tags_table.php | 4 ----
...3_02_08_102518_add_visible_to_research.php | 4 ----
..._112218_add_on_invite_only_to_research.php | 4 ----
...2_135520_create_dashboard_groups_table.php | 4 ----
...4_03_083652_create_organizations_table.php | 4 ----
...o_role_user_and_permission_user_tables.php | 4 ----
..._10_120312_create_checklist_svgs_table.php | 4 ----
...90001_create_alert_rule_formulas_table.php | 4 ----
...08_30_135044_add_source_to_measurement.php | 4 ----
...1247_add_future_to_alert_rule_formulas.php | 4 ----
...09_06_090804_add_future_to_measurement.php | 4 ----
...1511_add_app_version_to_checklist_svgs.php | 4 ----
...154132_create_calculation_models_table.php | 4 ----
...luation_results_to_alert_rule_formulas.php | 4 ----
.../2024_09_28_220019_add_rtc_to_devices.php | 4 ----
..._add_recalculate_to_sensor_definitions.php | 4 ----
.../2025_05_20_131603_add_flash_log_dates.php | 4 ----
...5_05_26_094603_add_flash_log_meta_data.php | 4 ----
...5_073900_add_log_validation_to_devices.php | 4 ----
...35556_add_time_corrections_to_flashlog.php | 4 ----
...28_141954_add_flash_log_valid_override.php | 4 ----
...01_000000_rename_password_resets_table.php | 4 ----
database/seeders/DatabaseSeeder.php | 2 --
database/seeders/UserSeeder.php | 2 --
tests/ExampleTest.php | 2 --
166 files changed, 1 insertion(+), 884 deletions(-)
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 45162d41..a5e2f75b 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -12,8 +12,6 @@ class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
- *
- * @return void
*/
protected function schedule(Schedule $schedule): void
{
@@ -38,8 +36,6 @@ function () {
/**
* Register the Closure based commands for the application.
- *
- * @return void
*/
protected function commands(): void
{
diff --git a/app/Http/Controllers/AlertController.php b/app/Http/Controllers/AlertController.php
index 2e9799ae..985126e7 100644
--- a/app/Http/Controllers/AlertController.php
+++ b/app/Http/Controllers/AlertController.php
@@ -12,8 +12,6 @@ class AlertController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -45,8 +43,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -78,9 +74,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -91,9 +84,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -105,7 +95,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -127,7 +116,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/AlertRuleController.php b/app/Http/Controllers/AlertRuleController.php
index 097f242d..f2e0d2cc 100644
--- a/app/Http/Controllers/AlertRuleController.php
+++ b/app/Http/Controllers/AlertRuleController.php
@@ -14,8 +14,6 @@ class AlertRuleController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -45,8 +43,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -121,9 +117,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -134,9 +127,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -148,7 +138,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -193,7 +182,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index 98867ae8..8168aaab 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -11,8 +11,6 @@ class AlertRuleFormulaController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -38,8 +36,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -73,9 +69,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -86,9 +79,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -100,7 +90,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -124,7 +113,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/Api/AlertController.php b/app/Http/Controllers/Api/AlertController.php
index 202834c1..c4d64535 100644
--- a/app/Http/Controllers/Api/AlertController.php
+++ b/app/Http/Controllers/Api/AlertController.php
@@ -21,8 +21,6 @@ class AlertController extends Controller
* List all user alerts that are not deleted.
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -43,8 +41,6 @@ public function index(Request $request): JsonResponse
* @bodyParam measurement_id integer required The physical quantity / unit to alert for.
* @bodyParam alert_value string required The alert value.
* @bodyParam show boolean Set to false (0) if the alert should NOT be shown anymore.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): JsonResponse
{
@@ -80,8 +76,6 @@ public function show($id)
* @authenticated
*
* @bodyParam show boolean Set to false (0) if the alert should NOT be shown anymore.
- *
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, $id): JsonResponse
{
@@ -96,8 +90,6 @@ public function update(Request $request, $id): JsonResponse
* Delete the specified user alert, or all if id === 'all', or specific id's when provided &alert_ids=1,4,7
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $id): JsonResponse
{
diff --git a/app/Http/Controllers/Api/AlertRuleController.php b/app/Http/Controllers/Api/AlertRuleController.php
index 92a5b0e7..dfa5804b 100644
--- a/app/Http/Controllers/Api/AlertRuleController.php
+++ b/app/Http/Controllers/Api/AlertRuleController.php
@@ -25,8 +25,6 @@ class AlertRuleController extends Controller
* List all user alert rules that are not deleted.
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -84,8 +82,6 @@ public function default_rules(Request $request)
* @bodyParam alert_via_email boolean Set to false (0) if an e-mail should NOT be sent on alert. Default: true (1).
* @bodyParam webhook_url string URL of optional endpoint to call on alert for web hook integration.
* @bodyParam active boolean Set to false (0) if the alert should NOT be active. Default: true (1).
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): JsonResponse
{
@@ -206,8 +202,6 @@ public function show($id)
* @bodyParam alert_via_email boolean Set to false (0) if an e-mail should NOT be sent on alert. Default: true (1).
* @bodyParam webhook_url string URL of optional endpoint to call on alert for web hook integration.
* @bodyParam active boolean Set to false (0) if the alert should NOT be active. Default: true (1).
- *
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, $id): JsonResponse
{
@@ -309,8 +303,6 @@ public function update(Request $request, $id): JsonResponse
* Delete the specified user alert rule.
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function destroy($id): JsonResponse
{
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index dcadc38e..8a0ad037 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -58,8 +58,6 @@ public function show()
/**
* Mark the authenticated user's email address as verified.
- *
- * @return \Illuminate\Http\Response
*/
public function verify(Request $request): RedirectResponse
{
diff --git a/app/Http/Controllers/Api/CategoryController.php b/app/Http/Controllers/Api/CategoryController.php
index 6abb68c6..8c456be2 100644
--- a/app/Http/Controllers/Api/CategoryController.php
+++ b/app/Http/Controllers/Api/CategoryController.php
@@ -61,8 +61,6 @@ public function inputs(Request $request): JsonResponse
* Display the specified category.
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function show(Request $request, Category $category): JsonResponse
{
diff --git a/app/Http/Controllers/Api/ChecklistController.php b/app/Http/Controllers/Api/ChecklistController.php
index 8e9ad814..10aa974e 100644
--- a/app/Http/Controllers/Api/ChecklistController.php
+++ b/app/Http/Controllers/Api/ChecklistController.php
@@ -17,8 +17,6 @@ class ChecklistController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Api/GroupController.php b/app/Http/Controllers/Api/GroupController.php
index e89e7faa..3bd3119f 100644
--- a/app/Http/Controllers/Api/GroupController.php
+++ b/app/Http/Controllers/Api/GroupController.php
@@ -60,8 +60,6 @@ public function index(Request $request, $code = 200, $message = null, $error = n
* Check a token for a group id, and accept or decline the invite
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function checktoken(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Api/HiveController.php b/app/Http/Controllers/Api/HiveController.php
index a19c1a88..f33acb73 100644
--- a/app/Http/Controllers/Api/HiveController.php
+++ b/app/Http/Controllers/Api/HiveController.php
@@ -61,7 +61,6 @@ private function saveQueen(Request $request, $hive)
* api/hives GET
* Display a listing of user hives.
*
- * @return \Illuminate\Http\Response
*
* @authenticated
*
@@ -127,9 +126,6 @@ public function index(Request $request): JsonResponse
* Store a newly created Hive in storage for the authenticated user.
*
* @authenticated
- *
- * @param \App\Requests\PostHiveRequest $request
- * @return \App\Hive
*/
public function store(PostHiveRequest $request): Hive
{
@@ -162,8 +158,6 @@ public function store(PostHiveRequest $request): Hive
* Display the specified resource.
*
* @authenticated
- *
- * @return \App\Hive
*/
public function show(Request $request, Hive $hive): JsonResponse
{
@@ -175,9 +169,6 @@ public function show(Request $request, Hive $hive): JsonResponse
* Update the specified user Hive in storage.
*
* @authenticated
- *
- * @param \App\Requests\PostHiveRequest $request
- * @return \App\Hive
*/
public function update(PostHiveRequest $request, Hive $hive): Hive
{
@@ -209,8 +200,6 @@ public function update(PostHiveRequest $request, Hive $hive): Hive
* Remove the specified user Hive from storage.
*
* @authenticated
- *
- * @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Hive $hive): JsonResponse
{
diff --git a/app/Http/Controllers/Api/HiveTagsController.php b/app/Http/Controllers/Api/HiveTagsController.php
index 0eac42da..45f50e40 100644
--- a/app/Http/Controllers/Api/HiveTagsController.php
+++ b/app/Http/Controllers/Api/HiveTagsController.php
@@ -71,7 +71,6 @@ public function show(Request $request, $tag)
* Update the specified resource in storage.
*
* @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, $tag): JsonResponse
{
@@ -100,7 +99,6 @@ public function update(Request $request, $tag): JsonResponse
* Remove the specified resource from storage.
*
* @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroy(Request $request, $tag): JsonResponse
{
diff --git a/app/Http/Controllers/Api/ImageController.php b/app/Http/Controllers/Api/ImageController.php
index 68ae07bb..59c2ab66 100644
--- a/app/Http/Controllers/Api/ImageController.php
+++ b/app/Http/Controllers/Api/ImageController.php
@@ -18,8 +18,6 @@ class ImageController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -34,9 +32,6 @@ public function index(Request $request): JsonResponse
/**
* Store a newly created resource in storage.
- *
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): JsonResponse
{
@@ -53,7 +48,6 @@ public function store(Request $request): JsonResponse
/**
* Display the specified resource.
*
- * @param int $id
* @return \Illuminate\Http\Response
*/
public function show(int $id)
@@ -65,9 +59,6 @@ public function show(int $id)
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, int $id): JsonResponse
{
@@ -82,7 +73,6 @@ public function update(Request $request, int $id): JsonResponse
* Remove the specified resource from storage.
*
* @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroyByUrl(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Api/LocationController.php b/app/Http/Controllers/Api/LocationController.php
index b6fbac57..00fc213f 100644
--- a/app/Http/Controllers/Api/LocationController.php
+++ b/app/Http/Controllers/Api/LocationController.php
@@ -32,8 +32,6 @@ public function __construct(HiveFactory $hiveFactory)
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -128,8 +126,6 @@ public function store(Request $request)
/**
* Display the specified resource.
- *
- * @return \Illuminate\Http\Response
*/
public function show(Request $request, Location $location): JsonResponse
{
@@ -141,7 +137,6 @@ public function show(Request $request, Location $location): JsonResponse
/**
* Update the specified resource in storage.
*
- * @param \Illuminate\Http\Request $request
* @param \App\Location $location
* @return \Illuminate\Http\Response
*/
diff --git a/app/Http/Controllers/Api/QueenController.php b/app/Http/Controllers/Api/QueenController.php
index ed129610..2c1a8d99 100644
--- a/app/Http/Controllers/Api/QueenController.php
+++ b/app/Http/Controllers/Api/QueenController.php
@@ -17,8 +17,6 @@ class QueenController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -31,8 +29,6 @@ public function index(Request $request): JsonResponse
/**
* Store a newly created resource in storage.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): JsonResponse
{
@@ -56,8 +52,6 @@ public function store(Request $request): JsonResponse
/**
* Display the specified resource.
- *
- * @return \Illuminate\Http\Response
*/
public function show(Request $request, Queen $queen): JsonResponse
{
@@ -76,8 +70,6 @@ public function update(Request $request, Queen $queen)
/**
* Remove the specified resource from storage.
- *
- * @return \Illuminate\Http\Response
*/
public function destroy(Request $request, Queen $queen): JsonResponse
{
diff --git a/app/Http/Controllers/Api/ResearchController.php b/app/Http/Controllers/Api/ResearchController.php
index c9b284c3..fdf7574e 100644
--- a/app/Http/Controllers/Api/ResearchController.php
+++ b/app/Http/Controllers/Api/ResearchController.php
@@ -45,8 +45,6 @@ public function index(Request $request)
* @bodyParam location_ids array Only share data from these location IDs
* @bodyParam hive_ids array Only share data from these hive IDs
* @bodyParam device_ids array Only share data from these device IDs
- *
- * @return \Illuminate\Http\Response
*/
public function add_consent(Request $request, $id): JsonResponse
{
diff --git a/app/Http/Controllers/Api/SampleCodeController.php b/app/Http/Controllers/Api/SampleCodeController.php
index b67f7d2e..5fbb852c 100644
--- a/app/Http/Controllers/Api/SampleCodeController.php
+++ b/app/Http/Controllers/Api/SampleCodeController.php
@@ -17,8 +17,6 @@ class SampleCodeController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(): JsonResponse
{
@@ -76,7 +74,6 @@ public function update(Request $request, SampleCode $sampleCode)
* Remove the specified resource from storage.
*
* @param \App\SampleCode $sampleCode
- * @return \Illuminate\Http\Response
*/
public function destroy(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Api/SensorDefinitionController.php b/app/Http/Controllers/Api/SensorDefinitionController.php
index bc17e083..0565ca03 100644
--- a/app/Http/Controllers/Api/SensorDefinitionController.php
+++ b/app/Http/Controllers/Api/SensorDefinitionController.php
@@ -112,8 +112,6 @@ private function makeRequestDataArray(Request $request)
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
* @bodyParam input_measurement_abbreviation string Filter sensordefinitions by provided input abbreviation.
* @bodyParam limit integer If input_abbr is set, limit the amount of results provided by more than 1 to get all historic sensordefinitions of this type.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): JsonResponse
{
@@ -161,8 +159,6 @@ public function index(Request $request): JsonResponse
* @bodyParam device_id integer Device ID that the Sensordefinition belongs to. Required if hardware_id, and device_hardware_id are not set.
* @bodyParam hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if device_id, and device_hardware_id are not set.
* @bodyParam device_hardware_id string Device hardware ID that the Sensordefinition belongs to. Required if hardware_id, and device_id are not set.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): JsonResponse
{
diff --git a/app/Http/Controllers/Api/WeatherController.php b/app/Http/Controllers/Api/WeatherController.php
index c80f9ea5..d7bb3d8c 100644
--- a/app/Http/Controllers/Api/WeatherController.php
+++ b/app/Http/Controllers/Api/WeatherController.php
@@ -16,8 +16,6 @@ class WeatherController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index e1da5d4c..f4fc9ca6 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -43,8 +43,6 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
- *
- * @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data): \Illuminate\Contracts\Validation\Validator
{
@@ -58,8 +56,6 @@ protected function validator(array $data): \Illuminate\Contracts\Validation\Vali
/**
* Create a new user instance after a valid registration.
- *
- * @return \App\User
*/
protected function create(array $data): User
{
diff --git a/app/Http/Controllers/CalculationModelController.php b/app/Http/Controllers/CalculationModelController.php
index 56cb66ee..8eb01c14 100644
--- a/app/Http/Controllers/CalculationModelController.php
+++ b/app/Http/Controllers/CalculationModelController.php
@@ -11,8 +11,6 @@ class CalculationModelController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -41,8 +39,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -69,9 +65,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -90,9 +83,6 @@ public function run(Request $request, $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -104,7 +94,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -121,7 +110,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.php
index 435c2936..7c68f22b 100755
--- a/app/Http/Controllers/CategoriesController.php
+++ b/app/Http/Controllers/CategoriesController.php
@@ -42,8 +42,6 @@ public function index(): View
/**
* Show the form for creating a new resource.
- *
- * @return Response
*/
public function create(Request $input): View
{
@@ -57,9 +55,6 @@ public function create(Request $input): View
/**
* Store a newly created resource in storage.
- *
- *
- * @return Response
*/
public function store(PostCategoryRequest $input): RedirectResponse
{
@@ -259,9 +254,6 @@ private function parseLinesToArray($list, $indentation = "\t")
/**
* Display the specified resource.
- *
- * @param int $id
- * @return Response
*/
public function show(int $id): View
{
@@ -276,9 +268,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return Response
*/
public function edit(int $id): View
{
@@ -294,9 +283,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return Response
*/
public function update(PostCategoryRequest $input, int $id): RedirectResponse
{
@@ -537,9 +523,6 @@ public function destroy($id): RedirectResponse
return redirect()->route('categories.index')->with('error', 'Category not found');
}
- /**
- * @return static
- */
protected function makeOptions(Collection $items): static
{
$options = ['' => 'Root'];
@@ -551,10 +534,6 @@ protected function makeOptions(Collection $items): static
return $options;
}
- /**
- * @param Category $except
- * @return CategoriesController
- */
protected function getCategoryOptions(Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index 5fbdf33d..7d6210dc 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -12,8 +12,6 @@ class CategoryInputsController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -31,8 +29,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -67,9 +63,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -80,9 +73,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -94,7 +84,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -119,7 +108,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/ChecklistController.php b/app/Http/Controllers/ChecklistController.php
index 6662a665..ad4cb809 100644
--- a/app/Http/Controllers/ChecklistController.php
+++ b/app/Http/Controllers/ChecklistController.php
@@ -22,8 +22,6 @@ public function __construct(CategoryFactory $categoryFactory)
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -39,8 +37,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -77,9 +73,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -92,9 +85,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -120,7 +110,6 @@ private function addChecklistToUsers(Request $request, $checklist)
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -144,7 +133,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index c48857b4..5e908e09 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -11,8 +11,6 @@ class ChecklistSvgController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -36,8 +34,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -67,9 +63,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -80,9 +73,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -94,7 +84,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -114,7 +103,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php
index 6a84c4fb..0c06ae60 100644
--- a/app/Http/Controllers/DashboardController.php
+++ b/app/Http/Controllers/DashboardController.php
@@ -54,8 +54,6 @@ private function cacheRequestGetArray($name)
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index f4e3b33a..04fec6e8 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -15,8 +15,6 @@ class DashboardGroupController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -45,8 +43,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -87,9 +83,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -100,9 +93,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -115,7 +105,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -151,7 +140,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index 3d8c60e1..455dda31 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -20,8 +20,6 @@ class DeviceController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): View
{
@@ -87,8 +85,6 @@ public function index(Request $request): View
/**
* Display the data from all selected devices.
- *
- * @return \Illuminate\Http\Response
*/
public function data(Request $request): View
{
@@ -209,8 +205,6 @@ public function data(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
*/
public function create(): View
{
@@ -222,8 +216,6 @@ public function create(): View
/**
* Store a newly created resource in storage.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): RedirectResponse
{
@@ -261,9 +253,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function show(int $id): View
{
@@ -398,9 +387,6 @@ public function flashlog(Request $request, $id, $fl_id)
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function edit(int $id): View
{
@@ -421,9 +407,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, int $id): RedirectResponse
{
@@ -473,9 +456,6 @@ public function undelete($id): RedirectResponse
/**
* Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroy(int $id): RedirectResponse
{
diff --git a/app/Http/Controllers/FlashLogController.php b/app/Http/Controllers/FlashLogController.php
index e4c0f433..339ca500 100644
--- a/app/Http/Controllers/FlashLogController.php
+++ b/app/Http/Controllers/FlashLogController.php
@@ -17,8 +17,6 @@ class FlashLogController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -85,8 +83,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -113,9 +109,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(Request $request, int $id): View
{
@@ -190,9 +183,6 @@ public function show(Request $request, int $id): View
/**
* Re-parse the specified flashlog.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function parse(Request $request, int $id): RedirectResponse
{
@@ -274,9 +264,6 @@ public function parse(Request $request, int $id): RedirectResponse
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -288,7 +275,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id)
@@ -331,7 +317,6 @@ public function update(Request $request, int $id)
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php
index 32ab9a2f..cfa2f755 100644
--- a/app/Http/Controllers/GroupController.php
+++ b/app/Http/Controllers/GroupController.php
@@ -11,8 +11,6 @@ class GroupController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): View
{
@@ -24,8 +22,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
*/
public function create(): View
{
@@ -34,8 +30,6 @@ public function create(): View
/**
* Store a newly created resource in storage.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): RedirectResponse
{
@@ -52,9 +46,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function show(int $id): View
{
@@ -65,9 +56,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function edit(int $id): View
{
@@ -78,9 +66,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, int $id): RedirectResponse
{
@@ -97,9 +82,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroy(int $id): RedirectResponse
{
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index 96e13aef..6a47c258 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -11,8 +11,6 @@ class HiveTagsController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -36,8 +34,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -67,9 +63,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -80,9 +73,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -94,7 +84,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -114,7 +103,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 1b18a58c..15ca6916 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -18,8 +18,6 @@ public function __construct()
/**
* Show the application dashboard.
- *
- * @return \Illuminate\Contracts\Support\Renderable
*/
public function index(): View
{
diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php
index 99983190..b26ea87d 100644
--- a/app/Http/Controllers/ImageController.php
+++ b/app/Http/Controllers/ImageController.php
@@ -11,8 +11,6 @@ class ImageController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -37,8 +35,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -63,9 +59,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -76,9 +69,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -90,7 +80,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -107,7 +96,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/InspectionItemsController.php b/app/Http/Controllers/InspectionItemsController.php
index f9b9f789..2bb0bca4 100644
--- a/app/Http/Controllers/InspectionItemsController.php
+++ b/app/Http/Controllers/InspectionItemsController.php
@@ -11,8 +11,6 @@ class InspectionItemsController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -33,8 +31,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -59,9 +55,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -72,9 +65,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -86,7 +76,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -103,7 +92,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/InspectionsController.php b/app/Http/Controllers/InspectionsController.php
index eaee6ec9..7b4f64ca 100644
--- a/app/Http/Controllers/InspectionsController.php
+++ b/app/Http/Controllers/InspectionsController.php
@@ -12,8 +12,6 @@ class InspectionsController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -27,8 +25,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -53,9 +49,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -77,9 +70,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -91,7 +81,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -108,7 +97,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/LanguageController.php b/app/Http/Controllers/LanguageController.php
index f6837db1..8851b32b 100644
--- a/app/Http/Controllers/LanguageController.php
+++ b/app/Http/Controllers/LanguageController.php
@@ -11,8 +11,6 @@ class LanguageController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -30,8 +28,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -56,9 +52,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -69,9 +62,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -83,7 +73,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -100,7 +89,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/MeasurementController.php b/app/Http/Controllers/MeasurementController.php
index d1d585f9..123e18c2 100644
--- a/app/Http/Controllers/MeasurementController.php
+++ b/app/Http/Controllers/MeasurementController.php
@@ -12,8 +12,6 @@ class MeasurementController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -30,8 +28,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -58,9 +54,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -71,9 +64,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -85,7 +75,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -106,7 +95,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php
index b0a9ced7..ea812f3a 100644
--- a/app/Http/Controllers/PermissionController.php
+++ b/app/Http/Controllers/PermissionController.php
@@ -11,8 +11,6 @@ class PermissionController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -30,8 +28,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -56,9 +52,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -69,9 +62,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -83,7 +73,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -100,7 +89,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/PhysicalQuantityController.php b/app/Http/Controllers/PhysicalQuantityController.php
index 0e733319..448138cf 100644
--- a/app/Http/Controllers/PhysicalQuantityController.php
+++ b/app/Http/Controllers/PhysicalQuantityController.php
@@ -11,8 +11,6 @@ class PhysicalQuantityController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -30,8 +28,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -56,9 +52,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -69,9 +62,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -83,7 +73,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -100,7 +89,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index c73d66a9..8e2954f6 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -65,8 +65,6 @@ private function checkAuthorization(Request $request)
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -151,8 +149,6 @@ public function consent_edit($id, $c_id, Request $request)
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -222,9 +218,6 @@ public function store(Request $request): RedirectResponse
/**
* Display Research overview.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id, Request $request): View
{
@@ -986,9 +979,6 @@ public function show(int $id, Request $request): View
/**
* Display Research data per device.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function data(int $id, Request $request): View
{
@@ -1720,9 +1710,6 @@ private function addDbDataToDataArray(&$data_array, $device, $from_date, $until_
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -1738,7 +1725,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -1799,7 +1785,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index c29040cb..4fdfab16 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -13,8 +13,6 @@ class RoleController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): View
{
@@ -26,8 +24,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
*/
public function create(): View
{
@@ -38,8 +34,6 @@ public function create(): View
/**
* Store a newly created resource in storage.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): RedirectResponse
{
@@ -66,9 +60,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function show(int $id): View
{
@@ -82,9 +73,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function edit(int $id): View
{
@@ -100,9 +88,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, int $id): RedirectResponse
{
@@ -130,9 +115,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroy(int $id): RedirectResponse
{
diff --git a/app/Http/Controllers/SampleCodeController.php b/app/Http/Controllers/SampleCodeController.php
index f0f5be50..276b8198 100644
--- a/app/Http/Controllers/SampleCodeController.php
+++ b/app/Http/Controllers/SampleCodeController.php
@@ -636,8 +636,6 @@ public function resultsave(Request $request): RedirectResponse
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -648,8 +646,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -683,9 +679,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -696,9 +689,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -710,7 +700,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -730,7 +719,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index 88c74c7e..20c5c081 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -14,8 +14,6 @@ class SensorDefinitionController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\View\View
*/
public function index(Request $request): View
{
@@ -81,8 +79,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\View\View
*/
public function create(): View
{
@@ -116,9 +112,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function show(int $id): View
{
@@ -129,9 +122,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\View\View
*/
public function edit(int $id): View
{
@@ -145,7 +135,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, int $id): RedirectResponse
@@ -169,7 +158,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
*
- * @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy(int $id): RedirectResponse
diff --git a/app/Http/Controllers/TranslationController.php b/app/Http/Controllers/TranslationController.php
index 6def20e9..7b9fac28 100644
--- a/app/Http/Controllers/TranslationController.php
+++ b/app/Http/Controllers/TranslationController.php
@@ -106,9 +106,6 @@ public function update(Language $language, Request $request): RedirectResponse
return redirect()->route('translations.edit', [$language->id])->with('error', 'No translations updated.');
}
- /**
- * @return static
- */
protected function makeOptions(Collection $items): static
{
$options = [];
@@ -120,10 +117,6 @@ protected function makeOptions(Collection $items): static
return $options;
}
- /**
- * @param Category $except
- * @return CategoriesController
- */
protected function getCategoryOptions(Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index e3b9df79..0d743e9b 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -19,8 +19,6 @@ class UserController extends Controller
{
/**
* Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
*/
public function index(Request $request): View
{
@@ -50,8 +48,6 @@ public function index(Request $request): View
/**
* Show the form for creating a new resource.
- *
- * @return \Illuminate\Http\Response
*/
public function create(): View
{
@@ -63,8 +59,6 @@ public function create(): View
/**
* Store a newly created resource in storage.
- *
- * @return \Illuminate\Http\Response
*/
public function store(Request $request): RedirectResponse
{
@@ -124,9 +118,6 @@ public function store(Request $request): RedirectResponse
/**
* Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function show(int $id): View
{
@@ -138,9 +129,6 @@ public function show(int $id): View
/**
* Show the form for editing the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function edit(int $id): View
{
@@ -155,9 +143,6 @@ public function edit(int $id): View
/**
* Update the specified resource in storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function update(Request $request, int $id): RedirectResponse
{
@@ -226,9 +211,6 @@ public function update(Request $request, int $id): RedirectResponse
/**
* Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
*/
public function destroy(int $id): RedirectResponse
{
diff --git a/app/Http/Middleware/EnsureWebappEmailIsVerified.php b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
index 265f12ac..0ec16ee4 100644
--- a/app/Http/Middleware/EnsureWebappEmailIsVerified.php
+++ b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
@@ -11,9 +11,6 @@ class EnsureWebappEmailIsVerified
{
/**
* Handle an incoming request.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next): \Symfony\Component\HttpFoundation\Response
{
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
index afc78c4e..4b2af74d 100644
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -13,7 +13,7 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
- * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
+ * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
*/
public function handle(Request $request, Closure $next, string ...$guards): Response
{
diff --git a/app/Http/Requests/PostCategoryRequest.php b/app/Http/Requests/PostCategoryRequest.php
index a4ecb6e7..e93bdc5d 100755
--- a/app/Http/Requests/PostCategoryRequest.php
+++ b/app/Http/Requests/PostCategoryRequest.php
@@ -6,8 +6,6 @@ class PostCategoryRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
- *
- * @return bool
*/
public function authorize(): bool
{
@@ -16,8 +14,6 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
- *
- * @return array
*/
public function rules(): array
{
diff --git a/app/Http/Requests/PostHiveRequest.php b/app/Http/Requests/PostHiveRequest.php
index ac84f208..66848ebe 100644
--- a/app/Http/Requests/PostHiveRequest.php
+++ b/app/Http/Requests/PostHiveRequest.php
@@ -6,8 +6,6 @@ class PostHiveRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
- *
- * @return bool
*/
public function authorize(): bool
{
@@ -16,8 +14,6 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
- *
- * @return array
*/
public function rules(): array
{
diff --git a/app/Http/Requests/PostLocationRequest.php b/app/Http/Requests/PostLocationRequest.php
index 3fda55d0..d474ff94 100644
--- a/app/Http/Requests/PostLocationRequest.php
+++ b/app/Http/Requests/PostLocationRequest.php
@@ -6,8 +6,6 @@ class PostLocationRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
- *
- * @return bool
*/
public function authorize(): bool
{
@@ -16,8 +14,6 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
- *
- * @return array
*/
public function rules(): array
{
diff --git a/app/Http/Requests/PostSensorRequest.php b/app/Http/Requests/PostSensorRequest.php
index 46e52e64..54537a98 100644
--- a/app/Http/Requests/PostSensorRequest.php
+++ b/app/Http/Requests/PostSensorRequest.php
@@ -6,8 +6,6 @@ class PostSensorRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
- *
- * @return bool
*/
public function authorize(): bool
{
@@ -16,8 +14,6 @@ public function authorize(): bool
/**
* Get the validation rules that apply to the request.
- *
- * @return array
*/
public function rules(): array
{
diff --git a/app/Http/Resources/InspectionCollection.php b/app/Http/Resources/InspectionCollection.php
index ebc4999b..8e5d0a7b 100644
--- a/app/Http/Resources/InspectionCollection.php
+++ b/app/Http/Resources/InspectionCollection.php
@@ -9,9 +9,6 @@ class InspectionCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
- *
- * @param \Illuminate\Http\Request $request
- * @return array
*/
public function toArray(Request $request): array
{
diff --git a/app/Listeners/LogSuccessfulLogin.php b/app/Listeners/LogSuccessfulLogin.php
index f0206b21..413f29ac 100644
--- a/app/Listeners/LogSuccessfulLogin.php
+++ b/app/Listeners/LogSuccessfulLogin.php
@@ -18,8 +18,6 @@ public function __construct()
/**
* Handle the event.
- *
- * @return void
*/
public function handle(Login $event): void
{
diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php
index 17d46de5..2ffe9946 100644
--- a/app/Notifications/ResetPassword.php
+++ b/app/Notifications/ResetPassword.php
@@ -26,7 +26,6 @@ class ResetPassword extends NotificationBase
/**
* Create a notification instance.
*
- * @param string $token
* @return void
*/
public function __construct(string $token)
@@ -49,7 +48,6 @@ public function via($notifiable): array
* Build the mail representation of the notification.
*
* @param mixed $notifiable
- * @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable): MailMessage
{
@@ -69,9 +67,6 @@ public function toMail($notifiable): MailMessage
/**
* Set a callback that should be used when building the notification mail message.
- *
- * @param \Closure $callback
- * @return void
*/
public static function toMailUsing(Closure $callback): void
{
diff --git a/app/Notifications/VerifyEmail.php b/app/Notifications/VerifyEmail.php
index 3b9d3d85..096a3585 100644
--- a/app/Notifications/VerifyEmail.php
+++ b/app/Notifications/VerifyEmail.php
@@ -13,7 +13,6 @@ class VerifyEmail extends VerifyEmailBase
* Get the verification URL for the given notifiable.
*
* @param mixed $notifiable
- * @return string
*/
protected function verificationUrl($notifiable): string
{
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index 02414582..fb4bb5eb 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -12,8 +12,6 @@ class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
- *
- * @return void
*/
public function boot(): void
{
@@ -52,8 +50,6 @@ public function boot(): void
/**
* Register any application services.
- *
- * @return void
*/
public function register(): void
{
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index a119d6f9..e22ccf18 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -17,8 +17,6 @@ class AuthServiceProvider extends ServiceProvider
/**
* Register any authentication / authorization services.
- *
- * @return void
*/
public function boot(): void
{
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
index cbbc4405..10db3755 100644
--- a/app/Providers/EventServiceProvider.php
+++ b/app/Providers/EventServiceProvider.php
@@ -25,8 +25,6 @@ class EventServiceProvider extends ServiceProvider
/**
* Register any events for your application.
- *
- * @return void
*/
public function boot(): void
{
@@ -36,8 +34,6 @@ public function boot(): void
/**
* Determine if events and listeners should be automatically discovered.
- *
- * @return bool
*/
public function shouldDiscoverEvents(): bool
{
diff --git a/database/factories/HiveFactory.php b/database/factories/HiveFactory.php
index 85b1ddb7..95ef43e0 100644
--- a/database/factories/HiveFactory.php
+++ b/database/factories/HiveFactory.php
@@ -19,8 +19,6 @@ class HiveFactory extends Factory
{
/**
* Define the model's default state.
- *
- * @return array
*/
public function definition(): array
{
diff --git a/database/factories/HiveLayerFactory.php b/database/factories/HiveLayerFactory.php
index 5127d12f..83e12dc4 100644
--- a/database/factories/HiveLayerFactory.php
+++ b/database/factories/HiveLayerFactory.php
@@ -19,8 +19,6 @@ class HiveLayerFactory extends Factory
{
/**
* Define the model's default state.
- *
- * @return array
*/
public function definition(): array
{
diff --git a/database/factories/HiveLayerFrameFactory.php b/database/factories/HiveLayerFrameFactory.php
index 4bbaaef4..8690e420 100644
--- a/database/factories/HiveLayerFrameFactory.php
+++ b/database/factories/HiveLayerFrameFactory.php
@@ -19,8 +19,6 @@ class HiveLayerFrameFactory extends Factory
{
/**
* Define the model's default state.
- *
- * @return array
*/
public function definition(): array
{
diff --git a/database/factories/LocationFactory.php b/database/factories/LocationFactory.php
index bd5355a8..56424187 100644
--- a/database/factories/LocationFactory.php
+++ b/database/factories/LocationFactory.php
@@ -19,8 +19,6 @@ class LocationFactory extends Factory
{
/**
* Define the model's default state.
- *
- * @return array
*/
public function definition(): array
{
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index 6a038473..45b6a7ac 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -20,8 +20,6 @@ class UserFactory extends Factory
{
/**
* Define the model's default state.
- *
- * @return array
*/
public function definition(): array
{
diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php
index 18ffb5b5..9a022a12 100644
--- a/database/migrations/2014_10_12_000000_create_users_table.php
+++ b/database/migrations/2014_10_12_000000_create_users_table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -27,8 +25,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php
index a0cecb22..9a67fb4e 100644
--- a/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2016_04_10_115211_create-category-table.php b/database/migrations/2016_04_10_115211_create-category-table.php
index e9c326f1..f3366826 100644
--- a/database/migrations/2016_04_10_115211_create-category-table.php
+++ b/database/migrations/2016_04_10_115211_create-category-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -26,8 +24,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2016_04_14_174603_create-location-table.php b/database/migrations/2016_04_14_174603_create-location-table.php
index 7a6f55af..75c67ac4 100644
--- a/database/migrations/2016_04_14_174603_create-location-table.php
+++ b/database/migrations/2016_04_14_174603_create-location-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -42,8 +40,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2016_12_20_121758_create_settings.php b/database/migrations/2016_12_20_121758_create_settings.php
index 00aab0be..e4734b87 100644
--- a/database/migrations/2016_12_20_121758_create_settings.php
+++ b/database/migrations/2016_12_20_121758_create_settings.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -31,8 +29,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2016_12_20_121819_create-hive-table.php b/database/migrations/2016_12_20_121819_create-hive-table.php
index 1840f17f..e7580bb6 100644
--- a/database/migrations/2016_12_20_121819_create-hive-table.php
+++ b/database/migrations/2016_12_20_121819_create-hive-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -66,8 +64,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2016_12_21_174159_create-sensor-table.php b/database/migrations/2016_12_21_174159_create-sensor-table.php
index 8a8c4397..19cd2e3f 100644
--- a/database/migrations/2016_12_21_174159_create-sensor-table.php
+++ b/database/migrations/2016_12_21_174159_create-sensor-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -43,8 +41,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2017_03_21_114148_create_groups_table.php b/database/migrations/2017_03_21_114148_create_groups_table.php
index b05d4440..c84ec9e7 100644
--- a/database/migrations/2017_03_21_114148_create_groups_table.php
+++ b/database/migrations/2017_03_21_114148_create_groups_table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -50,8 +48,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2017_03_21_114828_entrust_setup_tables.php b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
index 2e01c2a4..383aefe4 100644
--- a/database/migrations/2017_03_21_114828_entrust_setup_tables.php
+++ b/database/migrations/2017_03_21_114828_entrust_setup_tables.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -59,8 +57,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2017_04_14_175011_create-queen-table.php b/database/migrations/2017_04_14_175011_create-queen-table.php
index d99d35a0..2d5b980d 100644
--- a/database/migrations/2017_04_14_175011_create-queen-table.php
+++ b/database/migrations/2017_04_14_175011_create-queen-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -48,8 +46,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2017_04_14_175022_create-production-table.php b/database/migrations/2017_04_14_175022_create-production-table.php
index bc56365e..00b49fb2 100644
--- a/database/migrations/2017_04_14_175022_create-production-table.php
+++ b/database/migrations/2017_04_14_175022_create-production-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -42,8 +40,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2017_07_17_095406_add_users_last_login.php b/database/migrations/2017_07_17_095406_add_users_last_login.php
index 56778b0c..0f0e20d0 100644
--- a/database/migrations/2017_07_17_095406_add_users_last_login.php
+++ b/database/migrations/2017_07_17_095406_add_users_last_login.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
index 564c2666..3e811b19 100644
--- a/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
+++ b/database/migrations/2018_01_30_105927_add_category_nested_set_columns.php
@@ -9,8 +9,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_01_31_174432_create_category_input.php b/database/migrations/2018_01_31_174432_create_category_input.php
index e92aca89..66b431db 100644
--- a/database/migrations/2018_01_31_174432_create_category_input.php
+++ b/database/migrations/2018_01_31_174432_create_category_input.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -73,8 +71,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_02_20_161831_add_category_old_id.php b/database/migrations/2018_02_20_161831_add_category_old_id.php
index 5ded8254..fde856e0 100644
--- a/database/migrations/2018_02_20_161831_add_category_old_id.php
+++ b/database/migrations/2018_02_20_161831_add_category_old_id.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -23,8 +21,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_03_12_223732_create-checklists-table.php b/database/migrations/2018_03_12_223732_create-checklists-table.php
index eb6543d9..7d669555 100644
--- a/database/migrations/2018_03_12_223732_create-checklists-table.php
+++ b/database/migrations/2018_03_12_223732_create-checklists-table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -72,8 +70,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_04_03_110731_create_inspections_table.php b/database/migrations/2018_04_03_110731_create_inspections_table.php
index 85bc34e0..d5c1c3e0 100644
--- a/database/migrations/2018_04_03_110731_create_inspections_table.php
+++ b/database/migrations/2018_04_03_110731_create_inspections_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -73,8 +71,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_04_03_112937_create_inspection_items_table.php b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
index 6a5cb603..d0ec34b5 100644
--- a/database/migrations/2018_04_03_112937_create_inspection_items_table.php
+++ b/database/migrations/2018_04_03_112937_create_inspection_items_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -27,8 +25,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_04_03_115056_add_checklist_category_order.php b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
index 2c802c0e..fd9b3787 100644
--- a/database/migrations/2018_04_03_115056_add_checklist_category_order.php
+++ b/database/migrations/2018_04_03_115056_add_checklist_category_order.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
index fb2175e5..8e3f8638 100644
--- a/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
+++ b/database/migrations/2018_04_24_124855_AddCategoryTypeIndex.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
index 651a052d..82ed5d2d 100644
--- a/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
+++ b/database/migrations/2018_05_16_150929_add_location_hive_delete_foreign_key.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_05_18_091519_add_user_policy_check.php b/database/migrations/2018_05_18_091519_add_user_policy_check.php
index 0262ec3d..67f8a5fc 100644
--- a/database/migrations/2018_05_18_091519_add_user_policy_check.php
+++ b/database/migrations/2018_05_18_091519_add_user_policy_check.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -19,8 +17,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
index d7df4213..0296fa16 100644
--- a/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
+++ b/database/migrations/2018_06_03_110444_AddLanguageTwoChar.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -30,8 +28,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
index 4b02c641..1e3685e9 100644
--- a/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
+++ b/database/migrations/2018_06_06_121927_convert_inspections_to_taxonomy.php
@@ -89,8 +89,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
index 51e68b4c..52bd758c 100644
--- a/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
+++ b/database/migrations/2018_12_19_152505_add_email_token_to_user_table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_08_101831_add_category_required.php b/database/migrations/2019_01_08_101831_add_category_required.php
index aab62491..a148e8e8 100644
--- a/database/migrations/2019_01_08_101831_add_category_required.php
+++ b/database/migrations/2019_01_08_101831_add_category_required.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -23,8 +21,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_14_114237_add_group_extras.php b/database/migrations/2019_01_14_114237_add_group_extras.php
index b6fea7fd..96116c75 100644
--- a/database/migrations/2019_01_14_114237_add_group_extras.php
+++ b/database/migrations/2019_01_14_114237_add_group_extras.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_14_114804_create_group_hive.php b/database/migrations/2019_01_14_114804_create_group_hive.php
index 14531c85..32afd45f 100644
--- a/database/migrations/2019_01_14_114804_create_group_hive.php
+++ b/database/migrations/2019_01_14_114804_create_group_hive.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -33,8 +31,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_14_143937_add_group_user_admin.php b/database/migrations/2019_01_14_143937_add_group_user_admin.php
index 38a72ba6..f47db485 100644
--- a/database/migrations/2019_01_14_143937_add_group_user_admin.php
+++ b/database/migrations/2019_01_14_143937_add_group_user_admin.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_28_104628_create_measurements_table.php b/database/migrations/2019_01_28_104628_create_measurements_table.php
index f240aae6..fed8a24f 100644
--- a/database/migrations/2019_01_28_104628_create_measurements_table.php
+++ b/database/migrations/2019_01_28_104628_create_measurements_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -30,8 +28,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_28_223610_add_min_max_values.php b/database/migrations/2019_01_28_223610_add_min_max_values.php
index a4567c67..1c61b27d 100644
--- a/database/migrations/2019_01_28_223610_add_min_max_values.php
+++ b/database/migrations/2019_01_28_223610_add_min_max_values.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -28,8 +26,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_01_28_223654_add_high_low_values.php b/database/migrations/2019_01_28_223654_add_high_low_values.php
index 6bdca272..06d1337d 100644
--- a/database/migrations/2019_01_28_223654_add_high_low_values.php
+++ b/database/migrations/2019_01_28_223654_add_high_low_values.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -26,8 +24,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_11_21_153657_add_location_roofed.php b/database/migrations/2019_11_21_153657_add_location_roofed.php
index 7a2214f8..54a06076 100644
--- a/database/migrations/2019_11_21_153657_add_location_roofed.php
+++ b/database/migrations/2019_11_21_153657_add_location_roofed.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_11_21_204213_create_researches_table.php b/database/migrations/2019_11_21_204213_create_researches_table.php
index 6f20ec72..fcb893ce 100644
--- a/database/migrations/2019_11_21_204213_create_researches_table.php
+++ b/database/migrations/2019_11_21_204213_create_researches_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -64,8 +62,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2019_12_27_172844_create_images_table.php b/database/migrations/2019_12_27_172844_create_images_table.php
index 4de1e223..93f32116 100644
--- a/database/migrations/2019_12_27_172844_create_images_table.php
+++ b/database/migrations/2019_12_27_172844_create_images_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -45,8 +43,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
index b2d8bdd5..cf84bc71 100644
--- a/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
+++ b/database/migrations/2020_01_05_153657_add_inspection_checklist_id.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
index e28ff49a..56003589 100644
--- a/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
+++ b/database/migrations/2020_01_09_180741_change_sensors_hive_id_nullable.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
index d403b1c9..a7fca8a4 100644
--- a/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
+++ b/database/migrations/2020_01_11_134447_add_dimensions_to_hive.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -24,8 +22,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_11_135656_add_description_to_queen.php b/database/migrations/2020_01_11_135656_add_description_to_queen.php
index ab4a8219..c0526e11 100644
--- a/database/migrations/2020_01_11_135656_add_description_to_queen.php
+++ b/database/migrations/2020_01_11_135656_add_description_to_queen.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_11_140516_add_order_to_hive.php b/database/migrations/2020_01_11_140516_add_order_to_hive.php
index 30122e4e..82f334e3 100644
--- a/database/migrations/2020_01_11_140516_add_order_to_hive.php
+++ b/database/migrations/2020_01_11_140516_add_order_to_hive.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
index f14ab09b..37e60bde 100644
--- a/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
+++ b/database/migrations/2020_01_11_173757_create_sensor_definitions_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -36,8 +34,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
index a65e926d..71eb7cec 100644
--- a/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
+++ b/database/migrations/2020_01_11_224703_add_last_active_and_hw_id_to_sensor.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -27,8 +25,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_15_110902_add_storage_to_image.php b/database/migrations/2020_01_15_110902_add_storage_to_image.php
index 666ddf3d..7fd2c047 100644
--- a/database/migrations/2020_01_15_110902_add_storage_to_image.php
+++ b/database/migrations/2020_01_15_110902_add_storage_to_image.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
index a71cff27..fbb16cb0 100644
--- a/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
+++ b/database/migrations/2020_01_15_120918_change_url_field_length_for_image.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -30,8 +28,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_15_121511_add_image_to_inspection.php b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
index d1de122f..8d425d46 100644
--- a/database/migrations/2020_01_15_121511_add_image_to_inspection.php
+++ b/database/migrations/2020_01_15_121511_add_image_to_inspection.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
index 0b36f8dd..989fe26e 100644
--- a/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
+++ b/database/migrations/2020_01_27_205714_add_last_weather_time_stamp_to_location.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
index bcb18008..efdc2415 100644
--- a/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
+++ b/database/migrations/2020_02_19_152103_add_battery_voltage_to_device.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
index 6c7eac91..1eb7834c 100644
--- a/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
+++ b/database/migrations/2020_02_19_152416_add_downlink_message_to_device.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -21,8 +19,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_06_08_094741_add_locale_to_user.php b/database/migrations/2020_06_08_094741_add_locale_to_user.php
index 2560d760..ad14d9a3 100644
--- a/database/migrations/2020_06_08_094741_add_locale_to_user.php
+++ b/database/migrations/2020_06_08_094741_add_locale_to_user.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_06_25_154728_create_sample_codes_table.php b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
index f20d26ea..46c10a2c 100644
--- a/database/migrations/2020_06_25_154728_create_sample_codes_table.php
+++ b/database/migrations/2020_06_25_154728_create_sample_codes_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -40,8 +38,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
index d27752cd..1b15273c 100644
--- a/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
+++ b/database/migrations/2020_08_04_114944_add_hex_color_to_location.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
index f8c35b1e..7f9fe94d 100644
--- a/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
+++ b/database/migrations/2020_10_01_142238_add_research_owner_and_viewers.php
@@ -31,8 +31,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_02_09_170632_create_alerts_table.php b/database/migrations/2021_02_09_170632_create_alerts_table.php
index 581620fe..080f9123 100644
--- a/database/migrations/2021_02_09_170632_create_alerts_table.php
+++ b/database/migrations/2021_02_09_170632_create_alerts_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -34,8 +32,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_02_09_170935_create_alert_rules_table.php b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
index 3cee6632..618f0dc6 100644
--- a/database/migrations/2021_02_09_170935_create_alert_rules_table.php
+++ b/database/migrations/2021_02_09_170935_create_alert_rules_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -37,8 +35,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
index f8de729c..13ce0618 100644
--- a/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
+++ b/database/migrations/2021_02_10_114944_add_exclude_hive_ids_to_alert_rules.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -23,8 +21,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
index 6e1671c1..d72b200d 100644
--- a/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
+++ b/database/migrations/2021_02_22_164840_add_alert_rules_last_calculated.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -23,8 +21,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_02_24_095050_create_flash_logs_table.php b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
index 986e8325..72b7f315 100644
--- a/database/migrations/2021_02_24_095050_create_flash_logs_table.php
+++ b/database/migrations/2021_02_24_095050_create_flash_logs_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -33,8 +31,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_03_26_124313_add_flashlog_columns.php b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
index 408f3601..e1520c09 100644
--- a/database/migrations/2021_03_26_124313_add_flashlog_columns.php
+++ b/database/migrations/2021_03_26_124313_add_flashlog_columns.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -21,8 +19,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_04_09_180304_add_device_datetime.php b/database/migrations/2021_04_09_180304_add_device_datetime.php
index a2583fc8..48f3b448 100644
--- a/database/migrations/2021_04_09_180304_add_device_datetime.php
+++ b/database/migrations/2021_04_09_180304_add_device_datetime.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
index e919b716..7d6569ff 100644
--- a/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
+++ b/database/migrations/2021_04_09_220304_add_device_datetime_offset.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
index 7cfdeb94..ed83f2e8 100644
--- a/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170653_add_queen_hive_delete_foreign_key.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
index f8f23160..ba605473 100644
--- a/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
+++ b/database/migrations/2021_04_20_170800_add_device_sensor_definition_delete_foreign_key.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -21,8 +19,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
index 0c5cad3c..2032c2e3 100644
--- a/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
+++ b/database/migrations/2021_05_03_101244_change_sensors_offset_float_to_double.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
index 668f6909..99035719 100644
--- a/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
+++ b/database/migrations/2021_05_05_133125_add_alert_on_occurences_to_alert_rules.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
index f9e34ed5..da4a3597 100644
--- a/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
+++ b/database/migrations/2021_05_12_191500_add_alert_rules_last_evaluated.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
index 952b526b..6f81de67 100644
--- a/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
+++ b/database/migrations/2021_05_27_143213_add_flashlog_time_percentage.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_09_20_150053_add_count_to_alerts.php b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
index 5838577b..8d3624c5 100644
--- a/database/migrations/2021_09_20_150053_add_count_to_alerts.php
+++ b/database/migrations/2021_09_20_150053_add_count_to_alerts.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
index c505228a..c3f3c32a 100644
--- a/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
+++ b/database/migrations/2021_09_23_112134_add_show_in_alerts_to_measurements.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -21,8 +19,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_09_27_122352_remove_unused_tables.php b/database/migrations/2021_09_27_122352_remove_unused_tables.php
index a74f5950..2b2b4e11 100644
--- a/database/migrations/2021_09_27_122352_remove_unused_tables.php
+++ b/database/migrations/2021_09_27_122352_remove_unused_tables.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
index bc41e939..63cacfbc 100644
--- a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
+++ b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
@@ -6,8 +6,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -17,8 +15,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
index 4c026320..a0f7db1d 100644
--- a/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
+++ b/database/migrations/2021_09_28_102346_correct_hive_b_b_depth_and_height.php
@@ -9,8 +9,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -33,8 +31,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
index 3cfb5a32..b9b15275 100644
--- a/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
+++ b/database/migrations/2021_10_02_194618_add_weather_boolean_to_measurements.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
index f2067031..b049a20a 100644
--- a/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
+++ b/database/migrations/2021_10_15_103342_add_rate_limit_to_user.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
index 549fa049..da8266d0 100644
--- a/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
+++ b/database/migrations/2021_10_29_134428_add_former_key_list_to_device.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
index 4b92a56a..8c196b04 100644
--- a/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
+++ b/database/migrations/2022_01_25_152440_add_persisted_days_to_flashlog.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -21,8 +19,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
index 61760572..c9b4e3ef 100644
--- a/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
+++ b/database/migrations/2022_01_26_131359_add_default_user_ids_to_researches.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
index 7cd6fedc..5b15f25e 100644
--- a/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
+++ b/database/migrations/2022_02_23_094732_add_flashlog_persisted_block_ids.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_06_20_093325_add_queen_birth_date.php b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
index b4b0a99e..19ca00f3 100644
--- a/database/migrations/2022_06_20_093325_add_queen_birth_date.php
+++ b/database/migrations/2022_06_20_093325_add_queen_birth_date.php
@@ -9,8 +9,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -29,8 +27,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2022_06_20_123603_create_hive_tags_table.php b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
index fc1a6b05..2107a2b3 100644
--- a/database/migrations/2022_06_20_123603_create_hive_tags_table.php
+++ b/database/migrations/2022_06_20_123603_create_hive_tags_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -25,8 +23,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_02_08_102518_add_visible_to_research.php b/database/migrations/2023_02_08_102518_add_visible_to_research.php
index e7458295..b4d74974 100644
--- a/database/migrations/2023_02_08_102518_add_visible_to_research.php
+++ b/database/migrations/2023_02_08_102518_add_visible_to_research.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
index 7b7093a7..cc37a851 100644
--- a/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
+++ b/database/migrations/2023_03_06_112218_add_on_invite_only_to_research.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
index 8b6b2d10..ecd20218 100644
--- a/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
+++ b/database/migrations/2023_03_22_135520_create_dashboard_groups_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -34,8 +32,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_04_03_083652_create_organizations_table.php b/database/migrations/2023_04_03_083652_create_organizations_table.php
index d586b091..fbd26e39 100644
--- a/database/migrations/2023_04_03_083652_create_organizations_table.php
+++ b/database/migrations/2023_04_03_083652_create_organizations_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -84,8 +82,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index 93c5c402..8cdf36f4 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -51,8 +49,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
index d0ce38a1..a1f6e60d 100644
--- a/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
+++ b/database/migrations/2023_05_10_120312_create_checklist_svgs_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -26,8 +24,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
index 351a8dee..d7e4bdd9 100644
--- a/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
+++ b/database/migrations/2023_08_30_090001_create_alert_rule_formulas_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -53,8 +51,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_08_30_135044_add_source_to_measurement.php b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
index be018cb4..656684fe 100644
--- a/database/migrations/2023_08_30_135044_add_source_to_measurement.php
+++ b/database/migrations/2023_08_30_135044_add_source_to_measurement.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -22,8 +20,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
index cc218708..7ae029fa 100644
--- a/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
+++ b/database/migrations/2023_08_31_081247_add_future_to_alert_rule_formulas.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -51,8 +49,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_09_06_090804_add_future_to_measurement.php b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
index f3807602..887edeba 100644
--- a/database/migrations/2023_09_06_090804_add_future_to_measurement.php
+++ b/database/migrations/2023_09_06_090804_add_future_to_measurement.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
index 8cb18163..897dc646 100644
--- a/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
+++ b/database/migrations/2023_09_06_101511_add_app_version_to_checklist_svgs.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_09_25_154132_create_calculation_models_table.php b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
index 5d077aad..e4925801 100644
--- a/database/migrations/2023_09_25_154132_create_calculation_models_table.php
+++ b/database/migrations/2023_09_25_154132_create_calculation_models_table.php
@@ -7,8 +7,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -33,8 +31,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
index 11e82069..ae4443ce 100644
--- a/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
+++ b/database/migrations/2023_09_25_174447_add_evaluation_results_to_alert_rule_formulas.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -24,8 +22,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
index 6867998e..79d00e75 100644
--- a/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
+++ b/database/migrations/2024_09_28_220019_add_rtc_to_devices.php
@@ -9,8 +9,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -29,8 +27,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
index d1723087..1b46dd77 100644
--- a/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
+++ b/database/migrations/2025_05_01_213400_add_recalculate_to_sensor_definitions.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_05_20_131603_add_flash_log_dates.php b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
index 3cd3358a..9d5c7994 100644
--- a/database/migrations/2025_05_20_131603_add_flash_log_dates.php
+++ b/database/migrations/2025_05_20_131603_add_flash_log_dates.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -23,8 +21,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
index dc7e425a..fdadbb65 100644
--- a/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
+++ b/database/migrations/2025_05_26_094603_add_flash_log_meta_data.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
index aa2180f2..ddda960c 100644
--- a/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
+++ b/database/migrations/2025_06_05_073900_add_log_validation_to_devices.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
index 2f618ba2..ba8de3d9 100644
--- a/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
+++ b/database/migrations/2025_09_16_235556_add_time_corrections_to_flashlog.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
index 2653aadc..0cb27fa5 100644
--- a/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
+++ b/database/migrations/2025_11_28_141954_add_flash_log_valid_override.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -20,8 +18,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/migrations/2026_06_01_000000_rename_password_resets_table.php b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
index ab300e6e..f0ad3757 100644
--- a/database/migrations/2026_06_01_000000_rename_password_resets_table.php
+++ b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
@@ -8,8 +8,6 @@
{
/**
* Run the migrations.
- *
- * @return void
*/
public function up(): void
{
@@ -18,8 +16,6 @@ public function up(): void
/**
* Reverse the migrations.
- *
- * @return void
*/
public function down(): void
{
diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php
index e2ca138a..2b3ae587 100644
--- a/database/seeders/DatabaseSeeder.php
+++ b/database/seeders/DatabaseSeeder.php
@@ -8,8 +8,6 @@ class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
- *
- * @return void
*/
public function run(): void
{
diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php
index 9a34d261..8c5575e4 100644
--- a/database/seeders/UserSeeder.php
+++ b/database/seeders/UserSeeder.php
@@ -9,8 +9,6 @@ class UserSeeder extends Seeder
{
/**
* Run the database seeds.
- *
- * @return void
*/
public function run(): void
{
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
index a2777b2d..709f5a49 100644
--- a/tests/ExampleTest.php
+++ b/tests/ExampleTest.php
@@ -4,8 +4,6 @@ class ExampleTest extends TestCase
{
/**
* A basic functional test example.
- *
- * @return void
*/
public function test_basic_example(): void
{
From b0d0e50d518758f5cefc547eff8cc32232dfb804 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 13:25:04 +0000
Subject: [PATCH 073/127] Shift cleanup
---
app/Category.php | 4 ++--
app/CategoryInput.php | 2 +-
app/Checklist.php | 2 +-
app/Device.php | 4 ++--
app/Group.php | 2 +-
app/Hive.php | 10 +++++-----
app/HiveLayer.php | 4 ++--
app/HiveLayerFrame.php | 2 +-
app/Http/Controllers/AlertController.php | 4 ++--
app/Http/Controllers/AlertRuleController.php | 4 ++--
app/Http/Controllers/AlertRuleFormulaController.php | 4 ++--
app/Http/Controllers/Api/AlertController.php | 2 +-
app/Http/Controllers/Api/AlertRuleController.php | 2 +-
.../Controllers/Api/Auth/VerificationController.php | 2 +-
app/Http/Controllers/Api/CategoryController.php | 2 +-
app/Http/Controllers/Api/ChecklistController.php | 2 +-
app/Http/Controllers/Api/ChecklistSvgController.php | 2 +-
app/Http/Controllers/Api/DashboardGroupController.php | 2 +-
app/Http/Controllers/Api/DeviceController.php | 2 +-
app/Http/Controllers/Api/ExportController.php | 2 +-
app/Http/Controllers/Api/FlashLogController.php | 2 +-
app/Http/Controllers/Api/GroupController.php | 2 +-
app/Http/Controllers/Api/HiveController.php | 2 +-
app/Http/Controllers/Api/HiveTagsController.php | 2 +-
app/Http/Controllers/Api/ImageController.php | 2 +-
app/Http/Controllers/Api/InspectionsController.php | 2 +-
app/Http/Controllers/Api/LocationController.php | 2 +-
app/Http/Controllers/Api/MeasurementController.php | 2 +-
app/Http/Controllers/Api/QueenController.php | 2 +-
app/Http/Controllers/Api/ResearchController.php | 2 +-
app/Http/Controllers/Api/ResearchDataController.php | 2 +-
app/Http/Controllers/Api/SampleCodeController.php | 2 +-
.../Controllers/Api/SensorDefinitionController.php | 2 +-
app/Http/Controllers/Api/SettingController.php | 2 +-
app/Http/Controllers/Api/UserController.php | 2 +-
app/Http/Controllers/Api/WeatherController.php | 2 +-
app/Http/Controllers/Auth/LoginController.php | 2 +-
app/Http/Controllers/CalculationModelController.php | 4 ++--
app/Http/Controllers/CategoriesController.php | 6 +++---
app/Http/Controllers/CategoryInputsController.php | 4 ++--
app/Http/Controllers/ChecklistController.php | 4 ++--
app/Http/Controllers/ChecklistSvgController.php | 4 ++--
app/Http/Controllers/DashboardController.php | 2 +-
app/Http/Controllers/DashboardGroupController.php | 4 ++--
app/Http/Controllers/DeviceController.php | 4 ++--
app/Http/Controllers/FlashLogController.php | 4 ++--
app/Http/Controllers/GroupController.php | 4 ++--
app/Http/Controllers/HiveTagsController.php | 4 ++--
app/Http/Controllers/ImageController.php | 4 ++--
app/Http/Controllers/InspectionItemsController.php | 4 ++--
app/Http/Controllers/InspectionsController.php | 4 ++--
app/Http/Controllers/LanguageController.php | 4 ++--
app/Http/Controllers/MeasurementController.php | 4 ++--
app/Http/Controllers/PermissionController.php | 4 ++--
app/Http/Controllers/PhysicalQuantityController.php | 4 ++--
app/Http/Controllers/ResearchController.php | 4 ++--
app/Http/Controllers/RoleController.php | 4 ++--
app/Http/Controllers/SampleCodeController.php | 4 ++--
app/Http/Controllers/SensorDefinitionController.php | 4 ++--
app/Http/Controllers/TaxonomyController.php | 2 +-
app/Http/Controllers/TranslationController.php | 6 +++---
app/Http/Controllers/UserController.php | 4 ++--
app/Http/Middleware/EnsureWebappEmailIsVerified.php | 2 +-
app/Image.php | 2 +-
app/Inspection.php | 8 ++++----
app/InspectionItem.php | 2 +-
app/Language.php | 2 +-
app/Location.php | 10 +++++-----
app/Measurement.php | 2 +-
app/Models/Alert.php | 2 +-
app/Models/AlertRule.php | 4 ++--
app/Models/AlertRuleFormula.php | 2 +-
app/Models/CalculationModel.php | 2 +-
app/Models/ChecklistSvg.php | 2 +-
app/Models/DashboardGroup.php | 2 +-
app/Models/FlashLog.php | 2 +-
app/Models/HiveTag.php | 2 +-
app/PhysicalQuantity.php | 2 +-
app/Queen.php | 4 ++--
app/Research.php | 4 ++--
app/SampleCode.php | 2 +-
app/SensorDefinition.php | 2 +-
app/Setting.php | 2 +-
app/Taxonomy.php | 2 +-
app/Translation.php | 2 +-
app/User.php | 6 +++---
config/app.php | 2 +-
config/logging.php | 2 +-
.../2026_06_01_000000_rename_password_resets_table.php | 1 -
89 files changed, 135 insertions(+), 136 deletions(-)
diff --git a/app/Category.php b/app/Category.php
index d4c6ad99..b70c9dcb 100644
--- a/app/Category.php
+++ b/app/Category.php
@@ -2,10 +2,10 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
diff --git a/app/CategoryInput.php b/app/CategoryInput.php
index 5423c8f1..c261849e 100644
--- a/app/CategoryInput.php
+++ b/app/CategoryInput.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use LaravelLocalization;
class CategoryInput extends Model
diff --git a/app/Checklist.php b/app/Checklist.php
index 8e6f865b..f4a4d340 100644
--- a/app/Checklist.php
+++ b/app/Checklist.php
@@ -2,9 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Auth;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
diff --git a/app/Device.php b/app/Device.php
index 9fe27b41..d6b5eb1c 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -2,8 +2,6 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\Alert;
use App\Models\FlashLog;
use Auth;
@@ -11,6 +9,8 @@
use DB;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
use InfluxDB;
diff --git a/app/Group.php b/app/Group.php
index 42861c05..25142cbf 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -2,12 +2,12 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Auth;
use Cache;
use DB;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Hive.php b/app/Hive.php
index 19f25361..48588dc8 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -2,16 +2,16 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasOne;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasManyThrough;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index 11c62c43..9e7675b6 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -2,11 +2,11 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use Cache;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index 1e9c80d1..20e82edd 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -2,9 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class HiveLayerFrame extends Model
diff --git a/app/Http/Controllers/AlertController.php b/app/Http/Controllers/AlertController.php
index 985126e7..a779d8b3 100644
--- a/app/Http/Controllers/AlertController.php
+++ b/app/Http/Controllers/AlertController.php
@@ -2,11 +2,11 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\Alert;
use App\User;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class AlertController extends Controller
{
diff --git a/app/Http/Controllers/AlertRuleController.php b/app/Http/Controllers/AlertRuleController.php
index f2e0d2cc..e2d9256b 100644
--- a/app/Http/Controllers/AlertRuleController.php
+++ b/app/Http/Controllers/AlertRuleController.php
@@ -2,13 +2,13 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\AlertRule;
use App\User;
use Cache;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
+use Illuminate\View\View;
class AlertRuleController extends Controller
{
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index 8168aaab..0c4a8df2 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\AlertRuleFormula;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class AlertRuleFormulaController extends Controller
{
diff --git a/app/Http/Controllers/Api/AlertController.php b/app/Http/Controllers/Api/AlertController.php
index c4d64535..7c99037c 100644
--- a/app/Http/Controllers/Api/AlertController.php
+++ b/app/Http/Controllers/Api/AlertController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Models\Alert;
use Auth;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/AlertRuleController.php b/app/Http/Controllers/Api/AlertRuleController.php
index dfa5804b..260a6b12 100644
--- a/app/Http/Controllers/Api/AlertRuleController.php
+++ b/app/Http/Controllers/Api/AlertRuleController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Models\AlertRule;
use App\Models\AlertRuleFormula;
use Auth;
use Cache;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Validator;
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index 8a0ad037..46e4d875 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -2,11 +2,11 @@
namespace App\Http\Controllers\Api\Auth;
-use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\VerifiesEmails;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/CategoryController.php b/app/Http/Controllers/Api/CategoryController.php
index 8c456be2..d398040b 100644
--- a/app/Http/Controllers/Api/CategoryController.php
+++ b/app/Http/Controllers/Api/CategoryController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\CategoryInput;
use App\Http\Controllers\Controller;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/ChecklistController.php b/app/Http/Controllers/Api/ChecklistController.php
index 10aa974e..c63a4f61 100644
--- a/app/Http/Controllers/Api/ChecklistController.php
+++ b/app/Http/Controllers/Api/ChecklistController.php
@@ -2,9 +2,9 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Checklist;
use App\Http\Controllers\Controller;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/ChecklistSvgController.php b/app/Http/Controllers/Api/ChecklistSvgController.php
index 2e5cfdac..7c289e3c 100644
--- a/app/Http/Controllers/Api/ChecklistSvgController.php
+++ b/app/Http/Controllers/Api/ChecklistSvgController.php
@@ -2,8 +2,8 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/DashboardGroupController.php b/app/Http/Controllers/Api/DashboardGroupController.php
index 14a3ecbc..89f94df1 100644
--- a/app/Http/Controllers/Api/DashboardGroupController.php
+++ b/app/Http/Controllers/Api/DashboardGroupController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Hive;
use App\Http\Controllers\Controller;
use App\Measurement;
use App\Models\DashboardGroup;
use Cache;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Str;
diff --git a/app/Http/Controllers/Api/DeviceController.php b/app/Http/Controllers/Api/DeviceController.php
index 0f32ba9a..a5d5b9d8 100644
--- a/app/Http/Controllers/Api/DeviceController.php
+++ b/app/Http/Controllers/Api/DeviceController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Device;
use App\Inspection;
@@ -11,6 +10,7 @@
use Auth;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Rule;
diff --git a/app/Http/Controllers/Api/ExportController.php b/app/Http/Controllers/Api/ExportController.php
index 27a18617..381c82c4 100644
--- a/app/Http/Controllers/Api/ExportController.php
+++ b/app/Http/Controllers/Api/ExportController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Device;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -11,6 +10,7 @@
use App\Measurement;
use App\User;
use Cache;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
diff --git a/app/Http/Controllers/Api/FlashLogController.php b/app/Http/Controllers/Api/FlashLogController.php
index 49b80365..9d466184 100644
--- a/app/Http/Controllers/Api/FlashLogController.php
+++ b/app/Http/Controllers/Api/FlashLogController.php
@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Device;
use App\Http\Controllers\Controller;
use App\Measurement;
use App\Models\FlashLog;
use Auth;
use Cache;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
diff --git a/app/Http/Controllers/Api/GroupController.php b/app/Http/Controllers/Api/GroupController.php
index 3bd3119f..a6f42796 100644
--- a/app/Http/Controllers/Api/GroupController.php
+++ b/app/Http/Controllers/Api/GroupController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Group;
use App\Http\Controllers\Controller;
use App\Mail\GroupAcceptation;
@@ -11,6 +10,7 @@
use App\User;
use Auth;
use DB;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Mail;
diff --git a/app/Http/Controllers/Api/HiveController.php b/app/Http/Controllers/Api/HiveController.php
index f33acb73..d792d59a 100644
--- a/app/Http/Controllers/Api/HiveController.php
+++ b/app/Http/Controllers/Api/HiveController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Hive;
use App\HiveFactory;
@@ -10,6 +9,7 @@
use App\Http\Requests\PostHiveRequest;
use App\Location;
use App\Queen;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/HiveTagsController.php b/app/Http/Controllers/Api/HiveTagsController.php
index 45f50e40..cc7e4463 100644
--- a/app/Http/Controllers/Api/HiveTagsController.php
+++ b/app/Http/Controllers/Api/HiveTagsController.php
@@ -2,8 +2,8 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Validator;
diff --git a/app/Http/Controllers/Api/ImageController.php b/app/Http/Controllers/Api/ImageController.php
index 59c2ab66..48bff4e5 100644
--- a/app/Http/Controllers/Api/ImageController.php
+++ b/app/Http/Controllers/Api/ImageController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Image;
use Auth;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/InspectionsController.php b/app/Http/Controllers/Api/InspectionsController.php
index b51420b4..bebc549b 100644
--- a/app/Http/Controllers/Api/InspectionsController.php
+++ b/app/Http/Controllers/Api/InspectionsController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -10,6 +9,7 @@
use App\Inspection;
use App\InspectionItem;
use Auth;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use LaravelLocalization;
use Moment\Moment;
diff --git a/app/Http/Controllers/Api/LocationController.php b/app/Http/Controllers/Api/LocationController.php
index 00fc213f..86154a8f 100644
--- a/app/Http/Controllers/Api/LocationController.php
+++ b/app/Http/Controllers/Api/LocationController.php
@@ -2,13 +2,13 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Continent;
use App\HiveFactory;
use App\Http\Controllers\Controller;
use App\Http\Requests\PostLocationRequest;
use App\Location;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Validator;
diff --git a/app/Http/Controllers/Api/MeasurementController.php b/app/Http/Controllers/Api/MeasurementController.php
index 8671bfde..0169de82 100644
--- a/app/Http/Controllers/Api/MeasurementController.php
+++ b/app/Http/Controllers/Api/MeasurementController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Device;
use App\Measurement;
@@ -17,6 +16,7 @@
use Auth;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
// use App\Transformer\SensorTransformer;
use Illuminate\Support\Facades\Cache;
diff --git a/app/Http/Controllers/Api/QueenController.php b/app/Http/Controllers/Api/QueenController.php
index 2c1a8d99..1df55b8c 100644
--- a/app/Http/Controllers/Api/QueenController.php
+++ b/app/Http/Controllers/Api/QueenController.php
@@ -2,9 +2,9 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Queen;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/ResearchController.php b/app/Http/Controllers/Api/ResearchController.php
index fdf7574e..b7dc1089 100644
--- a/app/Http/Controllers/Api/ResearchController.php
+++ b/app/Http/Controllers/Api/ResearchController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Research;
use DB;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Moment\Moment;
diff --git a/app/Http/Controllers/Api/ResearchDataController.php b/app/Http/Controllers/Api/ResearchDataController.php
index 330d68e0..5355c6de 100644
--- a/app/Http/Controllers/Api/ResearchDataController.php
+++ b/app/Http/Controllers/Api/ResearchDataController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Device;
use App\Hive;
use App\Http\Controllers\Controller;
@@ -13,6 +12,7 @@
use App\User;
use Cache;
use DB;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Rule;
diff --git a/app/Http/Controllers/Api/SampleCodeController.php b/app/Http/Controllers/Api/SampleCodeController.php
index 5fbb852c..bed1f1a4 100644
--- a/app/Http/Controllers/Api/SampleCodeController.php
+++ b/app/Http/Controllers/Api/SampleCodeController.php
@@ -2,9 +2,9 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\SampleCode;
use Auth;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
/**
diff --git a/app/Http/Controllers/Api/SensorDefinitionController.php b/app/Http/Controllers/Api/SensorDefinitionController.php
index 0565ca03..7afc4165 100644
--- a/app/Http/Controllers/Api/SensorDefinitionController.php
+++ b/app/Http/Controllers/Api/SensorDefinitionController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use App\Measurement;
use App\SensorDefinition;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
diff --git a/app/Http/Controllers/Api/SettingController.php b/app/Http/Controllers/Api/SettingController.php
index 047fd4a4..b2ab54bb 100644
--- a/app/Http/Controllers/Api/SettingController.php
+++ b/app/Http/Controllers/Api/SettingController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\Category;
use App\Http\Controllers\Controller;
use App\Setting;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Response;
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index 477577f2..e12b8ab9 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Http\JsonResponse;
use App\ChecklistFactory;
use App\User;
use Auth;
use Hash;
use Illuminate\Auth\Events\Login as ApiTokenLogin;
+use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Str;
diff --git a/app/Http/Controllers/Api/WeatherController.php b/app/Http/Controllers/Api/WeatherController.php
index d7bb3d8c..4c54cb6e 100644
--- a/app/Http/Controllers/Api/WeatherController.php
+++ b/app/Http/Controllers/Api/WeatherController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\View\View;
use App\Http\Controllers\Controller;
use App\Weather;
use Illuminate\Http\Request;
+use Illuminate\View\View;
/**
* @group Api\WeatherController
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 5d3ad215..e6139d8a 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
+use Illuminate\Http\RedirectResponse;
class LoginController extends Controller
{
diff --git a/app/Http/Controllers/CalculationModelController.php b/app/Http/Controllers/CalculationModelController.php
index 8eb01c14..e111a7b5 100644
--- a/app/Http/Controllers/CalculationModelController.php
+++ b/app/Http/Controllers/CalculationModelController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\CalculationModel;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class CalculationModelController extends Controller
{
diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.php
index 7c68f22b..cd7ab59f 100755
--- a/app/Http/Controllers/CategoriesController.php
+++ b/app/Http/Controllers/CategoriesController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Category;
use App\CategoryFactory;
use App\CategoryInput;
@@ -11,8 +9,10 @@
use App\PhysicalQuantity;
use App\Translation;
use DB;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
+use Illuminate\View\View;
use Image;
use Kalnoy\Nestedset\Collection;
use Storage;
@@ -534,7 +534,7 @@ protected function makeOptions(Collection $items): static
return $options;
}
- protected function getCategoryOptions(Category $except = null): CategoriesController
+ protected function getCategoryOptions(?Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
$query = Category::select('id', 'name')->withDepth();
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index 7d6210dc..09579a43 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -2,11 +2,11 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\CategoryInput;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
+use Illuminate\View\View;
class CategoryInputsController extends Controller
{
diff --git a/app/Http/Controllers/ChecklistController.php b/app/Http/Controllers/ChecklistController.php
index ad4cb809..4a240ad8 100644
--- a/app/Http/Controllers/ChecklistController.php
+++ b/app/Http/Controllers/ChecklistController.php
@@ -2,15 +2,15 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Category;
use App\CategoryFactory;
use App\Checklist;
use App\User;
use Auth;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
+use Illuminate\View\View;
use LaravelLocalization;
class ChecklistController extends Controller
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index 5e908e09..471b834b 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\ChecklistSvg;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class ChecklistSvgController extends Controller
{
diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php
index 0c06ae60..6dd2cc66 100644
--- a/app/Http/Controllers/DashboardController.php
+++ b/app/Http/Controllers/DashboardController.php
@@ -2,7 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
use App\Category;
use App\Checklist;
use App\Device;
@@ -20,6 +19,7 @@
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
+use Illuminate\View\View;
use Moment\Moment;
class DashboardController extends Controller
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index 04fec6e8..972c0adb 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -2,13 +2,13 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\DashboardGroup;
use Auth;
use Cache;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
+use Illuminate\View\View;
use Str;
class DashboardGroupController extends Controller
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index 455dda31..01f89214 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Device;
use App\Hive;
@@ -13,8 +11,10 @@
use App\User;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
+use Illuminate\View\View;
class DeviceController extends Controller
{
diff --git a/app/Http/Controllers/FlashLogController.php b/app/Http/Controllers/FlashLogController.php
index 339ca500..a555d5fd 100644
--- a/app/Http/Controllers/FlashLogController.php
+++ b/app/Http/Controllers/FlashLogController.php
@@ -2,15 +2,15 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Models\CalculationModel;
use App\Models\FlashLog;
use App\SensorDefinition;
use App\User;
use Carbon\Carbon;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
use Storage;
class FlashLogController extends Controller
diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php
index cfa2f755..727960c1 100644
--- a/app/Http/Controllers/GroupController.php
+++ b/app/Http/Controllers/GroupController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Group;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class GroupController extends Controller
{
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index 6a47c258..f37dca69 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Models\HiveTag;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class HiveTagsController extends Controller
{
diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php
index b26ea87d..52657aa1 100644
--- a/app/Http/Controllers/ImageController.php
+++ b/app/Http/Controllers/ImageController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Image;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class ImageController extends Controller
{
diff --git a/app/Http/Controllers/InspectionItemsController.php b/app/Http/Controllers/InspectionItemsController.php
index 2bb0bca4..75bc3ea2 100644
--- a/app/Http/Controllers/InspectionItemsController.php
+++ b/app/Http/Controllers/InspectionItemsController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\InspectionItem;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class InspectionItemsController extends Controller
{
diff --git a/app/Http/Controllers/InspectionsController.php b/app/Http/Controllers/InspectionsController.php
index 7b4f64ca..05fbb889 100644
--- a/app/Http/Controllers/InspectionsController.php
+++ b/app/Http/Controllers/InspectionsController.php
@@ -2,11 +2,11 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Inspection;
use Auth;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class InspectionsController extends Controller
{
diff --git a/app/Http/Controllers/LanguageController.php b/app/Http/Controllers/LanguageController.php
index 8851b32b..0e78de6f 100644
--- a/app/Http/Controllers/LanguageController.php
+++ b/app/Http/Controllers/LanguageController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Language;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class LanguageController extends Controller
{
diff --git a/app/Http/Controllers/MeasurementController.php b/app/Http/Controllers/MeasurementController.php
index 123e18c2..d73cbf52 100644
--- a/app/Http/Controllers/MeasurementController.php
+++ b/app/Http/Controllers/MeasurementController.php
@@ -2,11 +2,11 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Measurement;
use Cache;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class MeasurementController extends Controller
{
diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php
index ea812f3a..dbf5290c 100644
--- a/app/Http/Controllers/PermissionController.php
+++ b/app/Http/Controllers/PermissionController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Permission;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class PermissionController extends Controller
{
diff --git a/app/Http/Controllers/PhysicalQuantityController.php b/app/Http/Controllers/PhysicalQuantityController.php
index 448138cf..51c051a9 100644
--- a/app/Http/Controllers/PhysicalQuantityController.php
+++ b/app/Http/Controllers/PhysicalQuantityController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\PhysicalQuantity;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class PhysicalQuantityController extends Controller
{
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index 8e2954f6..1b992112 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -2,8 +2,6 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Hive;
use App\Inspection;
@@ -17,8 +15,10 @@
use Auth;
use Cache;
use DB;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
+use Illuminate\View\View;
use InfluxDB;
use Moment\Moment;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index 4fdfab16..2ca99fc7 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Permission;
use App\Role;
use DB;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class RoleController extends Controller
{
diff --git a/app/Http/Controllers/SampleCodeController.php b/app/Http/Controllers/SampleCodeController.php
index 276b8198..e01832c3 100644
--- a/app/Http/Controllers/SampleCodeController.php
+++ b/app/Http/Controllers/SampleCodeController.php
@@ -2,16 +2,16 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Inspection;
use App\InspectionItem;
use App\Mail\SampleCodeMail;
use App\SampleCode;
use Auth;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
+use Illuminate\View\View;
use LaravelLocalization;
use Mail;
use Moment\Moment;
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index 20c5c081..b0695d59 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -2,13 +2,13 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Measurement;
use App\SensorDefinition;
use App\User;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
class SensorDefinitionController extends Controller
{
diff --git a/app/Http/Controllers/TaxonomyController.php b/app/Http/Controllers/TaxonomyController.php
index 3bd25f0f..02bd9a97 100644
--- a/app/Http/Controllers/TaxonomyController.php
+++ b/app/Http/Controllers/TaxonomyController.php
@@ -2,8 +2,8 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
use App\Category;
+use Illuminate\View\View;
use LaravelLocalization;
class TaxonomyController extends Controller
diff --git a/app/Http/Controllers/TranslationController.php b/app/Http/Controllers/TranslationController.php
index 7b9fac28..cbf2077f 100644
--- a/app/Http/Controllers/TranslationController.php
+++ b/app/Http/Controllers/TranslationController.php
@@ -2,15 +2,15 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Category;
use App\Language;
use App\Measurement;
use App\Models\AlertRule;
use App\PhysicalQuantity;
use App\Translation;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\View\View;
use Kalnoy\Nestedset\Collection;
class TranslationController extends Controller
@@ -117,7 +117,7 @@ protected function makeOptions(Collection $items): static
return $options;
}
- protected function getCategoryOptions(Category $except = null): CategoriesController
+ protected function getCategoryOptions(?Category $except = null): CategoriesController
{
/** @var \Kalnoy\Nestedset\QueryBuilder $query */
$query = Category::select('id', 'name')->withDepth();
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index 0d743e9b..5e8d4e39 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -2,16 +2,16 @@
namespace App\Http\Controllers;
-use Illuminate\View\View;
-use Illuminate\Http\RedirectResponse;
use App\Device;
use App\Role;
use App\User;
use Auth;
use DB;
use Hash;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
+use Illuminate\View\View;
use InterventionImage;
use Storage;
diff --git a/app/Http/Middleware/EnsureWebappEmailIsVerified.php b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
index 0ec16ee4..2917a516 100644
--- a/app/Http/Middleware/EnsureWebappEmailIsVerified.php
+++ b/app/Http/Middleware/EnsureWebappEmailIsVerified.php
@@ -2,9 +2,9 @@
namespace App\Http\Middleware;
-use Illuminate\Http\Request;
use Closure;
use Illuminate\Contracts\Auth\MustVerifyEmail;
+use Illuminate\Http\Request;
use Response;
class EnsureWebappEmailIsVerified
diff --git a/app/Image.php b/app/Image.php
index fd6a82de..4c56234b 100644
--- a/app/Image.php
+++ b/app/Image.php
@@ -2,9 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
use InterventionImage;
use Moment\Moment;
diff --git a/app/Inspection.php b/app/Inspection.php
index 2dd5daad..00db53ae 100644
--- a/app/Inspection.php
+++ b/app/Inspection.php
@@ -2,14 +2,14 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\HasMany;
-use Illuminate\Database\Eloquent\Relations\HasOne;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
use LaravelLocalization;
diff --git a/app/InspectionItem.php b/app/InspectionItem.php
index d4b52a43..448938b9 100644
--- a/app/InspectionItem.php
+++ b/app/InspectionItem.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
class InspectionItem extends Model
diff --git a/app/Language.php b/app/Language.php
index e0fcd132..5517118e 100644
--- a/app/Language.php
+++ b/app/Language.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Language extends Model
{
diff --git a/app/Location.php b/app/Location.php
index 2468fc94..464ce8fb 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -2,16 +2,16 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasMany;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasManyThrough;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Measurement.php b/app/Measurement.php
index 2651d7c1..16e7e0de 100644
--- a/app/Measurement.php
+++ b/app/Measurement.php
@@ -2,9 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use LaravelLocalization;
class Measurement extends Model
diff --git a/app/Models/Alert.php b/app/Models/Alert.php
index b83c0f7f..02f3e8a6 100644
--- a/app/Models/Alert.php
+++ b/app/Models/Alert.php
@@ -2,13 +2,13 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Hive;
use App\Location;
use App\Measurement;
use App\User;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Alert extends Model
{
diff --git a/app/Models/AlertRule.php b/app/Models/AlertRule.php
index accf3e41..c32c271f 100644
--- a/app/Models/AlertRule.php
+++ b/app/Models/AlertRule.php
@@ -2,14 +2,14 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Device;
use App\Mail\AlertMail;
use App\Measurement;
use App\User;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Log;
use LaravelLocalization;
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index d3ac712a..8496d346 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -2,10 +2,10 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Measurement;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use LaravelLocalization;
use Translation;
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 32df1663..578c864b 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -2,12 +2,12 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Measurement;
use Cache;
use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Log;
use Moment\Moment;
diff --git a/app/Models/ChecklistSvg.php b/app/Models/ChecklistSvg.php
index 7925f947..c9af2d63 100644
--- a/app/Models/ChecklistSvg.php
+++ b/app/Models/ChecklistSvg.php
@@ -2,10 +2,10 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Checklist;
use App\User;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class ChecklistSvg extends Model
{
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index 4aec589a..978b3157 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -2,9 +2,9 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\User;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class DashboardGroup extends Model
{
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index fd65e2c9..36fa8102 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -2,7 +2,6 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Device;
use App\Hive;
use App\Measurement;
@@ -10,6 +9,7 @@
use App\User;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Moment\Moment;
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index f98f30bc..5ee3583e 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -2,10 +2,10 @@
namespace App\Models;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use App\Hive;
use App\User;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class HiveTag extends Model
{
diff --git a/app/PhysicalQuantity.php b/app/PhysicalQuantity.php
index 7e61889d..7702f23e 100644
--- a/app/PhysicalQuantity.php
+++ b/app/PhysicalQuantity.php
@@ -2,10 +2,10 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use Cache;
use DB;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasMany;
use LaravelLocalization;
class PhysicalQuantity extends Model
diff --git a/app/Queen.php b/app/Queen.php
index add6e825..7f36dbd3 100644
--- a/app/Queen.php
+++ b/app/Queen.php
@@ -2,11 +2,11 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Research.php b/app/Research.php
index dd350745..9112a992 100644
--- a/app/Research.php
+++ b/app/Research.php
@@ -2,11 +2,11 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Auth;
use DB;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Research extends Model
{
diff --git a/app/SampleCode.php b/app/SampleCode.php
index af1cb1d7..c6aa63b9 100644
--- a/app/SampleCode.php
+++ b/app/SampleCode.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SampleCode extends Model
{
diff --git a/app/SensorDefinition.php b/app/SensorDefinition.php
index 450107dd..fedd13db 100644
--- a/app/SensorDefinition.php
+++ b/app/SensorDefinition.php
@@ -2,9 +2,9 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Cache;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
diff --git a/app/Setting.php b/app/Setting.php
index 0cd2c8fd..8fba0ce7 100644
--- a/app/Setting.php
+++ b/app/Setting.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Setting extends Model
{
diff --git a/app/Taxonomy.php b/app/Taxonomy.php
index 0137478b..2e06df29 100644
--- a/app/Taxonomy.php
+++ b/app/Taxonomy.php
@@ -2,9 +2,9 @@
namespace App;
+use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
-use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
diff --git a/app/Translation.php b/app/Translation.php
index 654d4841..d988e434 100644
--- a/app/Translation.php
+++ b/app/Translation.php
@@ -2,8 +2,8 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Facades\DB;
use LaravelLocalization;
diff --git a/app/User.php b/app/User.php
index f38df651..545f460b 100644
--- a/app/User.php
+++ b/app/User.php
@@ -2,9 +2,6 @@
namespace App;
-use Illuminate\Database\Eloquent\Relations\HasManyThrough;
-use Illuminate\Database\Eloquent\Relations\BelongsToMany;
-use Illuminate\Database\Eloquent\Relations\HasMany;
use App\Models\Alert;
use App\Models\AlertRule;
use App\Models\ChecklistSvg;
@@ -17,6 +14,9 @@
use Cache;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Log;
diff --git a/config/app.php b/config/app.php
index 90c93782..6385cccb 100644
--- a/config/app.php
+++ b/config/app.php
@@ -1,7 +1,7 @@
Date: Mon, 1 Jun 2026 16:38:02 +0200
Subject: [PATCH 074/127] php to 8.2 + mcamara/laravel-localization to 2.3.0 +
cast DB::raw() explicitly to string
---
app/Http/Controllers/DashboardController.php | 6 +-
composer.json | 4 +-
composer.lock | 2091 ++++++++++-------
...021_09_27_134729_upgrade_db_to_utf8mb4.php | 10 +-
public/herd.yml | 2 +-
5 files changed, 1195 insertions(+), 918 deletions(-)
diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php
index 6dd2cc66..b8a38920 100644
--- a/app/Http/Controllers/DashboardController.php
+++ b/app/Http/Controllers/DashboardController.php
@@ -79,9 +79,9 @@ public function index(Request $request): View
// Active users query:
$data['qrtusers_more_5_hives'] = count(DB::select(DB::raw('SELECT hives.`user_id`, COUNT(hives.`id`) as hive_cnt, users.`created_at`, users.`last_login` FROM hives
- INNER JOIN users ON hives.`user_id` = users.`id`
- WHERE hives.`deleted_at` IS NULL AND users.`created_at` != users.`updated_at` AND users.`last_login` > \''.$last_qrt.'\'
- GROUP BY hives.`user_id` HAVING hive_cnt > 5')));
+ INNER JOIN users ON hives.`user_id` = users.`id`
+ WHERE hives.`deleted_at` IS NULL AND users.`created_at` != users.`updated_at` AND users.`last_login` > \''.$last_qrt.'\'
+ GROUP BY hives.`user_id` HAVING hive_cnt > 5')->getValue(DB::connection()->getQueryGrammar())));
$data['yearusers'] = User::whereDate('last_login', '>', $last_year)->count();
$data['locations'] = Location::count();
diff --git a/composer.json b/composer.json
index 7a49146f..63ecd7fe 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"league/flysystem-aws-s3-v3": "^3.0",
- "mcamara/laravel-localization": "^1.7",
+ "mcamara/laravel-localization": "2.3.0",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^7.2",
@@ -49,7 +49,7 @@
"preferred-install": "dist",
"sort-packages": true,
"platform": {
- "php": "8.0.30"
+ "php": "8.2"
},
"allow-plugins": {
"kylekatarnls/update-helper": true,
diff --git a/composer.lock b/composer.lock
index e52e68cd..78d64c5e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "4cbeae6cac4f7d690906027a497fafa7",
+ "content-hash": "64327e7daaa8f7c86f202b84281e638b",
"packages": [
{
"name": "aws/aws-crt-php",
@@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.337.3",
+ "version": "3.383.1",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "06dfc8f76423b49aaa181debd25bbdc724c346d6"
+ "reference": "56b7ff3ff9e086eb3945bf31e75c97cde5ab531a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/06dfc8f76423b49aaa181debd25bbdc724c346d6",
- "reference": "06dfc8f76423b49aaa181debd25bbdc724c346d6",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/56b7ff3ff9e086eb3945bf31e75c97cde5ab531a",
+ "reference": "56b7ff3ff9e086eb3945bf31e75c97cde5ab531a",
"shasum": ""
},
"require": {
@@ -79,37 +79,36 @@
"ext-json": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
- "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5",
- "guzzlehttp/promises": "^1.4.0 || ^2.0",
- "guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
- "mtdowling/jmespath.php": "^2.6",
- "php": ">=7.2.5",
- "psr/http-message": "^1.0 || ^2.0"
+ "guzzlehttp/guzzle": "^7.4.5",
+ "guzzlehttp/promises": "^2.0",
+ "guzzlehttp/psr7": "^2.4.5",
+ "mtdowling/jmespath.php": "^2.8.0",
+ "php": ">=8.1",
+ "psr/http-message": "^1.0 || ^2.0",
+ "symfony/filesystem": "^v5.4.45 || ^v6.4.3 || ^v7.1.0 || ^v8.0.0"
},
"require-dev": {
"andrewsville/php-token-reflection": "^1.4",
"aws/aws-php-sns-message-validator": "~1.0",
"behat/behat": "~3.0",
- "composer/composer": "^1.10.22",
- "dms/phpunit-arraysubset-asserts": "^0.4.0",
+ "composer/composer": "^2.7.8",
+ "dms/phpunit-arraysubset-asserts": "^v0.5.0",
"doctrine/cache": "~1.4",
"ext-dom": "*",
"ext-openssl": "*",
- "ext-pcntl": "*",
"ext-sockets": "*",
- "nette/neon": "^2.3",
- "paragonie/random_compat": ">= 2",
- "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5",
- "psr/cache": "^1.0 || ^2.0 || ^3.0",
- "psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
- "sebastian/comparator": "^1.2.3 || ^4.0",
- "yoast/phpunit-polyfills": "^1.0"
+ "phpunit/phpunit": "^10.0",
+ "psr/cache": "^2.0 || ^3.0",
+ "psr/simple-cache": "^2.0 || ^3.0",
+ "sebastian/comparator": "^1.2.3 || ^4.0 || ^5.0",
+ "yoast/phpunit-polyfills": "^2.0"
},
"suggest": {
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
"doctrine/cache": "To use the DoctrineCacheAdapter",
"ext-curl": "To send requests using cURL",
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
+ "ext-pcntl": "To use client-side monitoring",
"ext-sockets": "To use client-side monitoring"
},
"type": "library",
@@ -136,11 +135,11 @@
"authors": [
{
"name": "Amazon Web Services",
- "homepage": "http://aws.amazon.com"
+ "homepage": "https://aws.amazon.com"
}
],
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
- "homepage": "http://aws.amazon.com/sdkforphp",
+ "homepage": "https://aws.amazon.com/sdk-for-php",
"keywords": [
"amazon",
"aws",
@@ -152,33 +151,33 @@
"sdk"
],
"support": {
- "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
+ "forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.337.3"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.383.1"
},
- "time": "2025-01-21T19:10:05+00:00"
+ "time": "2026-05-29T18:13:12+00:00"
},
{
"name": "brick/math",
- "version": "0.11.0",
+ "version": "0.12.3",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
- "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478"
+ "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478",
- "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478",
+ "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba",
+ "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba",
"shasum": ""
},
"require": {
- "php": "^8.0"
+ "php": "^8.1"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
- "phpunit/phpunit": "^9.0",
- "vimeo/psalm": "5.0.0"
+ "phpunit/phpunit": "^10.1",
+ "vimeo/psalm": "6.8.8"
},
"type": "library",
"autoload": {
@@ -198,12 +197,17 @@
"arithmetic",
"bigdecimal",
"bignum",
+ "bignumber",
"brick",
- "math"
+ "decimal",
+ "integer",
+ "math",
+ "mathematics",
+ "rational"
],
"support": {
"issues": "https://github.com/brick/math/issues",
- "source": "https://github.com/brick/math/tree/0.11.0"
+ "source": "https://github.com/brick/math/tree/0.12.3"
},
"funding": [
{
@@ -211,30 +215,30 @@
"type": "github"
}
],
- "time": "2023-01-15T23:15:59+00:00"
+ "time": "2025-02-28T13:11:00+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
- "version": "1.0.0",
+ "version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/CarbonPHP/carbon-doctrine-types.git",
- "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d"
+ "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/3c430083d0b41ceed84ecccf9dac613241d7305d",
- "reference": "3c430083d0b41ceed84ecccf9dac613241d7305d",
+ "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb",
+ "reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb",
"shasum": ""
},
"require": {
- "php": "^7.1.8 || ^8.0"
+ "php": "^7.4 || ^8.0"
},
"conflict": {
- "doctrine/dbal": ">=3.7.0"
+ "doctrine/dbal": "<3.7.0 || >=4.0.0"
},
"require-dev": {
- "doctrine/dbal": ">=2.0.0",
+ "doctrine/dbal": "^3.7.0",
"nesbot/carbon": "^2.71.0 || ^3.0.0",
"phpunit/phpunit": "^10.3"
},
@@ -264,7 +268,7 @@
],
"support": {
"issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues",
- "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/1.0.0"
+ "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0"
},
"funding": [
{
@@ -280,7 +284,7 @@
"type": "tidelift"
}
],
- "time": "2023-10-01T12:35:29+00:00"
+ "time": "2023-12-11T17:09:12+00:00"
},
{
"name": "composer/pcre",
@@ -436,131 +440,43 @@
},
"time": "2024-07-08T12:26:09+00:00"
},
- {
- "name": "doctrine/cache",
- "version": "2.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/cache.git",
- "reference": "1ca8f21980e770095a31456042471a57bc4c68fb"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb",
- "reference": "1ca8f21980e770095a31456042471a57bc4c68fb",
- "shasum": ""
- },
- "require": {
- "php": "~7.1 || ^8.0"
- },
- "conflict": {
- "doctrine/common": ">2.2,<2.4"
- },
- "require-dev": {
- "cache/integration-tests": "dev-master",
- "doctrine/coding-standard": "^9",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "psr/cache": "^1.0 || ^2.0 || ^3.0",
- "symfony/cache": "^4.4 || ^5.4 || ^6",
- "symfony/var-exporter": "^4.4 || ^5.4 || ^6"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com"
- },
- {
- "name": "Roman Borschel",
- "email": "roman@code-factory.org"
- },
- {
- "name": "Benjamin Eberlei",
- "email": "kontakt@beberlei.de"
- },
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com"
- },
- {
- "name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com"
- }
- ],
- "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
- "homepage": "https://www.doctrine-project.org/projects/cache.html",
- "keywords": [
- "abstraction",
- "apcu",
- "cache",
- "caching",
- "couchdb",
- "memcached",
- "php",
- "redis",
- "xcache"
- ],
- "support": {
- "issues": "https://github.com/doctrine/cache/issues",
- "source": "https://github.com/doctrine/cache/tree/2.2.0"
- },
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
- {
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
- "type": "tidelift"
- }
- ],
- "abandoned": true,
- "time": "2022-05-20T20:07:39+00:00"
- },
{
"name": "doctrine/dbal",
- "version": "2.13.9",
+ "version": "3.10.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
- "reference": "c480849ca3ad6706a39c970cdfe6888fa8a058b8"
+ "reference": "95d84866bf3c04b2ddca1df7c049714660959aef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/dbal/zipball/c480849ca3ad6706a39c970cdfe6888fa8a058b8",
- "reference": "c480849ca3ad6706a39c970cdfe6888fa8a058b8",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/95d84866bf3c04b2ddca1df7c049714660959aef",
+ "reference": "95d84866bf3c04b2ddca1df7c049714660959aef",
"shasum": ""
},
"require": {
- "doctrine/cache": "^1.0|^2.0",
+ "composer-runtime-api": "^2",
"doctrine/deprecations": "^0.5.3|^1",
- "doctrine/event-manager": "^1.0",
- "ext-pdo": "*",
- "php": "^7.1 || ^8"
+ "doctrine/event-manager": "^1|^2",
+ "php": "^7.4 || ^8.0",
+ "psr/cache": "^1|^2|^3",
+ "psr/log": "^1|^2|^3"
+ },
+ "conflict": {
+ "doctrine/cache": "< 1.11"
},
"require-dev": {
- "doctrine/coding-standard": "9.0.0",
- "jetbrains/phpstorm-stubs": "2021.1",
- "phpstan/phpstan": "1.4.6",
- "phpunit/phpunit": "^7.5.20|^8.5|9.5.16",
- "psalm/plugin-phpunit": "0.16.1",
- "squizlabs/php_codesniffer": "3.6.2",
- "symfony/cache": "^4.4",
- "symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
- "vimeo/psalm": "4.22.0"
+ "doctrine/cache": "^1.11|^2.0",
+ "doctrine/coding-standard": "14.0.0",
+ "fig/log-test": "^1",
+ "jetbrains/phpstorm-stubs": "2023.1",
+ "phpstan/phpstan": "2.1.30",
+ "phpstan/phpstan-strict-rules": "^2",
+ "phpunit/phpunit": "9.6.34",
+ "slevomat/coding-standard": "8.27.1",
+ "squizlabs/php_codesniffer": "4.0.1",
+ "symfony/cache": "^5.4|^6.0|^7.0|^8.0",
+ "symfony/console": "^4.4|^5.4|^6.0|^7.0|^8.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
@@ -571,7 +487,7 @@
"type": "library",
"autoload": {
"psr-4": {
- "Doctrine\\DBAL\\": "lib/Doctrine/DBAL"
+ "Doctrine\\DBAL\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -614,14 +530,13 @@
"queryobject",
"sasql",
"sql",
- "sqlanywhere",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
- "source": "https://github.com/doctrine/dbal/tree/2.13.9"
+ "source": "https://github.com/doctrine/dbal/tree/3.10.5"
},
"funding": [
{
@@ -637,7 +552,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-02T20:28:55+00:00"
+ "time": "2026-02-24T08:03:57+00:00"
},
{
"name": "doctrine/deprecations",
@@ -689,30 +604,29 @@
},
{
"name": "doctrine/event-manager",
- "version": "1.2.0",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
- "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520"
+ "reference": "dda33921b198841ca8dbad2eaa5d4d34769d18cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520",
- "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520",
+ "url": "https://api.github.com/repos/doctrine/event-manager/zipball/dda33921b198841ca8dbad2eaa5d4d34769d18cf",
+ "reference": "dda33921b198841ca8dbad2eaa5d4d34769d18cf",
"shasum": ""
},
"require": {
- "doctrine/deprecations": "^0.5.3 || ^1",
- "php": "^7.1 || ^8.0"
+ "php": "^8.1"
},
"conflict": {
"doctrine/common": "<2.9"
},
"require-dev": {
- "doctrine/coding-standard": "^9 || ^10",
- "phpstan/phpstan": "~1.4.10 || ^1.8.8",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.24"
+ "doctrine/coding-standard": "^14",
+ "phpdocumentor/guides-cli": "^1.4",
+ "phpstan/phpstan": "^2.1.32",
+ "phpunit/phpunit": "^10.5.58"
},
"type": "library",
"autoload": {
@@ -761,7 +675,7 @@
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
- "source": "https://github.com/doctrine/event-manager/tree/1.2.0"
+ "source": "https://github.com/doctrine/event-manager/tree/2.1.1"
},
"funding": [
{
@@ -777,7 +691,7 @@
"type": "tidelift"
}
],
- "time": "2022-10-12T20:51:15+00:00"
+ "time": "2026-01-29T07:11:08+00:00"
},
{
"name": "doctrine/inflector",
@@ -871,28 +785,27 @@
},
{
"name": "doctrine/lexer",
- "version": "2.1.1",
+ "version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
- "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6"
+ "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
- "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd",
+ "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd",
"shasum": ""
},
"require": {
- "doctrine/deprecations": "^1.0",
- "php": "^7.1 || ^8.0"
+ "php": "^8.1"
},
"require-dev": {
- "doctrine/coding-standard": "^9 || ^12",
- "phpstan/phpstan": "^1.3",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
+ "doctrine/coding-standard": "^12",
+ "phpstan/phpstan": "^1.10",
+ "phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.18.3",
- "vimeo/psalm": "^4.11 || ^5.21"
+ "vimeo/psalm": "^5.21"
},
"type": "library",
"autoload": {
@@ -929,7 +842,7 @@
],
"support": {
"issues": "https://github.com/doctrine/lexer/issues",
- "source": "https://github.com/doctrine/lexer/tree/2.1.1"
+ "source": "https://github.com/doctrine/lexer/tree/3.0.1"
},
"funding": [
{
@@ -945,7 +858,7 @@
"type": "tidelift"
}
],
- "time": "2024-02-05T11:35:39+00:00"
+ "time": "2024-02-05T11:56:58+00:00"
},
{
"name": "dragonmantank/cron-expression",
@@ -1013,25 +926,26 @@
},
{
"name": "dyrynda/laravel-cascade-soft-deletes",
- "version": "4.2.1",
+ "version": "4.4.1",
"source": {
"type": "git",
"url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2"
+ "reference": "d5d78b9360a3ddaf086e773a8a3db562e246caee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
- "reference": "6dc274b9b1009895a3786db4f0c879fb90ffe3e2",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/d5d78b9360a3ddaf086e773a8a3db562e246caee",
+ "reference": "d5d78b9360a3ddaf086e773a8a3db562e246caee",
"shasum": ""
},
"require": {
- "illuminate/database": "^8.12|^9.0",
- "illuminate/events": "^8.12|^9.0",
- "php": "^7.3|^8.0"
+ "illuminate/database": "^10.0 || ^11.0",
+ "illuminate/events": "^10.0 || ^11.0",
+ "php": "^8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "pestphp/pest": "^2.34",
+ "pestphp/pest-plugin-drift": "^2.5"
},
"type": "utility",
"autoload": {
@@ -1053,32 +967,32 @@
"description": "Cascading deletes for Eloquent models that implement soft deletes",
"support": {
"issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.2.1"
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.4.1"
},
- "time": "2022-11-22T03:11:30+00:00"
+ "time": "2025-01-06T22:18:43+00:00"
},
{
"name": "egulias/email-validator",
- "version": "3.2.6",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
- "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7"
+ "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
- "reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
+ "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
+ "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
"shasum": ""
},
"require": {
- "doctrine/lexer": "^1.2|^2",
- "php": ">=7.2",
- "symfony/polyfill-intl-idn": "^1.15"
+ "doctrine/lexer": "^2.0 || ^3.0",
+ "php": ">=8.1",
+ "symfony/polyfill-intl-idn": "^1.26"
},
"require-dev": {
- "phpunit/phpunit": "^8.5.8|^9.3.3",
- "vimeo/psalm": "^4"
+ "phpunit/phpunit": "^10.2",
+ "vimeo/psalm": "^5.12"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
@@ -1086,7 +1000,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0.x-dev"
+ "dev-master": "4.0.x-dev"
}
},
"autoload": {
@@ -1114,7 +1028,7 @@
],
"support": {
"issues": "https://github.com/egulias/EmailValidator/issues",
- "source": "https://github.com/egulias/EmailValidator/tree/3.2.6"
+ "source": "https://github.com/egulias/EmailValidator/tree/4.0.4"
},
"funding": [
{
@@ -1122,7 +1036,7 @@
"type": "github"
}
],
- "time": "2023-06-01T07:04:22+00:00"
+ "time": "2025-03-06T22:45:56+00:00"
},
{
"name": "ellipsesynergie/api-response",
@@ -1308,31 +1222,31 @@
},
{
"name": "fruitcake/php-cors",
- "version": "v1.3.0",
+ "version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/php-cors.git",
- "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b"
+ "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/3d158f36e7875e2f040f37bc0573956240a5a38b",
- "reference": "3d158f36e7875e2f040f37bc0573956240a5a38b",
+ "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379",
+ "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379",
"shasum": ""
},
"require": {
- "php": "^7.4|^8.0",
- "symfony/http-foundation": "^4.4|^5.4|^6|^7"
+ "php": "^8.1",
+ "symfony/http-foundation": "^5.4|^6.4|^7.3|^8"
},
"require-dev": {
- "phpstan/phpstan": "^1.4",
+ "phpstan/phpstan": "^2",
"phpunit/phpunit": "^9",
- "squizlabs/php_codesniffer": "^3.5"
+ "squizlabs/php_codesniffer": "^4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.3-dev"
}
},
"autoload": {
@@ -1363,7 +1277,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/php-cors/issues",
- "source": "https://github.com/fruitcake/php-cors/tree/v1.3.0"
+ "source": "https://github.com/fruitcake/php-cors/tree/v1.4.0"
},
"funding": [
{
@@ -1375,7 +1289,7 @@
"type": "github"
}
],
- "time": "2023-10-12T05:21:21+00:00"
+ "time": "2025-12-03T09:33:47+00:00"
},
{
"name": "graham-campbell/result-type",
@@ -2118,20 +2032,21 @@
},
{
"name": "laravel/framework",
- "version": "v9.52.21",
+ "version": "10.50.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "6055d9594c9da265ddbf1e27e7dd8f09624568bc"
+ "reference": "3ff39b7a9b83e633383ec9b019827ed54b6d38bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/6055d9594c9da265ddbf1e27e7dd8f09624568bc",
- "reference": "6055d9594c9da265ddbf1e27e7dd8f09624568bc",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/3ff39b7a9b83e633383ec9b019827ed54b6d38bc",
+ "reference": "3ff39b7a9b83e633383ec9b019827ed54b6d38bc",
"shasum": ""
},
"require": {
- "brick/math": "^0.9.3|^0.10.2|^0.11",
+ "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12",
+ "composer-runtime-api": "^2.2",
"doctrine/inflector": "^2.0.5",
"dragonmantank/cron-expression": "^3.3.2",
"egulias/email-validator": "^3.2.1|^4.0",
@@ -2144,33 +2059,38 @@
"ext-tokenizer": "*",
"fruitcake/php-cors": "^1.2",
"guzzlehttp/uri-template": "^1.0",
- "laravel/serializable-closure": "^1.2.2",
+ "laravel/prompts": "^0.1.9",
+ "laravel/serializable-closure": "^1.3",
"league/commonmark": "^2.2.1",
"league/flysystem": "^3.8.0",
- "monolog/monolog": "^2.0",
- "nesbot/carbon": "^2.62.1",
+ "monolog/monolog": "^3.0",
+ "nesbot/carbon": "^2.67",
"nunomaduro/termwind": "^1.13",
- "php": "^8.0.2",
+ "php": "^8.1",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"ramsey/uuid": "^4.7",
- "symfony/console": "^6.0.9",
- "symfony/error-handler": "^6.0",
- "symfony/finder": "^6.0",
- "symfony/http-foundation": "^6.0",
- "symfony/http-kernel": "^6.0",
- "symfony/mailer": "^6.0",
- "symfony/mime": "^6.0",
- "symfony/process": "^6.0",
- "symfony/routing": "^6.0",
- "symfony/uid": "^6.0",
- "symfony/var-dumper": "^6.0",
+ "symfony/console": "^6.2",
+ "symfony/error-handler": "^6.2",
+ "symfony/finder": "^6.2",
+ "symfony/http-foundation": "^6.4",
+ "symfony/http-kernel": "^6.2",
+ "symfony/mailer": "^6.2",
+ "symfony/mime": "^6.2",
+ "symfony/process": "^6.2",
+ "symfony/routing": "^6.2",
+ "symfony/uid": "^6.2",
+ "symfony/var-dumper": "^6.2",
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
"vlucas/phpdotenv": "^5.4.1",
"voku/portable-ascii": "^2.0"
},
"conflict": {
+ "carbonphp/carbon-doctrine-types": ">=3.0",
+ "doctrine/dbal": ">=4.0",
+ "mockery/mockery": "1.6.8",
+ "phpunit/phpunit": ">=11.0.0",
"tightenco/collect": "<5.5.33"
},
"provide": {
@@ -2201,6 +2121,7 @@
"illuminate/notifications": "self.version",
"illuminate/pagination": "self.version",
"illuminate/pipeline": "self.version",
+ "illuminate/process": "self.version",
"illuminate/queue": "self.version",
"illuminate/redis": "self.version",
"illuminate/routing": "self.version",
@@ -2214,7 +2135,7 @@
"require-dev": {
"ably/ably-php": "^1.0",
"aws/aws-sdk-php": "^3.235.5",
- "doctrine/dbal": "^2.13.3|^3.1.4",
+ "doctrine/dbal": "^3.5.1",
"ext-gmp": "*",
"fakerphp/faker": "^1.21",
"guzzlehttp/guzzle": "^7.5",
@@ -2224,20 +2145,21 @@
"league/flysystem-read-only": "^3.3",
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
- "orchestra/testbench-core": "^7.24",
+ "nyholm/psr7": "^1.2",
+ "orchestra/testbench-core": "^8.23.4",
"pda/pheanstalk": "^4.0",
- "phpstan/phpdoc-parser": "^1.15",
- "phpstan/phpstan": "^1.4.7",
- "phpunit/phpunit": "^9.5.8",
- "predis/predis": "^1.1.9|^2.0.2",
- "symfony/cache": "^6.0",
- "symfony/http-client": "^6.0"
+ "phpstan/phpstan": "~1.11.11",
+ "phpunit/phpunit": "^10.0.7",
+ "predis/predis": "^2.0.2",
+ "symfony/cache": "^6.2",
+ "symfony/http-client": "^6.2.4",
+ "symfony/psr-http-message-bridge": "^2.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).",
"brianium/paratest": "Required to run tests in parallel (^6.0).",
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).",
+ "doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).",
"ext-apcu": "Required to use the APC cache driver.",
"ext-fileinfo": "Required to use the Filesystem class.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
@@ -2259,27 +2181,29 @@
"mockery/mockery": "Required to use mocking (^1.5.1).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
- "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8).",
- "predis/predis": "Required to use the predis connector (^1.1.9|^2.0.2).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8|^10.0.7).",
+ "predis/predis": "Required to use the predis connector (^2.0.2).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^6.0).",
- "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).",
- "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.0).",
- "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.0).",
- "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^6.2).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^6.2).",
+ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.2).",
+ "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.2).",
+ "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.x-dev"
+ "dev-master": "10.x-dev"
}
},
"autoload": {
"files": [
+ "src/Illuminate/Collections/functions.php",
"src/Illuminate/Collections/helpers.php",
"src/Illuminate/Events/functions.php",
+ "src/Illuminate/Filesystem/functions.php",
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Support/helpers.php"
],
@@ -2312,7 +2236,65 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2025-09-30T14:57:50+00:00"
+ "time": "2026-02-15T14:12:07+00:00"
+ },
+ {
+ "name": "laravel/prompts",
+ "version": "v0.1.25",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/prompts.git",
+ "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/prompts/zipball/7b4029a84c37cb2725fc7f011586e2997040bc95",
+ "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "illuminate/collections": "^10.0|^11.0",
+ "php": "^8.1",
+ "symfony/console": "^6.2|^7.0"
+ },
+ "conflict": {
+ "illuminate/console": ">=10.17.0 <10.25.0",
+ "laravel/framework": ">=10.17.0 <10.25.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.5",
+ "pestphp/pest": "^2.3",
+ "phpstan/phpstan": "^1.11",
+ "phpstan/phpstan-mockery": "^1.1"
+ },
+ "suggest": {
+ "ext-pcntl": "Required for the spinner to be animated."
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "0.1.x-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/helpers.php"
+ ],
+ "psr-4": {
+ "Laravel\\Prompts\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Add beautiful and user-friendly forms to your command-line applications.",
+ "support": {
+ "issues": "https://github.com/laravel/prompts/issues",
+ "source": "https://github.com/laravel/prompts/tree/v0.1.25"
+ },
+ "time": "2024-08-12T22:06:33+00:00"
},
{
"name": "laravel/serializable-closure",
@@ -2443,27 +2425,29 @@
},
{
"name": "laravel/ui",
- "version": "v3.4.6",
+ "version": "v4.6.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/ui.git",
- "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c"
+ "reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/ui/zipball/65ec5c03f7fee2c8ecae785795b829a15be48c2c",
- "reference": "65ec5c03f7fee2c8ecae785795b829a15be48c2c",
+ "url": "https://api.github.com/repos/laravel/ui/zipball/ff27db15416c1ed8ad9848f5692e47595dd5de27",
+ "reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27",
"shasum": ""
},
"require": {
- "illuminate/console": "^8.42|^9.0",
- "illuminate/filesystem": "^8.42|^9.0",
- "illuminate/support": "^8.82|^9.0",
- "illuminate/validation": "^8.42|^9.0",
- "php": "^7.3|^8.0"
+ "illuminate/console": "^9.21|^10.0|^11.0|^12.0|^13.0",
+ "illuminate/filesystem": "^9.21|^10.0|^11.0|^12.0|^13.0",
+ "illuminate/support": "^9.21|^10.0|^11.0|^12.0|^13.0",
+ "illuminate/validation": "^9.21|^10.0|^11.0|^12.0|^13.0",
+ "php": "^8.0",
+ "symfony/console": "^6.0|^7.0|^8.0"
},
"require-dev": {
- "orchestra/testbench": "^6.23|^7.0"
+ "orchestra/testbench": "^7.35|^8.15|^9.0|^10.0|^11.0",
+ "phpunit/phpunit": "^9.3|^10.4|^11.5|^12.5|^13.0"
},
"type": "library",
"extra": {
@@ -2473,7 +2457,7 @@
]
},
"branch-alias": {
- "dev-master": "3.x-dev"
+ "dev-master": "4.x-dev"
}
},
"autoload": {
@@ -2498,9 +2482,9 @@
"ui"
],
"support": {
- "source": "https://github.com/laravel/ui/tree/v3.4.6"
+ "source": "https://github.com/laravel/ui/tree/v4.6.3"
},
- "time": "2022-05-20T13:38:08+00:00"
+ "time": "2026-03-17T13:41:52+00:00"
},
{
"name": "laravelcollective/html",
@@ -2849,20 +2833,20 @@
},
{
"name": "league/flysystem-aws-s3-v3",
- "version": "3.32.0",
+ "version": "3.34.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
- "reference": "a1979df7c9784d334ea6df356aed3d18ac6673d0"
+ "reference": "0c62fdac907791d8649ad3c61cb7a77628344fb8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/a1979df7c9784d334ea6df356aed3d18ac6673d0",
- "reference": "a1979df7c9784d334ea6df356aed3d18ac6673d0",
+ "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/0c62fdac907791d8649ad3c61cb7a77628344fb8",
+ "reference": "0c62fdac907791d8649ad3c61cb7a77628344fb8",
"shasum": ""
},
"require": {
- "aws/aws-sdk-php": "^3.295.10",
+ "aws/aws-sdk-php": "^3.371.5",
"league/flysystem": "^3.10.0",
"league/mime-type-detection": "^1.0.0",
"php": "^8.0.2"
@@ -2898,9 +2882,9 @@
"storage"
],
"support": {
- "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.32.0"
+ "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.34.0"
},
- "time": "2026-02-25T16:46:44+00:00"
+ "time": "2026-05-04T08:24:00+00:00"
},
{
"name": "league/flysystem-local",
@@ -3076,33 +3060,36 @@
},
{
"name": "maennchen/zipstream-php",
- "version": "2.4.0",
+ "version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
- "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3"
+ "reference": "6187e9cc4493da94b9b63eb2315821552015fca9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3",
- "reference": "3fa72e4c71a43f9e9118752a5c90e476a8dc9eb3",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/6187e9cc4493da94b9b63eb2315821552015fca9",
+ "reference": "6187e9cc4493da94b9b63eb2315821552015fca9",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
- "myclabs/php-enum": "^1.5",
- "php": "^8.0",
- "psr/http-message": "^1.0"
+ "ext-zlib": "*",
+ "php-64bit": "^8.1"
},
"require-dev": {
"ext-zip": "*",
- "friendsofphp/php-cs-fixer": "^3.9",
- "guzzlehttp/guzzle": "^6.5.3 || ^7.2.0",
+ "friendsofphp/php-cs-fixer": "^3.16",
+ "guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
- "php-coveralls/php-coveralls": "^2.4",
- "phpunit/phpunit": "^8.5.8 || ^9.4.2",
+ "php-coveralls/php-coveralls": "^2.5",
+ "phpunit/phpunit": "^10.0",
"vimeo/psalm": "^5.0"
},
+ "suggest": {
+ "guzzlehttp/psr7": "^2.4",
+ "psr/http-message": "^2.0"
+ },
"type": "library",
"autoload": {
"psr-4": {
@@ -3138,19 +3125,15 @@
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
- "source": "https://github.com/maennchen/ZipStream-PHP/tree/2.4.0"
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.1"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
- },
- {
- "url": "https://opencollective.com/zipstream",
- "type": "open_collective"
}
],
- "time": "2022-12-08T12:29:14+00:00"
+ "time": "2024-10-10T12:33:01+00:00"
},
{
"name": "markbaker/complex",
@@ -3261,25 +3244,25 @@
},
{
"name": "mcamara/laravel-localization",
- "version": "V1.8.0",
+ "version": "v2.3.0",
"source": {
"type": "git",
"url": "https://github.com/mcamara/laravel-localization.git",
- "reference": "9b1779a963c1779d1977d8ad0558a681608e3ec1"
+ "reference": "af91f489f518fb1907944de8622a19266159d28f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/9b1779a963c1779d1977d8ad0558a681608e3ec1",
- "reference": "9b1779a963c1779d1977d8ad0558a681608e3ec1",
+ "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/af91f489f518fb1907944de8622a19266159d28f",
+ "reference": "af91f489f518fb1907944de8622a19266159d28f",
"shasum": ""
},
"require": {
- "laravel/framework": "~5.2.0||~5.3.0||~5.4.0||~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0||^7.0||^8.0||^9.0|^10.0",
- "php": ">=7.1.0"
+ "laravel/framework": "^10.0|^11.0|^12.0",
+ "php": "^8.2"
},
"require-dev": {
- "orchestra/testbench-browser-kit": "~3.4|~3.8|~4.0|^7.12",
- "phpunit/phpunit": "6.0.*|^8.0|^9.5.10"
+ "orchestra/testbench-browser-kit": "^8.5|^9.0|^10.0",
+ "phpunit/phpunit": "^10.1|^11.0"
},
"suggest": {
"ext-intl": "*"
@@ -3321,7 +3304,7 @@
],
"support": {
"issues": "https://github.com/mcamara/laravel-localization/issues",
- "source": "https://github.com/mcamara/laravel-localization/tree/V1.8.0"
+ "source": "https://github.com/mcamara/laravel-localization/tree/v2.3.0"
},
"funding": [
{
@@ -3333,46 +3316,47 @@
"type": "github"
}
],
- "time": "2023-02-18T15:43:23+00:00"
+ "time": "2025-02-26T06:38:01+00:00"
},
{
"name": "monolog/monolog",
- "version": "2.11.0",
+ "version": "3.10.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "37308608e599f34a1a4845b16440047ec98a172a"
+ "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/37308608e599f34a1a4845b16440047ec98a172a",
- "reference": "37308608e599f34a1a4845b16440047ec98a172a",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0",
+ "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0",
"shasum": ""
},
"require": {
- "php": ">=7.2",
- "psr/log": "^1.0.1 || ^2.0 || ^3.0"
+ "php": ">=8.1",
+ "psr/log": "^2.0 || ^3.0"
},
"provide": {
- "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
+ "psr/log-implementation": "3.0.0"
},
"require-dev": {
- "aws/aws-sdk-php": "^2.4.9 || ^3.0",
+ "aws/aws-sdk-php": "^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7 || ^8",
"ext-json": "*",
- "graylog2/gelf-php": "^1.4.2 || ^2@dev",
- "guzzlehttp/guzzle": "^7.4",
+ "graylog2/gelf-php": "^1.4.2 || ^2.0",
+ "guzzlehttp/guzzle": "^7.4.5",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8 || ^2.0",
"php-amqplib/php-amqplib": "~2.4 || ^3",
- "phpspec/prophecy": "^1.15",
- "phpstan/phpstan": "^1.10",
- "phpunit/phpunit": "^8.5.38 || ^9.6.19",
- "predis/predis": "^1.1 || ^2.0",
- "rollbar/rollbar": "^1.3 || ^2 || ^3",
- "ruflin/elastica": "^7",
- "swiftmailer/swiftmailer": "^5.3|^6.0",
+ "php-console/php-console": "^3.1.8",
+ "phpstan/phpstan": "^2",
+ "phpstan/phpstan-deprecation-rules": "^2",
+ "phpstan/phpstan-strict-rules": "^2",
+ "phpunit/phpunit": "^10.5.17 || ^11.0.7",
+ "predis/predis": "^1.1 || ^2",
+ "rollbar/rollbar": "^4.0",
+ "ruflin/elastica": "^7 || ^8",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
@@ -3395,7 +3379,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.x-dev"
+ "dev-main": "3.x-dev"
}
},
"autoload": {
@@ -3423,7 +3407,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
- "source": "https://github.com/Seldaek/monolog/tree/2.11.0"
+ "source": "https://github.com/Seldaek/monolog/tree/3.10.0"
},
"funding": [
{
@@ -3435,7 +3419,7 @@
"type": "tidelift"
}
],
- "time": "2026-01-01T13:05:00+00:00"
+ "time": "2026-01-02T08:56:05+00:00"
},
{
"name": "mtdowling/jmespath.php",
@@ -3503,69 +3487,6 @@
},
"time": "2024-09-04T18:46:31+00:00"
},
- {
- "name": "myclabs/php-enum",
- "version": "1.8.5",
- "source": {
- "type": "git",
- "url": "https://github.com/myclabs/php-enum.git",
- "reference": "e7be26966b7398204a234f8673fdad5ac6277802"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/myclabs/php-enum/zipball/e7be26966b7398204a234f8673fdad5ac6277802",
- "reference": "e7be26966b7398204a234f8673fdad5ac6277802",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "php": "^7.3 || ^8.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.5",
- "squizlabs/php_codesniffer": "1.*",
- "vimeo/psalm": "^4.6.2 || ^5.2"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "MyCLabs\\Enum\\": "src/"
- },
- "classmap": [
- "stubs/Stringable.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP Enum contributors",
- "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
- }
- ],
- "description": "PHP Enum implementation",
- "homepage": "https://github.com/myclabs/php-enum",
- "keywords": [
- "enum"
- ],
- "support": {
- "issues": "https://github.com/myclabs/php-enum/issues",
- "source": "https://github.com/myclabs/php-enum/tree/1.8.5"
- },
- "funding": [
- {
- "url": "https://github.com/mnapoli",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
- "type": "tidelift"
- }
- ],
- "time": "2025-01-14T11:49:03+00:00"
- },
{
"name": "nesbot/carbon",
"version": "2.73.0",
@@ -3675,34 +3596,39 @@
},
{
"name": "nette/schema",
- "version": "v1.2.5",
+ "version": "v1.3.5",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
- "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a"
+ "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/schema/zipball/0462f0166e823aad657c9224d0f849ecac1ba10a",
- "reference": "0462f0166e823aad657c9224d0f849ecac1ba10a",
+ "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002",
+ "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002",
"shasum": ""
},
"require": {
- "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
- "php": "7.1 - 8.3"
+ "nette/utils": "^4.0",
+ "php": "8.1 - 8.5"
},
"require-dev": {
- "nette/tester": "^2.3 || ^2.4",
- "phpstan/phpstan-nette": "^1.0",
- "tracy/tracy": "^2.7"
+ "nette/phpstan-rules": "^1.0",
+ "nette/tester": "^2.6",
+ "phpstan/extension-installer": "^1.4@stable",
+ "phpstan/phpstan": "^2.1.39@stable",
+ "tracy/tracy": "^2.8"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-master": "1.3-dev"
}
},
"autoload": {
+ "psr-4": {
+ "Nette\\": "src"
+ },
"classmap": [
"src/"
]
@@ -3731,9 +3657,9 @@
],
"support": {
"issues": "https://github.com/nette/schema/issues",
- "source": "https://github.com/nette/schema/tree/v1.2.5"
+ "source": "https://github.com/nette/schema/tree/v1.3.5"
},
- "time": "2023-10-05T20:37:59+00:00"
+ "time": "2026-02-23T03:47:12+00:00"
},
{
"name": "nette/utils",
@@ -3826,30 +3752,37 @@
},
{
"name": "nikic/php-parser",
- "version": "v4.19.5",
+ "version": "v5.7.0",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837"
+ "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837",
- "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82",
+ "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82",
"shasum": ""
},
"require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
"ext-tokenizer": "*",
- "php": ">=7.1"
+ "php": ">=7.4"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
- "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
+ "phpunit/phpunit": "^9.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
@@ -3871,39 +3804,38 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0"
},
- "time": "2025-12-06T11:45:25+00:00"
+ "time": "2025-12-06T11:56:16+00:00"
},
{
"name": "nunomaduro/termwind",
- "version": "v1.15.1",
+ "version": "v1.17.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
- "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc"
+ "reference": "5369ef84d8142c1d87e4ec278711d4ece3cbf301"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
- "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc",
+ "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/5369ef84d8142c1d87e4ec278711d4ece3cbf301",
+ "reference": "5369ef84d8142c1d87e4ec278711d4ece3cbf301",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
- "php": "^8.0",
- "symfony/console": "^5.3.0|^6.0.0"
+ "php": "^8.1",
+ "symfony/console": "^6.4.15"
},
"require-dev": {
- "ergebnis/phpstan-rules": "^1.0.",
- "illuminate/console": "^8.0|^9.0",
- "illuminate/support": "^8.0|^9.0",
- "laravel/pint": "^1.0.0",
- "pestphp/pest": "^1.21.0",
- "pestphp/pest-plugin-mock": "^1.0",
- "phpstan/phpstan": "^1.4.6",
- "phpstan/phpstan-strict-rules": "^1.1.0",
- "symfony/var-dumper": "^5.2.7|^6.0.0",
+ "illuminate/console": "^10.48.24",
+ "illuminate/support": "^10.48.24",
+ "laravel/pint": "^1.18.2",
+ "pestphp/pest": "^2.36.0",
+ "pestphp/pest-plugin-mock": "2.0.0",
+ "phpstan/phpstan": "^1.12.11",
+ "phpstan/phpstan-strict-rules": "^1.6.1",
+ "symfony/var-dumper": "^6.4.15",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
@@ -3943,7 +3875,7 @@
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
- "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1"
+ "source": "https://github.com/nunomaduro/termwind/tree/v1.17.0"
},
"funding": [
{
@@ -3959,7 +3891,7 @@
"type": "github"
}
],
- "time": "2023-02-08T01:06:31+00:00"
+ "time": "2024-11-21T10:36:35+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
@@ -4206,6 +4138,55 @@
],
"time": "2025-11-12T18:00:11+00:00"
},
+ {
+ "name": "psr/cache",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/cache.git",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
+ "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Cache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for caching libraries",
+ "keywords": [
+ "cache",
+ "psr",
+ "psr-6"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/cache/tree/3.0.0"
+ },
+ "time": "2021-02-03T23:26:27+00:00"
+ },
{
"name": "psr/clock",
"version": "1.0.0",
@@ -4466,16 +4447,16 @@
},
{
"name": "psr/http-message",
- "version": "1.1",
+ "version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
- "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
- "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
@@ -4484,7 +4465,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
@@ -4499,7 +4480,7 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
@@ -4513,9 +4494,9 @@
"response"
],
"support": {
- "source": "https://github.com/php-fig/http-message/tree/1.1"
+ "source": "https://github.com/php-fig/http-message/tree/2.0"
},
- "time": "2023-04-04T09:50:52+00:00"
+ "time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/log",
@@ -4743,43 +4724,39 @@
},
{
"name": "ramsey/collection",
- "version": "1.3.0",
+ "version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/ramsey/collection.git",
- "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4"
+ "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4",
- "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4",
+ "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
+ "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
"shasum": ""
},
"require": {
- "php": "^7.4 || ^8.0",
- "symfony/polyfill-php81": "^1.23"
+ "php": "^8.1"
},
"require-dev": {
"captainhook/plugin-composer": "^5.3",
- "ergebnis/composer-normalize": "^2.28.3",
- "fakerphp/faker": "^1.21",
+ "ergebnis/composer-normalize": "^2.45",
+ "fakerphp/faker": "^1.24",
"hamcrest/hamcrest-php": "^2.0",
- "jangregor/phpstan-prophecy": "^1.0",
- "mockery/mockery": "^1.5",
+ "jangregor/phpstan-prophecy": "^2.1",
+ "mockery/mockery": "^1.6",
"php-parallel-lint/php-console-highlighter": "^1.0",
- "php-parallel-lint/php-parallel-lint": "^1.3",
- "phpcsstandards/phpcsutils": "^1.0.0-rc1",
- "phpspec/prophecy-phpunit": "^2.0",
- "phpstan/extension-installer": "^1.2",
- "phpstan/phpstan": "^1.9",
- "phpstan/phpstan-mockery": "^1.1",
- "phpstan/phpstan-phpunit": "^1.3",
- "phpunit/phpunit": "^9.5",
- "psalm/plugin-mockery": "^1.1",
- "psalm/plugin-phpunit": "^0.18.4",
- "ramsey/coding-standard": "^2.0.3",
- "ramsey/conventional-commits": "^1.3",
- "vimeo/psalm": "^5.4"
+ "php-parallel-lint/php-parallel-lint": "^1.4",
+ "phpspec/prophecy-phpunit": "^2.3",
+ "phpstan/extension-installer": "^1.4",
+ "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan-mockery": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpunit/phpunit": "^10.5",
+ "ramsey/coding-standard": "^2.3",
+ "ramsey/conventional-commits": "^1.6",
+ "roave/security-advisories": "dev-latest"
},
"type": "library",
"extra": {
@@ -4817,19 +4794,9 @@
],
"support": {
"issues": "https://github.com/ramsey/collection/issues",
- "source": "https://github.com/ramsey/collection/tree/1.3.0"
+ "source": "https://github.com/ramsey/collection/tree/2.1.1"
},
- "funding": [
- {
- "url": "https://github.com/ramsey",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/ramsey/collection",
- "type": "tidelift"
- }
- ],
- "time": "2022-12-27T19:12:24+00:00"
+ "time": "2025-03-22T05:38:12+00:00"
},
{
"name": "ramsey/uuid",
@@ -4986,23 +4953,24 @@
},
{
"name": "symfony/console",
- "version": "v6.0.19",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed"
+ "reference": "d21b17ed158e79180fac3895ff751707970eeb57"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
- "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed",
+ "url": "https://api.github.com/repos/symfony/console/zipball/d21b17ed158e79180fac3895ff751707970eeb57",
+ "reference": "d21b17ed158e79180fac3895ff751707970eeb57",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/service-contracts": "^1.1|^2|^3",
- "symfony/string": "^5.4|^6.0"
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/string": "^5.4|^6.0|^7.0"
},
"conflict": {
"symfony/dependency-injection": "<5.4",
@@ -5016,18 +4984,16 @@
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/event-dispatcher": "^5.4|^6.0",
- "symfony/lock": "^5.4|^6.0",
- "symfony/process": "^5.4|^6.0",
- "symfony/var-dumper": "^5.4|^6.0"
- },
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/lock": "",
- "symfony/process": ""
+ "symfony/config": "^5.4|^6.0|^7.0",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
+ "symfony/http-foundation": "^6.4|^7.0",
+ "symfony/http-kernel": "^6.4|^7.0",
+ "symfony/lock": "^5.4|^6.0|^7.0",
+ "symfony/messenger": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/stopwatch": "^5.4|^6.0|^7.0",
+ "symfony/var-dumper": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -5056,12 +5022,12 @@
"homepage": "https://symfony.com",
"keywords": [
"cli",
- "command line",
+ "command-line",
"console",
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v6.0.19"
+ "source": "https://github.com/symfony/console/tree/v6.4.41"
},
"funding": [
{
@@ -5072,29 +5038,33 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-05-24T08:48:41+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v6.0.19",
+ "version": "v6.4.34",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1"
+ "reference": "b0314c186f1464de048cce58979ff1625ca88bbb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/f1d00bddb83a4cb2138564b2150001cb6ce272b1",
- "reference": "f1d00bddb83a4cb2138564b2150001cb6ce272b1",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0314c186f1464de048cce58979ff1625ca88bbb",
+ "reference": "b0314c186f1464de048cce58979ff1625ca88bbb",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1"
},
"type": "library",
"autoload": {
@@ -5126,7 +5096,7 @@
"description": "Converts CSS selectors to XPath expressions",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/css-selector/tree/v6.0.19"
+ "source": "https://github.com/symfony/css-selector/tree/v6.4.34"
},
"funding": [
{
@@ -5137,29 +5107,33 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-02-16T08:37:21+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.0.2",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c"
+ "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
- "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/50f59d1f3ca46d41ac911f97a78626b6756af35b",
+ "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1"
},
"type": "library",
"extra": {
@@ -5168,7 +5142,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
@@ -5193,7 +5167,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -5204,36 +5178,44 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2022-01-02T09:55:41+00:00"
+ "time": "2026-04-13T15:52:40+00:00"
},
{
"name": "symfony/error-handler",
- "version": "v6.0.19",
+ "version": "v6.4.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
- "reference": "c7df52182f43a68522756ac31a532dd5b1e6db67"
+ "reference": "2ea68f0e1835ad6a126f93bbc14cd236c10ab361"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/error-handler/zipball/c7df52182f43a68522756ac31a532dd5b1e6db67",
- "reference": "c7df52182f43a68522756ac31a532dd5b1e6db67",
+ "url": "https://api.github.com/repos/symfony/error-handler/zipball/2ea68f0e1835ad6a126f93bbc14cd236c10ab361",
+ "reference": "2ea68f0e1835ad6a126f93bbc14cd236c10ab361",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
"psr/log": "^1|^2|^3",
- "symfony/var-dumper": "^5.4|^6.0"
+ "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ },
+ "conflict": {
+ "symfony/deprecation-contracts": "<2.5",
+ "symfony/http-kernel": "<6.4"
},
"require-dev": {
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/http-kernel": "^5.4|^6.0",
- "symfony/serializer": "^5.4|^6.0"
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/http-kernel": "^6.4|^7.0",
+ "symfony/serializer": "^5.4|^6.0|^7.0"
},
"bin": [
"Resources/bin/patch-type-declarations"
@@ -5264,7 +5246,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/error-handler/tree/v6.0.19"
+ "source": "https://github.com/symfony/error-handler/tree/v6.4.36"
},
"funding": [
{
@@ -5275,33 +5257,38 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-03-10T15:56:14+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v6.0.19",
+ "version": "v6.4.37",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a"
+ "reference": "2e3bf817ba9347341ab15926700fb6320367c0e1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a",
- "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2e3bf817ba9347341ab15926700fb6320367c0e1",
+ "reference": "2e3bf817ba9347341ab15926700fb6320367c0e1",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
- "symfony/event-dispatcher-contracts": "^2|^3"
+ "php": ">=8.1",
+ "symfony/event-dispatcher-contracts": "^2.5|^3"
},
"conflict": {
- "symfony/dependency-injection": "<5.4"
+ "symfony/dependency-injection": "<5.4",
+ "symfony/service-contracts": "<2.5"
},
"provide": {
"psr/event-dispatcher-implementation": "1.0",
@@ -5309,17 +5296,13 @@
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/error-handler": "^5.4|^6.0",
- "symfony/expression-language": "^5.4|^6.0",
- "symfony/http-foundation": "^5.4|^6.0",
- "symfony/service-contracts": "^1.1|^2|^3",
- "symfony/stopwatch": "^5.4|^6.0"
- },
- "suggest": {
- "symfony/dependency-injection": "",
- "symfony/http-kernel": ""
+ "symfony/config": "^5.4|^6.0|^7.0",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/error-handler": "^5.4|^6.0|^7.0",
+ "symfony/expression-language": "^5.4|^6.0|^7.0",
+ "symfony/http-foundation": "^5.4|^6.0|^7.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/stopwatch": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -5347,7 +5330,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19"
+ "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.37"
},
"funding": [
{
@@ -5358,34 +5341,35 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-04-13T14:11:12+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
- "version": "v3.0.2",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
- "reference": "7bc61cc2db649b4637d331240c5346dcc7708051"
+ "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051",
- "reference": "7bc61cc2db649b4637d331240c5346dcc7708051",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/ccba7060602b7fed0b03c85bf025257f76d9ef32",
+ "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
"psr/event-dispatcher": "^1"
},
- "suggest": {
- "symfony/event-dispatcher-implementation": ""
- },
"type": "library",
"extra": {
"thanks": {
@@ -5393,7 +5377,7 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
@@ -5426,7 +5410,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2"
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -5437,29 +5421,106 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2022-01-02T09:55:41+00:00"
+ "time": "2026-01-05T13:30:16+00:00"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v6.4.39",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "c507b077756b4e3e09adbbe7975fac81cd3722ca"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/c507b077756b4e3e09adbbe7975fac81cd3722ca",
+ "reference": "c507b077756b4e3e09adbbe7975fac81cd3722ca",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8"
+ },
+ "require-dev": {
+ "symfony/process": "^5.4|^6.4|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v6.4.39"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-07T13:11:42+00:00"
},
{
"name": "symfony/finder",
- "version": "v6.0.19",
+ "version": "v6.4.34",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11"
+ "reference": "9590e86be1d1c57bfbb16d0dd040345378c20896"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11",
- "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/9590e86be1d1c57bfbb16d0dd040345378c20896",
+ "reference": "9590e86be1d1c57bfbb16d0dd040345378c20896",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "symfony/filesystem": "^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -5487,7 +5548,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v6.0.19"
+ "source": "https://github.com/symfony/finder/tree/v6.4.34"
},
"funding": [
{
@@ -5498,43 +5559,49 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-20T17:44:14+00:00"
+ "time": "2026-01-28T15:16:37+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v6.0.20",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6"
+ "reference": "48d76c29a67a301e0f7779a512bf76417395ffef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e16b2676a4b3b1fa12378a20b29c364feda2a8d6",
- "reference": "e16b2676a4b3b1fa12378a20b29c364feda2a8d6",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/48d76c29a67a301e0f7779a512bf76417395ffef",
+ "reference": "48d76c29a67a301e0f7779a512bf76417395ffef",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/polyfill-mbstring": "~1.1"
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/polyfill-mbstring": "~1.1",
+ "symfony/polyfill-php83": "^1.27"
},
- "require-dev": {
- "predis/predis": "~1.0",
- "symfony/cache": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/expression-language": "^5.4|^6.0",
- "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4",
- "symfony/mime": "^5.4|^6.0",
- "symfony/rate-limiter": "^5.2|^6.0"
+ "conflict": {
+ "symfony/cache": "<6.4.12|>=7.0,<7.1.5"
},
- "suggest": {
- "symfony/mime": "To use the file extension guesser"
+ "require-dev": {
+ "doctrine/dbal": "^2.13.1|^3|^4",
+ "predis/predis": "^1.1|^2.0",
+ "symfony/cache": "^6.4.12|^7.1.5",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/expression-language": "^5.4|^6.0|^7.0",
+ "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0",
+ "symfony/mime": "^5.4|^6.0|^7.0",
+ "symfony/rate-limiter": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -5562,7 +5629,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-foundation/tree/v6.0.20"
+ "source": "https://github.com/symfony/http-foundation/tree/v6.4.41"
},
"funding": [
{
@@ -5573,49 +5640,57 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-30T15:41:07+00:00"
+ "time": "2026-05-24T10:54:17+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v6.0.20",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "6dc70833fd0ef5e861e17c7854c12d7d86679349"
+ "reference": "155f6c1fa29720e8c947591da3be4014951fba6f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6dc70833fd0ef5e861e17c7854c12d7d86679349",
- "reference": "6dc70833fd0ef5e861e17c7854c12d7d86679349",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/155f6c1fa29720e8c947591da3be4014951fba6f",
+ "reference": "155f6c1fa29720e8c947591da3be4014951fba6f",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
"psr/log": "^1|^2|^3",
- "symfony/error-handler": "^5.4|^6.0",
- "symfony/event-dispatcher": "^5.4|^6.0",
- "symfony/http-foundation": "^5.4|^6.0",
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/error-handler": "^6.4|^7.0",
+ "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
+ "symfony/http-foundation": "^6.4|^7.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/browser-kit": "<5.4",
"symfony/cache": "<5.4",
- "symfony/config": "<5.4",
+ "symfony/config": "<6.1",
"symfony/console": "<5.4",
- "symfony/dependency-injection": "<5.4",
+ "symfony/dependency-injection": "<6.4",
"symfony/doctrine-bridge": "<5.4",
"symfony/form": "<5.4",
"symfony/http-client": "<5.4",
+ "symfony/http-client-contracts": "<2.5",
"symfony/mailer": "<5.4",
"symfony/messenger": "<5.4",
"symfony/translation": "<5.4",
+ "symfony/translation-contracts": "<2.5",
"symfony/twig-bridge": "<5.4",
- "symfony/validator": "<5.4",
+ "symfony/validator": "<6.4",
+ "symfony/var-dumper": "<6.3",
"twig/twig": "<2.13"
},
"provide": {
@@ -5623,28 +5698,29 @@
},
"require-dev": {
"psr/cache": "^1.0|^2.0|^3.0",
- "symfony/browser-kit": "^5.4|^6.0",
- "symfony/config": "^5.4|^6.0",
- "symfony/console": "^5.4|^6.0",
- "symfony/css-selector": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/dom-crawler": "^5.4|^6.0",
- "symfony/expression-language": "^5.4|^6.0",
- "symfony/finder": "^5.4|^6.0",
- "symfony/http-client-contracts": "^1.1|^2|^3",
- "symfony/process": "^5.4|^6.0",
- "symfony/routing": "^5.4|^6.0",
- "symfony/stopwatch": "^5.4|^6.0",
- "symfony/translation": "^5.4|^6.0",
- "symfony/translation-contracts": "^1.1|^2|^3",
+ "symfony/browser-kit": "^5.4|^6.0|^7.0",
+ "symfony/clock": "^6.2|^7.0",
+ "symfony/config": "^6.1|^7.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/css-selector": "^5.4|^6.0|^7.0",
+ "symfony/dependency-injection": "^6.4.1|^7.0.1",
+ "symfony/dom-crawler": "^5.4|^6.0|^7.0",
+ "symfony/expression-language": "^5.4|^6.0|^7.0",
+ "symfony/finder": "^5.4|^6.0|^7.0",
+ "symfony/http-client-contracts": "^2.5|^3",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/property-access": "^5.4.5|^6.0.5|^7.0",
+ "symfony/routing": "^5.4|^6.0|^7.0",
+ "symfony/serializer": "^6.4.4|^7.0.4",
+ "symfony/stopwatch": "^5.4|^6.0|^7.0",
+ "symfony/translation": "^5.4|^6.0|^7.0",
+ "symfony/translation-contracts": "^2.5|^3",
+ "symfony/uid": "^5.4|^6.0|^7.0",
+ "symfony/validator": "^6.4|^7.0",
+ "symfony/var-dumper": "^5.4|^6.4|^7.0",
+ "symfony/var-exporter": "^6.2|^7.0",
"twig/twig": "^2.13|^3.0.4"
},
- "suggest": {
- "symfony/browser-kit": "",
- "symfony/config": "",
- "symfony/console": "",
- "symfony/dependency-injection": ""
- },
"type": "library",
"autoload": {
"psr-4": {
@@ -5671,7 +5747,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v6.0.20"
+ "source": "https://github.com/symfony/http-kernel/tree/v6.4.41"
},
"funding": [
{
@@ -5682,42 +5758,52 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-02-01T08:22:55+00:00"
+ "time": "2026-05-27T08:22:22+00:00"
},
{
"name": "symfony/mailer",
- "version": "v6.0.19",
+ "version": "v6.4.40",
"source": {
"type": "git",
"url": "https://github.com/symfony/mailer.git",
- "reference": "cd60799210c488f545ddde2444dc1aa548322872"
+ "reference": "94fd44f3052e02340b0dd4447a7d7a5856e32da2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mailer/zipball/cd60799210c488f545ddde2444dc1aa548322872",
- "reference": "cd60799210c488f545ddde2444dc1aa548322872",
+ "url": "https://api.github.com/repos/symfony/mailer/zipball/94fd44f3052e02340b0dd4447a7d7a5856e32da2",
+ "reference": "94fd44f3052e02340b0dd4447a7d7a5856e32da2",
"shasum": ""
},
"require": {
"egulias/email-validator": "^2.1.10|^3|^4",
- "php": ">=8.0.2",
+ "php": ">=8.1",
"psr/event-dispatcher": "^1",
"psr/log": "^1|^2|^3",
- "symfony/event-dispatcher": "^5.4|^6.0",
- "symfony/mime": "^5.4|^6.0",
- "symfony/service-contracts": "^1.1|^2|^3"
+ "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
+ "symfony/mime": "^6.2|^7.0",
+ "symfony/service-contracts": "^2.5|^3"
},
"conflict": {
- "symfony/http-kernel": "<5.4"
+ "symfony/http-client-contracts": "<2.5",
+ "symfony/http-kernel": "<5.4",
+ "symfony/messenger": "<6.2",
+ "symfony/mime": "<6.2",
+ "symfony/twig-bridge": "<6.2.1"
},
"require-dev": {
- "symfony/http-client-contracts": "^1.1|^2|^3",
- "symfony/messenger": "^5.4|^6.0"
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/http-client": "^5.4|^6.0|^7.0",
+ "symfony/messenger": "^6.2|^7.0",
+ "symfony/twig-bridge": "^6.2|^7.0"
},
"type": "library",
"autoload": {
@@ -5745,7 +5831,7 @@
"description": "Helps sending emails",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/mailer/tree/v6.0.19"
+ "source": "https://github.com/symfony/mailer/tree/v6.4.40"
},
"funding": [
{
@@ -5756,29 +5842,34 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-11T11:50:03+00:00"
+ "time": "2026-05-19T20:33:22+00:00"
},
{
"name": "symfony/mime",
- "version": "v6.0.19",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
- "reference": "d7052547a0070cbeadd474e172b527a00d657301"
+ "reference": "5575d37f8841e4e31d5df79ab3db078ae557ff8e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/d7052547a0070cbeadd474e172b527a00d657301",
- "reference": "d7052547a0070cbeadd474e172b527a00d657301",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/5575d37f8841e4e31d5df79ab3db078ae557ff8e",
+ "reference": "5575d37f8841e4e31d5df79ab3db078ae557ff8e",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-intl-idn": "^1.10",
"symfony/polyfill-mbstring": "^1.0"
},
@@ -5787,15 +5878,17 @@
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"symfony/mailer": "<5.4",
- "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6"
+ "symfony/serializer": "<6.4.3|>7.0,<7.0.3"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3.1|^4",
+ "league/html-to-markdown": "^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/property-access": "^5.4|^6.0",
- "symfony/property-info": "^5.4|^6.0",
- "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6"
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.4|^7.0",
+ "symfony/property-access": "^5.4|^6.0|^7.0",
+ "symfony/property-info": "^5.4|^6.0|^7.0",
+ "symfony/serializer": "^6.4.3|^7.0.3"
},
"type": "library",
"autoload": {
@@ -5827,7 +5920,7 @@
"mime-type"
],
"support": {
- "source": "https://github.com/symfony/mime/tree/v6.0.19"
+ "source": "https://github.com/symfony/mime/tree/v6.4.41"
},
"funding": [
{
@@ -5838,12 +5931,16 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-11T11:50:03+00:00"
+ "time": "2026-05-23T14:40:34+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -6352,17 +6449,17 @@
"time": "2026-04-10T16:19:22+00:00"
},
{
- "name": "symfony/polyfill-php81",
+ "name": "symfony/polyfill-php83",
"version": "v1.38.1",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7"
+ "url": "https://github.com/symfony/polyfill-php83.git",
+ "reference": "8339098cae28673c15cce00d80734af0453054e2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
- "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7",
+ "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/8339098cae28673c15cce00d80734af0453054e2",
+ "reference": "8339098cae28673c15cce00d80734af0453054e2",
"shasum": ""
},
"require": {
@@ -6380,7 +6477,7 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Php81\\": ""
+ "Symfony\\Polyfill\\Php83\\": ""
},
"classmap": [
"Resources/stubs"
@@ -6400,7 +6497,7 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@@ -6409,7 +6506,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1"
+ "source": "https://github.com/symfony/polyfill-php83/tree/v1.38.1"
},
"funding": [
{
@@ -6429,7 +6526,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-26T12:45:58+00:00"
+ "time": "2026-05-26T12:51:13+00:00"
},
{
"name": "symfony/polyfill-uuid",
@@ -6516,20 +6613,20 @@
},
{
"name": "symfony/process",
- "version": "v6.0.19",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "2114fd60f26a296cc403a7939ab91478475a33d4"
+ "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/2114fd60f26a296cc403a7939ab91478475a33d4",
- "reference": "2114fd60f26a296cc403a7939ab91478475a33d4",
+ "url": "https://api.github.com/repos/symfony/process/zipball/c8fc09bdfe9fde9aaa89b415a4477feaccec16a7",
+ "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1"
},
"type": "library",
"autoload": {
@@ -6557,7 +6654,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v6.0.19"
+ "source": "https://github.com/symfony/process/tree/v6.4.41"
},
"funding": [
{
@@ -6568,50 +6665,49 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-05-23T13:47:21+00:00"
},
{
"name": "symfony/routing",
- "version": "v6.0.19",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "e56ca9b41c1ec447193474cd86ad7c0b547755ac"
+ "reference": "af04c79671fd8df0805a44c83fa2b0ba56c8329e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/e56ca9b41c1ec447193474cd86ad7c0b547755ac",
- "reference": "e56ca9b41c1ec447193474cd86ad7c0b547755ac",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/af04c79671fd8df0805a44c83fa2b0ba56c8329e",
+ "reference": "af04c79671fd8df0805a44c83fa2b0ba56c8329e",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3"
},
"conflict": {
"doctrine/annotations": "<1.12",
- "symfony/config": "<5.4",
+ "symfony/config": "<6.2",
"symfony/dependency-injection": "<5.4",
"symfony/yaml": "<5.4"
},
"require-dev": {
"doctrine/annotations": "^1.12|^2",
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/expression-language": "^5.4|^6.0",
- "symfony/http-foundation": "^5.4|^6.0",
- "symfony/yaml": "^5.4|^6.0"
- },
- "suggest": {
- "symfony/config": "For using the all-in-one router or any loader",
- "symfony/expression-language": "For using expression matching",
- "symfony/http-foundation": "For using a Symfony Request object",
- "symfony/yaml": "For using the YAML loader"
+ "symfony/config": "^6.2|^7.0",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/expression-language": "^5.4|^6.0|^7.0",
+ "symfony/http-foundation": "^5.4|^6.0|^7.0",
+ "symfony/yaml": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -6645,7 +6741,7 @@
"url"
],
"support": {
- "source": "https://github.com/symfony/routing/tree/v6.0.19"
+ "source": "https://github.com/symfony/routing/tree/v6.4.41"
},
"funding": [
{
@@ -6656,37 +6752,39 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-05-24T11:18:16+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v3.0.2",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66"
+ "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66",
- "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d25d82433a80eba6aa0e6c24b61d7370d99e444a",
+ "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
- "psr/container": "^2.0"
+ "php": ">=8.1",
+ "psr/container": "^1.1|^2.0",
+ "symfony/deprecation-contracts": "^2.5|^3"
},
"conflict": {
"ext-psr": "<1.1|>=2"
},
- "suggest": {
- "symfony/service-implementation": ""
- },
"type": "library",
"extra": {
"thanks": {
@@ -6694,13 +6792,16 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Service\\": ""
- }
+ },
+ "exclude-from-classmap": [
+ "/Test/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -6727,7 +6828,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v3.0.2"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -6738,42 +6839,46 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2022-05-30T19:17:58+00:00"
+ "time": "2026-03-28T09:44:51+00:00"
},
{
"name": "symfony/string",
- "version": "v6.0.19",
+ "version": "v6.4.39",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a"
+ "reference": "62e3c927de664edadb5bef260987eb047a17a113"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a",
- "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a",
+ "url": "https://api.github.com/repos/symfony/string/zipball/62e3c927de664edadb5bef260987eb047a17a113",
+ "reference": "62e3c927de664edadb5bef260987eb047a17a113",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/translation-contracts": "<2.0"
+ "symfony/translation-contracts": "<2.5"
},
"require-dev": {
- "symfony/error-handler": "^5.4|^6.0",
- "symfony/http-client": "^5.4|^6.0",
- "symfony/translation-contracts": "^2.0|^3.0",
- "symfony/var-exporter": "^5.4|^6.0"
+ "symfony/http-client": "^5.4|^6.0|^7.0",
+ "symfony/intl": "^6.2|^7.0",
+ "symfony/translation-contracts": "^2.5|^3.0",
+ "symfony/var-exporter": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -6812,7 +6917,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v6.0.19"
+ "source": "https://github.com/symfony/string/tree/v6.4.39"
},
"funding": [
{
@@ -6823,37 +6928,44 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-05-12T11:44:19+00:00"
},
{
"name": "symfony/translation",
- "version": "v6.0.19",
+ "version": "v6.4.38",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f"
+ "reference": "afaa31b0c12d9a659eed1ea97f268a614cc1299c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f",
- "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/afaa31b0c12d9a659eed1ea97f268a614cc1299c",
+ "reference": "afaa31b0c12d9a659eed1ea97f268a614cc1299c",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/translation-contracts": "^2.3|^3.0"
+ "symfony/translation-contracts": "^2.5|^3.0"
},
"conflict": {
"symfony/config": "<5.4",
"symfony/console": "<5.4",
"symfony/dependency-injection": "<5.4",
+ "symfony/http-client-contracts": "<2.5",
"symfony/http-kernel": "<5.4",
+ "symfony/service-contracts": "<2.5",
"symfony/twig-bundle": "<5.4",
"symfony/yaml": "<5.4"
},
@@ -6861,22 +6973,19 @@
"symfony/translation-implementation": "2.3|3.0"
},
"require-dev": {
+ "nikic/php-parser": "^4.18|^5.0",
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0",
- "symfony/console": "^5.4|^6.0",
- "symfony/dependency-injection": "^5.4|^6.0",
- "symfony/finder": "^5.4|^6.0",
- "symfony/http-client-contracts": "^1.1|^2.0|^3.0",
- "symfony/http-kernel": "^5.4|^6.0",
- "symfony/intl": "^5.4|^6.0",
+ "symfony/config": "^5.4|^6.0|^7.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/finder": "^5.4|^6.0|^7.0",
+ "symfony/http-client-contracts": "^2.5|^3.0",
+ "symfony/http-kernel": "^5.4|^6.0|^7.0",
+ "symfony/intl": "^5.4|^6.0|^7.0",
"symfony/polyfill-intl-icu": "^1.21",
- "symfony/service-contracts": "^1.1.2|^2|^3",
- "symfony/yaml": "^5.4|^6.0"
- },
- "suggest": {
- "psr/log-implementation": "To use logging capability in translator",
- "symfony/config": "",
- "symfony/yaml": ""
+ "symfony/routing": "^5.4|^6.0|^7.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/yaml": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -6907,7 +7016,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v6.0.19"
+ "source": "https://github.com/symfony/translation/tree/v6.4.38"
},
"funding": [
{
@@ -6918,32 +7027,33 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2026-05-06T08:55:54+00:00"
},
{
"name": "symfony/translation-contracts",
- "version": "v3.0.2",
+ "version": "v3.7.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
- "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282"
+ "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282",
- "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/0ab302977a952b42fd51475c4ebac81f8da0a95d",
+ "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
- },
- "suggest": {
- "symfony/translation-implementation": ""
+ "php": ">=8.1"
},
"type": "library",
"extra": {
@@ -6952,13 +7062,16 @@
"name": "symfony/contracts"
},
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "3.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Translation\\": ""
- }
+ },
+ "exclude-from-classmap": [
+ "/Test/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -6985,7 +7098,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2"
+ "source": "https://github.com/symfony/translation-contracts/tree/v3.7.0"
},
"funding": [
{
@@ -6996,33 +7109,37 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2022-06-27T17:10:44+00:00"
+ "time": "2026-01-05T13:30:16+00:00"
},
{
"name": "symfony/uid",
- "version": "v6.0.19",
+ "version": "v6.4.32",
"source": {
"type": "git",
"url": "https://github.com/symfony/uid.git",
- "reference": "6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d"
+ "reference": "6b973c385f00341b246f697d82dc01a09107acdd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/uid/zipball/6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d",
- "reference": "6499e28b0ac9f2aa3151e11845bdb5cd21e6bb9d",
+ "url": "https://api.github.com/repos/symfony/uid/zipball/6b973c385f00341b246f697d82dc01a09107acdd",
+ "reference": "6b973c385f00341b246f697d82dc01a09107acdd",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
"symfony/polyfill-uuid": "^1.15"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0"
+ "symfony/console": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -7059,7 +7176,7 @@
"uuid"
],
"support": {
- "source": "https://github.com/symfony/uid/tree/v6.0.19"
+ "source": "https://github.com/symfony/uid/tree/v6.4.32"
},
"funding": [
{
@@ -7070,47 +7187,47 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-01T08:36:10+00:00"
+ "time": "2025-12-23T15:07:59+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v6.0.19",
+ "version": "v6.4.36",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "eb980457fa6899840fe1687e8627a03a7d8a3d52"
+ "reference": "7c8ad9ce4faf6c8a99948e70ce02b601a0439782"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eb980457fa6899840fe1687e8627a03a7d8a3d52",
- "reference": "eb980457fa6899840fe1687e8627a03a7d8a3d52",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7c8ad9ce4faf6c8a99948e70ce02b601a0439782",
+ "reference": "7c8ad9ce4faf6c8a99948e70ce02b601a0439782",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "phpunit/phpunit": "<5.4.3",
"symfony/console": "<5.4"
},
"require-dev": {
- "ext-iconv": "*",
- "symfony/console": "^5.4|^6.0",
- "symfony/process": "^5.4|^6.0",
- "symfony/uid": "^5.4|^6.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/error-handler": "^6.3|^7.0",
+ "symfony/http-kernel": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/uid": "^5.4|^6.0|^7.0",
"twig/twig": "^2.13|^3.0.4"
},
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "ext-intl": "To show region name in time zone dump",
- "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
- },
"bin": [
"Resources/bin/var-dump-server"
],
@@ -7147,7 +7264,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v6.0.19"
+ "source": "https://github.com/symfony/var-dumper/tree/v6.4.36"
},
"funding": [
{
@@ -7158,12 +7275,16 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-20T17:44:14+00:00"
+ "time": "2026-03-30T15:36:00+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@@ -7433,22 +7554,22 @@
"packages-dev": [
{
"name": "appzcoder/crud-generator",
- "version": "v3.3.1",
+ "version": "v4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sohelamin/crud-generator.git",
- "reference": "207dbdd1f9a8dd8c791d5304d57826c1bbb510b3"
+ "reference": "46dd9b21aaac8b24465956ebd82ef1dd27cb4325"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sohelamin/crud-generator/zipball/207dbdd1f9a8dd8c791d5304d57826c1bbb510b3",
- "reference": "207dbdd1f9a8dd8c791d5304d57826c1bbb510b3",
+ "url": "https://api.github.com/repos/sohelamin/crud-generator/zipball/46dd9b21aaac8b24465956ebd82ef1dd27cb4325",
+ "reference": "46dd9b21aaac8b24465956ebd82ef1dd27cb4325",
"shasum": ""
},
"require": {
- "illuminate/support": "^5.3|^6.0|^7.0|^8.0|^9.0",
- "laravelcollective/html": "^5.3|^6.0|^7.0",
- "php": ">=5.6.4|>=7.0|^8.0"
+ "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0",
+ "laravel/breeze": "^1.10|^2.0",
+ "php": "^8.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
@@ -7492,36 +7613,36 @@
],
"support": {
"issues": "https://github.com/sohelamin/crud-generator/issues",
- "source": "https://github.com/sohelamin/crud-generator/tree/v3.3.1"
+ "source": "https://github.com/sohelamin/crud-generator/tree/v4.0.0"
},
- "time": "2022-08-09T18:29:29+00:00"
+ "time": "2024-03-13T18:06:47+00:00"
},
{
"name": "barryvdh/laravel-debugbar",
- "version": "v3.14.10",
+ "version": "v3.16.5",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
- "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63"
+ "reference": "e85c0a8464da67e5b4a53a42796d46a43fc06c9a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/56b9bd235e3fe62e250124804009ce5bab97cc63",
- "reference": "56b9bd235e3fe62e250124804009ce5bab97cc63",
+ "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/e85c0a8464da67e5b4a53a42796d46a43fc06c9a",
+ "reference": "e85c0a8464da67e5b4a53a42796d46a43fc06c9a",
"shasum": ""
},
"require": {
- "illuminate/routing": "^9|^10|^11",
- "illuminate/session": "^9|^10|^11",
- "illuminate/support": "^9|^10|^11",
- "maximebf/debugbar": "~1.23.0",
- "php": "^8.0",
- "symfony/finder": "^6|^7"
+ "illuminate/routing": "^10|^11|^12",
+ "illuminate/session": "^10|^11|^12",
+ "illuminate/support": "^10|^11|^12",
+ "php": "^8.1",
+ "php-debugbar/php-debugbar": "^2.2.4",
+ "symfony/finder": "^6|^7|^8"
},
"require-dev": {
"mockery/mockery": "^1.3.3",
- "orchestra/testbench-dusk": "^5|^6|^7|^8|^9",
- "phpunit/phpunit": "^9.6|^10.5",
+ "orchestra/testbench-dusk": "^7|^8|^9|^10",
+ "phpunit/phpunit": "^9.5.10|^10|^11",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
@@ -7535,7 +7656,7 @@
]
},
"branch-alias": {
- "dev-master": "3.14-dev"
+ "dev-master": "3.16-dev"
}
},
"autoload": {
@@ -7560,13 +7681,14 @@
"keywords": [
"debug",
"debugbar",
+ "dev",
"laravel",
"profiler",
"webprofiler"
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
- "source": "https://github.com/fruitcake/laravel-debugbar/tree/v3.14.10"
+ "source": "https://github.com/fruitcake/laravel-debugbar/tree/v3.16.5"
},
"funding": [
{
@@ -7578,34 +7700,34 @@
"type": "github"
}
],
- "time": "2024-12-23T10:10:42+00:00"
+ "time": "2026-01-23T15:03:22+00:00"
},
{
"name": "doctrine/instantiator",
- "version": "1.5.0",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
- "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
+ "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
"shasum": ""
},
"require": {
- "php": "^7.1 || ^8.0"
+ "php": "^8.1"
},
"require-dev": {
- "doctrine/coding-standard": "^9 || ^11",
+ "doctrine/coding-standard": "^11",
"ext-pdo": "*",
"ext-phar": "*",
- "phpbench/phpbench": "^0.16 || ^1",
- "phpstan/phpstan": "^1.4",
- "phpstan/phpstan-phpunit": "^1",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.30 || ^5.4"
+ "phpbench/phpbench": "^1.2",
+ "phpstan/phpstan": "^1.9.4",
+ "phpstan/phpstan-phpunit": "^1.3",
+ "phpunit/phpunit": "^9.5.27",
+ "vimeo/psalm": "^5.4"
},
"type": "library",
"autoload": {
@@ -7632,7 +7754,7 @@
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
+ "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
},
"funding": [
{
@@ -7648,7 +7770,7 @@
"type": "tidelift"
}
],
- "time": "2022-12-30T00:15:36+00:00"
+ "time": "2022-12-30T00:23:10+00:00"
},
{
"name": "erusev/parsedown",
@@ -7887,16 +8009,16 @@
},
{
"name": "knuckleswtf/scribe",
- "version": "3.37.2",
+ "version": "4.40.0",
"source": {
"type": "git",
"url": "https://github.com/knuckleswtf/scribe.git",
- "reference": "74c483d8f14a57c36fad6a1063cab5437c312c6b"
+ "reference": "1ad707f229185bb2413ea9ed2fb01747abe78ff6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/74c483d8f14a57c36fad6a1063cab5437c312c6b",
- "reference": "74c483d8f14a57c36fad6a1063cab5437c312c6b",
+ "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/1ad707f229185bb2413ea9ed2fb01747abe78ff6",
+ "reference": "1ad707f229185bb2413ea9ed2fb01747abe78ff6",
"shasum": ""
},
"require": {
@@ -7905,37 +8027,37 @@
"ext-json": "*",
"ext-pdo": "*",
"fakerphp/faker": "^1.9.1",
- "illuminate/console": "^6.0|^7.0|^8.0|^9.0",
- "illuminate/routing": "^6.0|^7.0|^8.0|^9.0",
- "illuminate/support": "^6.0|^7.0|^8.0|^9.0",
+ "illuminate/console": "^8.0|^9.0|^10.0|^11.0",
+ "illuminate/routing": "^8.0|^9.0|^10.0|^11.0",
+ "illuminate/support": "^8.0|^9.0|^10.0|^11.0",
"league/flysystem": "^1.1.4|^2.1.1|^3.0",
"mpociot/reflection-docblock": "^1.0.1",
- "nikic/php-parser": "^4.10",
- "nunomaduro/collision": "^3.0|^4.0|^5.0|^6.0",
- "php": ">=7.4",
- "ramsey/uuid": "^3.8|^4.0",
+ "nikic/php-parser": "^5.0",
+ "nunomaduro/collision": "^5.10|^6.0|^7.0|^8.0",
+ "php": ">=8.0",
+ "ramsey/uuid": "^4.2.2",
"shalvah/clara": "^3.1.0",
- "shalvah/upgrader": "0.*",
+ "shalvah/upgrader": ">=0.6.0",
"spatie/data-transfer-object": "^2.6|^3.0",
- "symfony/var-exporter": "^4.0|^5.0|^6.0",
- "symfony/yaml": "^4.0|^5.0|^6.0"
+ "symfony/var-exporter": "^5.4|^6.0|^7.0",
+ "symfony/yaml": "^5.4|^6.0|^7.0"
},
"replace": {
"mpociot/laravel-apidoc-generator": "*"
},
"require-dev": {
"brianium/paratest": "^6.0",
- "dms/phpunit-arraysubset-asserts": "^0.2.0",
+ "dms/phpunit-arraysubset-asserts": "^0.4",
"laravel/legacy-factories": "^1.3.0",
- "laravel/lumen-framework": "^6.0|^7.0|^8.0|^9.0",
- "league/fractal": "^0.19.0",
+ "laravel/lumen-framework": "^8.0|^9.0|^10.0",
+ "league/fractal": "^0.20",
"nikic/fast-route": "^1.3",
- "orchestra/testbench": "^4.0|^5.0|^6.0|^7.0",
+ "orchestra/testbench": "^6.0|^7.0|^8.0",
"pestphp/pest": "^1.21",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.0|^10.0",
- "symfony/css-selector": "^5.3|^6.0",
- "symfony/dom-crawler": "^5.3|^6.0"
+ "symfony/css-selector": "^5.4|^6.0",
+ "symfony/dom-crawler": "^5.4|^6.0"
},
"type": "library",
"extra": {
@@ -7957,8 +8079,7 @@
],
"authors": [
{
- "name": "Shalvah",
- "email": "hello@shalvah.me"
+ "name": "Shalvah"
}
],
"description": "Generate API documentation for humans from your Laravel codebase.✍",
@@ -7971,7 +8092,7 @@
],
"support": {
"issues": "https://github.com/knuckleswtf/scribe/issues",
- "source": "https://github.com/knuckleswtf/scribe/tree/3.37.2"
+ "source": "https://github.com/knuckleswtf/scribe/tree/4.40.0"
},
"funding": [
{
@@ -7979,47 +8100,47 @@
"type": "patreon"
}
],
- "time": "2022-09-07T23:13:06+00:00"
+ "time": "2025-02-03T20:29:15+00:00"
},
{
- "name": "maximebf/debugbar",
- "version": "v1.23.6",
+ "name": "laravel/breeze",
+ "version": "v1.29.1",
"source": {
"type": "git",
- "url": "https://github.com/php-debugbar/php-debugbar.git",
- "reference": "4b3d5f1afe09a7db5a9d3282890f49f6176d6542"
+ "url": "https://github.com/laravel/breeze.git",
+ "reference": "22c53b84b7fff91b01a318d71a10dfc251e92849"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/4b3d5f1afe09a7db5a9d3282890f49f6176d6542",
- "reference": "4b3d5f1afe09a7db5a9d3282890f49f6176d6542",
+ "url": "https://api.github.com/repos/laravel/breeze/zipball/22c53b84b7fff91b01a318d71a10dfc251e92849",
+ "reference": "22c53b84b7fff91b01a318d71a10dfc251e92849",
"shasum": ""
},
"require": {
- "php": "^7.2|^8",
- "psr/log": "^1|^2|^3",
- "symfony/var-dumper": "^4|^5|^6|^7"
+ "illuminate/console": "^10.17",
+ "illuminate/filesystem": "^10.17",
+ "illuminate/support": "^10.17",
+ "illuminate/validation": "^10.17",
+ "php": "^8.1.0"
},
"require-dev": {
- "dbrekelmans/bdi": "^1",
- "phpunit/phpunit": "^8|^9",
- "symfony/panther": "^1|^2.1",
- "twig/twig": "^1.38|^2.7|^3.0"
- },
- "suggest": {
- "kriswallsmith/assetic": "The best way to manage assets",
- "monolog/monolog": "Log using Monolog",
- "predis/predis": "Redis storage"
+ "orchestra/testbench": "^8.0",
+ "phpstan/phpstan": "^1.10"
},
"type": "library",
"extra": {
+ "laravel": {
+ "providers": [
+ "Laravel\\Breeze\\BreezeServiceProvider"
+ ]
+ },
"branch-alias": {
- "dev-master": "1.23-dev"
+ "dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
- "DebugBar\\": "src/DebugBar/"
+ "Laravel\\Breeze\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -8028,27 +8149,20 @@
],
"authors": [
{
- "name": "Maxime Bouroumeau-Fuseau",
- "email": "maxime.bouroumeau@gmail.com",
- "homepage": "http://maximebf.com"
- },
- {
- "name": "Barry vd. Heuvel",
- "email": "barryvdh@gmail.com"
+ "name": "Taylor Otwell",
+ "email": "taylor@laravel.com"
}
],
- "description": "Debug bar in the browser for php application",
- "homepage": "https://github.com/maximebf/php-debugbar",
+ "description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
"keywords": [
- "debug",
- "debugbar"
+ "auth",
+ "laravel"
],
"support": {
- "issues": "https://github.com/php-debugbar/php-debugbar/issues",
- "source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.6"
+ "issues": "https://github.com/laravel/breeze/issues",
+ "source": "https://github.com/laravel/breeze"
},
- "abandoned": "php-debugbar/php-debugbar",
- "time": "2025-02-13T12:22:36+00:00"
+ "time": "2024-03-04T14:35:21+00:00"
},
{
"name": "mockery/mockery",
@@ -8452,6 +8566,80 @@
},
"time": "2022-02-21T01:04:05+00:00"
},
+ {
+ "name": "php-debugbar/php-debugbar",
+ "version": "v2.2.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-debugbar/php-debugbar.git",
+ "reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
+ "reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.1",
+ "psr/log": "^1|^2|^3",
+ "symfony/var-dumper": "^5.4|^6.4|^7.3|^8.0"
+ },
+ "replace": {
+ "maximebf/debugbar": "self.version"
+ },
+ "require-dev": {
+ "dbrekelmans/bdi": "^1",
+ "phpunit/phpunit": "^10",
+ "symfony/browser-kit": "^6.0|7.0",
+ "symfony/panther": "^1|^2.1",
+ "twig/twig": "^3.11.2"
+ },
+ "suggest": {
+ "kriswallsmith/assetic": "The best way to manage assets",
+ "monolog/monolog": "Log using Monolog",
+ "predis/predis": "Redis storage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.2-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "DebugBar\\": "src/DebugBar/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Maxime Bouroumeau-Fuseau",
+ "email": "maxime.bouroumeau@gmail.com",
+ "homepage": "http://maximebf.com"
+ },
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "barryvdh@gmail.com"
+ }
+ ],
+ "description": "Debug bar in the browser for php application",
+ "homepage": "https://github.com/php-debugbar/php-debugbar",
+ "keywords": [
+ "debug",
+ "debug bar",
+ "debugbar",
+ "dev"
+ ],
+ "support": {
+ "issues": "https://github.com/php-debugbar/php-debugbar/issues",
+ "source": "https://github.com/php-debugbar/php-debugbar/tree/v2.2.6"
+ },
+ "time": "2025-12-22T13:21:32+00:00"
+ },
{
"name": "phpunit/php-code-coverage",
"version": "9.2.32",
@@ -9942,21 +10130,21 @@
},
{
"name": "shalvah/upgrader",
- "version": "0.5.0",
+ "version": "0.6.0",
"source": {
"type": "git",
"url": "https://github.com/shalvah/upgrader.git",
- "reference": "e1ee67cc411ca9af61375548431e2f38f694ea85"
+ "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/shalvah/upgrader/zipball/e1ee67cc411ca9af61375548431e2f38f694ea85",
- "reference": "e1ee67cc411ca9af61375548431e2f38f694ea85",
+ "url": "https://api.github.com/repos/shalvah/upgrader/zipball/d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
+ "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
"shasum": ""
},
"require": {
"illuminate/support": ">=8.0",
- "nikic/php-parser": "^4.13|^5.0",
+ "nikic/php-parser": "^5.0",
"php": ">=8.0"
},
"require-dev": {
@@ -9988,7 +10176,7 @@
],
"support": {
"issues": "https://github.com/shalvah/upgrader/issues",
- "source": "https://github.com/shalvah/upgrader/tree/0.5.0"
+ "source": "https://github.com/shalvah/upgrader/tree/0.6.0"
},
"funding": [
{
@@ -9996,7 +10184,7 @@
"type": "patreon"
}
],
- "time": "2024-02-20T11:48:40+00:00"
+ "time": "2024-02-20T11:51:46+00:00"
},
{
"name": "spatie/backtrace",
@@ -10126,6 +10314,80 @@
"abandoned": "spatie/laravel-data",
"time": "2022-09-16T13:34:38+00:00"
},
+ {
+ "name": "spatie/error-solutions",
+ "version": "1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/error-solutions.git",
+ "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/error-solutions/zipball/e495d7178ca524f2dd0fe6a1d99a1e608e1c9936",
+ "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.0"
+ },
+ "require-dev": {
+ "illuminate/broadcasting": "^10.0|^11.0|^12.0",
+ "illuminate/cache": "^10.0|^11.0|^12.0",
+ "illuminate/support": "^10.0|^11.0|^12.0",
+ "livewire/livewire": "^2.11|^3.5.20",
+ "openai-php/client": "^0.10.1",
+ "orchestra/testbench": "8.22.3|^9.0|^10.0",
+ "pestphp/pest": "^2.20|^3.0",
+ "phpstan/phpstan": "^2.1",
+ "psr/simple-cache": "^3.0",
+ "psr/simple-cache-implementation": "^3.0",
+ "spatie/ray": "^1.28",
+ "symfony/cache": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "vlucas/phpdotenv": "^5.5"
+ },
+ "suggest": {
+ "openai-php/client": "Require get solutions from OpenAI",
+ "simple-cache-implementation": "To cache solutions from OpenAI"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Spatie\\Ignition\\": "legacy/ignition",
+ "Spatie\\ErrorSolutions\\": "src",
+ "Spatie\\LaravelIgnition\\": "legacy/laravel-ignition"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ruben Van Assche",
+ "email": "ruben@spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "This is my package error-solutions",
+ "homepage": "https://github.com/spatie/error-solutions",
+ "keywords": [
+ "error-solutions",
+ "spatie"
+ ],
+ "support": {
+ "issues": "https://github.com/spatie/error-solutions/issues",
+ "source": "https://github.com/spatie/error-solutions/tree/1.1.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/Spatie",
+ "type": "github"
+ }
+ ],
+ "time": "2025-02-14T12:29:50+00:00"
+ },
{
"name": "spatie/flare-client-php",
"version": "1.11.1",
@@ -10197,37 +10459,40 @@
},
{
"name": "spatie/ignition",
- "version": "1.14.2",
+ "version": "1.16.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/ignition.git",
- "reference": "5e11c11f675bb5251f061491a493e04a1a571532"
+ "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/ignition/zipball/5e11c11f675bb5251f061491a493e04a1a571532",
- "reference": "5e11c11f675bb5251f061491a493e04a1a571532",
+ "url": "https://api.github.com/repos/spatie/ignition/zipball/b59385bb7aa24dae81bcc15850ebecfda7b40838",
+ "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": "^8.0",
- "spatie/backtrace": "^1.5.3",
- "spatie/flare-client-php": "^1.4.0",
- "symfony/console": "^5.4|^6.0|^7.0",
- "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ "spatie/backtrace": "^1.7.1",
+ "spatie/error-solutions": "^1.1.2",
+ "spatie/flare-client-php": "^1.9",
+ "symfony/console": "^5.4.42|^6.0|^7.0|^8.0",
+ "symfony/http-foundation": "^5.4.42|^6.0|^7.0|^8.0",
+ "symfony/mime": "^5.4.42|^6.0|^7.0|^8.0",
+ "symfony/var-dumper": "^5.4.42|^6.0|^7.0|^8.0"
},
"require-dev": {
- "illuminate/cache": "^9.52|^10.0|^11.0",
+ "illuminate/cache": "^9.52|^10.0|^11.0|^12.0|^13.0",
"mockery/mockery": "^1.4",
- "pestphp/pest": "^1.20|^2.0",
+ "pestphp/pest": "^1.20|^2.0|^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"psr/simple-cache-implementation": "*",
- "symfony/cache": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/cache": "^5.4.38|^6.0|^7.0|^8.0",
+ "symfony/process": "^5.4.35|^6.0|^7.0|^8.0",
"vlucas/phpdotenv": "^5.5"
},
"suggest": {
@@ -10276,45 +10541,46 @@
"type": "github"
}
],
- "time": "2024-05-29T08:10:20+00:00"
+ "time": "2026-03-17T10:51:08+00:00"
},
{
"name": "spatie/laravel-ignition",
- "version": "1.7.2",
+ "version": "2.9.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-ignition.git",
- "reference": "30fd8f91deadba03da4d33237d624e824536c35a"
+ "reference": "1baee07216d6748ebd3a65ba97381b051838707a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/30fd8f91deadba03da4d33237d624e824536c35a",
- "reference": "30fd8f91deadba03da4d33237d624e824536c35a",
+ "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/1baee07216d6748ebd3a65ba97381b051838707a",
+ "reference": "1baee07216d6748ebd3a65ba97381b051838707a",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
- "illuminate/support": "^8.77|^9.27",
- "monolog/monolog": "^2.3",
- "php": "^8.0",
- "spatie/flare-client-php": "^1.0.1",
- "spatie/ignition": ">=1.4.1 <=1.14.2",
- "symfony/console": "^5.0|^6.0",
- "symfony/var-dumper": "^5.0|^6.0"
+ "illuminate/support": "^10.0|^11.0|^12.0",
+ "php": "^8.1",
+ "spatie/ignition": "^1.15",
+ "symfony/console": "^6.2.3|^7.0",
+ "symfony/var-dumper": "^6.2.3|^7.0"
},
"require-dev": {
- "filp/whoops": "^2.14",
- "livewire/livewire": "^2.8|dev-develop",
- "mockery/mockery": "^1.4",
- "nunomaduro/larastan": "^1.0",
- "orchestra/testbench": "^6.23|^7.0",
- "pestphp/pest": "^1.20",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan-deprecation-rules": "^1.0",
- "phpstan/phpstan-phpunit": "^1.0",
- "spatie/laravel-ray": "^1.27"
+ "livewire/livewire": "^2.11|^3.3.5",
+ "mockery/mockery": "^1.5.1",
+ "openai-php/client": "^0.8.1|^0.10",
+ "orchestra/testbench": "8.22.3|^9.0|^10.0",
+ "pestphp/pest": "^2.34|^3.7",
+ "phpstan/extension-installer": "^1.3.1",
+ "phpstan/phpstan-deprecation-rules": "^1.1.1|^2.0",
+ "phpstan/phpstan-phpunit": "^1.3.16|^2.0",
+ "vlucas/phpdotenv": "^5.5"
+ },
+ "suggest": {
+ "openai-php/client": "Require get solutions from OpenAI",
+ "psr/simple-cache-implementation": "Needed to cache solutions from OpenAI"
},
"type": "library",
"extra": {
@@ -10366,27 +10632,30 @@
"type": "github"
}
],
- "time": "2026-03-17T15:56:37+00:00"
+ "time": "2025-02-20T13:13:55+00:00"
},
{
"name": "symfony/var-exporter",
- "version": "v6.0.19",
+ "version": "v6.4.37",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
- "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2"
+ "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
- "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2",
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/34f6957deffacabd1b1c579a312daa481e3e99ca",
+ "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3"
},
"require-dev": {
- "symfony/var-dumper": "^5.4|^6.0"
+ "symfony/property-access": "^6.4|^7.0",
+ "symfony/serializer": "^6.4|^7.0",
+ "symfony/var-dumper": "^5.4|^6.0|^7.0"
},
"type": "library",
"autoload": {
@@ -10419,10 +10688,12 @@
"export",
"hydrate",
"instantiate",
+ "lazy-loading",
+ "proxy",
"serialize"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v6.0.19"
+ "source": "https://github.com/symfony/var-exporter/tree/v6.4.37"
},
"funding": [
{
@@ -10433,39 +10704,41 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-13T08:34:10+00:00"
+ "time": "2026-04-14T12:12:40+00:00"
},
{
"name": "symfony/yaml",
- "version": "v6.0.19",
+ "version": "v6.4.41",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "deec3a812a0305a50db8ae689b183f43d915c884"
+ "reference": "e8fdf3408c85806198d5826e604ffc6830d33152"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884",
- "reference": "deec3a812a0305a50db8ae689b183f43d915c884",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/e8fdf3408c85806198d5826e604ffc6830d33152",
+ "reference": "e8fdf3408c85806198d5826e604ffc6830d33152",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<5.4"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0"
- },
- "suggest": {
- "symfony/console": "For validating YAML files using the lint command"
+ "symfony/console": "^5.4|^6.0|^7.0"
},
"bin": [
"Resources/bin/yaml-lint"
@@ -10496,7 +10769,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/yaml/tree/v6.0.19"
+ "source": "https://github.com/symfony/yaml/tree/v6.4.41"
},
"funding": [
{
@@ -10507,12 +10780,16 @@
"url": "https://github.com/fabpot",
"type": "github"
},
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
- "time": "2023-01-11T11:50:03+00:00"
+ "time": "2026-05-25T06:03:23+00:00"
},
{
"name": "theseer/tokenizer",
@@ -10566,16 +10843,16 @@
}
],
"aliases": [],
- "minimum-stability": "dev",
+ "minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": "^8.0"
+ "php": "^8.1"
},
"platform-dev": [],
"platform-overrides": {
- "php": "8.0.30"
+ "php": "8.2"
},
"plugin-api-version": "2.6.0"
}
diff --git a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
index 63cacfbc..3d6a7396 100644
--- a/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
+++ b/database/migrations/2021_09_27_134729_upgrade_db_to_utf8mb4.php
@@ -27,7 +27,7 @@ private function convertDb($connection, $charset, $collate, $dryRun)
$dbName = config("database.connections.{$connection}.database");
$varchars = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'varchar' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE = 'varchar' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'")->getValue(DB::connection()->getQueryGrammar()));
// Check if shrinking field size will truncate!
$skip = []; // List of table.column that will be handled manually
@@ -40,12 +40,12 @@ private function convertDb($connection, $charset, $collate, $dryRun)
// Check if column is indexed
$index = \DB::connection($connection)
- ->select(\DB::raw("SHOW INDEX FROM `{$t->TABLE_NAME}` where column_name = '{$t->COLUMN_NAME}'"));
+ ->select(\DB::raw("SHOW INDEX FROM `{$t->TABLE_NAME}` where column_name = '{$t->COLUMN_NAME}'")->getValue(DB::connection()->getQueryGrammar()));
$indexed[$key] = count($index) ? true : false;
if (count($index)) {
$result = \DB::connection($connection)
- ->select(\DB::raw("SELECT count(*) as `count` from `{$t->TABLE_NAME}` where length(`{$t->COLUMN_NAME}`) > 191"));
+ ->select(\DB::raw("SELECT count(*) as `count` from `{$t->TABLE_NAME}` where length(`{$t->COLUMN_NAME}`) > 191")->getValue(DB::connection()->getQueryGrammar()));
if ($result[0]->count > 0) {
echo "-- DATA TRUNCATION: {$t->TABLE_NAME}.{$t->COLUMN_NAME}({$t->CHARACTER_MAXIMUM_LENGTH}) => {$result[0]->count}".PHP_EOL;
if (! in_array($key, $skip)) {
@@ -86,14 +86,14 @@ private function convertDb($connection, $charset, $collate, $dryRun)
// Convert text like columns
$texts = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE LIKE '%text%' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'"));
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE LIKE '%text%' AND (CHARACTER_SET_NAME != '{$charset}' OR COLLATION_NAME != '{$collate}') AND TABLE_SCHEMA = '{$dbName}'")->getValue(DB::connection()->getQueryGrammar()));
foreach ($texts as $t) {
$tableChanges["{$t->TABLE_NAME}"][] = "CHANGE `{$t->COLUMN_NAME}` `{$t->COLUMN_NAME}` {$t->DATA_TYPE} CHARACTER SET {$charset} COLLATE {$collate}";
}
// Convert tables
$tables = \DB::connection($connection)
- ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_COLLATION != '{$collate}' AND TABLE_SCHEMA = '{$dbName}';"));
+ ->select(\DB::raw("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_COLLATION != '{$collate}' AND TABLE_SCHEMA = '{$dbName}';")->getValue(DB::connection()->getQueryGrammar()));
foreach ($tables as $t) {
$tableChanges["{$t->TABLE_NAME}"][] = "CONVERT TO CHARACTER SET {$charset} COLLATE {$collate}";
$tableChanges["{$t->TABLE_NAME}"][] = "DEFAULT CHARACTER SET={$charset} COLLATE={$collate}";
diff --git a/public/herd.yml b/public/herd.yml
index 03211db5..18389a30 100644
--- a/public/herd.yml
+++ b/public/herd.yml
@@ -1,5 +1,5 @@
name: BEEP
-php: '8.0'
+php: '8.2'
secured: true
aliases:
- BEEP.test
From eb788e950c9bb0e90d8af03605d06fefd77127a7 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Mon, 1 Jun 2026 16:47:40 +0200
Subject: [PATCH 075/127] composer update
---
composer.lock | 174 ++++++++++++++++++++++++++------------------------
1 file changed, 90 insertions(+), 84 deletions(-)
diff --git a/composer.lock b/composer.lock
index 78d64c5e..d01ef5df 100644
--- a/composer.lock
+++ b/composer.lock
@@ -862,20 +862,20 @@
},
{
"name": "dragonmantank/cron-expression",
- "version": "v3.5.0",
+ "version": "v3.6.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
- "reference": "1b2de7f4a468165dca07b142240733a1973e766d"
+ "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/1b2de7f4a468165dca07b142240733a1973e766d",
- "reference": "1b2de7f4a468165dca07b142240733a1973e766d",
+ "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013",
+ "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013",
"shasum": ""
},
"require": {
- "php": "^7.2|^8.0"
+ "php": "^8.2|^8.3|^8.4|^8.5"
},
"replace": {
"mtdowling/cron-expression": "^1.0"
@@ -914,7 +914,7 @@
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
- "source": "https://github.com/dragonmantank/cron-expression/tree/v3.5.0"
+ "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0"
},
"funding": [
{
@@ -922,7 +922,7 @@
"type": "github"
}
],
- "time": "2025-10-31T18:36:32+00:00"
+ "time": "2025-10-31T18:51:33+00:00"
},
{
"name": "dyrynda/laravel-cascade-soft-deletes",
@@ -3060,31 +3060,32 @@
},
{
"name": "maennchen/zipstream-php",
- "version": "3.1.1",
+ "version": "3.1.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
- "reference": "6187e9cc4493da94b9b63eb2315821552015fca9"
+ "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/6187e9cc4493da94b9b63eb2315821552015fca9",
- "reference": "6187e9cc4493da94b9b63eb2315821552015fca9",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
+ "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
- "php-64bit": "^8.1"
+ "php-64bit": "^8.2"
},
"require-dev": {
+ "brianium/paratest": "^7.7",
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
- "phpunit/phpunit": "^10.0",
- "vimeo/psalm": "^5.0"
+ "phpunit/phpunit": "^11.0",
+ "vimeo/psalm": "^6.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
@@ -3125,7 +3126,7 @@
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
- "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.1"
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
},
"funding": [
{
@@ -3133,7 +3134,7 @@
"type": "github"
}
],
- "time": "2024-10-10T12:33:01+00:00"
+ "time": "2025-01-27T12:07:53+00:00"
},
{
"name": "markbaker/complex",
@@ -3663,20 +3664,20 @@
},
{
"name": "nette/utils",
- "version": "v4.0.10",
+ "version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
- "reference": "2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3"
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nette/utils/zipball/2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3",
- "reference": "2778deb6aab136c8db4ed1f4d6e9f465ca2dbee3",
+ "url": "https://api.github.com/repos/nette/utils/zipball/7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
+ "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7",
"shasum": ""
},
"require": {
- "php": "8.0 - 8.5"
+ "php": "8.2 - 8.5"
},
"conflict": {
"nette/finder": "<3",
@@ -3684,8 +3685,10 @@
},
"require-dev": {
"jetbrains/phpstorm-attributes": "^1.2",
+ "nette/phpstan-rules": "^1.0",
"nette/tester": "^2.5",
- "phpstan/phpstan-nette": "^2.0@stable",
+ "phpstan/extension-installer": "^1.4@stable",
+ "phpstan/phpstan": "^2.1@stable",
"tracy/tracy": "^2.9"
},
"suggest": {
@@ -3699,7 +3702,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-master": "4.1-dev"
}
},
"autoload": {
@@ -3746,9 +3749,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
- "source": "https://github.com/nette/utils/tree/v4.0.10"
+ "source": "https://github.com/nette/utils/tree/v4.1.4"
},
- "time": "2025-12-01T17:30:42+00:00"
+ "time": "2026-05-11T20:49:54+00:00"
},
{
"name": "nikic/php-parser",
@@ -5051,20 +5054,20 @@
},
{
"name": "symfony/css-selector",
- "version": "v6.4.34",
+ "version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "b0314c186f1464de048cce58979ff1625ca88bbb"
+ "reference": "b75663ed96cf4756e28e3105476f220f92886cc4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0314c186f1464de048cce58979ff1625ca88bbb",
- "reference": "b0314c186f1464de048cce58979ff1625ca88bbb",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/b75663ed96cf4756e28e3105476f220f92886cc4",
+ "reference": "b75663ed96cf4756e28e3105476f220f92886cc4",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"type": "library",
"autoload": {
@@ -5096,7 +5099,7 @@
"description": "Converts CSS selectors to XPath expressions",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/css-selector/tree/v6.4.34"
+ "source": "https://github.com/symfony/css-selector/tree/v7.4.9"
},
"funding": [
{
@@ -5116,7 +5119,7 @@
"type": "tidelift"
}
],
- "time": "2026-02-16T08:37:21+00:00"
+ "time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -5270,24 +5273,24 @@
},
{
"name": "symfony/event-dispatcher",
- "version": "v6.4.37",
+ "version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "2e3bf817ba9347341ab15926700fb6320367c0e1"
+ "reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2e3bf817ba9347341ab15926700fb6320367c0e1",
- "reference": "2e3bf817ba9347341ab15926700fb6320367c0e1",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e4a2e29753c7801f7a8340e066cfa788f3bc8101",
+ "reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/event-dispatcher-contracts": "^2.5|^3"
},
"conflict": {
- "symfony/dependency-injection": "<5.4",
+ "symfony/dependency-injection": "<6.4",
"symfony/service-contracts": "<2.5"
},
"provide": {
@@ -5296,13 +5299,14 @@
},
"require-dev": {
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/error-handler": "^5.4|^6.0|^7.0",
- "symfony/expression-language": "^5.4|^6.0|^7.0",
- "symfony/http-foundation": "^5.4|^6.0|^7.0",
+ "symfony/config": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/error-handler": "^6.4|^7.0|^8.0",
+ "symfony/expression-language": "^6.4|^7.0|^8.0",
+ "symfony/framework-bundle": "^6.4|^7.0|^8.0",
+ "symfony/http-foundation": "^6.4|^7.0|^8.0",
"symfony/service-contracts": "^2.5|^3",
- "symfony/stopwatch": "^5.4|^6.0|^7.0"
+ "symfony/stopwatch": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -5330,7 +5334,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.37"
+ "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.9"
},
"funding": [
{
@@ -5350,7 +5354,7 @@
"type": "tidelift"
}
],
- "time": "2026-04-13T14:11:12+00:00"
+ "time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -5434,25 +5438,25 @@
},
{
"name": "symfony/filesystem",
- "version": "v6.4.39",
+ "version": "v7.4.11",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "c507b077756b4e3e09adbbe7975fac81cd3722ca"
+ "reference": "d721ea61b4a5fba8c5b6e7c1feda19efea144b50"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/c507b077756b4e3e09adbbe7975fac81cd3722ca",
- "reference": "c507b077756b4e3e09adbbe7975fac81cd3722ca",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/d721ea61b4a5fba8c5b6e7c1feda19efea144b50",
+ "reference": "d721ea61b4a5fba8c5b6e7c1feda19efea144b50",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8"
},
"require-dev": {
- "symfony/process": "^5.4|^6.4|^7.0"
+ "symfony/process": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -5480,7 +5484,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v6.4.39"
+ "source": "https://github.com/symfony/filesystem/tree/v7.4.11"
},
"funding": [
{
@@ -5500,7 +5504,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-07T13:11:42+00:00"
+ "time": "2026-05-11T16:38:44+00:00"
},
{
"name": "symfony/finder",
@@ -6852,22 +6856,23 @@
},
{
"name": "symfony/string",
- "version": "v6.4.39",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "62e3c927de664edadb5bef260987eb047a17a113"
+ "reference": "961683010db3b27ec6ebcd7308e6e1ee8fa7ffde"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/62e3c927de664edadb5bef260987eb047a17a113",
- "reference": "62e3c927de664edadb5bef260987eb047a17a113",
+ "url": "https://api.github.com/repos/symfony/string/zipball/961683010db3b27ec6ebcd7308e6e1ee8fa7ffde",
+ "reference": "961683010db3b27ec6ebcd7308e6e1ee8fa7ffde",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-intl-grapheme": "~1.0",
+ "symfony/polyfill-intl-grapheme": "~1.33",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
@@ -6875,10 +6880,11 @@
"symfony/translation-contracts": "<2.5"
},
"require-dev": {
- "symfony/http-client": "^5.4|^6.0|^7.0",
- "symfony/intl": "^6.2|^7.0",
+ "symfony/emoji": "^7.1|^8.0",
+ "symfony/http-client": "^6.4|^7.0|^8.0",
+ "symfony/intl": "^6.4|^7.0|^8.0",
"symfony/translation-contracts": "^2.5|^3.0",
- "symfony/var-exporter": "^5.4|^6.0|^7.0"
+ "symfony/var-exporter": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -6917,7 +6923,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v6.4.39"
+ "source": "https://github.com/symfony/string/tree/v7.4.13"
},
"funding": [
{
@@ -6937,7 +6943,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-12T11:44:19+00:00"
+ "time": "2026-05-23T15:23:29+00:00"
},
{
"name": "symfony/translation",
@@ -10636,26 +10642,26 @@
},
{
"name": "symfony/var-exporter",
- "version": "v6.4.37",
+ "version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
- "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca"
+ "reference": "22e03a49c95ef054a43601cd159b222bfab1c701"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/34f6957deffacabd1b1c579a312daa481e3e99ca",
- "reference": "34f6957deffacabd1b1c579a312daa481e3e99ca",
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/22e03a49c95ef054a43601cd159b222bfab1c701",
+ "reference": "22e03a49c95ef054a43601cd159b222bfab1c701",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3"
},
"require-dev": {
- "symfony/property-access": "^6.4|^7.0",
- "symfony/serializer": "^6.4|^7.0",
- "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ "symfony/property-access": "^6.4|^7.0|^8.0",
+ "symfony/serializer": "^6.4|^7.0|^8.0",
+ "symfony/var-dumper": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -10693,7 +10699,7 @@
"serialize"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v6.4.37"
+ "source": "https://github.com/symfony/var-exporter/tree/v7.4.9"
},
"funding": [
{
@@ -10713,32 +10719,32 @@
"type": "tidelift"
}
],
- "time": "2026-04-14T12:12:40+00:00"
+ "time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/yaml",
- "version": "v6.4.41",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "e8fdf3408c85806198d5826e604ffc6830d33152"
+ "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/e8fdf3408c85806198d5826e604ffc6830d33152",
- "reference": "e8fdf3408c85806198d5826e604ffc6830d33152",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
+ "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
- "symfony/console": "<5.4"
+ "symfony/console": "<6.4"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0|^7.0"
+ "symfony/console": "^6.4|^7.0|^8.0"
},
"bin": [
"Resources/bin/yaml-lint"
@@ -10769,7 +10775,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/yaml/tree/v6.4.41"
+ "source": "https://github.com/symfony/yaml/tree/v7.4.13"
},
"funding": [
{
@@ -10789,7 +10795,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-25T06:03:23+00:00"
+ "time": "2026-05-25T06:06:12+00:00"
},
{
"name": "theseer/tokenizer",
From 94924d1f08b6748a7e60c96a0c6f032d3790c2d3 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:58:56 +0000
Subject: [PATCH 076/127] Remove default `app` files
---
app/Http/Middleware/Authenticate.php | 17 --------
app/Http/Middleware/EncryptCookies.php | 17 --------
.../PreventRequestsDuringMaintenance.php | 17 --------
.../Middleware/RedirectIfAuthenticated.php | 30 --------------
app/Http/Middleware/TrimStrings.php | 19 ---------
app/Http/Middleware/TrustHosts.php | 20 ----------
app/Http/Middleware/TrustProxies.php | 28 -------------
app/Http/Middleware/ValidateSignature.php | 22 ----------
app/Http/Middleware/VerifyCsrfToken.php | 17 --------
app/Providers/BroadcastServiceProvider.php | 19 ---------
app/Providers/RouteServiceProvider.php | 40 -------------------
11 files changed, 246 deletions(-)
delete mode 100644 app/Http/Middleware/Authenticate.php
delete mode 100644 app/Http/Middleware/EncryptCookies.php
delete mode 100644 app/Http/Middleware/PreventRequestsDuringMaintenance.php
delete mode 100644 app/Http/Middleware/RedirectIfAuthenticated.php
delete mode 100644 app/Http/Middleware/TrimStrings.php
delete mode 100644 app/Http/Middleware/TrustHosts.php
delete mode 100644 app/Http/Middleware/TrustProxies.php
delete mode 100644 app/Http/Middleware/ValidateSignature.php
delete mode 100644 app/Http/Middleware/VerifyCsrfToken.php
delete mode 100644 app/Providers/BroadcastServiceProvider.php
delete mode 100644 app/Providers/RouteServiceProvider.php
diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php
deleted file mode 100644
index d4ef6447..00000000
--- a/app/Http/Middleware/Authenticate.php
+++ /dev/null
@@ -1,17 +0,0 @@
-expectsJson() ? null : route('login');
- }
-}
diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php
deleted file mode 100644
index 033136ad..00000000
--- a/app/Http/Middleware/EncryptCookies.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- */
- protected $except = [
- //
- ];
-}
diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php
deleted file mode 100644
index 4b2af74d..00000000
--- a/app/Http/Middleware/RedirectIfAuthenticated.php
+++ /dev/null
@@ -1,30 +0,0 @@
-check()) {
- return redirect(RouteServiceProvider::HOME);
- }
- }
-
- return $next($request);
- }
-}
diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php
deleted file mode 100644
index 88cadcaa..00000000
--- a/app/Http/Middleware/TrimStrings.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
- */
- protected $except = [
- 'current_password',
- 'password',
- 'password_confirmation',
- ];
-}
diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php
deleted file mode 100644
index c9c58bdd..00000000
--- a/app/Http/Middleware/TrustHosts.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
- */
- public function hosts(): array
- {
- return [
- $this->allSubdomainsOfApplicationUrl(),
- ];
- }
-}
diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php
deleted file mode 100644
index 3391630e..00000000
--- a/app/Http/Middleware/TrustProxies.php
+++ /dev/null
@@ -1,28 +0,0 @@
-|string|null
- */
- protected $proxies;
-
- /**
- * The headers that should be used to detect proxies.
- *
- * @var int
- */
- protected $headers =
- Request::HEADER_X_FORWARDED_FOR |
- Request::HEADER_X_FORWARDED_HOST |
- Request::HEADER_X_FORWARDED_PORT |
- Request::HEADER_X_FORWARDED_PROTO |
- Request::HEADER_X_FORWARDED_AWS_ELB;
-}
diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php
deleted file mode 100644
index 093bf64a..00000000
--- a/app/Http/Middleware/ValidateSignature.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- */
- protected $except = [
- // 'fbclid',
- // 'utm_campaign',
- // 'utm_content',
- // 'utm_medium',
- // 'utm_source',
- // 'utm_term',
- ];
-}
diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php
deleted file mode 100644
index 0c13b854..00000000
--- a/app/Http/Middleware/VerifyCsrfToken.php
+++ /dev/null
@@ -1,17 +0,0 @@
-by($request->user()?->id ?: $request->ip());
- });
-
- $this->routes(function () {
- Route::middleware('api')
- ->prefix('api')
- ->group(base_path('routes/api.php'));
-
- Route::middleware('web')
- ->group(base_path('routes/web.php'));
- });
- }
-}
From 2a856c8c5966a30b5a79af47e077dbb883c6c127 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:58:56 +0000
Subject: [PATCH 077/127] Shift core files
---
artisan | 52 +++++++-----------------------------------------
public/index.php | 48 +++++---------------------------------------
2 files changed, 12 insertions(+), 88 deletions(-)
diff --git a/artisan b/artisan
index d5c6aaf9..8e04b422 100755
--- a/artisan
+++ b/artisan
@@ -1,53 +1,15 @@
#!/usr/bin/env php
make(Illuminate\Contracts\Console\Kernel::class);
-
-$status = $kernel->handle(
- $input = new Symfony\Component\Console\Input\ArgvInput,
- new Symfony\Component\Console\Output\ConsoleOutput
-);
-
-/*
-|--------------------------------------------------------------------------
-| Shutdown The Application
-|--------------------------------------------------------------------------
-|
-| Once Artisan has finished running, we will fire off the shutdown events
-| so that any final work may be done by the application before we shut
-| down the process. This is the last thing to happen to the request.
-|
-*/
-
-$kernel->terminate($input, $status);
+// Bootstrap Laravel and handle the command...
+$status = (require_once __DIR__.'/bootstrap/app.php')
+ ->handleCommand(new ArgvInput);
-exit($status);
\ No newline at end of file
+exit($status);
diff --git a/public/index.php b/public/index.php
index 1d69f3a2..947d9896 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,55 +1,17 @@
make(Kernel::class);
-
-$response = $kernel->handle(
- $request = Request::capture()
-)->send();
-
-$kernel->terminate($request, $response);
+// Bootstrap Laravel and handle the request...
+(require_once __DIR__.'/../bootstrap/app.php')
+ ->handleRequest(Request::capture());
From 0ce976786b1e963e866f0d81911b30a61b190379 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:02 +0000
Subject: [PATCH 078/127] Streamline config files
---
config/.gitkeep | 0
config/app.php | 141 --------------------------
config/auth.php | 108 --------------------
config/broadcasting.php | 71 -------------
config/cache.php | 96 ------------------
config/cors.php | 34 -------
config/database.php | 123 +----------------------
config/filesystems.php | 51 ----------
config/hashing.php | 54 ----------
config/logging.php | 116 ----------------------
config/mail.php | 112 ---------------------
config/queue.php | 93 -----------------
config/services.php | 22 -----
config/session.php | 214 ----------------------------------------
config/view.php | 36 -------
15 files changed, 3 insertions(+), 1268 deletions(-)
create mode 100644 config/.gitkeep
delete mode 100644 config/broadcasting.php
delete mode 100644 config/cors.php
delete mode 100644 config/hashing.php
delete mode 100644 config/queue.php
delete mode 100755 config/session.php
delete mode 100755 config/view.php
diff --git a/config/.gitkeep b/config/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/config/app.php b/config/app.php
index 6385cccb..3a99294a 100644
--- a/config/app.php
+++ b/config/app.php
@@ -5,138 +5,8 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Application Name
- |--------------------------------------------------------------------------
- |
- | This value is the name of your application. This value is used when the
- | framework needs to place the application's name in a notification or
- | any other location as required by the application or its packages.
- */
-
- 'name' => env('APP_NAME', 'Beep'),
-
- /*
- |--------------------------------------------------------------------------
- | Application Environment
- |--------------------------------------------------------------------------
- |
- | This value determines the "environment" your application is currently
- | running in. This may determine how you prefer to configure various
- | services your application utilizes. Set this in your ".env" file.
- |
- */
-
- 'env' => env('APP_ENV', 'production'),
-
- /*
- |--------------------------------------------------------------------------
- | Application Debug Mode
- |--------------------------------------------------------------------------
- |
- | When your application is in debug mode, detailed error messages with
- | stack traces will be shown on every error that occurs within your
- | application. If disabled, a simple generic error page is shown.
- |
- */
-
- 'debug' => env('APP_DEBUG', false),
-
- /*
- |--------------------------------------------------------------------------
- | Application URL
- |--------------------------------------------------------------------------
- |
- | This URL is used by the console to properly generate URLs when using
- | the Artisan command line tool. You should set this to the root of
- | your application so that it is used when running Artisan tasks.
- |
- */
-
- 'url' => env('APP_URL', 'http://localhost'),
-
- 'asset_url' => env('ASSET_URL', null),
-
'webapp_url' => env('WEBAPP_URL', null),
- /*
- |--------------------------------------------------------------------------
- | Application Timezone
- |--------------------------------------------------------------------------
- |
- | Here you may specify the default timezone for your application, which
- | will be used by the PHP date and date-time functions. We have gone
- | ahead and set this to a sensible default for you out of the box.
- |
- */
-
- 'timezone' => 'UTC',
-
- /*
- |--------------------------------------------------------------------------
- | Application Locale Configuration
- |--------------------------------------------------------------------------
- |
- | The application locale determines the default locale that will be used
- | by the translation service provider. You are free to set this value
- | to any of the locales which will be supported by the application.
- |
- */
-
- 'locale' => env('APP_LOCALE', 'nl'),
-
- /*
- |--------------------------------------------------------------------------
- | Application Fallback Locale
- |--------------------------------------------------------------------------
- |
- | The fallback locale determines the locale to use when the current one
- | is not available. You may change the value to correspond to any of
- | the language folders that are provided through your application.
- |
- */
-
- 'fallback_locale' => 'en',
-
- /*
- |--------------------------------------------------------------------------
- | Faker Locale
- |--------------------------------------------------------------------------
- |
- | This locale will be used by the Faker PHP library when generating fake
- | data for your database seeds. For example, this will be used to get
- | localized telephone numbers, street address information and more.
- |
- */
-
- 'faker_locale' => 'en_GB',
-
- /*
- |--------------------------------------------------------------------------
- | Encryption Key
- |--------------------------------------------------------------------------
- |
- | This key is used by the Illuminate encrypter service and should be set
- | to a random, 32 character string, otherwise these encrypted strings
- | will not be safe. Please do this before deploying an application!
- |
- */
-
- 'key' => env('APP_KEY'),
- 'cipher' => 'AES-256-CBC',
-
- /*
- |--------------------------------------------------------------------------
- | Autoloaded Service Providers
- |--------------------------------------------------------------------------
- |
- | The service providers listed here will be automatically loaded on the
- | request to your application. Feel free to add your own services to
- | this array to grant expanded functionality to your applications.
- |
- */
-
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
@@ -159,17 +29,6 @@
App\Providers\RouteServiceProvider::class,
])->toArray(),
- /*
- |--------------------------------------------------------------------------
- | Class Aliases
- |--------------------------------------------------------------------------
- |
- | This array of class aliases will be registered when this application
- | is started. However, feel free to register as many as you wish as
- | the aliases are "lazy" loaded so they don't hinder performance.
- |
- */
-
'aliases' => Facade::defaultAliases()->merge([
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
diff --git a/config/auth.php b/config/auth.php
index 0628b650..1642fb24 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -2,45 +2,7 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Authentication Defaults
- |--------------------------------------------------------------------------
- |
- | This option controls the default authentication "guard" and password
- | reset options for your application. You may change these defaults
- | as required, but they're a perfect start for most applications.
- |
- */
-
- 'defaults' => [
- 'guard' => 'web',
- 'passwords' => 'users',
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Authentication Guards
- |--------------------------------------------------------------------------
- |
- | Next, you may define every authentication guard for your application.
- | Of course, a great default configuration has been defined for you
- | here which uses session storage and the Eloquent user provider.
- |
- | All authentication drivers have a user provider. This defines how the
- | users are actually retrieved out of your database or other storage
- | mechanisms used by this application to persist your user's data.
- |
- | Supported: "session"
- |
- */
-
'guards' => [
- 'web' => [
- 'driver' => 'session',
- 'provider' => 'users',
- ],
-
'api' => [
'driver' => 'token',
'provider' => 'users',
@@ -48,74 +10,4 @@
],
],
- /*
- |--------------------------------------------------------------------------
- | User Providers
- |--------------------------------------------------------------------------
- |
- | All authentication drivers have a user provider. This defines how the
- | users are actually retrieved out of your database or other storage
- | mechanisms used by this application to persist your user's data.
- |
- | If you have multiple user tables or models you may configure multiple
- | sources which represent each model / table. These sources may then
- | be assigned to any extra authentication guards you have defined.
- |
- | Supported: "database", "eloquent"
- |
- */
-
- 'providers' => [
- 'users' => [
- 'driver' => 'eloquent',
- 'model' => App\User::class,
- ],
-
- // 'users' => [
- // 'driver' => 'database',
- // 'table' => 'users',
- // ],
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Resetting Passwords
- |--------------------------------------------------------------------------
- |
- | You may specify multiple password reset configurations if you have more
- | than one user table or model in the application and you want to have
- | separate password reset settings based on the specific user types.
- |
- | The expiry time is the number of minutes that each reset token will be
- | considered valid. This security feature keeps tokens short-lived so
- | they have less time to be guessed. You may change this as needed.
- |
- | The throttle setting is the number of seconds a user must wait before
- | generating more password reset tokens. This prevents the user from
- | quickly generating a very large amount of password reset tokens.
- |
- */
-
- 'passwords' => [
- 'users' => [
- 'provider' => 'users',
- 'table' => 'password_reset_tokens',
- 'expire' => 60,
- 'throttle' => 60,
- ],
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Password Confirmation Timeout
- |--------------------------------------------------------------------------
- |
- | Here you may define the amount of seconds before a password confirmation
- | times out and the user is prompted to re-enter their password via the
- | confirmation screen. By default, the timeout lasts for three hours.
- |
- */
-
- 'password_timeout' => 10800,
-
];
diff --git a/config/broadcasting.php b/config/broadcasting.php
deleted file mode 100644
index 24104853..00000000
--- a/config/broadcasting.php
+++ /dev/null
@@ -1,71 +0,0 @@
- env('BROADCAST_DRIVER', 'null'),
-
- /*
- |--------------------------------------------------------------------------
- | Broadcast Connections
- |--------------------------------------------------------------------------
- |
- | Here you may define all of the broadcast connections that will be used
- | to broadcast events to other systems or over websockets. Samples of
- | each available type of connection are provided inside this array.
- |
- */
-
- 'connections' => [
-
- 'pusher' => [
- 'driver' => 'pusher',
- 'key' => env('PUSHER_APP_KEY'),
- 'secret' => env('PUSHER_APP_SECRET'),
- 'app_id' => env('PUSHER_APP_ID'),
- 'options' => [
- 'cluster' => env('PUSHER_APP_CLUSTER'),
- 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
- 'port' => env('PUSHER_PORT', 443),
- 'scheme' => env('PUSHER_SCHEME', 'https'),
- 'encrypted' => true,
- 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
- ],
- 'client_options' => [
- // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
- ],
- ],
-
- 'ably' => [
- 'driver' => 'ably',
- 'key' => env('ABLY_KEY'),
- ],
-
- 'redis' => [
- 'driver' => 'redis',
- 'connection' => 'default',
- ],
-
- 'log' => [
- 'driver' => 'log',
- ],
-
- 'null' => [
- 'driver' => 'null',
- ],
-
- ],
-
-];
diff --git a/config/cache.php b/config/cache.php
index 791b02ba..e17aabde 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -4,108 +4,12 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Default Cache Store
- |--------------------------------------------------------------------------
- |
- | This option controls the default cache connection that gets used while
- | using this caching library. This connection is used when another is
- | not explicitly specified when executing a given caching function.
- |
- */
-
- 'default' => env('CACHE_DRIVER', 'file'),
-
- /*
- |--------------------------------------------------------------------------
- | Cache Stores
- |--------------------------------------------------------------------------
- |
- | Here you may define all of the cache "stores" for your application as
- | well as their drivers. You may even define multiple stores for the
- | same cache driver to group types of items stored in your caches.
- |
- | Supported drivers: "apc", "array", "database", "file",
- | "memcached", "redis", "dynamodb", "octane", "null"
- |
- */
-
'stores' => [
-
- 'apc' => [
- 'driver' => 'apc',
- ],
-
- 'array' => [
- 'driver' => 'array',
- 'serialize' => false,
- ],
-
- 'database' => [
- 'driver' => 'database',
- 'table' => 'cache',
- 'connection' => null,
- 'lock_connection' => null,
- ],
-
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
'lock_path' => storage_path('framework/cache/data'),
],
-
- 'memcached' => [
- 'driver' => 'memcached',
- 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
- 'sasl' => [
- env('MEMCACHED_USERNAME'),
- env('MEMCACHED_PASSWORD'),
- ],
- 'options' => [
- // Memcached::OPT_CONNECT_TIMEOUT => 2000,
- ],
- 'servers' => [
- [
- 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
- 'port' => env('MEMCACHED_PORT', 11211),
- 'weight' => 100,
- ],
- ],
- ],
-
- 'redis' => [
- 'driver' => 'redis',
- 'connection' => 'cache',
- 'lock_connection' => 'default',
- ],
-
- 'dynamodb' => [
- 'driver' => 'dynamodb',
- 'key' => env('AWS_ACCESS_KEY_ID'),
- 'secret' => env('AWS_SECRET_ACCESS_KEY'),
- 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
- 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
- 'endpoint' => env('DYNAMODB_ENDPOINT'),
- ],
-
- 'octane' => [
- 'driver' => 'octane',
- ],
-
],
- /*
- |--------------------------------------------------------------------------
- | Cache Key Prefix
- |--------------------------------------------------------------------------
- |
- | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
- | stores there might be other applications using the same cache. For
- | that reason, you may prefix every cache key to avoid collisions.
- |
- */
-
- 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
-
];
diff --git a/config/cors.php b/config/cors.php
deleted file mode 100644
index 8a39e6da..00000000
--- a/config/cors.php
+++ /dev/null
@@ -1,34 +0,0 @@
- ['api/*', 'sanctum/csrf-cookie'],
-
- 'allowed_methods' => ['*'],
-
- 'allowed_origins' => ['*'],
-
- 'allowed_origins_patterns' => [],
-
- 'allowed_headers' => ['*'],
-
- 'exposed_headers' => [],
-
- 'max_age' => 0,
-
- 'supports_credentials' => false,
-
-];
diff --git a/config/database.php b/config/database.php
index b598ccd3..0b7e2bad 100644
--- a/config/database.php
+++ b/config/database.php
@@ -4,45 +4,7 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Default Database Connection Name
- |--------------------------------------------------------------------------
- |
- | Here you may specify which of the database connections below you wish
- | to use as your default connection for all database work. Of course
- | you may use many connections at once using the Database library.
- |
- */
-
- 'default' => env('DB_CONNECTION', 'mysql'),
-
- /*
- |--------------------------------------------------------------------------
- | Database Connections
- |--------------------------------------------------------------------------
- |
- | Here are each of the database connections setup for your application.
- | Of course, examples of configuring each database platform that is
- | supported by Laravel is shown below to make development simple.
- |
- |
- | All database work in Laravel is done through the PHP PDO facilities
- | so make sure you have the driver for your particular database of
- | choice installed on your machine before you begin development.
- |
- */
-
'connections' => [
-
- 'sqlite' => [
- 'driver' => 'sqlite',
- 'url' => env('DATABASE_URL'),
- 'database' => env('DB_DATABASE', database_path('database.sqlite')),
- 'prefix' => '',
- 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
- ],
-
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
@@ -94,90 +56,11 @@
],
'engine' => null,
],
-
- 'pgsql' => [
- 'driver' => 'pgsql',
- 'url' => env('DATABASE_URL'),
- 'host' => env('DB_HOST', '127.0.0.1'),
- 'port' => env('DB_PORT', '5432'),
- 'database' => env('DB_DATABASE', 'forge'),
- 'username' => env('DB_USERNAME', 'forge'),
- 'password' => env('DB_PASSWORD', ''),
- 'charset' => 'utf8',
- 'prefix' => '',
- 'prefix_indexes' => true,
- 'search_path' => 'public',
- 'sslmode' => 'prefer',
- ],
-
- 'sqlsrv' => [
- 'driver' => 'sqlsrv',
- 'url' => env('DATABASE_URL'),
- 'host' => env('DB_HOST', 'localhost'),
- 'port' => env('DB_PORT', '1433'),
- 'database' => env('DB_DATABASE', 'forge'),
- 'username' => env('DB_USERNAME', 'forge'),
- 'password' => env('DB_PASSWORD', ''),
- 'charset' => 'utf8',
- 'prefix' => '',
- 'prefix_indexes' => true,
- // 'encrypt' => env('DB_ENCRYPT', 'yes'),
- // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
- ],
-
],
- /*
- |--------------------------------------------------------------------------
- | Migration Repository Table
- |--------------------------------------------------------------------------
- |
- | This table keeps track of all the migrations that have already run for
- | your application. Using this information, we can determine which of
- | the migrations on disk haven't actually been run in the database.
- |
- */
-
- 'migrations' => 'migrations',
-
- /*
- |--------------------------------------------------------------------------
- | Redis Databases
- |--------------------------------------------------------------------------
- |
- | Redis is an open source, fast, and advanced key-value store that also
- | provides a richer body of commands than a typical key-value system
- | such as APC or Memcached. Laravel makes it easy to dig right in.
- |
- */
-
- 'redis' => [
-
- 'client' => env('REDIS_CLIENT', 'phpredis'),
-
- 'options' => [
- 'cluster' => env('REDIS_CLUSTER', 'redis'),
- 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
- ],
-
- 'default' => [
- 'url' => env('REDIS_URL'),
- 'host' => env('REDIS_HOST', '127.0.0.1'),
- 'username' => env('REDIS_USERNAME'),
- 'password' => env('REDIS_PASSWORD'),
- 'port' => env('REDIS_PORT', '6379'),
- 'database' => env('REDIS_DB', '0'),
- ],
-
- 'cache' => [
- 'url' => env('REDIS_URL'),
- 'host' => env('REDIS_HOST', '127.0.0.1'),
- 'username' => env('REDIS_USERNAME'),
- 'password' => env('REDIS_PASSWORD'),
- 'port' => env('REDIS_PORT', '6379'),
- 'database' => env('REDIS_CACHE_DB', '1'),
- ],
-
+ 'migrations' => [
+ 'table' => 'migrations',
+ 'update_date_on_publish' => false, // disable to preserve original behavior for existing applications
],
];
diff --git a/config/filesystems.php b/config/filesystems.php
index 5fe1f694..db170670 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -2,48 +2,13 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Default Filesystem Disk
- |--------------------------------------------------------------------------
- |
- | Here you may specify the default filesystem disk that should be used
- | by the framework. The "local" disk, as well as a variety of cloud
- | based disks are available to your application. Just store away!
- |
- */
-
- 'default' => env('FILESYSTEM_DISK', 'local'),
-
- /*
- |--------------------------------------------------------------------------
- | Filesystem Disks
- |--------------------------------------------------------------------------
- |
- | Here you may configure as many filesystem "disks" as you wish, and you
- | may even configure multiple disks of the same driver. Defaults have
- | been set up for each driver as an example of the required values.
- |
- | Supported Drivers: "local", "ftp", "sftp", "s3"
- |
- */
-
'disks' => [
-
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
],
- 'public' => [
- 'driver' => 'local',
- 'root' => storage_path('app/public'),
- 'url' => env('APP_URL').'/storage',
- 'visibility' => 'public',
- 'throw' => false,
- ],
-
'icons' => [
'driver' => 'local',
'root' => storage_path('app/public/icons'),
@@ -74,22 +39,6 @@
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
],
-
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Symbolic Links
- |--------------------------------------------------------------------------
- |
- | Here you may configure the symbolic links that will be created when the
- | `storage:link` Artisan command is executed. The array keys should be
- | the locations of the links and the values should be their targets.
- |
- */
-
- 'links' => [
- public_path('storage') => storage_path('app/public'),
],
];
diff --git a/config/hashing.php b/config/hashing.php
deleted file mode 100644
index 0e8a0bb3..00000000
--- a/config/hashing.php
+++ /dev/null
@@ -1,54 +0,0 @@
- 'bcrypt',
-
- /*
- |--------------------------------------------------------------------------
- | Bcrypt Options
- |--------------------------------------------------------------------------
- |
- | Here you may specify the configuration options that should be used when
- | passwords are hashed using the Bcrypt algorithm. This will allow you
- | to control the amount of time it takes to hash the given password.
- |
- */
-
- 'bcrypt' => [
- 'rounds' => env('BCRYPT_ROUNDS', 12),
- 'verify' => true,
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Argon Options
- |--------------------------------------------------------------------------
- |
- | Here you may specify the configuration options that should be used when
- | passwords are hashed using the Argon algorithm. These will allow you
- | to control the amount of time it takes to hash the given password.
- |
- */
-
- 'argon' => [
- 'memory' => 65536,
- 'threads' => 1,
- 'time' => 4,
- 'verify' => true,
- ],
-
-];
diff --git a/config/logging.php b/config/logging.php
index e7a12905..eeeffdcf 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -7,122 +7,6 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Default Log Channel
- |--------------------------------------------------------------------------
- |
- | This option defines the default log channel that gets used when writing
- | messages to the logs. The name specified in this option should match
- | one of the channels defined in the "channels" configuration array.
- |
- */
-
- 'default' => env('LOG_CHANNEL', 'stack'),
-
- /*
- |--------------------------------------------------------------------------
- | Deprecations Log Channel
- |--------------------------------------------------------------------------
- |
- | This option controls the log channel that should be used to log warnings
- | regarding deprecated PHP and library features. This allows you to get
- | your application ready for upcoming major versions of dependencies.
- |
- */
-
'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
- /*
- |--------------------------------------------------------------------------
- | Log Channels
- |--------------------------------------------------------------------------
- |
- | Here you may configure the log channels for your application. Out of
- | the box, Laravel uses the Monolog PHP logging library. This gives
- | you a variety of powerful log handlers / formatters to utilize.
- |
- | Available Drivers: "single", "daily", "slack", "syslog",
- | "errorlog", "monolog",
- | "custom", "stack"
- |
- */
-
- 'channels' => [
- 'stack' => [
- 'driver' => 'stack',
- 'channels' => ['daily', 'slack'],
- 'ignore_exceptions' => false,
- ],
-
- 'single' => [
- 'driver' => 'single',
- 'path' => storage_path('logs/laravel.log'),
- 'level' => env('LOG_LEVEL', 'debug'),
- 'replace_placeholders' => true,
- ],
-
- 'daily' => [
- 'driver' => 'daily',
- 'path' => storage_path('logs/laravel.log'),
- 'level' => env('LOG_LEVEL', 'debug'),
- 'days' => 14,
- 'replace_placeholders' => true,
- ],
-
- 'slack' => [
- 'driver' => 'slack',
- 'url' => env('LOG_SLACK_WEBHOOK_URL'),
- 'username' => env('APP_NAME'),
- 'emoji' => ':boom:',
- 'level' => env('LOG_LEVEL', 'critical'),
- 'replace_placeholders' => true,
- ],
-
- 'papertrail' => [
- 'driver' => 'monolog',
- 'level' => env('LOG_LEVEL', 'debug'),
- 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
- 'handler_with' => [
- 'host' => env('PAPERTRAIL_URL'),
- 'port' => env('PAPERTRAIL_PORT'),
- 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
- ],
- 'processors' => [PsrLogMessageProcessor::class],
- ],
-
- 'stderr' => [
- 'driver' => 'monolog',
- 'level' => env('LOG_LEVEL', 'debug'),
- 'handler' => StreamHandler::class,
- 'formatter' => env('LOG_STDERR_FORMATTER'),
- 'with' => [
- 'stream' => 'php://stderr',
- ],
- 'processors' => [PsrLogMessageProcessor::class],
- ],
-
- 'syslog' => [
- 'driver' => 'syslog',
- 'level' => env('LOG_LEVEL', 'debug'),
- 'facility' => LOG_USER,
- 'replace_placeholders' => true,
- ],
-
- 'errorlog' => [
- 'driver' => 'errorlog',
- 'level' => env('LOG_LEVEL', 'debug'),
- 'replace_placeholders' => true,
- ],
-
- 'null' => [
- 'driver' => 'monolog',
- 'handler' => NullHandler::class,
- ],
-
- 'emergency' => [
- 'path' => storage_path('logs/laravel.log'),
- ],
- ],
-
];
diff --git a/config/mail.php b/config/mail.php
index e894b2e5..63112a1c 100644
--- a/config/mail.php
+++ b/config/mail.php
@@ -2,127 +2,15 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Default Mailer
- |--------------------------------------------------------------------------
- |
- | This option controls the default mailer that is used to send any email
- | messages sent by your application. Alternative mailers may be setup
- | and used as needed; however, this mailer will be used by default.
- |
- */
-
- 'default' => env('MAIL_MAILER', 'smtp'),
-
- /*
- |--------------------------------------------------------------------------
- | Mailer Configurations
- |--------------------------------------------------------------------------
- |
- | Here you may configure all of the mailers used by your application plus
- | their respective settings. Several examples have been configured for
- | you and you are free to add your own as your application requires.
- |
- | Laravel supports a variety of mail "transport" drivers to be used while
- | sending an e-mail. You will specify which one you are using for your
- | mailers below. You are free to add additional mailers as required.
- |
- | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
- | "postmark", "log", "array", "failover", "roundrobin"
- |
- */
-
'mailers' => [
- 'smtp' => [
- 'transport' => 'smtp',
- 'url' => env('MAIL_URL'),
- 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
- 'port' => env('MAIL_PORT', 587),
- 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
- 'username' => env('MAIL_USERNAME'),
- 'password' => env('MAIL_PASSWORD'),
- 'timeout' => null,
- 'local_domain' => env('MAIL_EHLO_DOMAIN'),
- ],
-
- 'ses' => [
- 'transport' => 'ses',
- ],
-
- 'postmark' => [
- 'transport' => 'postmark',
- // 'message_stream_id' => null,
- // 'client' => [
- // 'timeout' => 5,
- // ],
- ],
-
'mailgun' => [
'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
],
-
- 'sendmail' => [
- 'transport' => 'sendmail',
- 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
- ],
-
- 'log' => [
- 'transport' => 'log',
- 'channel' => env('MAIL_LOG_CHANNEL'),
- ],
-
- 'array' => [
- 'transport' => 'array',
- ],
-
- 'failover' => [
- 'transport' => 'failover',
- 'mailers' => [
- 'smtp',
- 'log',
- ],
- ],
-
- 'roundrobin' => [
- 'transport' => 'roundrobin',
- 'mailers' => [
- 'ses',
- 'postmark',
- ],
- ],
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Global "From" Address
- |--------------------------------------------------------------------------
- |
- | You may wish for all e-mails sent by your application to be sent from
- | the same address. Here, you may specify a name and address that is
- | used globally for all e-mails that are sent by your application.
- |
- */
-
- 'from' => [
- 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
- 'name' => env('MAIL_FROM_NAME', 'Example'),
],
- /*
- |--------------------------------------------------------------------------
- | Markdown Mail Settings
- |--------------------------------------------------------------------------
- |
- | If you are using Markdown based email rendering, you may configure your
- | theme and component paths here, allowing you to customize the design
- | of the emails. Or, you may simply stick with the Laravel defaults!
- |
- */
-
'markdown' => [
'theme' => 'default',
diff --git a/config/queue.php b/config/queue.php
deleted file mode 100644
index 25ea5a81..00000000
--- a/config/queue.php
+++ /dev/null
@@ -1,93 +0,0 @@
- env('QUEUE_CONNECTION', 'sync'),
-
- /*
- |--------------------------------------------------------------------------
- | Queue Connections
- |--------------------------------------------------------------------------
- |
- | Here you may configure the connection information for each server that
- | is used by your application. A default configuration has been added
- | for each back-end shipped with Laravel. You are free to add more.
- |
- | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
- |
- */
-
- 'connections' => [
-
- 'sync' => [
- 'driver' => 'sync',
- ],
-
- 'database' => [
- 'driver' => 'database',
- 'table' => 'jobs',
- 'queue' => 'default',
- 'retry_after' => 90,
- 'after_commit' => false,
- ],
-
- 'beanstalkd' => [
- 'driver' => 'beanstalkd',
- 'host' => 'localhost',
- 'queue' => 'default',
- 'retry_after' => 90,
- 'block_for' => 0,
- 'after_commit' => false,
- ],
-
- 'sqs' => [
- 'driver' => 'sqs',
- 'key' => env('AWS_ACCESS_KEY_ID'),
- 'secret' => env('AWS_SECRET_ACCESS_KEY'),
- 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
- 'queue' => env('SQS_QUEUE', 'default'),
- 'suffix' => env('SQS_SUFFIX'),
- 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
- 'after_commit' => false,
- ],
-
- 'redis' => [
- 'driver' => 'redis',
- 'connection' => 'default',
- 'queue' => env('REDIS_QUEUE', 'default'),
- 'retry_after' => 90,
- 'block_for' => null,
- 'after_commit' => false,
- ],
-
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Failed Queue Jobs
- |--------------------------------------------------------------------------
- |
- | These options configure the behavior of failed queue job logging so you
- | can control which database and table are used to store the jobs that
- | have failed. You may change them to any database / table you wish.
- |
- */
-
- 'failed' => [
- 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
- 'database' => env('DB_CONNECTION', 'mysql'),
- 'table' => 'failed_jobs',
- ],
-
-];
diff --git a/config/services.php b/config/services.php
index dd7122d2..0d1d21a5 100755
--- a/config/services.php
+++ b/config/services.php
@@ -2,18 +2,6 @@
return [
- /*
- |--------------------------------------------------------------------------
- | Third Party Services
- |--------------------------------------------------------------------------
- |
- | This file is for storing the credentials for third party services such
- | as Mailgun, Postmark, AWS and more. This file provides the de facto
- | location for this type of information, allowing packages to have
- | a conventional file to locate the various service credentials.
- |
- */
-
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
@@ -21,16 +9,6 @@
'scheme' => 'https',
],
- 'postmark' => [
- 'token' => env('POSTMARK_TOKEN'),
- ],
-
- 'ses' => [
- 'key' => env('AWS_ACCESS_KEY_ID'),
- 'secret' => env('AWS_SECRET_ACCESS_KEY'),
- 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
- ],
-
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
diff --git a/config/session.php b/config/session.php
deleted file mode 100755
index e738cb3e..00000000
--- a/config/session.php
+++ /dev/null
@@ -1,214 +0,0 @@
- env('SESSION_DRIVER', 'file'),
-
- /*
- |--------------------------------------------------------------------------
- | Session Lifetime
- |--------------------------------------------------------------------------
- |
- | Here you may specify the number of minutes that you wish the session
- | to be allowed to remain idle before it expires. If you want them
- | to immediately expire on the browser closing, set that option.
- |
- */
-
- 'lifetime' => env('SESSION_LIFETIME', 120),
-
- 'expire_on_close' => false,
-
- /*
- |--------------------------------------------------------------------------
- | Session Encryption
- |--------------------------------------------------------------------------
- |
- | This option allows you to easily specify that all of your session data
- | should be encrypted before it is stored. All encryption will be run
- | automatically by Laravel and you can use the Session like normal.
- |
- */
-
- 'encrypt' => false,
-
- /*
- |--------------------------------------------------------------------------
- | Session File Location
- |--------------------------------------------------------------------------
- |
- | When using the native session driver, we need a location where session
- | files may be stored. A default has been set for you but a different
- | location may be specified. This is only needed for file sessions.
- |
- */
-
- 'files' => storage_path('framework/sessions'),
-
- /*
- |--------------------------------------------------------------------------
- | Session Database Connection
- |--------------------------------------------------------------------------
- |
- | When using the "database" or "redis" session drivers, you may specify a
- | connection that should be used to manage these sessions. This should
- | correspond to a connection in your database configuration options.
- |
- */
-
- 'connection' => env('SESSION_CONNECTION'),
-
- /*
- |--------------------------------------------------------------------------
- | Session Database Table
- |--------------------------------------------------------------------------
- |
- | When using the "database" session driver, you may specify the table we
- | should use to manage the sessions. Of course, a sensible default is
- | provided for you; however, you are free to change this as needed.
- |
- */
-
- 'table' => 'sessions',
-
- /*
- |--------------------------------------------------------------------------
- | Session Cache Store
- |--------------------------------------------------------------------------
- |
- | While using one of the framework's cache driven session backends you may
- | list a cache store that should be used for these sessions. This value
- | must match with one of the application's configured cache "stores".
- |
- | Affects: "apc", "dynamodb", "memcached", "redis"
- |
- */
-
- 'store' => env('SESSION_STORE'),
-
- /*
- |--------------------------------------------------------------------------
- | Session Sweeping Lottery
- |--------------------------------------------------------------------------
- |
- | Some session drivers must manually sweep their storage location to get
- | rid of old sessions from storage. Here are the chances that it will
- | happen on a given request. By default, the odds are 2 out of 100.
- |
- */
-
- 'lottery' => [2, 100],
-
- /*
- |--------------------------------------------------------------------------
- | Session Cookie Name
- |--------------------------------------------------------------------------
- |
- | Here you may change the name of the cookie used to identify a session
- | instance by ID. The name specified here will get used every time a
- | new session cookie is created by the framework for every driver.
- |
- */
-
- 'cookie' => env(
- 'SESSION_COOKIE',
- Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
- ),
-
- /*
- |--------------------------------------------------------------------------
- | Session Cookie Path
- |--------------------------------------------------------------------------
- |
- | The session cookie path determines the path for which the cookie will
- | be regarded as available. Typically, this will be the root path of
- | your application but you are free to change this when necessary.
- |
- */
-
- 'path' => '/',
-
- /*
- |--------------------------------------------------------------------------
- | Session Cookie Domain
- |--------------------------------------------------------------------------
- |
- | Here you may change the domain of the cookie used to identify a session
- | in your application. This will determine which domains the cookie is
- | available to in your application. A sensible default has been set.
- |
- */
-
- 'domain' => env('SESSION_DOMAIN'),
-
- /*
- |--------------------------------------------------------------------------
- | HTTPS Only Cookies
- |--------------------------------------------------------------------------
- |
- | By setting this option to true, session cookies will only be sent back
- | to the server if the browser has a HTTPS connection. This will keep
- | the cookie from being sent to you when it can't be done securely.
- |
- */
-
- 'secure' => env('SESSION_SECURE_COOKIE'),
-
- /*
- |--------------------------------------------------------------------------
- | HTTP Access Only
- |--------------------------------------------------------------------------
- |
- | Setting this value to true will prevent JavaScript from accessing the
- | value of the cookie and the cookie will only be accessible through
- | the HTTP protocol. You are free to modify this option if needed.
- |
- */
-
- 'http_only' => true,
-
- /*
- |--------------------------------------------------------------------------
- | Same-Site Cookies
- |--------------------------------------------------------------------------
- |
- | This option determines how your cookies behave when cross-site requests
- | take place, and can be used to mitigate CSRF attacks. By default, we
- | will set this value to "lax" since this is a secure default value.
- |
- | Supported: "lax", "strict", "none", null
- |
- */
-
- 'same_site' => 'lax',
-
- /*
- |--------------------------------------------------------------------------
- | Partitioned Cookies
- |--------------------------------------------------------------------------
- |
- | Setting this value to true will tie the cookie to the top-level site for
- | a cross-site context. Partitioned cookies are accepted by the browser
- | when flagged "secure" and the Same-Site attribute is set to "none".
- |
- */
-
- 'partitioned' => false,
-
-];
diff --git a/config/view.php b/config/view.php
deleted file mode 100755
index 22b8a18d..00000000
--- a/config/view.php
+++ /dev/null
@@ -1,36 +0,0 @@
- [
- resource_path('views'),
- ],
-
- /*
- |--------------------------------------------------------------------------
- | Compiled View Path
- |--------------------------------------------------------------------------
- |
- | This option determines where all the compiled Blade templates will be
- | stored for your application. Typically, this is within the storage
- | directory. However, as usual, you are free to change this value.
- |
- */
-
- 'compiled' => env(
- 'VIEW_COMPILED_PATH',
- realpath(storage_path('framework/views'))
- ),
-
-];
From 6be51db271e62c06ce5c5f095aa27586698fdbc4 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:03 +0000
Subject: [PATCH 079/127] Set new `ENV` variables
---
.env.example | 14 ++++++++++++--
config/database.php | 2 +-
phpunit.xml | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/.env.example b/.env.example
index 465a3e60..8d3c7a53 100644
--- a/.env.example
+++ b/.env.example
@@ -2,6 +2,12 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
+
+APP_FALLBACK_LOCALE=en
+APP_FAKER_LOCALE=en_US
+APP_MAINTENANCE_DRIVER=file
+APP_MAINTENANCE_STORE=database
+BCRYPT_ROUNDS=12
APP_NAME=BEEP
APP_LOCALE=en
@@ -9,6 +15,7 @@ BETA=false
ALLOWED_ORIGINS="*"
LOG_CHANNEL=stack
+LOG_STACK=single
LOG_SLACK_WEBHOOK_URL=
DB_CONNECTION=mysql
@@ -33,11 +40,14 @@ INFLUXDB_UDP_PORT=4444
INFLUXDB_DBNAME=bee_data
INFLUXDB_PASSWORD=pass_influx
-BROADCAST_DRIVER=log
-CACHE_DRIVER=redis
+BROADCAST_CONNECTION=log
+CACHE_STORE=redis
QUEUE_CONNECTION=sync
SESSION_DRIVER=redis
SESSION_LIFETIME=126
+SESSION_ENCRYPT=false
+SESSION_PATH=/
+SESSION_DOMAIN=null
SESSION_CONNECTION=default
MEMCACHED_HOST=127.0.0.1
diff --git a/config/database.php b/config/database.php
index 0b7e2bad..bfe92ede 100644
--- a/config/database.php
+++ b/config/database.php
@@ -7,7 +7,7 @@
'connections' => [
'mysql' => [
'driver' => 'mysql',
- 'url' => env('DATABASE_URL'),
+ 'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
diff --git a/phpunit.xml b/phpunit.xml
index dbd66120..b0ab841d 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -16,7 +16,7 @@
-
+
From dfaeaf184578427d241c3adb2b03fa271b301391 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:03 +0000
Subject: [PATCH 080/127] Default new `bootstrap/app.php`
---
bootstrap/app.php | 72 +++++++++++------------------------------
bootstrap/providers.php | 5 +++
2 files changed, 24 insertions(+), 53 deletions(-)
create mode 100644 bootstrap/providers.php
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 037e17df..d5d7e70d 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -1,55 +1,21 @@
singleton(
- Illuminate\Contracts\Http\Kernel::class,
- App\Http\Kernel::class
-);
-
-$app->singleton(
- Illuminate\Contracts\Console\Kernel::class,
- App\Console\Kernel::class
-);
-
-$app->singleton(
- Illuminate\Contracts\Debug\ExceptionHandler::class,
- App\Exceptions\Handler::class
-);
-
-/*
-|--------------------------------------------------------------------------
-| Return The Application
-|--------------------------------------------------------------------------
-|
-| This script returns the application instance. The instance is given to
-| the calling script so we can separate the building of the instances
-| from the actual running of the application and sending responses.
-|
-*/
-
-return $app;
+use Illuminate\Foundation\Application;
+use Illuminate\Foundation\Configuration\Exceptions;
+use Illuminate\Foundation\Configuration\Middleware;
+
+return Application::configure(basePath: dirname(__DIR__))
+ ->withProviders()
+ ->withRouting(
+ web: __DIR__.'/../routes/web.php',
+ // api: __DIR__.'/../routes/api.php',
+ commands: __DIR__.'/../routes/console.php',
+ // channels: __DIR__.'/../routes/channels.php',
+ health: '/up',
+ )
+ ->withMiddleware(function (Middleware $middleware) {
+ //
+ })
+ ->withExceptions(function (Exceptions $exceptions) {
+ //
+ })->create();
diff --git a/bootstrap/providers.php b/bootstrap/providers.php
new file mode 100644
index 00000000..38b258d1
--- /dev/null
+++ b/bootstrap/providers.php
@@ -0,0 +1,5 @@
+
Date: Mon, 1 Jun 2026 14:59:03 +0000
Subject: [PATCH 081/127] Re-register HTTP middleware
---
app/Http/Kernel.php | 89 ---------------------------------------------
bootstrap/app.php | 22 ++++++++++-
2 files changed, 21 insertions(+), 90 deletions(-)
delete mode 100644 app/Http/Kernel.php
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
deleted file mode 100644
index 5f15e6a3..00000000
--- a/app/Http/Kernel.php
+++ /dev/null
@@ -1,89 +0,0 @@
- [
- \App\Http\Middleware\EncryptCookies::class,
- \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
- \Illuminate\Session\Middleware\StartSession::class,
- \Illuminate\View\Middleware\ShareErrorsFromSession::class,
- \App\Http\Middleware\VerifyCsrfToken::class,
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- ],
-
- 'api' => [
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- ],
- ];
-
- /**
- * The application's middleware aliases.
- *
- * Aliases may be used to conveniently assign middleware to routes and groups.
- *
- * @var array
- */
- protected $middlewareAliases = [
- 'auth' => \App\Http\Middleware\Authenticate::class,
- 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
- 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
- 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
- 'can' => \Illuminate\Auth\Middleware\Authorize::class,
- 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
- 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
- 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
- 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
- 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
- 'verifiedApi' => \App\Http\Middleware\EnsureWebappEmailIsVerified::class,
- // Laratrust
- 'role' => \Laratrust\Middleware\LaratrustRole::class,
- 'permission' => \Laratrust\Middleware\LaratrustPermission::class,
- 'ability' => \Laratrust\Middleware\LaratrustAbility::class,
- // Laravellocalization
- 'localize' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class,
- 'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class,
- 'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class,
- ];
-
- /**
- * The priority-sorted list of middleware.
- *
- * This forces non-global middleware to always be in the given order.
- *
- * @var array
- */
- protected $middlewarePriority = [
- \Illuminate\Session\Middleware\StartSession::class,
- \Illuminate\View\Middleware\ShareErrorsFromSession::class,
- \App\Http\Middleware\Authenticate::class,
- \Illuminate\Session\Middleware\AuthenticateSession::class,
- \Illuminate\Routing\Middleware\SubstituteBindings::class,
- \Illuminate\Auth\Middleware\Authorize::class,
- ];
-}
diff --git a/bootstrap/app.php b/bootstrap/app.php
index d5d7e70d..50321b4a 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -14,7 +14,27 @@
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
- //
+ $middleware->redirectGuestsTo(fn () => route('login'));
+ $middleware->redirectUsersTo(RouteServiceProvider::HOME);
+
+ $middleware->alias([
+ 'ability' => \Laratrust\Middleware\LaratrustAbility::class,
+ 'localeSessionRedirect' => \Mcamara\LaravelLocalization\Middleware\LocaleSessionRedirect::class,
+ 'localizationRedirect' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRedirectFilter::class,
+ 'localize' => \Mcamara\LaravelLocalization\Middleware\LaravelLocalizationRoutes::class,
+ 'permission' => \Laratrust\Middleware\LaratrustPermission::class,
+ 'role' => \Laratrust\Middleware\LaratrustRole::class,
+ 'verifiedApi' => \App\Http\Middleware\EnsureWebappEmailIsVerified::class,
+ ]);
+
+ $middleware->priority([
+ \Illuminate\Session\Middleware\StartSession::class,
+ \Illuminate\View\Middleware\ShareErrorsFromSession::class,
+ \App\Http\Middleware\Authenticate::class,
+ \Illuminate\Session\Middleware\AuthenticateSession::class,
+ \Illuminate\Routing\Middleware\SubstituteBindings::class,
+ \Illuminate\Auth\Middleware\Authorize::class,
+ ]);
})
->withExceptions(function (Exceptions $exceptions) {
//
From c0f3fba1ef99a7fa5c3969abb099169ce0045b73 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:04 +0000
Subject: [PATCH 082/127] Consolidate service providers
---
app/Providers/AppServiceProvider.php | 21 +++++++++++++
app/Providers/AuthServiceProvider.php | 25 ---------------
app/Providers/EventServiceProvider.php | 42 --------------------------
bootstrap/app.php | 3 +-
4 files changed, 23 insertions(+), 68 deletions(-)
delete mode 100644 app/Providers/AuthServiceProvider.php
delete mode 100644 app/Providers/EventServiceProvider.php
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index fb4bb5eb..caa95747 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -4,12 +4,24 @@
use App\ChecklistFactory;
use App\HiveFactory;
+use Illuminate\Cache\RateLimiting\Limit;
+use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
+use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
+ /**
+ * The path to your application's "home" route.
+ *
+ * Typically, users are redirected here after authentication.
+ *
+ * @var string
+ */
+ public const HOME = '/home';
+
/**
* Bootstrap any application services.
*/
@@ -46,6 +58,8 @@ public function boot(): void
return $paginator;
});
+
+ $this->bootRoute();
}
/**
@@ -65,4 +79,11 @@ public function register(): void
$this->app->register('Appzcoder\CrudGenerator\CrudGeneratorServiceProvider');
}
}
+
+ public function bootRoute(): void
+ {
+ RateLimiter::for('api', function (Request $request) {
+ return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
+ });
+ }
}
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
deleted file mode 100644
index e22ccf18..00000000
--- a/app/Providers/AuthServiceProvider.php
+++ /dev/null
@@ -1,25 +0,0 @@
- 'App\Policies\ModelPolicy',
- ];
-
- /**
- * Register any authentication / authorization services.
- */
- public function boot(): void
- {
- //
- }
-}
diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php
deleted file mode 100644
index 10db3755..00000000
--- a/app/Providers/EventServiceProvider.php
+++ /dev/null
@@ -1,42 +0,0 @@
- [
- SendEmailVerificationNotification::class,
- ],
- 'Illuminate\Auth\Events\Login' => [
- \App\Listeners\LogSuccessfulLogin::class,
- ],
- ];
-
- /**
- * Register any events for your application.
- */
- public function boot(): void
- {
-
- //
- }
-
- /**
- * Determine if events and listeners should be automatically discovered.
- */
- public function shouldDiscoverEvents(): bool
- {
- return false;
- }
-}
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 50321b4a..43cbba59 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -1,5 +1,6 @@
withMiddleware(function (Middleware $middleware) {
$middleware->redirectGuestsTo(fn () => route('login'));
- $middleware->redirectUsersTo(RouteServiceProvider::HOME);
+ $middleware->redirectUsersTo(AppServiceProvider::HOME);
$middleware->alias([
'ability' => \Laratrust\Middleware\LaratrustAbility::class,
From a339f9b924c3aa8ded84b6878becd9ea65324caa Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:04 +0000
Subject: [PATCH 083/127] Re-register service providers
---
bootstrap/app.php | 9 ++++++++-
config/app.php | 21 ---------------------
2 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 43cbba59..153e980b 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -6,7 +6,14 @@
use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__))
- ->withProviders()
+ ->withProviders([
+ \Laravel\Tinker\TinkerServiceProvider::class,
+ \EllipseSynergie\ApiResponse\Laravel\ResponseServiceProvider::class,
+ \Collective\Html\HtmlServiceProvider::class,
+ \Intervention\Image\ImageServiceProvider::class,
+ \Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
+ \TrayLabs\InfluxDB\Providers\ServiceProvider::class,
+ ])
->withRouting(
web: __DIR__.'/../routes/web.php',
// api: __DIR__.'/../routes/api.php',
diff --git a/config/app.php b/config/app.php
index 3a99294a..ed44595d 100644
--- a/config/app.php
+++ b/config/app.php
@@ -7,27 +7,6 @@
'webapp_url' => env('WEBAPP_URL', null),
- 'providers' => ServiceProvider::defaultProviders()->merge([
- /*
- * Package Service Providers...
- */
- Laravel\Tinker\TinkerServiceProvider::class,
- EllipseSynergie\ApiResponse\Laravel\ResponseServiceProvider::class,
- Collective\Html\HtmlServiceProvider::class,
- Intervention\Image\ImageServiceProvider::class,
- Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
- TrayLabs\InfluxDB\Providers\ServiceProvider::class,
- //
-
- /*
- * Application Service Providers...
- */
- App\Providers\AppServiceProvider::class,
- App\Providers\AuthServiceProvider::class,
- // App\Providers\BroadcastServiceProvider::class,
- App\Providers\EventServiceProvider::class,
- App\Providers\RouteServiceProvider::class,
- ])->toArray(),
'aliases' => Facade::defaultAliases()->merge([
'Form' => Collective\Html\FormFacade::class,
From 98a56d86ed6afc23c22ba9d3cd85e661c1dca5ff Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:05 +0000
Subject: [PATCH 084/127] Re-register routes
---
bootstrap/app.php | 2 +-
routes/channels.php | 16 ----------------
routes/console.php | 11 -----------
3 files changed, 1 insertion(+), 28 deletions(-)
delete mode 100644 routes/channels.php
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 153e980b..053808c4 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -16,7 +16,7 @@
])
->withRouting(
web: __DIR__.'/../routes/web.php',
- // api: __DIR__.'/../routes/api.php',
+ api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
// channels: __DIR__.'/../routes/channels.php',
health: '/up',
diff --git a/routes/channels.php b/routes/channels.php
deleted file mode 100644
index f16a20b9..00000000
--- a/routes/channels.php
+++ /dev/null
@@ -1,16 +0,0 @@
-id === (int) $id;
-});
diff --git a/routes/console.php b/routes/console.php
index e05f4c9a..3c9adf1a 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -3,17 +3,6 @@
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
-/*
-|--------------------------------------------------------------------------
-| Console Routes
-|--------------------------------------------------------------------------
-|
-| This file is where you may define all of your Closure based console
-| commands. Each Closure is bound to a command instance allowing a
-| simple approach to interacting with each command's IO methods.
-|
-*/
-
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
From f98e9d703cf21fde937974ba1e45c6bbffe35c7d Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:06 +0000
Subject: [PATCH 085/127] Re-register scheduled commands
---
app/Console/Kernel.php | 46 ------------------------------------------
routes/console.php | 23 +++++++++++++++++++++
2 files changed, 23 insertions(+), 46 deletions(-)
delete mode 100644 app/Console/Kernel.php
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
deleted file mode 100644
index a5e2f75b..00000000
--- a/app/Console/Kernel.php
+++ /dev/null
@@ -1,46 +0,0 @@
-call(
- function () {
- Weather::updateLocations();
- }
- )->everyFiveMinutes();
-
- $schedule->call(
- function () {
- AlertRule::parseRules();
- }
- )->everyMinute();
-
- $schedule->call(
- function () {
- FlashLog::parseUnparsedFlashlogs();
- }
- )->everyFiveMinutes();
- }
-
- /**
- * Register the Closure based commands for the application.
- */
- protected function commands(): void
- {
- $this->load(__DIR__.'/Commands');
-
- require base_path('routes/console.php');
- }
-}
diff --git a/routes/console.php b/routes/console.php
index 3c9adf1a..93e3995e 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -1,8 +1,31 @@
comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
+
+
+Schedule::call(
+ function () {
+ Weather::updateLocations();
+ }
+)->everyFiveMinutes();
+
+Schedule::call(
+ function () {
+ AlertRule::parseRules();
+ }
+)->everyMinute();
+
+Schedule::call(
+ function () {
+ FlashLog::parseUnparsedFlashlogs();
+ }
+)->everyFiveMinutes();
From 21be29704c6617b614ac709d1bcbd3575e59578b Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:07 +0000
Subject: [PATCH 086/127] Bump Composer dependencies
---
composer.json | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/composer.json b/composer.json
index 63ecd7fe..9fe633ac 100644
--- a/composer.json
+++ b/composer.json
@@ -14,35 +14,34 @@
"license": "MIT",
"type": "project",
"require": {
- "php": "^8.1",
+ "php": "^8.2",
"doctrine/dbal": "^3.5",
- "dyrynda/laravel-cascade-soft-deletes": "^4.3",
+ "dyrynda/laravel-cascade-soft-deletes": "^4.4",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
- "guzzlehttp/guzzle": "^7.2",
+ "guzzlehttp/guzzle": "^7.8",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
- "laravel/framework": "^10.48",
- "laravel/tinker": "^2.8",
- "laravel/ui": "^4.2",
+ "laravel/framework": "^11.51",
+ "laravel/tinker": "^2.9",
+ "laravel/ui": "^4.4",
"laravelcollective/html": "^6.4",
"league/flysystem-aws-s3-v3": "^3.0",
"mcamara/laravel-localization": "2.3.0",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
- "santigarcor/laratrust": "^7.2",
+ "santigarcor/laratrust": "^8.3",
"tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
"appzcoder/crud-generator": "^4.0",
- "barryvdh/laravel-debugbar": "^3.8",
+ "barryvdh/laravel-debugbar": "^3.10",
"filp/whoops": "^2.8",
- "knuckleswtf/scribe": "^4.15",
- "mockery/mockery": "^1.4.4",
- "nunomaduro/collision": "^6.3",
- "phpunit/phpunit": "^9.5.10",
- "fakerphp/faker": "^1.9.1",
- "spatie/laravel-ignition": "^2.0"
+ "knuckleswtf/scribe": "^4.33",
+ "mockery/mockery": "^1.6",
+ "nunomaduro/collision": "^8.0",
+ "phpunit/phpunit": "^10.5",
+ "fakerphp/faker": "^1.23"
},
"config": {
"optimize-autoloader": true,
From 949774ccbceae72cd80e4d462315a5566f4d8579 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:11 +0000
Subject: [PATCH 087/127] Convert `$casts` property to method
---
app/Device.php | 9 +++++++--
app/Models/AlertRuleFormula.php | 9 +++++++--
app/Models/CalculationModel.php | 9 +++++++--
app/Models/DashboardGroup.php | 9 +++++++--
app/Models/FlashLog.php | 7 ++++++-
app/Models/HiveTag.php | 7 ++++++-
app/Research.php | 11 +++++++----
7 files changed, 47 insertions(+), 14 deletions(-)
diff --git a/app/Device.php b/app/Device.php
index d6b5eb1c..61521628 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -32,8 +32,6 @@ class Device extends Model
protected $appends = ['type', 'hive_name', 'location_name', 'owner', 'online'];
- protected $casts = ['log_file_info' => 'array'];
-
public $timestamps = false;
public static function boot()
@@ -82,6 +80,13 @@ public static function boot()
});
}
+ protected function casts(): array
+ {
+ return [
+ 'log_file_info' => 'array'
+ ];
+ }
+
public function empty_cache($clear_users = true)
{
Cache::forget('device-'.$this->id.'-hive-'.$this->hive_id.'-user-ids');
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index 8496d346..ab780b23 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -33,8 +33,6 @@ class AlertRuleFormula extends Model
protected $fillable = ['alert_rule_id', 'measurement_id', 'calculation', 'comparator', 'comparison', 'logical', 'period_minutes', 'threshold_value', 'future'];
protected $hidden = [];
-
- protected $casts = ['future' => 'boolean'];
// protected $appends = ['calculation_minutes']; // CAUSES LOOP BY append of alert_rule->formulas
public static $calculations = ['min' => 'Minimum', 'max' => 'Maximum', 'ave' => 'Average', 'cnt' => 'Count']; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
@@ -45,6 +43,13 @@ class AlertRuleFormula extends Model
public static $logicals = ['or' => 'Or', 'and' => 'And'];
+ protected function casts(): array
+ {
+ return [
+ 'future' => 'boolean'
+ ];
+ }
+
public function alert_rule(): BelongsTo
{
return $this->belongsTo(AlertRule::class);
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 578c864b..88ec97c2 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -34,8 +34,6 @@ class CalculationModel extends Model
*/
protected $fillable = ['name', 'measurement_id', 'data_measurement_id', 'data_interval', 'data_relative_interval', 'data_interval_index', 'data_api_url', 'data_api_http_request', 'data_last_call', 'calculation', 'repository_url', 'data_interval_amount', 'calculation_interval_minutes'];
- protected $casts = ['data_relative_interval' => 'boolean'];
-
/**
* Model properties:
* name
@@ -60,6 +58,13 @@ class CalculationModel extends Model
public static $calculations = ['model_cumulative_daily_weight_anomaly' => 'Cumulative daily hive weight anomaly',
'model_colony_failure_weight_history' => 'Colony failure weight history (AWS Lambda)'];
+ protected function casts(): array
+ {
+ return [
+ 'data_relative_interval' => 'boolean'
+ ];
+ }
+
public function input_measurement(): BelongsTo
{
return $this->belongsTo(Measurement::class, 'data_measurement_id');
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index 978b3157..be83bf69 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -31,10 +31,15 @@ class DashboardGroup extends Model
protected $hidden = ['user_id', 'user', 'created_at', 'updated_at'];
- protected $casts = ['hive_ids' => 'array'];
-
public static $intervals = ['hour' => 'Hour', 'day' => 'Day', 'week' => 'Week', 'month' => 'Month', 'year' => 'Year', 'selection' => 'Selection'];
+ protected function casts(): array
+ {
+ return [
+ 'hive_ids' => 'array'
+ ];
+ }
+
public function hives()
{
if (is_array($this->hive_ids) && count($this->hive_ids) > 0) {
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index 36fa8102..ad901a39 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -52,7 +52,12 @@ class FlashLog extends Model
protected $appends = ['device_name', 'hive_name', 'user_name'];
- protected $casts = ['meta_data' => 'array', 'time_corrections' => 'array'];
+ protected function casts(): array
+ {
+ return [
+ 'meta_data' => 'array', 'time_corrections' => 'array'
+ ];
+ }
public function hive(): BelongsTo
{
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index 5ee3583e..4dda7e0d 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -32,7 +32,12 @@ class HiveTag extends Model
protected $hidden = ['id', 'created_at', 'updated_at', 'user_id'];
- protected $casts = ['router_link' => 'array'];
+ protected function casts(): array
+ {
+ return [
+ 'router_link' => 'array'
+ ];
+ }
public function hive(): BelongsTo
{
diff --git a/app/Research.php b/app/Research.php
index 9112a992..e2b1ea24 100644
--- a/app/Research.php
+++ b/app/Research.php
@@ -35,12 +35,15 @@ class Research extends Model
protected $appends = ['consent', 'consent_history', 'checklist_names', 'thumb_url'];
- protected $casts = [
- 'default_user_ids' => 'array',
- ];
-
public static $pictureType = 'research';
+ protected function casts(): array
+ {
+ return [
+ 'default_user_ids' => 'array',
+ ];
+ }
+
public static function storeImage($requestData)
{
return Image::store($requestData, Research::$pictureType);
From 9cffc4b5514ae236dae6a67a9415674fccd789d7 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:17 +0000
Subject: [PATCH 088/127] Mark base controller as `abstract`
---
app/Http/Controllers/Controller.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 77ec359a..bd3e17ed 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -6,7 +6,7 @@
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
-class Controller extends BaseController
+abstract class Controller extends BaseController
{
use AuthorizesRequests, ValidatesRequests;
}
From 06809b73c11efe71bc0578439ac7e38ed87a9114 Mon Sep 17 00:00:00 2001
From: Shift
Date: Mon, 1 Jun 2026 14:59:20 +0000
Subject: [PATCH 089/127] Shift cleanup
---
app/Device.php | 2 +-
app/Models/AlertRuleFormula.php | 2 +-
app/Models/CalculationModel.php | 2 +-
app/Models/DashboardGroup.php | 2 +-
app/Models/FlashLog.php | 2 +-
app/Models/HiveTag.php | 2 +-
config/app.php | 2 --
config/cache.php | 2 --
config/database.php | 2 --
config/logging.php | 5 -----
routes/console.php | 1 -
11 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/app/Device.php b/app/Device.php
index 61521628..5e181c64 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -83,7 +83,7 @@ public static function boot()
protected function casts(): array
{
return [
- 'log_file_info' => 'array'
+ 'log_file_info' => 'array',
];
}
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index ab780b23..dc91e06b 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -46,7 +46,7 @@ class AlertRuleFormula extends Model
protected function casts(): array
{
return [
- 'future' => 'boolean'
+ 'future' => 'boolean',
];
}
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 88ec97c2..4995ee76 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -61,7 +61,7 @@ class CalculationModel extends Model
protected function casts(): array
{
return [
- 'data_relative_interval' => 'boolean'
+ 'data_relative_interval' => 'boolean',
];
}
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index be83bf69..c7b1698a 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -36,7 +36,7 @@ class DashboardGroup extends Model
protected function casts(): array
{
return [
- 'hive_ids' => 'array'
+ 'hive_ids' => 'array',
];
}
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index ad901a39..8a5598ee 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -55,7 +55,7 @@ class FlashLog extends Model
protected function casts(): array
{
return [
- 'meta_data' => 'array', 'time_corrections' => 'array'
+ 'meta_data' => 'array', 'time_corrections' => 'array',
];
}
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index 4dda7e0d..aecd1109 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -35,7 +35,7 @@ class HiveTag extends Model
protected function casts(): array
{
return [
- 'router_link' => 'array'
+ 'router_link' => 'array',
];
}
diff --git a/config/app.php b/config/app.php
index ed44595d..bfa8a7db 100644
--- a/config/app.php
+++ b/config/app.php
@@ -1,13 +1,11 @@
env('WEBAPP_URL', null),
-
'aliases' => Facade::defaultAliases()->merge([
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
diff --git a/config/cache.php b/config/cache.php
index e17aabde..4978058c 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -1,7 +1,5 @@
[
diff --git a/config/database.php b/config/database.php
index bfe92ede..c5ad21c6 100644
--- a/config/database.php
+++ b/config/database.php
@@ -1,7 +1,5 @@
[
diff --git a/config/logging.php b/config/logging.php
index eeeffdcf..72b1dc13 100644
--- a/config/logging.php
+++ b/config/logging.php
@@ -1,10 +1,5 @@
env('LOG_DEPRECATIONS_CHANNEL', 'null'),
diff --git a/routes/console.php b/routes/console.php
index 93e3995e..bda2c711 100644
--- a/routes/console.php
+++ b/routes/console.php
@@ -11,7 +11,6 @@
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
-
Schedule::call(
function () {
Weather::updateLocations();
From a27622c1516e2a6049fc971f206d34e6ee1e3bdb Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 07:31:44 +0000
Subject: [PATCH 090/127] Swap dependency
---
composer.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/composer.json b/composer.json
index 9fe633ac..dd5330e0 100644
--- a/composer.json
+++ b/composer.json
@@ -25,13 +25,13 @@
"laravel/framework": "^11.51",
"laravel/tinker": "^2.9",
"laravel/ui": "^4.4",
- "laravelcollective/html": "^6.4",
"league/flysystem-aws-s3-v3": "^3.0",
"mcamara/laravel-localization": "2.3.0",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^8.3",
- "tray-labs/laravel-influxdb": "1.0.12"
+ "tray-labs/laravel-influxdb": "1.0.12",
+ "spatie/laravel-html": "^3.11"
},
"require-dev": {
"appzcoder/crud-generator": "^4.0",
From a1980cb8096e550c3cd5c40678b17095ff836d2d Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 07:31:48 +0000
Subject: [PATCH 091/127] Convert `Form` facade
---
config/app.php | 2 -
.../views/alert-rule-formula/form.blade.php | 4 +-
resources/views/alert-rule/form.blade.php | 10 ++---
resources/views/alert-rule/index.blade.php | 6 +--
resources/views/alert/form.blade.php | 10 ++---
resources/views/alert/index.blade.php | 6 +--
.../views/calculation-model/form.blade.php | 6 +--
resources/views/categories/create.blade.php | 6 +--
resources/views/categories/edit.blade.php | 6 +--
.../categories/partials/details.blade.php | 34 ++++++++---------
.../views/categories/partials/form.blade.php | 18 ++++-----
.../partials/translations.blade.php | 2 +-
resources/views/checklist-svg/form.blade.php | 4 +-
resources/views/checklists/form.blade.php | 4 +-
.../views/dashboard-group/form.blade.php | 4 +-
resources/views/devices/create.blade.php | 12 +++---
resources/views/devices/data.blade.php | 4 +-
resources/views/devices/edit.blade.php | 38 +++++++++----------
resources/views/devices/index.blade.php | 10 ++---
resources/views/devices/show.blade.php | 14 +++----
resources/views/flash-log/form.blade.php | 4 +-
resources/views/flash-log/index.blade.php | 4 +-
resources/views/groups/create.blade.php | 8 ++--
resources/views/groups/edit.blade.php | 8 ++--
resources/views/groups/index.blade.php | 6 +--
resources/views/image/form.blade.php | 8 ++--
resources/views/inspections/form.blade.php | 2 +-
resources/views/measurement/form.blade.php | 2 +-
.../views/research/consent_edit.blade.php | 10 ++---
resources/views/research/data.blade.php | 4 +-
resources/views/research/form.blade.php | 8 ++--
resources/views/research/show.blade.php | 4 +-
resources/views/roles/create.blade.php | 12 +++---
resources/views/roles/edit.blade.php | 10 ++---
resources/views/roles/index.blade.php | 6 +--
resources/views/sample-code/form.blade.php | 4 +-
.../views/sensordefinition/form.blade.php | 6 +--
.../views/sensordefinition/index.blade.php | 8 ++--
resources/views/translations/edit.blade.php | 8 ++--
.../translations/partials/input.blade.php | 10 ++---
resources/views/users/create.blade.php | 24 ++++++------
resources/views/users/edit.blade.php | 22 +++++------
resources/views/users/index.blade.php | 12 +++---
43 files changed, 194 insertions(+), 196 deletions(-)
diff --git a/config/app.php b/config/app.php
index bfa8a7db..c4d43955 100644
--- a/config/app.php
+++ b/config/app.php
@@ -7,8 +7,6 @@
'webapp_url' => env('WEBAPP_URL', null),
'aliases' => Facade::defaultAliases()->merge([
- 'Form' => Collective\Html\FormFacade::class,
- 'Html' => Collective\Html\HtmlFacade::class,
'Influx' => TrayLabs\InfluxDB\Facades\InfluxDB::class,
'InterventionImage' => Intervention\Image\Facades\Image::class,
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
diff --git a/resources/views/alert-rule-formula/form.blade.php b/resources/views/alert-rule-formula/form.blade.php
index 9bce9eac..1f52cece 100644
--- a/resources/views/alert-rule-formula/form.blade.php
+++ b/resources/views/alert-rule-formula/form.blade.php
@@ -2,7 +2,7 @@
@@ -11,7 +11,7 @@
diff --git a/resources/views/alert-rule/form.blade.php b/resources/views/alert-rule/form.blade.php
index f35a3da6..ebb8f3dd 100644
--- a/resources/views/alert-rule/form.blade.php
+++ b/resources/views/alert-rule/form.blade.php
@@ -80,7 +80,7 @@
@@ -155,7 +155,7 @@
@@ -164,7 +164,7 @@
@@ -173,7 +173,7 @@
@@ -193,7 +193,7 @@
diff --git a/resources/views/alert-rule/index.blade.php b/resources/views/alert-rule/index.blade.php
index 954508ab..7c203292 100644
--- a/resources/views/alert-rule/index.blade.php
+++ b/resources/views/alert-rule/index.blade.php
@@ -1,7 +1,7 @@
@extends('layouts.app')
@section('page-title') {{ __('crud.management', ['item'=>__('beep.AlertRule')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'alert-rule.index', 'class' => 'form-inline', 'role' => 'search', 'style'=>'display: inline-block;']) !!}
+ {{ html()->form('GET', route('alert-rule.index'))->class('form-inline')->attribute('role', 'search')->style('display: inline-block;')->open() }}
@@ -15,7 +15,7 @@
--}}
@@ -24,7 +24,7 @@
Default
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
@section('content')
diff --git a/resources/views/alert/form.blade.php b/resources/views/alert/form.blade.php
index 4078d347..5e64440b 100644
--- a/resources/views/alert/form.blade.php
+++ b/resources/views/alert/form.blade.php
@@ -2,7 +2,7 @@
@@ -29,7 +29,7 @@
@@ -79,7 +79,7 @@
@@ -97,7 +97,7 @@
@@ -106,7 +106,7 @@
diff --git a/resources/views/alert/index.blade.php b/resources/views/alert/index.blade.php
index f9d3ebcf..2c7b872c 100644
--- a/resources/views/alert/index.blade.php
+++ b/resources/views/alert/index.blade.php
@@ -1,7 +1,7 @@
@extends('layouts.app')
@section('page-title') {{ __('crud.management', ['item'=>__('beep.Alert')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'alert.index', 'class' => 'form-inline', 'role' => 'search', 'style'=>'display: inline-block;']) !!}
+ {{ html()->form('GET', route('alert.index'))->class('form-inline')->attribute('role', 'search')->style('display: inline-block;')->open() }}
@@ -15,13 +15,13 @@
No measurements
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
@section('content')
diff --git a/resources/views/calculation-model/form.blade.php b/resources/views/calculation-model/form.blade.php
index 47420c24..6ae572ad 100644
--- a/resources/views/calculation-model/form.blade.php
+++ b/resources/views/calculation-model/form.blade.php
@@ -11,7 +11,7 @@
@@ -20,7 +20,7 @@
@@ -107,7 +107,7 @@
{{ 'Calculation type' }}
- {!! Form::select('calculation', App\Models\CalculationModel::$calculations, e($calculationmodel->calculation ?? null), array('placeholder'=>__('crud.select', ['item'=>'Calculation type']),'class' => 'form-control select2')) !!}
+ {{ html()->select('calculation', App\Models\CalculationModel::$calculations, e($calculationmodel->calculation ?? null))->placeholder(__('crud.select', ['item' => 'Calculation type']))->class('form-control select2') }}
{!! $errors->first('calculation', '
:message
') !!}
diff --git a/resources/views/categories/create.blade.php b/resources/views/categories/create.blade.php
index 3796c7c8..c245b992 100755
--- a/resources/views/categories/create.blade.php
+++ b/resources/views/categories/create.blade.php
@@ -5,11 +5,11 @@
@overwrite
@section('body')
- {!! Form::model($data, [ 'route' => 'categories.store' ]) !!}
+ {{ html()->modelForm($data, 'POST', route('categories.store'))->open() }}
@include('categories.partials.form')
- {!! Form::submit('Create', [ 'class' => 'btn btn-primary btn-block' ]) !!}
+ {{ html()->input('submit')->value('Create')->class('btn btn-primary btn-block') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@overwrite
\ No newline at end of file
diff --git a/resources/views/categories/edit.blade.php b/resources/views/categories/edit.blade.php
index 3ad934fc..1d10ddac 100755
--- a/resources/views/categories/edit.blade.php
+++ b/resources/views/categories/edit.blade.php
@@ -5,12 +5,12 @@
@overwrite
@section('body')
- {!! Form::model($category, [ 'route' => [ 'categories.update', $category->getKey() ], 'method' => 'PATCH' ]) !!}
+ {{ html()->modelForm($category, 'PATCH', route('categories.update', $category->getKey()))->open() }}
@include('categories.partials.form')
- {!! Form::submit('Save', [ 'class' => 'btn btn-primary' ]) !!}
+ {{ html()->input('submit')->value('Save')->class('btn btn-primary') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@overwrite
\ No newline at end of file
diff --git a/resources/views/categories/partials/details.blade.php b/resources/views/categories/partials/details.blade.php
index 5b66764d..6fad3e62 100644
--- a/resources/views/categories/partials/details.blade.php
+++ b/resources/views/categories/partials/details.blade.php
@@ -11,7 +11,7 @@
@endif
- {!! Form::model($category, ['method' => 'PATCH', 'route' => ['categories.update', $category->id], 'files'=>'true']) !!}
+ {{ html()->modelForm($category, 'PATCH', route('categories.update', $category->id))->acceptsFiles()->open() }}
@@ -24,11 +24,11 @@
@endif
- {!! Form::text('name', null, array('placeholder' => 'Programmatic name (make sure it not already used!!)', 'class' => 'form-control', 'title'=>'Programmatic (code) name (make sure it not used in the code, else it will break the app!!)')) !!}
+ {{ html()->text('name')->placeholder('Programmatic name (make sure it not already used!!)')->class('form-control')->attribute('title', 'Programmatic (code) name (make sure it not used in the code, else it will break the app!!)') }}
- {!! Form::file('icon', array('class' => 'btn btn-default', 'style'=>'display: inline-block;', 'title'=>'Icon')) !!}
+ {{ html()->file('icon')->class('btn btn-default')->style('display: inline-block;')->attribute('title', 'Icon') }}
@@ -36,10 +36,10 @@
- {!! Form::select('parent_id', $categories, null, [ 'class' => 'form-control' ]) !!}
+ {{ html()->select('parent_id', $categories)->class('form-control') }}
- {!! Form::select('type', App\Category::$types, null, array('class' => 'form-control')) !!}
+ {{ html()->select('type', App\Category::$types)->class('form-control') }}
@@ -56,14 +56,14 @@
{{ __('crud.description') }}:
- {!! Form::text('description', null, array('placeholder' => 'Description in English', 'class' => 'form-control')) !!}
+ {{ html()->text('description')->placeholder('Description in English')->class('form-control') }}
Input {{ __('crud.type') }}:
- {!! Form::select('category_input_id', App\CategoryInput::selectList(), null, array('class' => 'form-control')) !!}
+ {{ html()->select('category_input_id', App\CategoryInput::selectList())->class('form-control') }}
{{ __('general.Physical_quantity') }} ({{ __('general.unit') }}):
- {!! Form::select('physical_quantity_id', App\PhysicalQuantity::selectList(), null, array('class' => 'form-control')) !!}
+ {{ html()->select('physical_quantity_id', App\PhysicalQuantity::selectList())->class('form-control') }}
{{ __('general.Source') }}:
- {!! Form::text('source', null, array('placeholder' => __('general.Source').' (http://)', 'class' => 'form-control')) !!}
+ {{ html()->text('source')->placeholder(__('general.Source') . ' (http://)')->class('form-control') }}
{{ __('beep.required_in_inspection') }}:
@@ -77,7 +77,7 @@
{{--
--}}
{{-- Old (fixed) category ID:
- {!! Form::text('old_id', null, array('placeholder' => 'Id of former category in database', 'class' => 'form-control')) !!} --}}
+ {{ html()->text('old_id')->placeholder('Id of former category in database')->class('form-control') }} --}}
@@ -87,7 +87,7 @@
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@@ -101,13 +101,13 @@
@permission('taxonomy-delete')
@if ($category->useAmount() == 0)
- {!! Form::open(['method' => 'DELETE','route' => ['categories.destroy', $category->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("'.__('crud.sure',['item'=>__('general.category'),'name'=>'\''.$category->name.'\'']).'")', 'title'=>'Delete category (and all it\'s descendants)']) !!}
- {!! Form::button('
', ['type'=>'submit', 'class' => 'btn btn-danger pull-right']) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('categories.destroy', $category->id))->style('display:inline')->attribute('onsubmit', 'return confirm("' . __('crud.sure', ['item' => __('general.category'), 'name' => '\'' . $category->name . '\'']) . '")')->attribute('title', 'Delete category (and all it\'s descendants)')->open() }}
+ {{ html()->input('submit')->value('
')->class('btn btn-danger pull-right') }}
+ {{ html()->form()->close() }}
- {!! Form::open(['method' => 'DELETE','route' => ['categories.pop', $category->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("Are you sure you want to pop category "'.$category->name.'" out in between of the tree (and move all it"s descendants to its parent?")', 'title'=>'Pop category (and move all it\'s descendants to its parent)']) !!}
- {!! Form::button('
', ['type'=>'submit', 'class' => 'btn btn-danger pull-right','style'=>'margin-right: 10px;', ($category->isLeaf() ? 'disabled' : '')]) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('categories.pop', $category->id))->style('display:inline')->attribute('onsubmit', 'return confirm("Are you sure you want to pop category "' . $category->name . '" out in between of the tree (and move all it"s descendants to its parent?")')->attribute('title', 'Pop category (and move all it\'s descendants to its parent)')->open() }}
+ {{ html()->input('submit')->value('
')->class('btn btn-danger pull-right')->style('margin-right: 10px;') }}
+ {{ html()->form()->close() }}
@endif
@endpermission
diff --git a/resources/views/categories/partials/form.blade.php b/resources/views/categories/partials/form.blade.php
index c4247391..fc38436a 100755
--- a/resources/views/categories/partials/form.blade.php
+++ b/resources/views/categories/partials/form.blade.php
@@ -1,28 +1,28 @@
- {!! Form::label('name', 'Identifier name (EN, lowercase, no spaces):') !!}
- {!! Form::text('name', null, [ 'class' => 'form-control', 'autofocus' => true ]) !!}
+ {{ html()->label('Identifier name (EN, lowercase, no spaces):', 'name') }}
+ {{ html()->text('name')->class('form-control')->autofocus(true) }}
{!! $errors->first('name') !!}
- {!! Form::label('names', 'OR multiple textual rows with categories (EN). Use a TAB to indicate a new child category:') !!}
- {!! Form::textarea('names', null, [ 'class' => 'form-control' ]) !!}
+ {{ html()->label('OR multiple textual rows with categories (EN). Use a TAB to indicate a new child category:', 'names') }}
+ {{ html()->textarea('names')->class('form-control') }}
{!! $errors->first('names') !!}
- {!! Form::label('parent_id', 'Parent:') !!}
- {!! Form::select('parent_id', $categories, null, [ 'class' => 'form-control' ]) !!}
+ {{ html()->label('Parent:', 'parent_id') }}
+ {{ html()->select('parent_id', $categories)->class('form-control') }}
{!! $errors->first('parent_id') !!}
{{ __('crud.description') }}:
- {!! Form::text('description', null, array('placeholder' => 'Description in English', 'class' => 'form-control')) !!}
+ {{ html()->text('description')->placeholder('Description in English')->class('form-control') }}
{{ __('crud.type') }}:
- {!! Form::select('category_input_id', App\CategoryInput::selectList(), isset($category->category_input_id) ? $category->category_input_id : 32, array('class' => 'form-control')) !!}
+ {{ html()->select('category_input_id', App\CategoryInput::selectList(), isset($category->category_input_id) ? $category->category_input_id : 32)->class('form-control') }}
{{ __('general.Physical_quantity') }} ({{ __('general.unit') }}):
- {!! Form::select('physical_quantity_id', App\PhysicalQuantity::selectList(), null, array('class' => 'form-control')) !!}
+ {{ html()->select('physical_quantity_id', App\PhysicalQuantity::selectList())->class('form-control') }}
{{ __('beep.required_in_inspection') }}:
diff --git a/resources/views/categories/partials/translations.blade.php b/resources/views/categories/partials/translations.blade.php
index d41b107f..329f869c 100644
--- a/resources/views/categories/partials/translations.blade.php
+++ b/resources/views/categories/partials/translations.blade.php
@@ -4,7 +4,7 @@
{{ $lang->name_english }}:
- {!! Form::text('language['.$lang->abbreviation.']', $translations->get($lang->id), array('placeholder' => $lang->name,'class' => 'form-control')) !!}
+ {{ html()->text('language[' . $lang->abbreviation . ']', $translations->get($lang->id))->placeholder($lang->name)->class('form-control') }}
@endforeach
diff --git a/resources/views/checklist-svg/form.blade.php b/resources/views/checklist-svg/form.blade.php
index 3642a5b2..1a65bd90 100644
--- a/resources/views/checklist-svg/form.blade.php
+++ b/resources/views/checklist-svg/form.blade.php
@@ -1,14 +1,14 @@
{{ __('general.User') }}
- {!! Form::select('user_id', App\User::selectlist(), isset($checklistsvg->user_id) ? $checklistsvg->user_id : Auth::user()->id, array('placeholder'=>__('crud.select', ['item'=>__('general.user')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('user_id', App\User::selectlist(), isset($checklistsvg->user_id) ? $checklistsvg->user_id : Auth::user()->id)->placeholder(__('crud.select', ['item' => __('general.user')]))->class('form-control select2') }}
diff --git a/resources/views/checklists/form.blade.php b/resources/views/checklists/form.blade.php
index 723a3932..0d1c32cf 100644
--- a/resources/views/checklists/form.blade.php
+++ b/resources/views/checklists/form.blade.php
@@ -45,7 +45,7 @@
@@ -58,7 +58,7 @@
{{ __('general.User') }}
{{ Auth::user()->name }}
- {!! Form::hidden('user_id[]', Auth::user()->id) !!}
+ {{ html()->hidden('user_id[]', Auth::user()->id) }}
{!! $errors->first('user_id', '
:message
') !!}
diff --git a/resources/views/dashboard-group/form.blade.php b/resources/views/dashboard-group/form.blade.php
index 14c9644f..967af1df 100644
--- a/resources/views/dashboard-group/form.blade.php
+++ b/resources/views/dashboard-group/form.blade.php
@@ -29,7 +29,7 @@
{{ 'HivesIds' }}
- {!! Form::select('hive_ids[]', $hive_ids, $dashboardgroup->hive_ids, array('class' => 'form-control select2','multiple')) !!}
+ {{ html()->multiselect('hive_ids[]', $hive_ids, $dashboardgroup->hive_ids)->class('form-control select2') }}
@@ -46,7 +46,7 @@
diff --git a/resources/views/devices/create.blade.php b/resources/views/devices/create.blade.php
index 5542fe52..b74c43ad 100644
--- a/resources/views/devices/create.blade.php
+++ b/resources/views/devices/create.blade.php
@@ -15,30 +15,30 @@
@endif
- {!! Form::open(array('route' => 'devices.store','method'=>'POST')) !!}
+ {{ html()->form('POST', route('devices.store'))->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, ['placeholder' => __('crud.name'),'class' => 'form-control']) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.type') }}:
- {!! Form::select('category_id', $types, null, ['placeholder'=>__('crud.select', ['item'=>__('general.device').' '.__('general.type')]),'class' => 'form-control select2']) !!}
+ {{ html()->select('category_id', $types)->placeholder(__('crud.select', ['item' => __('general.device') . ' ' . __('general.type')]))->class('form-control select2') }}
LoRa DEV EUI:
- {!! Form::text('key', null, ['placeholder' => __('crud.key'),'class' => 'form-control']) !!}
+ {{ html()->text('key')->placeholder(__('crud.key'))->class('form-control') }}
{{ __('general.User') }}:
- {!! Form::select('user_id', App\User::selectlist(), null, array('placeholder'=>__('crud.select', ['item'=>__('general.user')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('user_id', App\User::selectlist())->placeholder(__('crud.select', ['item' => __('general.user')]))->class('form-control select2') }}
@@ -60,5 +60,5 @@
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/devices/data.blade.php b/resources/views/devices/data.blade.php
index 342e492d..bee222d2 100644
--- a/resources/views/devices/data.blade.php
+++ b/resources/views/devices/data.blade.php
@@ -10,7 +10,7 @@
@slot('title')
{{ __('crud.overview', ['item'=>__('general.devices')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'devices.data', 'class' => 'form-inline', 'role' => 'search']) !!}
+ {{ html()->form('GET', route('devices.data'))->class('form-inline')->attribute('role', 'search')->open() }}
@for($year=date('Y'); $year > 2018; $year--)
@@ -53,7 +53,7 @@
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
NB: Fill at least one of the 'Research', 'User' & 'Device properties' filter properties to show Data and Completeness. The filter shows 10 items per page.
@endslot
diff --git a/resources/views/devices/edit.blade.php b/resources/views/devices/edit.blade.php
index de952a42..c27b29e2 100644
--- a/resources/views/devices/edit.blade.php
+++ b/resources/views/devices/edit.blade.php
@@ -18,55 +18,55 @@
@endif
- {!! Form::model($item, ['method' => 'PATCH','route' => ['devices.update', $item->id]]) !!}
+ {{ html()->modelForm($item, 'PATCH', route('devices.update', $item->id))->open() }}
{{ __('crud.name') }}
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.type') }}
- {!! Form::select('category_id', $types, $item->category_id, array('placeholder'=>__('crud.select', ['item'=>__('general.device').' '.__('general.type')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('category_id', $types, $item->category_id)->placeholder(__('crud.select', ['item' => __('general.device') . ' ' . __('general.type')]))->class('form-control select2') }}
LoRa DEV EUI:
- {!! Form::text('key', null, array('placeholder' => __('crud.key'),'class' => 'form-control')) !!}
+ {{ html()->text('key')->placeholder(__('crud.key'))->class('form-control') }}
Former DEV EUIs, after auto LoRa configure (comma separated):
- {!! Form::text('former_key_list', null, array('placeholder' => 'Former keys','class' => 'form-control')) !!}
+ {{ html()->text('former_key_list')->placeholder('Former keys')->class('form-control') }}
{{ __('general.User') }}
- {!! Form::select('user_id', App\User::selectlist(), $item->user_id, array('placeholder'=>__('crud.select', ['item'=>__('general.user')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('user_id', App\User::selectlist(), $item->user_id)->placeholder(__('crud.select', ['item' => __('general.user')]))->class('form-control select2') }}
{{ __('beep.Hive') }}
- {!! Form::select('hive_id', $hives, $item->hive_id, array('placeholder'=>__('crud.select', ['item'=>__('beep.Hive')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('hive_id', $hives, $item->hive_id)->placeholder(__('crud.select', ['item' => __('beep.Hive')]))->class('form-control select2') }}
Hardware ID
- {!! Form::text('hardware_id', null, array('placeholder' => 'Hardware ID','class' => 'form-control')) !!}
+ {{ html()->text('hardware_id')->placeholder('Hardware ID')->class('form-control') }}
@@ -74,35 +74,35 @@
@@ -118,27 +118,27 @@ class="form-control" min="1" max="1440"
Next downlink mesaage (Not yet working)
- {!! Form::text('next_downlink_message', null, array('placeholder' => 'HEX downlink message','class' => 'form-control')) !!}
+ {{ html()->text('next_downlink_message')->placeholder('HEX downlink message')->class('form-control') }}
@@ -166,7 +166,7 @@ class="form-control" min="1" max="1440"
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@endsection
@section('scripts')
diff --git a/resources/views/devices/index.blade.php b/resources/views/devices/index.blade.php
index 2d33fabe..86ff6685 100644
--- a/resources/views/devices/index.blade.php
+++ b/resources/views/devices/index.blade.php
@@ -12,7 +12,7 @@
@component('components/box')
@slot('title')
{{ __('crud.overview', ['item'=>__('general.devices')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'devices.index', 'class' => 'form-inline', 'role' => 'search']) !!}
+ {{ html()->form('GET', route('devices.index'))->class('form-inline')->attribute('role', 'search')->open() }}
@@ -31,7 +31,7 @@
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
NB: De 'Research', 'User' & 'Device properties' filter velden filteren max 50 devices op volgorde van het laatste contact uit de database
@endslot
@@ -114,9 +114,9 @@
@endpermission
@permission('sensor-delete')
- {!! Form::open(['method' => 'DELETE','route' => ['devices.destroy', $device->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("'.__('crud.sure',['item'=>__('general.sensor'),'name'=>'\''.$device->name.'\'']).'")']) !!}
- {!! Form::button(' ', ['type'=>'submit', 'class' => 'btn btn-danger pull-right']) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('devices.destroy', $device->id))->style('display:inline')->attribute('onsubmit', 'return confirm("' . __('crud.sure', ['item' => __('general.sensor'), 'name' => '\'' . $device->name . '\'']) . '")')->open() }}
+ {{ html()->input('submit')->value(' ')->class('btn btn-danger pull-right') }}
+ {{ html()->form()->close() }}
@endpermission
@endif
diff --git a/resources/views/devices/show.blade.php b/resources/views/devices/show.blade.php
index 56ec3b35..c05dbf50 100644
--- a/resources/views/devices/show.blade.php
+++ b/resources/views/devices/show.blade.php
@@ -92,43 +92,43 @@
@endslot
@slot('body')
- {!! Form::open(['method' => 'GET','route' => ['devices.flashlog', $item->id, $flashlog->id]]) !!}
+ {{ html()->form('GET', route('devices.flashlog', [$item->id, $flashlog->id]))->open() }}
Min # of DB matches:
- {!! Form::number('matches_min', $matches_min, array('class' => 'form-control')) !!}
+ {{ html()->number('matches_min', $matches_min)->class('form-control') }}
Min # of match properties:
- {!! Form::number('match_props', $match_props, array('class' => 'form-control')) !!}
+ {{ html()->number('match_props', $match_props)->class('form-control') }}
Number of DB records to query:
- {!! Form::number('db_records', $db_records, array('class' => 'form-control')) !!}
+ {{ html()->number('db_records', $db_records)->class('form-control') }}
Save Flashlog result after parsing
- {!! Form::checkbox('save_result', 1, $save_result) !!}
+ {{ html()->checkbox('save_result', $save_result, 1) }}
Force NOT using RTC
- {!! Form::checkbox('dont_use_rtc', 1, $dont_use_rtc) !!}
+ {{ html()->checkbox('dont_use_rtc', $dont_use_rtc, 1) }}
Re-parse Flashlog {{ $flashlog->id }} with current variables
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
diff --git a/resources/views/flash-log/form.blade.php b/resources/views/flash-log/form.blade.php
index 82c921a2..1bdd0cf9 100644
--- a/resources/views/flash-log/form.blade.php
+++ b/resources/views/flash-log/form.blade.php
@@ -2,7 +2,7 @@
@@ -11,7 +11,7 @@
diff --git a/resources/views/flash-log/index.blade.php b/resources/views/flash-log/index.blade.php
index 0d9daf67..d9600862 100644
--- a/resources/views/flash-log/index.blade.php
+++ b/resources/views/flash-log/index.blade.php
@@ -7,7 +7,7 @@
@component('components/box')
@slot('title')
{{ __('crud.overview', ['item'=>__('beep.Flash_logs')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'flash-log.index', 'class' => 'form-inline', 'role' => 'search']) !!}
+ {{ html()->form('GET', route('flash-log.index'))->class('form-inline')->attribute('role', 'search')->open() }}
@@ -57,7 +57,7 @@
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
NB: De 'Device', 'User' & 'Flashlog properties' filter velden filteren max 50 flashlog op volgorde van de laatste upload uit de database
@endslot
diff --git a/resources/views/groups/create.blade.php b/resources/views/groups/create.blade.php
index 50701d39..fbb19374 100644
--- a/resources/views/groups/create.blade.php
+++ b/resources/views/groups/create.blade.php
@@ -15,23 +15,23 @@
@endif
- {!! Form::open(array('route' => 'groups.store','method'=>'POST')) !!}
+ {{ html()->form('POST', route('groups.store'))->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.type') }}:
- {!! Form::text('type', null, array('placeholder' => __('crud.type'),'class' => 'form-control')) !!}
+ {{ html()->text('type')->placeholder(__('crud.type'))->class('form-control') }}
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/groups/edit.blade.php b/resources/views/groups/edit.blade.php
index 67033270..bbd7d984 100644
--- a/resources/views/groups/edit.blade.php
+++ b/resources/views/groups/edit.blade.php
@@ -15,23 +15,23 @@
@endif
- {!! Form::model($item, ['method' => 'PATCH','route' => ['groups.update', $item->id]]) !!}
+ {{ html()->modelForm($item, 'PATCH', route('groups.update', $item->id))->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.type') }}:
- {!! Form::text('type', null, array('placeholder' => __('crud.type'),'class' => 'form-control','style'=>'height:100px')) !!}
+ {{ html()->text('type')->placeholder(__('crud.type'))->class('form-control')->style('height:100px') }}
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/groups/index.blade.php b/resources/views/groups/index.blade.php
index 9336db29..126bd25d 100644
--- a/resources/views/groups/index.blade.php
+++ b/resources/views/groups/index.blade.php
@@ -36,9 +36,9 @@
@endpermission
@permission('group-delete')
- {!! Form::open(['method' => 'DELETE','route' => ['groups.destroy', $group->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("'.__('crud.sure',['item'=>__('general.group'),'name'=>'\''.$group->name.'\'']).'")']) !!}
- {!! Form::button(' ', ['type'=>'submit', 'class' => 'btn btn-danger pull-right']) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('groups.destroy', $group->id))->style('display:inline')->attribute('onsubmit', 'return confirm("' . __('crud.sure', ['item' => __('general.group'), 'name' => '\'' . $group->name . '\'']) . '")')->open() }}
+ {{ html()->input('submit')->value(' ')->class('btn btn-danger pull-right') }}
+ {{ html()->form()->close() }}
@endpermission
diff --git a/resources/views/image/form.blade.php b/resources/views/image/form.blade.php
index ad121142..b69966f7 100644
--- a/resources/views/image/form.blade.php
+++ b/resources/views/image/form.blade.php
@@ -63,7 +63,7 @@
@@ -72,7 +72,7 @@
@@ -81,7 +81,7 @@
@@ -90,7 +90,7 @@
diff --git a/resources/views/inspections/form.blade.php b/resources/views/inspections/form.blade.php
index 5f466e6e..6cee1737 100644
--- a/resources/views/inspections/form.blade.php
+++ b/resources/views/inspections/form.blade.php
@@ -50,7 +50,7 @@
diff --git a/resources/views/measurement/form.blade.php b/resources/views/measurement/form.blade.php
index a10d8960..378d080f 100644
--- a/resources/views/measurement/form.blade.php
+++ b/resources/views/measurement/form.blade.php
@@ -11,7 +11,7 @@
diff --git a/resources/views/research/consent_edit.blade.php b/resources/views/research/consent_edit.blade.php
index 8bd37f81..300d85f2 100644
--- a/resources/views/research/consent_edit.blade.php
+++ b/resources/views/research/consent_edit.blade.php
@@ -42,24 +42,24 @@
- {!! Form::model($item, ['method' => 'PATCH','route' => ['research.consent_edit', ['id'=>$research->id, 'c_id'=>$item->id]]]) !!}
+ {{ html()->modelForm($item, 'PATCH', route('research.consent_edit', ['id' => $research->id, 'c_id' => $item->id]))->open() }}
{{ __('beep.Hives') }}
- {!! Form::select('consent_hive_ids[]', \App\Hive::where('user_id',$item->user_id)->pluck('name','id')->toArray(), $item->consent_hive_ids, array('class' => 'form-control select2', 'multiple', 'id'=>'consent_hive_ids')) !!}
+ {{ html()->multiselect('consent_hive_ids[]', \App\Hive::where('user_id', $item->user_id)->pluck('name', 'id')->toArray(), $item->consent_hive_ids)->class('form-control select2')->id('consent_hive_ids') }}
Locations
- {!! Form::select('consent_location_ids[]', \App\Location::where('user_id',$item->user_id)->pluck('name','id')->toArray(), $item->consent_location_ids, array('class' => 'form-control select2', 'multiple', 'id'=>'consent_location_ids')) !!}
+ {{ html()->multiselect('consent_location_ids[]', \App\Location::where('user_id', $item->user_id)->pluck('name', 'id')->toArray(), $item->consent_location_ids)->class('form-control select2')->id('consent_location_ids') }}
Devices
- {!! Form::select('consent_sensor_ids[]', \App\Device::where('user_id',$item->user_id)->pluck('name','id')->toArray(), $item->consent_sensor_ids, array('class' => 'form-control select2', 'multiple', 'id'=>'consent_sensor_ids')) !!}
+ {{ html()->multiselect('consent_sensor_ids[]', \App\Device::where('user_id', $item->user_id)->pluck('name', 'id')->toArray(), $item->consent_sensor_ids)->class('form-control select2')->id('consent_sensor_ids') }}
@@ -75,6 +75,6 @@
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@endcomponent
@endsection
diff --git a/resources/views/research/data.blade.php b/resources/views/research/data.blade.php
index 7d1225fc..5b6c03f4 100644
--- a/resources/views/research/data.blade.php
+++ b/resources/views/research/data.blade.php
@@ -58,7 +58,7 @@
@@ -70,7 +70,7 @@
diff --git a/resources/views/research/form.blade.php b/resources/views/research/form.blade.php
index 0c981c74..4e964c73 100644
--- a/resources/views/research/form.blade.php
+++ b/resources/views/research/form.blade.php
@@ -3,7 +3,7 @@
{{ 'Owner' }}
{{--
--}}
- {!! Form::select('user_id', App\User::selectList(), isset($research->user_id) ? $research->user_id : Auth::user()->id, array('id'=>'user_id','class' => 'form-control select2')) !!}
+ {{ html()->select('user_id', App\User::selectList(), isset($research->user_id) ? $research->user_id : Auth::user()->id)->id('user_id')->class('form-control select2') }}
{!! $errors->first('user_id', '
:message
') !!}
@@ -145,7 +145,7 @@
{{ 'Checklists' }}
{{--
--}}
- {!! Form::select('checklist_ids[]', App\Checklist::selectList(), $research->checklists->count() > 0 ? $research->checklists->pluck('id') : null, array('id'=>'checklist_ids','class' => 'form-control select2', 'multiple')) !!}
+ {{ html()->multiselect('checklist_ids[]', App\Checklist::selectList(), $research->checklists->count() > 0 ? $research->checklists->pluck('id') : null)->id('checklist_ids')->class('form-control select2') }}
{!! $errors->first('checklist_ids', '
:message
') !!}
@@ -156,7 +156,7 @@
{{ 'Viewers' }}
{{--
--}}
- {!! Form::select('viewer_ids[]', App\User::selectList(), $research->viewers->count() > 0 ? $research->viewers->pluck('id') : null, array('id'=>'viewer_ids','class' => 'form-control select2', 'multiple')) !!}
+ {{ html()->multiselect('viewer_ids[]', App\User::selectList(), $research->viewers->count() > 0 ? $research->viewers->pluck('id') : null)->id('viewer_ids')->class('form-control select2') }}
{!! $errors->first('viewer_ids', '
:message
') !!}
@@ -167,7 +167,7 @@
{{ 'Most important users (first selection in research backend) & Invited users (in case of On invite only)' }}
{{--
--}}
- {!! Form::select('default_user_ids[]', App\User::selectList(), isset($research->default_user_ids) ? $research->default_user_ids : null, array('id'=>'default_user_ids','class' => 'form-control select2', 'multiple')) !!}
+ {{ html()->multiselect('default_user_ids[]', App\User::selectList(), isset($research->default_user_ids) ? $research->default_user_ids : null)->id('default_user_ids')->class('form-control select2') }}
{!! $errors->first('default_user_ids', '
:message
') !!}
diff --git a/resources/views/research/show.blade.php b/resources/views/research/show.blade.php
index 789c0603..1ecd0a04 100644
--- a/resources/views/research/show.blade.php
+++ b/resources/views/research/show.blade.php
@@ -22,7 +22,7 @@
@@ -31,7 +31,7 @@
diff --git a/resources/views/roles/create.blade.php b/resources/views/roles/create.blade.php
index 45d4a2a1..b8c1f524 100644
--- a/resources/views/roles/create.blade.php
+++ b/resources/views/roles/create.blade.php
@@ -15,24 +15,24 @@
@endif
- {!! Form::open(array('route' => 'roles.store','method'=>'POST')) !!}
+ {{ html()->form('POST', route('roles.store'))->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.display_name') }}:
- {!! Form::text('display_name', null, array('placeholder' => __('crud.display_name'),'class' => 'form-control')) !!}
+ {{ html()->text('display_name')->placeholder(__('crud.display_name'))->class('form-control') }}
{{ __('crud.description') }}:
- {!! Form::textarea('description', null, array('placeholder' => __('crud.description'),'class' => 'form-control','style'=>'height:100px')) !!}
+ {{ html()->textarea('description')->placeholder(__('crud.description'))->class('form-control')->style('height:100px') }}
@@ -41,7 +41,7 @@
{{ __('crud.select_multi', ['item'=>__('general.permission')]) }}
@foreach($permission as $value)
- {{ Form::checkbox('permission[]', $value->id, false, array('class' => 'name')) }}
+ {{ html()->checkbox('permission[]', false, $value->id)->class('name') }}
{{ $value->display_name }}
@endforeach
@@ -52,5 +52,5 @@
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/roles/edit.blade.php b/resources/views/roles/edit.blade.php
index 8ebb55ee..28b9289c 100644
--- a/resources/views/roles/edit.blade.php
+++ b/resources/views/roles/edit.blade.php
@@ -15,18 +15,18 @@
@endif
- {!! Form::model($role, ['method' => 'PATCH','route' => ['roles.update', $role->id]]) !!}
+ {{ html()->modelForm($role, 'PATCH', route('roles.update', $role->id))->open() }}
{{ __('crud.name') }}:
- {!! Form::text('display_name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('display_name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.description') }}:
- {!! Form::textarea('description', null, array('placeholder' => __('crud.description'),'class' => 'form-control','style'=>'height:100px')) !!}
+ {{ html()->textarea('description')->placeholder(__('crud.description'))->class('form-control')->style('height:100px') }}
@@ -35,7 +35,7 @@
{{ __('crud.select_multi', ['item'=>__('general.permission')]) }}
@foreach($permission as $value)
- {{ Form::checkbox('permission[]', $value->id, in_array($value->id, $rolePermissions->toArray()) ? true : false, array('class' => 'name')) }}
+ {{ html()->checkbox('permission[]', in_array($value->id, $rolePermissions->toArray()) ? true : false, $value->id)->class('name') }}
{{ $value->display_name }}
@endforeach
@@ -46,6 +46,6 @@
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/roles/index.blade.php b/resources/views/roles/index.blade.php
index cc5ead69..1e1044b2 100644
--- a/resources/views/roles/index.blade.php
+++ b/resources/views/roles/index.blade.php
@@ -37,9 +37,9 @@
@endpermission
@permission('role-delete')
- {!! Form::open(['method' => 'DELETE','route' => ['roles.destroy', $role->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("'.__('crud.sure',['item'=>__('general.role'),'name'=>'\''.$role->display_name.'\'']).'")']) !!}
- {!! Form::button(' ', ['type'=>'submit', 'class' => 'btn btn-danger pull-right']) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('roles.destroy', $role->id))->style('display:inline')->attribute('onsubmit', 'return confirm("' . __('crud.sure', ['item' => __('general.role'), 'name' => '\'' . $role->display_name . '\'']) . '")')->open() }}
+ {{ html()->input('submit')->value(' ')->class('btn btn-danger pull-right') }}
+ {{ html()->form()->close() }}
@endpermission
diff --git a/resources/views/sample-code/form.blade.php b/resources/views/sample-code/form.blade.php
index de5cc3ff..59d822e8 100644
--- a/resources/views/sample-code/form.blade.php
+++ b/resources/views/sample-code/form.blade.php
@@ -58,7 +58,7 @@
@@ -74,7 +74,7 @@
diff --git a/resources/views/sensordefinition/form.blade.php b/resources/views/sensordefinition/form.blade.php
index 6e9155e3..fcef868e 100644
--- a/resources/views/sensordefinition/form.blade.php
+++ b/resources/views/sensordefinition/form.blade.php
@@ -62,7 +62,7 @@
@@ -72,7 +72,7 @@
@@ -82,7 +82,7 @@
diff --git a/resources/views/sensordefinition/index.blade.php b/resources/views/sensordefinition/index.blade.php
index 57ab9188..d22a659d 100644
--- a/resources/views/sensordefinition/index.blade.php
+++ b/resources/views/sensordefinition/index.blade.php
@@ -8,10 +8,10 @@
@slot('title')
{{ __('crud.overview', ['item'=>__('beep.SensorDefinition')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'sensordefinition.index', 'class' => 'form-inline', 'role' => 'search']) !!}
+ {{ html()->form('GET', route('sensordefinition.index'))->class('form-inline')->attribute('role', 'search')->open() }}
- {!! Form::select('measurement_id', App\Measurement::selectList(), e($search_mid ?? null), array('style'=>'max-width: 300px; font-size:10px;', 'onchange'=>'this.form.submit()', 'placeholder'=>__('crud.select', ['item'=>__('beep.measurement')]),'class' => 'form-control select2')) !!}
+ {{ html()->select('measurement_id', App\Measurement::selectList(), e($search_mid ?? null))->style('max-width: 300px; font-size:10px;')->attribute('onchange', 'this.form.submit()')->placeholder(__('crud.select', ['item' => __('beep.measurement')]))->class('form-control select2') }}
@@ -31,9 +31,9 @@
- {!! Form::hidden('page', $page) !!}
+ {{ html()->hidden('page', $page) }}
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endslot
@slot('action')
diff --git a/resources/views/translations/edit.blade.php b/resources/views/translations/edit.blade.php
index 58a9c49d..b1c5e1d4 100644
--- a/resources/views/translations/edit.blade.php
+++ b/resources/views/translations/edit.blade.php
@@ -30,7 +30,7 @@
@endslot
@endcomponent
- {!! Form::open([ 'route' => ['translations.update', $language->id], 'method' => 'PATCH' ]) !!}
+ {{ html()->form('PATCH', route('translations.update', $language->id))->open() }}
@component('components/box')
@slot('title')
@@ -38,7 +38,7 @@
@endslot
@slot('action')
- {!! Form::submit('Update translations', [ 'class' => 'btn btn-primary btn-block small' ]) !!}
+ {{ html()->input('submit')->value('Update translations')->class('btn btn-primary btn-block small') }}
@endslot
@slot('body')
@@ -50,12 +50,12 @@
@endif
- {!! Form::submit('Update translations', [ 'class' => 'btn btn-primary btn-block' ]) !!}
+ {{ html()->input('submit')->value('Update translations')->class('btn btn-primary btn-block') }}
@endslot
@endcomponent
- {!! Form::close() !!}
+ {{ html()->form()->close() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/translations/partials/input.blade.php b/resources/views/translations/partials/input.blade.php
index ce697102..78ac71fa 100644
--- a/resources/views/translations/partials/input.blade.php
+++ b/resources/views/translations/partials/input.blade.php
@@ -32,10 +32,10 @@
{{ App\Translation::where('type', 'alert_rule_description')->where('name', $r->description)->where('language_id', 1)->value('translation') }}
- {!! Form::text("translation_alert_rule[$r->id]", App\Translation::where('type', 'alert_rule')->where('name', $r->name)->where('language_id', $language->id)->value('translation'), [ 'class' => 'form-control' ]) !!}
+ {{ html()->text("translation_alert_rule[{$r->id}]", App\Translation::where('type', 'alert_rule')->where('name', $r->name)->where('language_id', $language->id)->value('translation'))->class('form-control') }}
- {!! Form::text("translation_alert_rule_descr[$r->id]", App\Translation::where('type', 'alert_rule_description')->where('name', $r->description)->where('language_id', $language->id)->value('translation'), [ 'class' => 'form-control' ]) !!}
+ {{ html()->text("translation_alert_rule_descr[{$r->id}]", App\Translation::where('type', 'alert_rule_description')->where('name', $r->description)->where('language_id', $language->id)->value('translation'))->class('form-control') }}
@@ -78,7 +78,7 @@
{{ App\Translation::where('type', 'physical_quantity')->where('name', $p->abbreviation)->where('language_id', 1)->value('translation') }}
- {!! Form::text("translation_physical_quantity[$p->id]", App\Translation::where('type', 'physical_quantity')->where('name', $p->abbreviation)->where('language_id', $language->id)->value('translation'), [ 'class' => 'form-control' ]) !!}
+ {{ html()->text("translation_physical_quantity[{$p->id}]", App\Translation::where('type', 'physical_quantity')->where('name', $p->abbreviation)->where('language_id', $language->id)->value('translation'))->class('form-control') }}
@@ -120,7 +120,7 @@
{{ App\Translation::where('type', 'measurement')->where('name', $m->abbreviation)->where('language_id', 1)->value('translation') }}
- {!! Form::text("translation_measurement[$m->id]", App\Translation::where('type', 'measurement')->where('name', $m->abbreviation)->where('language_id', $language->id)->value('translation'), [ 'class' => 'form-control' ]) !!}
+ {{ html()->text("translation_measurement[{$m->id}]", App\Translation::where('type', 'measurement')->where('name', $m->abbreviation)->where('language_id', $language->id)->value('translation'))->class('form-control') }}
@@ -169,7 +169,7 @@
{{ App\Translation::where('type', 'category')->where('name', $name)->where('language_id', 1)->value('translation') }}
- {!! Form::text("translation_category[$cat_id]", App\Translation::where('type', 'category')->where('name', $name)->where('language_id', $language->id)->value('translation'), [ 'class' => 'form-control' ]) !!}
+ {{ html()->text("translation_category[{$cat_id}]", App\Translation::where('type', 'category')->where('name', $name)->where('language_id', $language->id)->value('translation'))->class('form-control') }}
diff --git a/resources/views/users/create.blade.php b/resources/views/users/create.blade.php
index 45a353ea..3fe19ab2 100644
--- a/resources/views/users/create.blade.php
+++ b/resources/views/users/create.blade.php
@@ -15,63 +15,63 @@
@endif
- {!! Form::open(array('route' => 'users.store','method'=>'POST','files'=>'true')) !!}
+ {{ html()->form('POST', route('users.store'))->acceptsFiles()->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.email') }}:
- {!! Form::text('email', null, array('placeholder' => __('crud.email'),'class' => 'form-control')) !!}
+ {{ html()->text('email')->placeholder(__('crud.email'))->class('form-control') }}
{{ __('general.Language') }}:
- {!! Form::text('locale', null, array('placeholder' => __('general.Language').' code','class' => 'form-control')) !!}
+ {{ html()->text('locale')->placeholder(__('general.Language') . ' code')->class('form-control') }}
Rate limit (max req/min):
- {!! Form::text('rate_limit_per_min', null, array('placeholder' => 'Max requests per minute'.' code','class' => 'form-control')) !!}
+ {{ html()->text('rate_limit_per_min')->placeholder('Max requests per minute' . ' code')->class('form-control') }}
{{ __('crud.pass') }}:
- {!! Form::password('password', array('placeholder' => __('crud.pass'),'class' => 'form-control')) !!}
+ {{ html()->password('password')->attribute('placeholder', __('crud.pass'))->class('form-control') }}
{{ __('crud.pass_confirm') }}:
- {!! Form::password('confirm-password', array('placeholder' => __('crud.pass_confirm'),'class' => 'form-control')) !!}
+ {{ html()->password('confirm-password')->attribute('placeholder', __('crud.pass_confirm'))->class('form-control') }}
@role('superadmin')
@@ -80,6 +80,6 @@
{{ __('crud.save') }}
- {!! Form::hidden('api-token', Str::random(60)) !!}
- {!! Form::close() !!}
+ {{ html()->hidden('api-token', Str::random(60)) }}
+ {{ html()->form()->close() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php
index 68deebc3..6954e4bf 100644
--- a/resources/views/users/edit.blade.php
+++ b/resources/views/users/edit.blade.php
@@ -16,30 +16,30 @@
@endif
- {!! Form::model($user, ['method' => 'PATCH','route' => ['users.update', $user->id],'files'=>'true']) !!}
+ {{ html()->modelForm($user, 'PATCH', route('users.update', $user->id))->acceptsFiles()->open() }}
{{ __('crud.name') }}:
- {!! Form::text('name', null, array('placeholder' => __('crud.name'),'class' => 'form-control')) !!}
+ {{ html()->text('name')->placeholder(__('crud.name'))->class('form-control') }}
{{ __('crud.email') }}:
- {!! Form::text('email', null, array('placeholder' => __('crud.email'),'class' => 'form-control')) !!}
+ {{ html()->text('email')->placeholder(__('crud.email'))->class('form-control') }}
{{ __('general.Language') }}:
- {!! Form::text('locale', null, array('placeholder' => __('general.Language').' code','class' => 'form-control')) !!}
+ {{ html()->text('locale')->placeholder(__('general.Language') . ' code')->class('form-control') }}
Rate limit (max req/min):
- {!! Form::text('rate_limit_per_min', null, array('placeholder' => 'Max requests per minute'.' code','class' => 'form-control')) !!}
+ {{ html()->text('rate_limit_per_min')->placeholder('Max requests per minute' . ' code')->class('form-control') }}
@@ -47,34 +47,34 @@
{{ __('crud.avatar') }}:
- {!! Form::file('avatar', array('class' => 'btn btn-default', 'style'=>'display: inline-block;')) !!}
+ {{ html()->file('avatar')->class('btn btn-default')->style('display: inline-block;') }}
{{ __('crud.avatar_file')}}
{{ __('crud.pass') }}:
- {!! Form::password('password', array('placeholder' => __('crud.pass'),'class' => 'form-control')) !!}
+ {{ html()->password('password')->attribute('placeholder', __('crud.pass'))->class('form-control') }}
{{ __('crud.pass_confirm') }}:
- {!! Form::password('confirm-password', array('placeholder' => __('crud.pass_confirm'),'class' => 'form-control')) !!}
+ {{ html()->password('confirm-password')->attribute('placeholder', __('crud.pass_confirm'))->class('form-control') }}
@role('superadmin')
@@ -85,5 +85,5 @@
{{ __('crud.save') }}
- {!! Form::close() !!}
+ {{ html()->closeModelForm() }}
@endsection
\ No newline at end of file
diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php
index b2cb90dc..4e479e9a 100644
--- a/resources/views/users/index.blade.php
+++ b/resources/views/users/index.blade.php
@@ -9,15 +9,15 @@
@component('components/box')
@slot('title')
{{ __('crud.overview', ['item'=>__('general.users')]) }}
- {!! Form::open(['method' => 'GET', 'route' => 'users.index', 'class' => 'form-inline', 'role' => 'search']) !!}
+ {{ html()->form('GET', route('users.index'))->class('form-inline')->attribute('role', 'search')->open() }}
- {!! Form::hidden('page', $page) !!}
- {!! Form::close() !!}
+ {{ html()->hidden('page', $page) }}
+ {{ html()->form()->close() }}
@endslot
@slot('action')
@@ -100,9 +100,9 @@
@endpermission
@permission('user-delete')
- {!! Form::open(['method' => 'DELETE','route' => ['users.destroy', $user->id], 'style'=>'display:inline', 'onsubmit'=>'return confirm("'.__('crud.sure',['item'=>__('general.user'),'name'=>'\''.$user->name.'\'']).'")']) !!}
- {!! Form::button(' ', ['type'=>'submit', 'class' => 'btn btn-danger pull-right']) !!}
- {!! Form::close() !!}
+ {{ html()->form('DELETE', route('users.destroy', $user->id))->style('display:inline')->attribute('onsubmit', 'return confirm("' . __('crud.sure', ['item' => __('general.user'), 'name' => '\'' . $user->name . '\'']) . '")')->open() }}
+ {{ html()->input('submit')->value(' ')->class('btn btn-danger pull-right') }}
+ {{ html()->form()->close() }}
@endpermission
From e14561f4a779182d811427bc9999cc4b4f3a87ae Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 11:36:53 +0200
Subject: [PATCH 092/127] update to laratrust 8.x + add providers to auth.php +
install influxdata/influxdb-client-php + update migration to only run if
table does not exist yet
---
.env.example | 2 +-
app/Exceptions/Handler.php | 2 +-
app/Http/Controllers/RoleController.php | 4 +-
app/Http/Controllers/UserController.php | 4 +-
app/Permission.php | 5 +-
app/Role.php | 12 +-
app/User.php | 8 +-
bootstrap/app.php | 1 -
composer.json | 5 +-
composer.lock | 2959 +++++++++--------
config/auth.php | 8 +
config/cache.php | 48 +
config/laratrust.php | 76 +-
...o_role_user_and_permission_user_tables.php | 2 +-
...01_000000_rename_password_resets_table.php | 8 +-
.../2026_06_02_074531_create_cache_table.php | 35 +
storage/framework/cache/data/.gitignore | 2 -
17 files changed, 1838 insertions(+), 1343 deletions(-)
create mode 100644 database/migrations/2026_06_02_074531_create_cache_table.php
delete mode 100755 storage/framework/cache/data/.gitignore
diff --git a/.env.example b/.env.example
index 8d3c7a53..2ac2a2be 100644
--- a/.env.example
+++ b/.env.example
@@ -2,13 +2,13 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
+APP_NAME=BEEP
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
-APP_NAME=BEEP
APP_LOCALE=en
BETA=false
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php
index e9f0aa70..b10c9ba9 100644
--- a/app/Exceptions/Handler.php
+++ b/app/Exceptions/Handler.php
@@ -2,7 +2,7 @@
namespace App\Exceptions;
-use Exception;
+// use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index 2ca99fc7..a8b8e02c 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -51,7 +51,7 @@ public function store(Request $request): RedirectResponse
$role->save();
foreach ($request->input('permission') as $key => $value) {
- $role->attachPermission($value);
+ $role->givePermission($value);
}
return redirect()->route('roles.index')
@@ -106,7 +106,7 @@ public function update(Request $request, int $id): RedirectResponse
->delete();
foreach ($request->input('permission') as $key => $value) {
- $role->attachPermission($value);
+ $role->givePermission($value);
}
return redirect()->route('roles.index')
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index 5e8d4e39..efc5dbef 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -98,7 +98,7 @@ public function store(Request $request): RedirectResponse
$roleIds = $this->getMyPermittedRoles(Auth::user(), true);
foreach ($request->input('roles') as $key => $value) {
if (in_array($value, $roleIds)) {
- $user->attachRole($value);
+ $user->addRole($value);
}
}
}
@@ -186,7 +186,7 @@ public function update(Request $request, int $id): RedirectResponse
if ($request->filled('roles')) {
DB::table('role_user')->where('user_id', $id)->delete();
foreach ($request->input('roles') as $key => $value) {
- $user->attachRole($value);
+ $user->addRole($value);
}
}
} else {
diff --git a/app/Permission.php b/app/Permission.php
index b2aa6b8d..f830637f 100644
--- a/app/Permission.php
+++ b/app/Permission.php
@@ -2,7 +2,8 @@
namespace App;
-use Laratrust\Models\LaratrustPermission;
+use Laratrust\Models\Permission as LaratrustPermission;
+
class Permission extends LaratrustPermission
{
@@ -170,7 +171,7 @@ public static function updatePermissions()
// if (Role::where('name', 'superadmin')->count() == 1)
// {
- // Role::where('name', 'superadmin')->first()->attachPermissions([$p]);
+ // Role::where('name', 'superadmin')->first()->givePermissions([$p]);
// }
echo 'Added permission '.$value['display_name']."\r\n";
}
diff --git a/app/Role.php b/app/Role.php
index d37663c7..850986bb 100644
--- a/app/Role.php
+++ b/app/Role.php
@@ -2,7 +2,7 @@
namespace App;
-use Laratrust\Models\LaratrustRole;
+use Laratrust\Models\Role as LaratrustRole;
class Role extends LaratrustRole
{
@@ -66,7 +66,7 @@ public static function updateRoles()
$super->display_name = 'Super administrator'; // optional
$super->description = 'User is the master of the system, and can edit everything'; // optional
$super->save();
- $super->attachPermissions($perm_super); // all roles
+ $super->givePermissions($perm_super); // all roles
}
if (Role::where('name', 'admin')->count() == 0) {
@@ -75,7 +75,7 @@ public static function updateRoles()
$admin->display_name = 'Administrator'; // optional
$admin->description = 'User is allowed to manage users, groups and sensors'; // optional
$admin->save();
- $admin->attachPermissions($perm_admin);
+ $admin->givePermissions($perm_admin);
}
if (Role::where('name', 'manager')->count() == 0) {
@@ -84,7 +84,7 @@ public static function updateRoles()
$manag->display_name = 'Sensor manager'; // optional
$manag->description = 'User is allowed to manage groups and sensors'; // optional
$manag->save();
- $manag->attachPermissions($perm_manag);
+ $manag->givePermissions($perm_manag);
}
if (Role::where('name', 'taxonomy')->count() == 0) {
@@ -93,7 +93,7 @@ public static function updateRoles()
$taxon->display_name = 'Taxonomy editor'; // optional
$taxon->description = 'User is allowed to create and edit taxonomy items'; // optional
$taxon->save();
- $taxon->attachPermissions($perm_taxonomy_editor);
+ $taxon->givePermissions($perm_taxonomy_editor);
}
if (Role::where('name', 'translator')->count() == 0) {
@@ -102,7 +102,7 @@ public static function updateRoles()
$trans->display_name = 'Translation editor'; // optional
$trans->description = 'User is allowed to create languages and edit translations'; // optional
$trans->save();
- $trans->attachPermissions($perm_language_editor);
+ $trans->givePermissions($perm_language_editor);
}
}
}
diff --git a/app/User.php b/app/User.php
index 545f460b..1f0f079a 100644
--- a/app/User.php
+++ b/app/User.php
@@ -20,12 +20,14 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\Log;
-use Laratrust\Traits\LaratrustUserTrait;
+use Laratrust\Contracts\LaratrustUser;
+use Laratrust\Traits\HasRolesAndPermissions;
-class User extends Authenticatable
+
+class User extends Authenticatable implements LaratrustUser
{
use HasFactory;
- use LaratrustUserTrait;
+ use HasRolesAndPermissions;
use Notifiable;
protected $fillable = ['name', 'email', 'password', 'api_token', 'last_login', 'policy_accepted', 'locale', 'avatar', 'rate_limit_per_min'];
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 053808c4..4a0c04fb 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -9,7 +9,6 @@
->withProviders([
\Laravel\Tinker\TinkerServiceProvider::class,
\EllipseSynergie\ApiResponse\Laravel\ResponseServiceProvider::class,
- \Collective\Html\HtmlServiceProvider::class,
\Intervention\Image\ImageServiceProvider::class,
\Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
\TrayLabs\InfluxDB\Providers\ServiceProvider::class,
diff --git a/composer.json b/composer.json
index dd5330e0..c6fb412c 100644
--- a/composer.json
+++ b/composer.json
@@ -20,6 +20,7 @@
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
"guzzlehttp/guzzle": "^7.8",
+ "influxdata/influxdb-client-php": "3.6",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
"laravel/framework": "^11.51",
@@ -30,8 +31,8 @@
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
"santigarcor/laratrust": "^8.3",
- "tray-labs/laravel-influxdb": "1.0.12",
- "spatie/laravel-html": "^3.11"
+ "spatie/laravel-html": "^3.11",
+ "tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
"appzcoder/crud-generator": "^4.0",
diff --git a/composer.lock b/composer.lock
index d01ef5df..be0a20c7 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "64327e7daaa8f7c86f202b84281e638b",
+ "content-hash": "0d6c61c0640fad2087ae7e47b6d99cd4",
"packages": [
{
"name": "aws/aws-crt-php",
@@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.383.1",
+ "version": "3.383.2",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "56b7ff3ff9e086eb3945bf31e75c97cde5ab531a"
+ "reference": "11c2de39e4511dc99e44f049c7dfc8087e051867"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/56b7ff3ff9e086eb3945bf31e75c97cde5ab531a",
- "reference": "56b7ff3ff9e086eb3945bf31e75c97cde5ab531a",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/11c2de39e4511dc99e44f049c7dfc8087e051867",
+ "reference": "11c2de39e4511dc99e44f049c7dfc8087e051867",
"shasum": ""
},
"require": {
@@ -153,31 +153,31 @@
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.383.1"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.383.2"
},
- "time": "2026-05-29T18:13:12+00:00"
+ "time": "2026-06-01T18:08:21+00:00"
},
{
"name": "brick/math",
- "version": "0.12.3",
+ "version": "0.14.8",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
- "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba"
+ "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba",
- "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba",
+ "url": "https://api.github.com/repos/brick/math/zipball/63422359a44b7f06cae63c3b429b59e8efcc0629",
+ "reference": "63422359a44b7f06cae63c3b429b59e8efcc0629",
"shasum": ""
},
"require": {
- "php": "^8.1"
+ "php": "^8.2"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
- "phpunit/phpunit": "^10.1",
- "vimeo/psalm": "6.8.8"
+ "phpstan/phpstan": "2.1.22",
+ "phpunit/phpunit": "^11.5"
},
"type": "library",
"autoload": {
@@ -207,7 +207,7 @@
],
"support": {
"issues": "https://github.com/brick/math/issues",
- "source": "https://github.com/brick/math/tree/0.12.3"
+ "source": "https://github.com/brick/math/tree/0.14.8"
},
"funding": [
{
@@ -215,7 +215,7 @@
"type": "github"
}
],
- "time": "2025-02-28T13:11:00+00:00"
+ "time": "2026-02-10T14:33:43+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
@@ -286,6 +286,72 @@
],
"time": "2023-12-11T17:09:12+00:00"
},
+ {
+ "name": "clue/stream-filter",
+ "version": "v1.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/clue/stream-filter.git",
+ "reference": "049509fef80032cb3f051595029ab75b49a3c2f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7",
+ "reference": "049509fef80032cb3f051595029ab75b49a3c2f7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/functions_include.php"
+ ],
+ "psr-4": {
+ "Clue\\StreamFilter\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christian Lück",
+ "email": "christian@clue.engineering"
+ }
+ ],
+ "description": "A simple and modern approach to stream filtering in PHP",
+ "homepage": "https://github.com/clue/stream-filter",
+ "keywords": [
+ "bucket brigade",
+ "callback",
+ "filter",
+ "php_user_filter",
+ "stream",
+ "stream_filter_append",
+ "stream_filter_register"
+ ],
+ "support": {
+ "issues": "https://github.com/clue/stream-filter/issues",
+ "source": "https://github.com/clue/stream-filter/tree/v1.7.0"
+ },
+ "funding": [
+ {
+ "url": "https://clue.engineering/support",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/clue",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-20T15:40:13+00:00"
+ },
{
"name": "composer/pcre",
"version": "3.3.2",
@@ -926,25 +992,25 @@
},
{
"name": "dyrynda/laravel-cascade-soft-deletes",
- "version": "4.4.1",
+ "version": "4.5.0",
"source": {
"type": "git",
"url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "d5d78b9360a3ddaf086e773a8a3db562e246caee"
+ "reference": "df5fee4003fc183c8ef46dc9055c1cada4182494"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/d5d78b9360a3ddaf086e773a8a3db562e246caee",
- "reference": "d5d78b9360a3ddaf086e773a8a3db562e246caee",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/df5fee4003fc183c8ef46dc9055c1cada4182494",
+ "reference": "df5fee4003fc183c8ef46dc9055c1cada4182494",
"shasum": ""
},
"require": {
- "illuminate/database": "^10.0 || ^11.0",
- "illuminate/events": "^10.0 || ^11.0",
- "php": "^8.1"
+ "illuminate/database": "^11.0 || ^12.0",
+ "illuminate/events": "^11.0 || ^12.0",
+ "php": "^8.2"
},
"require-dev": {
- "pestphp/pest": "^2.34",
+ "pestphp/pest": "^2.34 || ^3.7",
"pestphp/pest-plugin-drift": "^2.5"
},
"type": "utility",
@@ -967,9 +1033,9 @@
"description": "Cascading deletes for Eloquent models that implement soft deletes",
"support": {
"issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.4.1"
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.5.0"
},
- "time": "2025-01-06T22:18:43+00:00"
+ "time": "2025-02-26T10:22:40+00:00"
},
{
"name": "egulias/email-validator",
@@ -1766,6 +1832,56 @@
],
"time": "2026-05-23T22:00:21+00:00"
},
+ {
+ "name": "influxdata/influxdb-client-php",
+ "version": "3.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/influxdata/influxdb-client-php.git",
+ "reference": "3606b12214508f22126b7ed0565d53380674312a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/influxdata/influxdb-client-php/zipball/3606b12214508f22126b7ed0565d53380674312a",
+ "reference": "3606b12214508f22126b7ed0565d53380674312a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "php": ">=7.2",
+ "php-http/client-common": "^2.2.1",
+ "php-http/discovery": "^1.9.1",
+ "psr/http-client": "^1.0.1"
+ },
+ "require-dev": {
+ "guzzlehttp/guzzle": "^7.0.1",
+ "guzzlehttp/psr7": "^2.0.0",
+ "phpunit/phpunit": "^8.5.27",
+ "squizlabs/php_codesniffer": "~3.7"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "InfluxDB2\\": "src/InfluxDB2"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "InfluxDB (v2+) Client Library for PHP",
+ "homepage": "https://www.github.com/influxdata/influxdb-client-php",
+ "keywords": [
+ "influxdb"
+ ],
+ "support": {
+ "issues": "https://github.com/influxdata/influxdb-client-php/issues",
+ "source": "https://github.com/influxdata/influxdb-client-php/tree/3.6.0"
+ },
+ "time": "2024-06-24T10:01:53+00:00"
+ },
{
"name": "influxdb/influxdb-php",
"version": "1.15.2",
@@ -2032,23 +2148,23 @@
},
{
"name": "laravel/framework",
- "version": "10.50.2",
+ "version": "v11.54.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "3ff39b7a9b83e633383ec9b019827ed54b6d38bc"
+ "reference": "4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/3ff39b7a9b83e633383ec9b019827ed54b6d38bc",
- "reference": "3ff39b7a9b83e633383ec9b019827ed54b6d38bc",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58",
+ "reference": "4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58",
"shasum": ""
},
"require": {
- "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12",
+ "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12|^0.13|^0.14",
"composer-runtime-api": "^2.2",
"doctrine/inflector": "^2.0.5",
- "dragonmantank/cron-expression": "^3.3.2",
+ "dragonmantank/cron-expression": "^3.4",
"egulias/email-validator": "^3.2.1|^4.0",
"ext-ctype": "*",
"ext-filter": "*",
@@ -2057,44 +2173,45 @@
"ext-openssl": "*",
"ext-session": "*",
"ext-tokenizer": "*",
- "fruitcake/php-cors": "^1.2",
+ "fruitcake/php-cors": "^1.3",
+ "guzzlehttp/guzzle": "^7.8.2",
"guzzlehttp/uri-template": "^1.0",
- "laravel/prompts": "^0.1.9",
- "laravel/serializable-closure": "^1.3",
- "league/commonmark": "^2.2.1",
- "league/flysystem": "^3.8.0",
+ "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0",
+ "laravel/serializable-closure": "^1.3|^2.0",
+ "league/commonmark": "^2.7",
+ "league/flysystem": "^3.25.1",
+ "league/flysystem-local": "^3.25.1",
+ "league/uri": "^7.5.1",
"monolog/monolog": "^3.0",
- "nesbot/carbon": "^2.67",
- "nunomaduro/termwind": "^1.13",
- "php": "^8.1",
+ "nesbot/carbon": "^2.72.6|^3.8.4",
+ "nunomaduro/termwind": "^2.0",
+ "php": "^8.2",
"psr/container": "^1.1.1|^2.0.1",
"psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0|^3.0",
"ramsey/uuid": "^4.7",
- "symfony/console": "^6.2",
- "symfony/error-handler": "^6.2",
- "symfony/finder": "^6.2",
- "symfony/http-foundation": "^6.4",
- "symfony/http-kernel": "^6.2",
- "symfony/mailer": "^6.2",
- "symfony/mime": "^6.2",
- "symfony/process": "^6.2",
- "symfony/routing": "^6.2",
- "symfony/uid": "^6.2",
- "symfony/var-dumper": "^6.2",
+ "symfony/console": "^7.0.3",
+ "symfony/error-handler": "^7.0.3",
+ "symfony/finder": "^7.0.3",
+ "symfony/http-foundation": "^7.2.0",
+ "symfony/http-kernel": "^7.0.3",
+ "symfony/mailer": "^7.0.3",
+ "symfony/mime": "^7.0.3",
+ "symfony/polyfill-php83": "^1.31",
+ "symfony/process": "^7.0.3",
+ "symfony/routing": "^7.0.3",
+ "symfony/uid": "^7.0.3",
+ "symfony/var-dumper": "^7.0.3",
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
- "vlucas/phpdotenv": "^5.4.1",
- "voku/portable-ascii": "^2.0"
+ "vlucas/phpdotenv": "^5.6.1",
+ "voku/portable-ascii": "^2.0.2"
},
"conflict": {
- "carbonphp/carbon-doctrine-types": ">=3.0",
- "doctrine/dbal": ">=4.0",
- "mockery/mockery": "1.6.8",
- "phpunit/phpunit": ">=11.0.0",
"tightenco/collect": "<5.5.33"
},
"provide": {
"psr/container-implementation": "1.1|2.0",
+ "psr/log-implementation": "1.0|2.0|3.0",
"psr/simple-cache-implementation": "1.0|2.0|3.0"
},
"replace": {
@@ -2103,6 +2220,7 @@
"illuminate/bus": "self.version",
"illuminate/cache": "self.version",
"illuminate/collections": "self.version",
+ "illuminate/concurrency": "self.version",
"illuminate/conditionable": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
@@ -2130,36 +2248,39 @@
"illuminate/testing": "self.version",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
- "illuminate/view": "self.version"
+ "illuminate/view": "self.version",
+ "spatie/once": "*"
},
"require-dev": {
"ably/ably-php": "^1.0",
- "aws/aws-sdk-php": "^3.235.5",
- "doctrine/dbal": "^3.5.1",
+ "aws/aws-sdk-php": "^3.322.9",
"ext-gmp": "*",
- "fakerphp/faker": "^1.21",
- "guzzlehttp/guzzle": "^7.5",
- "league/flysystem-aws-s3-v3": "^3.0",
- "league/flysystem-ftp": "^3.0",
- "league/flysystem-path-prefixing": "^3.3",
- "league/flysystem-read-only": "^3.3",
- "league/flysystem-sftp-v3": "^3.0",
- "mockery/mockery": "^1.5.1",
- "nyholm/psr7": "^1.2",
- "orchestra/testbench-core": "^8.23.4",
- "pda/pheanstalk": "^4.0",
- "phpstan/phpstan": "~1.11.11",
- "phpunit/phpunit": "^10.0.7",
- "predis/predis": "^2.0.2",
- "symfony/cache": "^6.2",
- "symfony/http-client": "^6.2.4",
- "symfony/psr-http-message-bridge": "^2.0"
+ "fakerphp/faker": "^1.24",
+ "guzzlehttp/promises": "^2.0.3",
+ "guzzlehttp/psr7": "^2.4",
+ "laravel/pint": "^1.18",
+ "league/flysystem-aws-s3-v3": "^3.25.1",
+ "league/flysystem-ftp": "^3.25.1",
+ "league/flysystem-path-prefixing": "^3.25.1",
+ "league/flysystem-read-only": "^3.25.1",
+ "league/flysystem-sftp-v3": "^3.25.1",
+ "mockery/mockery": "^1.6.10",
+ "orchestra/testbench-core": "^9.18.0",
+ "pda/pheanstalk": "^5.0.6",
+ "php-http/discovery": "^1.15",
+ "phpstan/phpstan": "2.1.41",
+ "phpunit/phpunit": "^10.5.35|^11.3.6|^12.0.1",
+ "predis/predis": "^2.3",
+ "resend/resend-php": "^0.10.0",
+ "symfony/cache": "^7.0.3",
+ "symfony/http-client": "^7.0.3",
+ "symfony/psr-http-message-bridge": "^7.0.3",
+ "symfony/translation": "^7.0.3"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
- "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.235.5).",
- "brianium/paratest": "Required to run tests in parallel (^6.0).",
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (^3.5.1).",
+ "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).",
+ "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).",
"ext-apcu": "Required to use the APC cache driver.",
"ext-fileinfo": "Required to use the Filesystem class.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
@@ -2168,34 +2289,34 @@
"ext-pcntl": "Required to use all features of the queue worker and console signal trapping.",
"ext-pdo": "Required to use all database features.",
"ext-posix": "Required to use all features of the queue worker.",
- "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
+ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
- "guzzlehttp/guzzle": "Required to use the HTTP Client and the ping methods on schedules (^7.5).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
- "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).",
- "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).",
- "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.3).",
- "league/flysystem-read-only": "Required to use read-only disks (^3.3)",
- "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).",
- "mockery/mockery": "Required to use mocking (^1.5.1).",
- "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
- "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
- "phpunit/phpunit": "Required to use assertions and run tests (^9.5.8|^10.0.7).",
- "predis/predis": "Required to use the predis connector (^2.0.2).",
+ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).",
+ "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).",
+ "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.25.1).",
+ "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)",
+ "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).",
+ "mockery/mockery": "Required to use mocking (^1.6).",
+ "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).",
+ "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1).",
+ "predis/predis": "Required to use the predis connector (^2.3).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^6.2).",
- "symfony/filesystem": "Required to enable support for relative symbolic links (^6.2).",
- "symfony/http-client": "Required to enable support for the Symfony API mail transports (^6.2).",
- "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^6.2).",
- "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^6.2).",
- "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)."
+ "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^7.0).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).",
+ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.0).",
+ "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).",
+ "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0).",
+ "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "10.x-dev"
+ "dev-master": "11.x-dev"
}
},
"autoload": {
@@ -2205,6 +2326,8 @@
"src/Illuminate/Events/functions.php",
"src/Illuminate/Filesystem/functions.php",
"src/Illuminate/Foundation/helpers.php",
+ "src/Illuminate/Log/functions.php",
+ "src/Illuminate/Support/functions.php",
"src/Illuminate/Support/helpers.php"
],
"psr-4": {
@@ -2236,37 +2359,38 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2026-02-15T14:12:07+00:00"
+ "time": "2026-05-26T23:41:51+00:00"
},
{
"name": "laravel/prompts",
- "version": "v0.1.25",
+ "version": "v0.3.18",
"source": {
"type": "git",
"url": "https://github.com/laravel/prompts.git",
- "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95"
+ "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/prompts/zipball/7b4029a84c37cb2725fc7f011586e2997040bc95",
- "reference": "7b4029a84c37cb2725fc7f011586e2997040bc95",
+ "url": "https://api.github.com/repos/laravel/prompts/zipball/a19af51bb144bf87f08397921fa619f85c7d4e72",
+ "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72",
"shasum": ""
},
"require": {
+ "composer-runtime-api": "^2.2",
"ext-mbstring": "*",
- "illuminate/collections": "^10.0|^11.0",
"php": "^8.1",
- "symfony/console": "^6.2|^7.0"
+ "symfony/console": "^6.2|^7.0|^8.0"
},
"conflict": {
"illuminate/console": ">=10.17.0 <10.25.0",
"laravel/framework": ">=10.17.0 <10.25.0"
},
"require-dev": {
+ "illuminate/collections": "^10.0|^11.0|^12.0|^13.0",
"mockery/mockery": "^1.5",
- "pestphp/pest": "^2.3",
- "phpstan/phpstan": "^1.11",
- "phpstan/phpstan-mockery": "^1.1"
+ "pestphp/pest": "^2.3|^3.4|^4.0",
+ "phpstan/phpstan": "^1.12.28",
+ "phpstan/phpstan-mockery": "^1.1.3"
},
"suggest": {
"ext-pcntl": "Required for the spinner to be animated."
@@ -2274,7 +2398,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "0.1.x-dev"
+ "dev-main": "0.3.x-dev"
}
},
"autoload": {
@@ -2292,38 +2416,38 @@
"description": "Add beautiful and user-friendly forms to your command-line applications.",
"support": {
"issues": "https://github.com/laravel/prompts/issues",
- "source": "https://github.com/laravel/prompts/tree/v0.1.25"
+ "source": "https://github.com/laravel/prompts/tree/v0.3.18"
},
- "time": "2024-08-12T22:06:33+00:00"
+ "time": "2026-05-19T00:47:18+00:00"
},
{
"name": "laravel/serializable-closure",
- "version": "v1.3.7",
+ "version": "v2.0.13",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
- "reference": "4f48ade902b94323ca3be7646db16209ec76be3d"
+ "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d",
- "reference": "4f48ade902b94323ca3be7646db16209ec76be3d",
+ "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/b566ee0dd251f3c4078bed003a7ce015f5ea6dce",
+ "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce",
"shasum": ""
},
"require": {
- "php": "^7.3|^8.0"
+ "php": "^8.1"
},
"require-dev": {
- "illuminate/support": "^8.0|^9.0|^10.0|^11.0",
- "nesbot/carbon": "^2.61|^3.0",
- "pestphp/pest": "^1.21.3",
- "phpstan/phpstan": "^1.8.2",
- "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0"
+ "illuminate/support": "^10.0|^11.0|^12.0|^13.0",
+ "nesbot/carbon": "^2.67|^3.0",
+ "pestphp/pest": "^2.36|^3.0|^4.0",
+ "phpstan/phpstan": "^2.0",
+ "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-master": "2.x-dev"
}
},
"autoload": {
@@ -2355,7 +2479,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
- "time": "2024-11-14T18:34:49+00:00"
+ "time": "2026-04-16T14:03:50+00:00"
},
{
"name": "laravel/tinker",
@@ -2486,79 +2610,6 @@
},
"time": "2026-03-17T13:41:52+00:00"
},
- {
- "name": "laravelcollective/html",
- "version": "v6.4.1",
- "source": {
- "type": "git",
- "url": "https://github.com/LaravelCollective/html.git",
- "reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/LaravelCollective/html/zipball/64ddfdcaeeb8d332bd98bef442bef81e39c3910b",
- "reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b",
- "shasum": ""
- },
- "require": {
- "illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "illuminate/session": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "illuminate/view": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "php": ">=7.2.5"
- },
- "require-dev": {
- "illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0",
- "mockery/mockery": "~1.0",
- "phpunit/phpunit": "~8.5|^9.5.10"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "6.x-dev"
- },
- "laravel": {
- "providers": [
- "Collective\\Html\\HtmlServiceProvider"
- ],
- "aliases": {
- "Form": "Collective\\Html\\FormFacade",
- "Html": "Collective\\Html\\HtmlFacade"
- }
- }
- },
- "autoload": {
- "files": [
- "src/helpers.php"
- ],
- "psr-4": {
- "Collective\\Html\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Adam Engebretson",
- "email": "adam@laravelcollective.com"
- },
- {
- "name": "Taylor Otwell",
- "email": "taylorotwell@gmail.com"
- }
- ],
- "description": "HTML and Form Builders for the Laravel Framework",
- "homepage": "https://laravelcollective.com",
- "support": {
- "issues": "https://github.com/LaravelCollective/html/issues",
- "source": "https://github.com/LaravelCollective/html"
- },
- "abandoned": "spatie/laravel-html",
- "time": "2023-04-25T02:46:11+00:00"
- },
{
"name": "league/commonmark",
"version": "2.8.2",
@@ -3058,6 +3109,188 @@
],
"time": "2024-09-21T08:32:55+00:00"
},
+ {
+ "name": "league/uri",
+ "version": "7.8.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/uri.git",
+ "reference": "08cf38e3924d4f56238125547b5720496fac8fd4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4",
+ "reference": "08cf38e3924d4f56238125547b5720496fac8fd4",
+ "shasum": ""
+ },
+ "require": {
+ "league/uri-interfaces": "^7.8.1",
+ "php": "^8.1",
+ "psr/http-factory": "^1"
+ },
+ "conflict": {
+ "league/uri-schemes": "^1.0"
+ },
+ "suggest": {
+ "ext-bcmath": "to improve IPV4 host parsing",
+ "ext-dom": "to convert the URI into an HTML anchor tag",
+ "ext-fileinfo": "to create Data URI from file contennts",
+ "ext-gmp": "to improve IPV4 host parsing",
+ "ext-intl": "to handle IDN host with the best performance",
+ "ext-uri": "to use the PHP native URI class",
+ "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain",
+ "league/uri-components": "to provide additional tools to manipulate URI objects components",
+ "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP",
+ "php-64bit": "to improve IPV4 host parsing",
+ "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification",
+ "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "7.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Uri\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ignace Nyamagana Butera",
+ "email": "nyamsprod@gmail.com",
+ "homepage": "https://nyamsprod.com"
+ }
+ ],
+ "description": "URI manipulation library",
+ "homepage": "https://uri.thephpleague.com",
+ "keywords": [
+ "URN",
+ "data-uri",
+ "file-uri",
+ "ftp",
+ "hostname",
+ "http",
+ "https",
+ "middleware",
+ "parse_str",
+ "parse_url",
+ "psr-7",
+ "query-string",
+ "querystring",
+ "rfc2141",
+ "rfc3986",
+ "rfc3987",
+ "rfc6570",
+ "rfc8141",
+ "uri",
+ "uri-template",
+ "url",
+ "ws"
+ ],
+ "support": {
+ "docs": "https://uri.thephpleague.com",
+ "forum": "https://thephpleague.slack.com",
+ "issues": "https://github.com/thephpleague/uri-src/issues",
+ "source": "https://github.com/thephpleague/uri/tree/7.8.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/nyamsprod",
+ "type": "github"
+ }
+ ],
+ "time": "2026-03-15T20:22:25+00:00"
+ },
+ {
+ "name": "league/uri-interfaces",
+ "version": "7.8.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/thephpleague/uri-interfaces.git",
+ "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928",
+ "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928",
+ "shasum": ""
+ },
+ "require": {
+ "ext-filter": "*",
+ "php": "^8.1",
+ "psr/http-message": "^1.1 || ^2.0"
+ },
+ "suggest": {
+ "ext-bcmath": "to improve IPV4 host parsing",
+ "ext-gmp": "to improve IPV4 host parsing",
+ "ext-intl": "to handle IDN host with the best performance",
+ "php-64bit": "to improve IPV4 host parsing",
+ "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification",
+ "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "7.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "League\\Uri\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ignace Nyamagana Butera",
+ "email": "nyamsprod@gmail.com",
+ "homepage": "https://nyamsprod.com"
+ }
+ ],
+ "description": "Common tools for parsing and resolving RFC3987/RFC3986 URI",
+ "homepage": "https://uri.thephpleague.com",
+ "keywords": [
+ "data-uri",
+ "file-uri",
+ "ftp",
+ "hostname",
+ "http",
+ "https",
+ "parse_str",
+ "parse_url",
+ "psr-7",
+ "query-string",
+ "querystring",
+ "rfc3986",
+ "rfc3987",
+ "rfc6570",
+ "uri",
+ "url",
+ "ws"
+ ],
+ "support": {
+ "docs": "https://uri.thephpleague.com",
+ "forum": "https://thephpleague.slack.com",
+ "issues": "https://github.com/thephpleague/uri-src/issues",
+ "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/nyamsprod",
+ "type": "github"
+ }
+ ],
+ "time": "2026-03-08T20:05:35+00:00"
+ },
{
"name": "maennchen/zipstream-php",
"version": "3.1.2",
@@ -3490,42 +3723,40 @@
},
{
"name": "nesbot/carbon",
- "version": "2.73.0",
+ "version": "3.11.4",
"source": {
"type": "git",
"url": "https://github.com/CarbonPHP/carbon.git",
- "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075"
+ "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/9228ce90e1035ff2f0db84b40ec2e023ed802075",
- "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075",
+ "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/e890471a3494740f7d9326d72ce6a8c559ffee60",
+ "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60",
"shasum": ""
},
"require": {
- "carbonphp/carbon-doctrine-types": "*",
+ "carbonphp/carbon-doctrine-types": "<100.0",
"ext-json": "*",
- "php": "^7.1.8 || ^8.0",
+ "php": "^8.1",
"psr/clock": "^1.0",
+ "symfony/clock": "^6.3.12 || ^7.0 || ^8.0",
"symfony/polyfill-mbstring": "^1.0",
- "symfony/polyfill-php80": "^1.16",
- "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0"
+ "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0"
},
"provide": {
"psr/clock-implementation": "1.0"
},
"require-dev": {
- "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0",
- "doctrine/orm": "^2.7 || ^3.0",
- "friendsofphp/php-cs-fixer": "^3.0",
- "kylekatarnls/multi-tester": "^2.0",
- "ondrejmirtes/better-reflection": "<6",
- "phpmd/phpmd": "^2.9",
- "phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12.99 || ^1.7.14",
- "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6",
- "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
- "squizlabs/php_codesniffer": "^3.4"
+ "doctrine/dbal": "^3.6.3 || ^4.0",
+ "doctrine/orm": "^2.15.2 || ^3.0",
+ "friendsofphp/php-cs-fixer": "^v3.87.1",
+ "kylekatarnls/multi-tester": "^2.5.3",
+ "phpmd/phpmd": "^2.15.0",
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^2.1.22",
+ "phpunit/phpunit": "^10.5.53",
+ "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0"
},
"bin": [
"bin/carbon"
@@ -3568,16 +3799,16 @@
}
],
"description": "An API extension for DateTime that supports 281 different languages.",
- "homepage": "https://carbon.nesbot.com",
+ "homepage": "https://carbonphp.github.io/carbon/",
"keywords": [
"date",
"datetime",
"time"
],
"support": {
- "docs": "https://carbon.nesbot.com/docs",
- "issues": "https://github.com/briannesbitt/Carbon/issues",
- "source": "https://github.com/briannesbitt/Carbon"
+ "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html",
+ "issues": "https://github.com/CarbonPHP/carbon/issues",
+ "source": "https://github.com/CarbonPHP/carbon"
},
"funding": [
{
@@ -3593,7 +3824,7 @@
"type": "tidelift"
}
],
- "time": "2025-01-08T20:10:23+00:00"
+ "time": "2026-04-07T09:57:54+00:00"
},
{
"name": "nette/schema",
@@ -3813,32 +4044,31 @@
},
{
"name": "nunomaduro/termwind",
- "version": "v1.17.0",
+ "version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/termwind.git",
- "reference": "5369ef84d8142c1d87e4ec278711d4ece3cbf301"
+ "reference": "712a31b768f5daea284c2169a7d227031001b9a8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/5369ef84d8142c1d87e4ec278711d4ece3cbf301",
- "reference": "5369ef84d8142c1d87e4ec278711d4ece3cbf301",
+ "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8",
+ "reference": "712a31b768f5daea284c2169a7d227031001b9a8",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
- "php": "^8.1",
- "symfony/console": "^6.4.15"
+ "php": "^8.2",
+ "symfony/console": "^7.4.4 || ^8.0.4"
},
"require-dev": {
- "illuminate/console": "^10.48.24",
- "illuminate/support": "^10.48.24",
- "laravel/pint": "^1.18.2",
- "pestphp/pest": "^2.36.0",
- "pestphp/pest-plugin-mock": "2.0.0",
- "phpstan/phpstan": "^1.12.11",
- "phpstan/phpstan-strict-rules": "^1.6.1",
- "symfony/var-dumper": "^6.4.15",
+ "illuminate/console": "^11.47.0",
+ "laravel/pint": "^1.27.1",
+ "mockery/mockery": "^1.6.12",
+ "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2",
+ "phpstan/phpstan": "^1.12.32",
+ "phpstan/phpstan-strict-rules": "^1.6.2",
+ "symfony/var-dumper": "^7.3.5 || ^8.0.4",
"thecodingmachine/phpstan-strict-rules": "^1.0.0"
},
"type": "library",
@@ -3847,6 +4077,9 @@
"providers": [
"Termwind\\Laravel\\TermwindServiceProvider"
]
+ },
+ "branch-alias": {
+ "dev-2.x": "2.x-dev"
}
},
"autoload": {
@@ -3867,7 +4100,7 @@
"email": "enunomaduro@gmail.com"
}
],
- "description": "Its like Tailwind CSS, but for the console.",
+ "description": "It's like Tailwind CSS, but for the console.",
"keywords": [
"cli",
"console",
@@ -3878,7 +4111,7 @@
],
"support": {
"issues": "https://github.com/nunomaduro/termwind/issues",
- "source": "https://github.com/nunomaduro/termwind/tree/v1.17.0"
+ "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0"
},
"funding": [
{
@@ -3894,46 +4127,370 @@
"type": "github"
}
],
- "time": "2024-11-21T10:36:35+00:00"
+ "time": "2026-02-16T23:10:27+00:00"
},
{
- "name": "phpoffice/phpspreadsheet",
- "version": "1.30.5",
+ "name": "php-http/client-common",
+ "version": "2.7.3",
"source": {
"type": "git",
- "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
- "reference": "97bcabd32a64924688487dcd64aceaf158affb5c"
+ "url": "https://github.com/php-http/client-common.git",
+ "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/97bcabd32a64924688487dcd64aceaf158affb5c",
- "reference": "97bcabd32a64924688487dcd64aceaf158affb5c",
+ "url": "https://api.github.com/repos/php-http/client-common/zipball/dcc6de29c90dd74faab55f71b79d89409c4bf0c1",
+ "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1",
"shasum": ""
},
"require": {
- "composer/pcre": "^1||^2||^3",
- "ext-ctype": "*",
- "ext-dom": "*",
- "ext-fileinfo": "*",
- "ext-gd": "*",
- "ext-iconv": "*",
- "ext-libxml": "*",
- "ext-mbstring": "*",
- "ext-simplexml": "*",
- "ext-xml": "*",
- "ext-xmlreader": "*",
- "ext-xmlwriter": "*",
- "ext-zip": "*",
- "ext-zlib": "*",
- "ezyang/htmlpurifier": "^4.15",
- "maennchen/zipstream-php": "^2.1 || ^3.0",
- "markbaker/complex": "^3.0",
- "markbaker/matrix": "^3.0",
- "php": ">=7.4.0 <8.5.0",
- "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
- },
- "require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+ "php": "^7.1 || ^8.0",
+ "php-http/httplug": "^2.0",
+ "php-http/message": "^1.6",
+ "psr/http-client": "^1.0",
+ "psr/http-factory": "^1.0",
+ "psr/http-message": "^1.0 || ^2.0",
+ "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
+ "symfony/polyfill-php80": "^1.17"
+ },
+ "require-dev": {
+ "doctrine/instantiator": "^1.1",
+ "guzzlehttp/psr7": "^1.4",
+ "nyholm/psr7": "^1.2",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7"
+ },
+ "suggest": {
+ "ext-json": "To detect JSON responses with the ContentTypePlugin",
+ "ext-libxml": "To detect XML responses with the ContentTypePlugin",
+ "php-http/cache-plugin": "PSR-6 Cache plugin",
+ "php-http/logger-plugin": "PSR-3 Logger plugin",
+ "php-http/stopwatch-plugin": "Symfony Stopwatch plugin"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Http\\Client\\Common\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "Common HTTP Client implementations and tools for HTTPlug",
+ "homepage": "http://httplug.io",
+ "keywords": [
+ "client",
+ "common",
+ "http",
+ "httplug"
+ ],
+ "support": {
+ "issues": "https://github.com/php-http/client-common/issues",
+ "source": "https://github.com/php-http/client-common/tree/2.7.3"
+ },
+ "time": "2025-11-29T19:12:34+00:00"
+ },
+ {
+ "name": "php-http/discovery",
+ "version": "1.20.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/discovery.git",
+ "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d",
+ "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0|^2.0",
+ "php": "^7.1 || ^8.0"
+ },
+ "conflict": {
+ "nyholm/psr7": "<1.0",
+ "zendframework/zend-diactoros": "*"
+ },
+ "provide": {
+ "php-http/async-client-implementation": "*",
+ "php-http/client-implementation": "*",
+ "psr/http-client-implementation": "*",
+ "psr/http-factory-implementation": "*",
+ "psr/http-message-implementation": "*"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0.2|^2.0",
+ "graham-campbell/phpspec-skip-example-extension": "^5.0",
+ "php-http/httplug": "^1.0 || ^2.0",
+ "php-http/message-factory": "^1.0",
+ "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3",
+ "sebastian/comparator": "^3.0.5 || ^4.0.8",
+ "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "Http\\Discovery\\Composer\\Plugin",
+ "plugin-optional": true
+ },
+ "autoload": {
+ "psr-4": {
+ "Http\\Discovery\\": "src/"
+ },
+ "exclude-from-classmap": [
+ "src/Composer/Plugin.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "adapter",
+ "client",
+ "discovery",
+ "factory",
+ "http",
+ "message",
+ "psr17",
+ "psr7"
+ ],
+ "support": {
+ "issues": "https://github.com/php-http/discovery/issues",
+ "source": "https://github.com/php-http/discovery/tree/1.20.0"
+ },
+ "time": "2024-10-02T11:20:13+00:00"
+ },
+ {
+ "name": "php-http/httplug",
+ "version": "2.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/httplug.git",
+ "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4",
+ "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0",
+ "php-http/promise": "^1.1",
+ "psr/http-client": "^1.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "require-dev": {
+ "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
+ "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Http\\Client\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Eric GELOEN",
+ "email": "geloen.eric@gmail.com"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com",
+ "homepage": "https://sagikazarmark.hu"
+ }
+ ],
+ "description": "HTTPlug, the HTTP client abstraction for PHP",
+ "homepage": "http://httplug.io",
+ "keywords": [
+ "client",
+ "http"
+ ],
+ "support": {
+ "issues": "https://github.com/php-http/httplug/issues",
+ "source": "https://github.com/php-http/httplug/tree/2.4.1"
+ },
+ "time": "2024-09-23T11:39:58+00:00"
+ },
+ {
+ "name": "php-http/message",
+ "version": "1.16.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/message.git",
+ "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a",
+ "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a",
+ "shasum": ""
+ },
+ "require": {
+ "clue/stream-filter": "^1.5",
+ "php": "^7.2 || ^8.0",
+ "psr/http-message": "^1.1 || ^2.0"
+ },
+ "provide": {
+ "php-http/message-factory-implementation": "1.0"
+ },
+ "require-dev": {
+ "ergebnis/composer-normalize": "^2.6",
+ "ext-zlib": "*",
+ "guzzlehttp/psr7": "^1.0 || ^2.0",
+ "laminas/laminas-diactoros": "^2.0 || ^3.0",
+ "php-http/message-factory": "^1.0.2",
+ "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
+ "slim/slim": "^3.0"
+ },
+ "suggest": {
+ "ext-zlib": "Used with compressor/decompressor streams",
+ "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories",
+ "laminas/laminas-diactoros": "Used with Diactoros Factories",
+ "slim/slim": "Used with Slim Framework PSR-7 implementation"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/filters.php"
+ ],
+ "psr-4": {
+ "Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "HTTP Message related tools",
+ "homepage": "http://php-http.org",
+ "keywords": [
+ "http",
+ "message",
+ "psr-7"
+ ],
+ "support": {
+ "issues": "https://github.com/php-http/message/issues",
+ "source": "https://github.com/php-http/message/tree/1.16.2"
+ },
+ "time": "2024-10-02T11:34:13+00:00"
+ },
+ {
+ "name": "php-http/promise",
+ "version": "1.3.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-http/promise.git",
+ "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
+ "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3",
+ "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Http\\Promise\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Joel Wurtz",
+ "email": "joel.wurtz@gmail.com"
+ },
+ {
+ "name": "Márk Sági-Kazár",
+ "email": "mark.sagikazar@gmail.com"
+ }
+ ],
+ "description": "Promise used for asynchronous HTTP requests",
+ "homepage": "http://httplug.io",
+ "keywords": [
+ "promise"
+ ],
+ "support": {
+ "issues": "https://github.com/php-http/promise/issues",
+ "source": "https://github.com/php-http/promise/tree/1.3.1"
+ },
+ "time": "2024-03-15T13:55:21+00:00"
+ },
+ {
+ "name": "phpoffice/phpspreadsheet",
+ "version": "1.30.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+ "reference": "97bcabd32a64924688487dcd64aceaf158affb5c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/97bcabd32a64924688487dcd64aceaf158affb5c",
+ "reference": "97bcabd32a64924688487dcd64aceaf158affb5c",
+ "shasum": ""
+ },
+ "require": {
+ "composer/pcre": "^1||^2||^3",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-fileinfo": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "ezyang/htmlpurifier": "^4.15",
+ "maennchen/zipstream-php": "^2.1 || ^3.0",
+ "markbaker/complex": "^3.0",
+ "markbaker/matrix": "^3.0",
+ "php": ">=7.4.0 <8.5.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"doctrine/instantiator": "^1.5",
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
@@ -4881,27 +5438,27 @@
},
{
"name": "santigarcor/laratrust",
- "version": "7.2.1",
+ "version": "8.5.5",
"source": {
"type": "git",
"url": "https://github.com/santigarcor/laratrust.git",
- "reference": "26e254161d2249163dede61fce89a02f952d8907"
+ "reference": "d38d1e00e388e559252136277e264b9cecfa6586"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/26e254161d2249163dede61fce89a02f952d8907",
- "reference": "26e254161d2249163dede61fce89a02f952d8907",
+ "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/d38d1e00e388e559252136277e264b9cecfa6586",
+ "reference": "d38d1e00e388e559252136277e264b9cecfa6586",
"shasum": ""
},
"require": {
"kkszymanowski/traitor": "^1.0",
- "laravel/framework": "~6.0|~7.0|~8.0|^9.0|^10.0",
- "php": ">=7.2"
+ "laravel/framework": "^10.0|^11.0|^12.0|^13.0",
+ "php": ">=8.1"
},
"require-dev": {
"mockery/mockery": "^1.3.2",
- "orchestra/testbench": "4.*|5.*|6.*|7.*|^8.0",
- "phpunit/phpunit": "^7.5.15|^8.4|^9.0"
+ "orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
+ "phpunit/phpunit": "^8.4|^9.0|^10.5|^11.5.3|^12.5.12"
},
"type": "library",
"extra": {
@@ -4944,7 +5501,7 @@
],
"support": {
"issues": "https://github.com/santigarcor/laratrust/issues",
- "source": "https://github.com/santigarcor/laratrust/tree/7.2.1"
+ "source": "https://github.com/santigarcor/laratrust/tree/8.5.5"
},
"funding": [
{
@@ -4952,58 +5509,214 @@
"type": "github"
}
],
- "time": "2023-02-20T23:23:08+00:00"
+ "time": "2026-03-06T14:10:22+00:00"
},
{
- "name": "symfony/console",
- "version": "v6.4.41",
+ "name": "spatie/laravel-html",
+ "version": "3.13.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "d21b17ed158e79180fac3895ff751707970eeb57"
+ "url": "https://github.com/spatie/laravel-html.git",
+ "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/d21b17ed158e79180fac3895ff751707970eeb57",
- "reference": "d21b17ed158e79180fac3895ff751707970eeb57",
+ "url": "https://api.github.com/repos/spatie/laravel-html/zipball/0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
+ "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
"shasum": ""
},
"require": {
- "php": ">=8.1",
- "symfony/deprecation-contracts": "^2.5|^3",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/service-contracts": "^2.5|^3",
- "symfony/string": "^5.4|^6.0|^7.0"
- },
- "conflict": {
- "symfony/dependency-injection": "<5.4",
- "symfony/dotenv": "<5.4",
- "symfony/event-dispatcher": "<5.4",
- "symfony/lock": "<5.4",
- "symfony/process": "<5.4"
- },
- "provide": {
- "psr/log-implementation": "1.0|2.0|3.0"
+ "illuminate/http": "^10.0|^11.0|^12.0|^13.0",
+ "illuminate/support": "^10.0|^11.0|^12.0|^13.0",
+ "php": "^8.2"
},
"require-dev": {
- "psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
- "symfony/http-foundation": "^6.4|^7.0",
- "symfony/http-kernel": "^6.4|^7.0",
- "symfony/lock": "^5.4|^6.0|^7.0",
- "symfony/messenger": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.0|^7.0",
- "symfony/stopwatch": "^5.4|^6.0|^7.0",
- "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ "mockery/mockery": "^1.3",
+ "orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
+ "pestphp/pest": "^2.34|^3.7|^4.0"
},
"type": "library",
+ "extra": {
+ "laravel": {
+ "aliases": {
+ "Html": "Spatie\\Html\\Facades\\Html"
+ },
+ "providers": [
+ "Spatie\\Html\\HtmlServiceProvider"
+ ]
+ }
+ },
"autoload": {
+ "files": [
+ "src/helpers.php"
+ ],
"psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
+ "Spatie\\Html\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian De Deyne",
+ "email": "sebastian@spatie.be",
+ "homepage": "https://spatie.be",
+ "role": "Developer"
+ },
+ {
+ "name": "Freek Van der Herten",
+ "email": "freek@spatie.be",
+ "homepage": "https://spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "A fluent html builder",
+ "homepage": "https://github.com/spatie/laravel-html",
+ "keywords": [
+ "html",
+ "spatie"
+ ],
+ "support": {
+ "source": "https://github.com/spatie/laravel-html/tree/3.13.0"
+ },
+ "funding": [
+ {
+ "url": "https://spatie.be/open-source/support-us",
+ "type": "custom"
+ }
+ ],
+ "time": "2026-02-22T09:05:56+00:00"
+ },
+ {
+ "name": "symfony/clock",
+ "version": "v7.4.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/clock.git",
+ "reference": "674fa3b98e21531dd040e613479f5f6fa8f32111"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/clock/zipball/674fa3b98e21531dd040e613479f5f6fa8f32111",
+ "reference": "674fa3b98e21531dd040e613479f5f6fa8f32111",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "psr/clock": "^1.0",
+ "symfony/polyfill-php83": "^1.28"
+ },
+ "provide": {
+ "psr/clock-implementation": "1.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "Resources/now.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\Clock\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Decouples applications from the system clock",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "clock",
+ "psr20",
+ "time"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/clock/tree/v7.4.8"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-03-24T13:12:05+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v7.4.13",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/85095d2573eaefaf35e40b9513a9bf09f72cd217",
+ "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/string": "^7.2|^8.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<6.4",
+ "symfony/dotenv": "<6.4",
+ "symfony/event-dispatcher": "<6.4",
+ "symfony/lock": "<6.4",
+ "symfony/process": "<6.4"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0|3.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/event-dispatcher": "^6.4|^7.0|^8.0",
+ "symfony/http-foundation": "^6.4|^7.0|^8.0",
+ "symfony/http-kernel": "^6.4|^7.0|^8.0",
+ "symfony/lock": "^6.4|^7.0|^8.0",
+ "symfony/messenger": "^6.4|^7.0|^8.0",
+ "symfony/process": "^6.4|^7.0|^8.0",
+ "symfony/stopwatch": "^6.4|^7.0|^8.0",
+ "symfony/var-dumper": "^6.4|^7.0|^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
"/Tests/"
]
},
@@ -5030,7 +5743,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v6.4.41"
+ "source": "https://github.com/symfony/console/tree/v7.4.13"
},
"funding": [
{
@@ -5050,7 +5763,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-24T08:48:41+00:00"
+ "time": "2026-05-24T08:56:14+00:00"
},
{
"name": "symfony/css-selector",
@@ -5194,31 +5907,34 @@
},
{
"name": "symfony/error-handler",
- "version": "v6.4.36",
+ "version": "v7.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
- "reference": "2ea68f0e1835ad6a126f93bbc14cd236c10ab361"
+ "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/error-handler/zipball/2ea68f0e1835ad6a126f93bbc14cd236c10ab361",
- "reference": "2ea68f0e1835ad6a126f93bbc14cd236c10ab361",
+ "url": "https://api.github.com/repos/symfony/error-handler/zipball/8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa",
+ "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"psr/log": "^1|^2|^3",
- "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ "symfony/polyfill-php85": "^1.32",
+ "symfony/var-dumper": "^6.4|^7.0|^8.0"
},
"conflict": {
"symfony/deprecation-contracts": "<2.5",
"symfony/http-kernel": "<6.4"
},
"require-dev": {
+ "symfony/console": "^6.4|^7.0|^8.0",
"symfony/deprecation-contracts": "^2.5|^3",
- "symfony/http-kernel": "^6.4|^7.0",
- "symfony/serializer": "^5.4|^6.0|^7.0"
+ "symfony/http-kernel": "^6.4|^7.0|^8.0",
+ "symfony/serializer": "^6.4|^7.0|^8.0",
+ "symfony/webpack-encore-bundle": "^1.0|^2.0"
},
"bin": [
"Resources/bin/patch-type-declarations"
@@ -5249,7 +5965,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/error-handler/tree/v6.4.36"
+ "source": "https://github.com/symfony/error-handler/tree/v7.4.8"
},
"funding": [
{
@@ -5269,7 +5985,7 @@
"type": "tidelift"
}
],
- "time": "2026-03-10T15:56:14+00:00"
+ "time": "2026-03-24T13:12:05+00:00"
},
{
"name": "symfony/event-dispatcher",
@@ -5508,23 +6224,23 @@
},
{
"name": "symfony/finder",
- "version": "v6.4.34",
+ "version": "v7.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "9590e86be1d1c57bfbb16d0dd040345378c20896"
+ "reference": "e0be088d22278583a82da281886e8c3592fbf149"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/9590e86be1d1c57bfbb16d0dd040345378c20896",
- "reference": "9590e86be1d1c57bfbb16d0dd040345378c20896",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/e0be088d22278583a82da281886e8c3592fbf149",
+ "reference": "e0be088d22278583a82da281886e8c3592fbf149",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "symfony/filesystem": "^6.0|^7.0"
+ "symfony/filesystem": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -5552,7 +6268,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/finder/tree/v6.4.34"
+ "source": "https://github.com/symfony/finder/tree/v7.4.8"
},
"funding": [
{
@@ -5572,40 +6288,41 @@
"type": "tidelift"
}
],
- "time": "2026-01-28T15:16:37+00:00"
+ "time": "2026-03-24T13:12:05+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v6.4.41",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "48d76c29a67a301e0f7779a512bf76417395ffef"
+ "reference": "bc354f47c62301e990b7874fa662326368508e2c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/48d76c29a67a301e0f7779a512bf76417395ffef",
- "reference": "48d76c29a67a301e0f7779a512bf76417395ffef",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/bc354f47c62301e990b7874fa662326368508e2c",
+ "reference": "bc354f47c62301e990b7874fa662326368508e2c",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
- "symfony/polyfill-mbstring": "~1.1",
- "symfony/polyfill-php83": "^1.27"
+ "symfony/polyfill-mbstring": "^1.1"
},
"conflict": {
+ "doctrine/dbal": "<3.6",
"symfony/cache": "<6.4.12|>=7.0,<7.1.5"
},
"require-dev": {
- "doctrine/dbal": "^2.13.1|^3|^4",
+ "doctrine/dbal": "^3.6|^4",
"predis/predis": "^1.1|^2.0",
- "symfony/cache": "^6.4.12|^7.1.5",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/expression-language": "^5.4|^6.0|^7.0",
- "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4|^7.0",
- "symfony/mime": "^5.4|^6.0|^7.0",
- "symfony/rate-limiter": "^5.4|^6.0|^7.0"
+ "symfony/cache": "^6.4.12|^7.1.5|^8.0",
+ "symfony/clock": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/expression-language": "^6.4|^7.0|^8.0",
+ "symfony/http-kernel": "^6.4|^7.0|^8.0",
+ "symfony/mime": "^6.4|^7.0|^8.0",
+ "symfony/rate-limiter": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -5633,7 +6350,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-foundation/tree/v6.4.41"
+ "source": "https://github.com/symfony/http-foundation/tree/v7.4.13"
},
"funding": [
{
@@ -5653,77 +6370,78 @@
"type": "tidelift"
}
],
- "time": "2026-05-24T10:54:17+00:00"
+ "time": "2026-05-24T11:20:33+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v6.4.41",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "155f6c1fa29720e8c947591da3be4014951fba6f"
+ "reference": "9df847980c436451f4f51d1284491bb4356dd989"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/155f6c1fa29720e8c947591da3be4014951fba6f",
- "reference": "155f6c1fa29720e8c947591da3be4014951fba6f",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9df847980c436451f4f51d1284491bb4356dd989",
+ "reference": "9df847980c436451f4f51d1284491bb4356dd989",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"psr/log": "^1|^2|^3",
"symfony/deprecation-contracts": "^2.5|^3",
- "symfony/error-handler": "^6.4|^7.0",
- "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
- "symfony/http-foundation": "^6.4|^7.0",
+ "symfony/error-handler": "^6.4|^7.0|^8.0",
+ "symfony/event-dispatcher": "^7.3|^8.0",
+ "symfony/http-foundation": "^7.4|^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
- "symfony/browser-kit": "<5.4",
- "symfony/cache": "<5.4",
- "symfony/config": "<6.1",
- "symfony/console": "<5.4",
+ "symfony/browser-kit": "<6.4",
+ "symfony/cache": "<6.4",
+ "symfony/config": "<6.4",
+ "symfony/console": "<6.4",
"symfony/dependency-injection": "<6.4",
- "symfony/doctrine-bridge": "<5.4",
- "symfony/form": "<5.4",
- "symfony/http-client": "<5.4",
+ "symfony/doctrine-bridge": "<6.4",
+ "symfony/flex": "<2.10",
+ "symfony/form": "<6.4",
+ "symfony/http-client": "<6.4",
"symfony/http-client-contracts": "<2.5",
- "symfony/mailer": "<5.4",
- "symfony/messenger": "<5.4",
- "symfony/translation": "<5.4",
+ "symfony/mailer": "<6.4",
+ "symfony/messenger": "<6.4",
+ "symfony/translation": "<6.4",
"symfony/translation-contracts": "<2.5",
- "symfony/twig-bridge": "<5.4",
+ "symfony/twig-bridge": "<6.4",
"symfony/validator": "<6.4",
- "symfony/var-dumper": "<6.3",
- "twig/twig": "<2.13"
+ "symfony/var-dumper": "<6.4",
+ "twig/twig": "<3.12"
},
"provide": {
"psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
"psr/cache": "^1.0|^2.0|^3.0",
- "symfony/browser-kit": "^5.4|^6.0|^7.0",
- "symfony/clock": "^6.2|^7.0",
- "symfony/config": "^6.1|^7.0",
- "symfony/console": "^5.4|^6.0|^7.0",
- "symfony/css-selector": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^6.4.1|^7.0.1",
- "symfony/dom-crawler": "^5.4|^6.0|^7.0",
- "symfony/expression-language": "^5.4|^6.0|^7.0",
- "symfony/finder": "^5.4|^6.0|^7.0",
+ "symfony/browser-kit": "^6.4|^7.0|^8.0",
+ "symfony/clock": "^6.4|^7.0|^8.0",
+ "symfony/config": "^6.4|^7.0|^8.0",
+ "symfony/console": "^6.4|^7.0|^8.0",
+ "symfony/css-selector": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4.1|^7.0.1|^8.0",
+ "symfony/dom-crawler": "^6.4|^7.0|^8.0",
+ "symfony/expression-language": "^6.4|^7.0|^8.0",
+ "symfony/finder": "^6.4|^7.0|^8.0",
"symfony/http-client-contracts": "^2.5|^3",
- "symfony/process": "^5.4|^6.0|^7.0",
- "symfony/property-access": "^5.4.5|^6.0.5|^7.0",
- "symfony/routing": "^5.4|^6.0|^7.0",
- "symfony/serializer": "^6.4.4|^7.0.4",
- "symfony/stopwatch": "^5.4|^6.0|^7.0",
- "symfony/translation": "^5.4|^6.0|^7.0",
+ "symfony/process": "^6.4|^7.0|^8.0",
+ "symfony/property-access": "^7.1|^8.0",
+ "symfony/routing": "^6.4|^7.0|^8.0",
+ "symfony/serializer": "^7.1|^8.0",
+ "symfony/stopwatch": "^6.4|^7.0|^8.0",
+ "symfony/translation": "^6.4|^7.0|^8.0",
"symfony/translation-contracts": "^2.5|^3",
- "symfony/uid": "^5.4|^6.0|^7.0",
- "symfony/validator": "^6.4|^7.0",
- "symfony/var-dumper": "^5.4|^6.4|^7.0",
- "symfony/var-exporter": "^6.2|^7.0",
- "twig/twig": "^2.13|^3.0.4"
+ "symfony/uid": "^6.4|^7.0|^8.0",
+ "symfony/validator": "^6.4|^7.0|^8.0",
+ "symfony/var-dumper": "^6.4|^7.0|^8.0",
+ "symfony/var-exporter": "^6.4|^7.0|^8.0",
+ "twig/twig": "^3.12"
},
"type": "library",
"autoload": {
@@ -5751,7 +6469,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v6.4.41"
+ "source": "https://github.com/symfony/http-kernel/tree/v7.4.13"
},
"funding": [
{
@@ -5771,43 +6489,43 @@
"type": "tidelift"
}
],
- "time": "2026-05-27T08:22:22+00:00"
+ "time": "2026-05-27T08:31:43+00:00"
},
{
"name": "symfony/mailer",
- "version": "v6.4.40",
+ "version": "v7.4.12",
"source": {
"type": "git",
"url": "https://github.com/symfony/mailer.git",
- "reference": "94fd44f3052e02340b0dd4447a7d7a5856e32da2"
+ "reference": "5cefb712a25f320579615ba9e1942abaeade7dff"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mailer/zipball/94fd44f3052e02340b0dd4447a7d7a5856e32da2",
- "reference": "94fd44f3052e02340b0dd4447a7d7a5856e32da2",
+ "url": "https://api.github.com/repos/symfony/mailer/zipball/5cefb712a25f320579615ba9e1942abaeade7dff",
+ "reference": "5cefb712a25f320579615ba9e1942abaeade7dff",
"shasum": ""
},
"require": {
"egulias/email-validator": "^2.1.10|^3|^4",
- "php": ">=8.1",
+ "php": ">=8.2",
"psr/event-dispatcher": "^1",
"psr/log": "^1|^2|^3",
- "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
- "symfony/mime": "^6.2|^7.0",
+ "symfony/event-dispatcher": "^6.4|^7.0|^8.0",
+ "symfony/mime": "^7.2|^8.0",
"symfony/service-contracts": "^2.5|^3"
},
"conflict": {
"symfony/http-client-contracts": "<2.5",
- "symfony/http-kernel": "<5.4",
- "symfony/messenger": "<6.2",
- "symfony/mime": "<6.2",
- "symfony/twig-bridge": "<6.2.1"
+ "symfony/http-kernel": "<6.4",
+ "symfony/messenger": "<6.4",
+ "symfony/mime": "<6.4",
+ "symfony/twig-bridge": "<6.4"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0|^7.0",
- "symfony/http-client": "^5.4|^6.0|^7.0",
- "symfony/messenger": "^6.2|^7.0",
- "symfony/twig-bridge": "^6.2|^7.0"
+ "symfony/console": "^6.4|^7.0|^8.0",
+ "symfony/http-client": "^6.4|^7.0|^8.0",
+ "symfony/messenger": "^6.4|^7.0|^8.0",
+ "symfony/twig-bridge": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -5835,7 +6553,7 @@
"description": "Helps sending emails",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/mailer/tree/v6.4.40"
+ "source": "https://github.com/symfony/mailer/tree/v7.4.12"
},
"funding": [
{
@@ -5855,44 +6573,44 @@
"type": "tidelift"
}
],
- "time": "2026-05-19T20:33:22+00:00"
+ "time": "2026-05-20T07:20:23+00:00"
},
{
"name": "symfony/mime",
- "version": "v6.4.41",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
- "reference": "5575d37f8841e4e31d5df79ab3db078ae557ff8e"
+ "reference": "a845722765c4f6b2ce88beaf4f4479975b186770"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/5575d37f8841e4e31d5df79ab3db078ae557ff8e",
- "reference": "5575d37f8841e4e31d5df79ab3db078ae557ff8e",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/a845722765c4f6b2ce88beaf4f4479975b186770",
+ "reference": "a845722765c4f6b2ce88beaf4f4479975b186770",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-intl-idn": "^1.10",
"symfony/polyfill-mbstring": "^1.0"
},
"conflict": {
"egulias/email-validator": "~3.0.0",
- "phpdocumentor/reflection-docblock": "<3.2.2",
- "phpdocumentor/type-resolver": "<1.4.0",
- "symfony/mailer": "<5.4",
+ "phpdocumentor/reflection-docblock": "<5.2|>=7",
+ "phpdocumentor/type-resolver": "<1.5.1",
+ "symfony/mailer": "<6.4",
"symfony/serializer": "<6.4.3|>7.0,<7.0.3"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3.1|^4",
"league/html-to-markdown": "^5.0",
- "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.4|^7.0",
- "symfony/property-access": "^5.4|^6.0|^7.0",
- "symfony/property-info": "^5.4|^6.0|^7.0",
- "symfony/serializer": "^6.4.3|^7.0.3"
+ "phpdocumentor/reflection-docblock": "^5.2|^6.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/process": "^6.4|^7.0|^8.0",
+ "symfony/property-access": "^6.4|^7.0|^8.0",
+ "symfony/property-info": "^6.4|^7.0|^8.0",
+ "symfony/serializer": "^6.4.3|^7.0.3|^8.0"
},
"type": "library",
"autoload": {
@@ -5924,7 +6642,78 @@
"mime-type"
],
"support": {
- "source": "https://github.com/symfony/mime/tree/v6.4.41"
+ "source": "https://github.com/symfony/mime/tree/v7.4.13"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-23T16:22:37+00:00"
+ },
+ {
+ "name": "symfony/options-resolver",
+ "version": "v7.4.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/options-resolver.git",
+ "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2888fcdc4dc2fd5f7c7397be78631e8af12e02b4",
+ "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\OptionsResolver\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an improved replacement for the array_replace PHP function",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "config",
+ "configuration",
+ "options"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/options-resolver/tree/v7.4.8"
},
"funding": [
{
@@ -5944,7 +6733,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-23T14:40:34+00:00"
+ "time": "2026-03-24T13:12:05+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -6533,28 +7322,22 @@
"time": "2026-05-26T12:51:13+00:00"
},
{
- "name": "symfony/polyfill-uuid",
- "version": "v1.37.0",
+ "name": "symfony/polyfill-php85",
+ "version": "v1.38.1",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-uuid.git",
- "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94"
+ "url": "https://github.com/symfony/polyfill-php85.git",
+ "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
- "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
+ "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1",
+ "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
- "provide": {
- "ext-uuid": "*"
- },
- "suggest": {
- "ext-uuid": "For best performance"
- },
"type": "library",
"extra": {
"thanks": {
@@ -6567,8 +7350,11 @@
"bootstrap.php"
],
"psr-4": {
- "Symfony\\Polyfill\\Uuid\\": ""
- }
+ "Symfony\\Polyfill\\Php85\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -6576,24 +7362,24 @@
],
"authors": [
{
- "name": "Grégoire Pineau",
- "email": "lyrixx@lyrixx.info"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for uuid functions",
+ "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
- "uuid"
+ "shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0"
+ "source": "https://github.com/symfony/polyfill-php85/tree/v1.38.1"
},
"funding": [
{
@@ -6613,28 +7399,111 @@
"type": "tidelift"
}
],
- "time": "2026-04-10T16:19:22+00:00"
+ "time": "2026-05-26T02:25:22+00:00"
},
{
- "name": "symfony/process",
- "version": "v6.4.41",
+ "name": "symfony/polyfill-uuid",
+ "version": "v1.37.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/process.git",
- "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7"
+ "url": "https://github.com/symfony/polyfill-uuid.git",
+ "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/c8fc09bdfe9fde9aaa89b415a4477feaccec16a7",
- "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7",
+ "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
+ "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=7.2"
},
- "type": "library",
- "autoload": {
- "psr-4": {
+ "provide": {
+ "ext-uuid": "*"
+ },
+ "suggest": {
+ "ext-uuid": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Uuid\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Grégoire Pineau",
+ "email": "lyrixx@lyrixx.info"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for uuid functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "uuid"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-04-10T16:19:22+00:00"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v7.4.13",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/process.git",
+ "reference": "f5804be144caceb570f6747519999636b664f24c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c",
+ "reference": "f5804be144caceb570f6747519999636b664f24c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
@@ -6658,7 +7527,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v6.4.41"
+ "source": "https://github.com/symfony/process/tree/v7.4.13"
},
"funding": [
{
@@ -6678,40 +7547,38 @@
"type": "tidelift"
}
],
- "time": "2026-05-23T13:47:21+00:00"
+ "time": "2026-05-23T16:05:06+00:00"
},
{
"name": "symfony/routing",
- "version": "v6.4.41",
+ "version": "v7.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "af04c79671fd8df0805a44c83fa2b0ba56c8329e"
+ "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/af04c79671fd8df0805a44c83fa2b0ba56c8329e",
- "reference": "af04c79671fd8df0805a44c83fa2b0ba56c8329e",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/3a162171bb008e5e0f15dce6581373a4c0e8390d",
+ "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3"
},
"conflict": {
- "doctrine/annotations": "<1.12",
- "symfony/config": "<6.2",
- "symfony/dependency-injection": "<5.4",
- "symfony/yaml": "<5.4"
+ "symfony/config": "<6.4",
+ "symfony/dependency-injection": "<6.4",
+ "symfony/yaml": "<6.4"
},
"require-dev": {
- "doctrine/annotations": "^1.12|^2",
"psr/log": "^1|^2|^3",
- "symfony/config": "^6.2|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/expression-language": "^5.4|^6.0|^7.0",
- "symfony/http-foundation": "^5.4|^6.0|^7.0",
- "symfony/yaml": "^5.4|^6.0|^7.0"
+ "symfony/config": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/expression-language": "^6.4|^7.0|^8.0",
+ "symfony/http-foundation": "^6.4|^7.0|^8.0",
+ "symfony/yaml": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -6745,7 +7612,7 @@
"url"
],
"support": {
- "source": "https://github.com/symfony/routing/tree/v6.4.41"
+ "source": "https://github.com/symfony/routing/tree/v7.4.13"
},
"funding": [
{
@@ -6765,7 +7632,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-24T11:18:16+00:00"
+ "time": "2026-05-24T11:20:33+00:00"
},
{
"name": "symfony/service-contracts",
@@ -6947,51 +7814,52 @@
},
{
"name": "symfony/translation",
- "version": "v6.4.38",
+ "version": "v7.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "afaa31b0c12d9a659eed1ea97f268a614cc1299c"
+ "reference": "ada7578c30dd5feaa8259cff3e885069ea81ddde"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/afaa31b0c12d9a659eed1ea97f268a614cc1299c",
- "reference": "afaa31b0c12d9a659eed1ea97f268a614cc1299c",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/ada7578c30dd5feaa8259cff3e885069ea81ddde",
+ "reference": "ada7578c30dd5feaa8259cff3e885069ea81ddde",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/translation-contracts": "^2.5|^3.0"
+ "symfony/translation-contracts": "^2.5.3|^3.3"
},
"conflict": {
- "symfony/config": "<5.4",
- "symfony/console": "<5.4",
- "symfony/dependency-injection": "<5.4",
+ "nikic/php-parser": "<5.0",
+ "symfony/config": "<6.4",
+ "symfony/console": "<6.4",
+ "symfony/dependency-injection": "<6.4",
"symfony/http-client-contracts": "<2.5",
- "symfony/http-kernel": "<5.4",
+ "symfony/http-kernel": "<6.4",
"symfony/service-contracts": "<2.5",
- "symfony/twig-bundle": "<5.4",
- "symfony/yaml": "<5.4"
+ "symfony/twig-bundle": "<6.4",
+ "symfony/yaml": "<6.4"
},
"provide": {
"symfony/translation-implementation": "2.3|3.0"
},
"require-dev": {
- "nikic/php-parser": "^4.18|^5.0",
+ "nikic/php-parser": "^5.0",
"psr/log": "^1|^2|^3",
- "symfony/config": "^5.4|^6.0|^7.0",
- "symfony/console": "^5.4|^6.0|^7.0",
- "symfony/dependency-injection": "^5.4|^6.0|^7.0",
- "symfony/finder": "^5.4|^6.0|^7.0",
+ "symfony/config": "^6.4|^7.0|^8.0",
+ "symfony/console": "^6.4|^7.0|^8.0",
+ "symfony/dependency-injection": "^6.4|^7.0|^8.0",
+ "symfony/finder": "^6.4|^7.0|^8.0",
"symfony/http-client-contracts": "^2.5|^3.0",
- "symfony/http-kernel": "^5.4|^6.0|^7.0",
- "symfony/intl": "^5.4|^6.0|^7.0",
+ "symfony/http-kernel": "^6.4|^7.0|^8.0",
+ "symfony/intl": "^6.4|^7.0|^8.0",
"symfony/polyfill-intl-icu": "^1.21",
- "symfony/routing": "^5.4|^6.0|^7.0",
+ "symfony/routing": "^6.4|^7.0|^8.0",
"symfony/service-contracts": "^2.5|^3",
- "symfony/yaml": "^5.4|^6.0|^7.0"
+ "symfony/yaml": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -7022,7 +7890,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v6.4.38"
+ "source": "https://github.com/symfony/translation/tree/v7.4.10"
},
"funding": [
{
@@ -7042,7 +7910,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-06T08:55:54+00:00"
+ "time": "2026-05-06T11:19:24+00:00"
},
{
"name": "symfony/translation-contracts",
@@ -7128,24 +7996,24 @@
},
{
"name": "symfony/uid",
- "version": "v6.4.32",
+ "version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/uid.git",
- "reference": "6b973c385f00341b246f697d82dc01a09107acdd"
+ "reference": "2676b524340abcfe4d6151ec698463cebafee439"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/uid/zipball/6b973c385f00341b246f697d82dc01a09107acdd",
- "reference": "6b973c385f00341b246f697d82dc01a09107acdd",
+ "url": "https://api.github.com/repos/symfony/uid/zipball/2676b524340abcfe4d6151ec698463cebafee439",
+ "reference": "2676b524340abcfe4d6151ec698463cebafee439",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/polyfill-uuid": "^1.15"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0|^7.0"
+ "symfony/console": "^6.4|^7.0|^8.0"
},
"type": "library",
"autoload": {
@@ -7182,7 +8050,7 @@
"uuid"
],
"support": {
- "source": "https://github.com/symfony/uid/tree/v6.4.32"
+ "source": "https://github.com/symfony/uid/tree/v7.4.9"
},
"funding": [
{
@@ -7202,37 +8070,36 @@
"type": "tidelift"
}
],
- "time": "2025-12-23T15:07:59+00:00"
+ "time": "2026-04-30T15:19:22+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v6.4.36",
+ "version": "v7.4.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "7c8ad9ce4faf6c8a99948e70ce02b601a0439782"
+ "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7c8ad9ce4faf6c8a99948e70ce02b601a0439782",
- "reference": "7c8ad9ce4faf6c8a99948e70ce02b601a0439782",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9510c3966f749a1d1ff0059e1eabef6cc621e7fd",
+ "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd",
"shasum": ""
},
"require": {
- "php": ">=8.1",
+ "php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "symfony/console": "<5.4"
+ "symfony/console": "<6.4"
},
"require-dev": {
- "symfony/console": "^5.4|^6.0|^7.0",
- "symfony/error-handler": "^6.3|^7.0",
- "symfony/http-kernel": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.0|^7.0",
- "symfony/uid": "^5.4|^6.0|^7.0",
- "twig/twig": "^2.13|^3.0.4"
+ "symfony/console": "^6.4|^7.0|^8.0",
+ "symfony/http-kernel": "^6.4|^7.0|^8.0",
+ "symfony/process": "^6.4|^7.0|^8.0",
+ "symfony/uid": "^6.4|^7.0|^8.0",
+ "twig/twig": "^3.12"
},
"bin": [
"Resources/bin/var-dump-server"
@@ -7270,7 +8137,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v6.4.36"
+ "source": "https://github.com/symfony/var-dumper/tree/v7.4.8"
},
"funding": [
{
@@ -7290,7 +8157,7 @@
"type": "tidelift"
}
],
- "time": "2026-03-30T15:36:00+00:00"
+ "time": "2026-03-30T13:44:50+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@@ -7708,76 +8575,6 @@
],
"time": "2026-01-23T15:03:22+00:00"
},
- {
- "name": "doctrine/instantiator",
- "version": "2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
- "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0",
- "shasum": ""
- },
- "require": {
- "php": "^8.1"
- },
- "require-dev": {
- "doctrine/coding-standard": "^11",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpbench/phpbench": "^1.2",
- "phpstan/phpstan": "^1.9.4",
- "phpstan/phpstan-phpunit": "^1.3",
- "phpunit/phpunit": "^9.5.27",
- "vimeo/psalm": "^5.4"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "https://ocramius.github.io/"
- }
- ],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
- "keywords": [
- "constructor",
- "instantiate"
- ],
- "support": {
- "issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/2.0.0"
- },
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
- {
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
- "type": "tidelift"
- }
- ],
- "time": "2022-12-30T00:23:10+00:00"
- },
{
"name": "erusev/parsedown",
"version": "1.7.4",
@@ -8110,28 +8907,30 @@
},
{
"name": "laravel/breeze",
- "version": "v1.29.1",
+ "version": "v2.4.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/breeze.git",
- "reference": "22c53b84b7fff91b01a318d71a10dfc251e92849"
+ "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/breeze/zipball/22c53b84b7fff91b01a318d71a10dfc251e92849",
- "reference": "22c53b84b7fff91b01a318d71a10dfc251e92849",
+ "url": "https://api.github.com/repos/laravel/breeze/zipball/4f20e7b2cc8d25daa85d8647241a89c8e0930305",
+ "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305",
"shasum": ""
},
"require": {
- "illuminate/console": "^10.17",
- "illuminate/filesystem": "^10.17",
- "illuminate/support": "^10.17",
- "illuminate/validation": "^10.17",
- "php": "^8.1.0"
+ "illuminate/console": "^11.0|^12.0|^13.0",
+ "illuminate/filesystem": "^11.0|^12.0|^13.0",
+ "illuminate/support": "^11.0|^12.0|^13.0",
+ "illuminate/validation": "^11.0|^12.0|^13.0",
+ "php": "^8.2.0",
+ "symfony/console": "^7.0|^8.0"
},
"require-dev": {
- "orchestra/testbench": "^8.0",
- "phpstan/phpstan": "^1.10"
+ "laravel/framework": "^11.0|^12.0|^13.0",
+ "orchestra/testbench-core": "^9.0|^10.0|^11.0",
+ "phpstan/phpstan": "^2.0"
},
"type": "library",
"extra": {
@@ -8139,9 +8938,6 @@
"providers": [
"Laravel\\Breeze\\BreezeServiceProvider"
]
- },
- "branch-alias": {
- "dev-master": "1.x-dev"
}
},
"autoload": {
@@ -8168,7 +8964,7 @@
"issues": "https://github.com/laravel/breeze/issues",
"source": "https://github.com/laravel/breeze"
},
- "time": "2024-03-04T14:35:21+00:00"
+ "time": "2026-05-14T16:54:25+00:00"
},
{
"name": "mockery/mockery",
@@ -8368,32 +9164,38 @@
},
{
"name": "nunomaduro/collision",
- "version": "v6.4.0",
+ "version": "v8.5.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
- "reference": "f05978827b9343cba381ca05b8c7deee346b6015"
+ "reference": "f5c101b929c958e849a633283adff296ed5f38f5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f05978827b9343cba381ca05b8c7deee346b6015",
- "reference": "f05978827b9343cba381ca05b8c7deee346b6015",
+ "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f5c101b929c958e849a633283adff296ed5f38f5",
+ "reference": "f5c101b929c958e849a633283adff296ed5f38f5",
"shasum": ""
},
"require": {
- "filp/whoops": "^2.14.5",
- "php": "^8.0.0",
- "symfony/console": "^6.0.2"
+ "filp/whoops": "^2.16.0",
+ "nunomaduro/termwind": "^2.1.0",
+ "php": "^8.2.0",
+ "symfony/console": "^7.1.5"
+ },
+ "conflict": {
+ "laravel/framework": "<11.0.0 || >=12.0.0",
+ "phpunit/phpunit": "<10.5.1 || >=12.0.0"
},
"require-dev": {
- "brianium/paratest": "^6.4.1",
- "laravel/framework": "^9.26.1",
- "laravel/pint": "^1.1.1",
- "nunomaduro/larastan": "^1.0.3",
- "nunomaduro/mock-final-classes": "^1.1.0",
- "orchestra/testbench": "^7.7",
- "phpunit/phpunit": "^9.5.23",
- "spatie/ignition": "^1.4.1"
+ "larastan/larastan": "^2.9.8",
+ "laravel/framework": "^11.28.0",
+ "laravel/pint": "^1.18.1",
+ "laravel/sail": "^1.36.0",
+ "laravel/sanctum": "^4.0.3",
+ "laravel/tinker": "^2.10.0",
+ "orchestra/testbench-core": "^9.5.3",
+ "pestphp/pest": "^2.36.0 || ^3.4.0",
+ "sebastian/environment": "^6.1.0 || ^7.2.0"
},
"type": "library",
"extra": {
@@ -8403,10 +9205,13 @@
]
},
"branch-alias": {
- "dev-develop": "6.x-dev"
+ "dev-8.x": "8.x-dev"
}
},
"autoload": {
+ "files": [
+ "./src/Adapters/Phpunit/Autoload.php"
+ ],
"psr-4": {
"NunoMaduro\\Collision\\": "src/"
}
@@ -8452,7 +9257,7 @@
"type": "patreon"
}
],
- "time": "2023-01-03T12:54:54+00:00"
+ "time": "2024-10-15T16:06:32+00:00"
},
{
"name": "phar-io/manifest",
@@ -8648,16 +9453,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.32",
+ "version": "10.1.16",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5"
+ "reference": "7e308268858ed6baedc8704a304727d20bc07c77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5",
- "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77",
+ "reference": "7e308268858ed6baedc8704a304727d20bc07c77",
"shasum": ""
},
"require": {
@@ -8665,18 +9470,18 @@
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.19.1 || ^5.1.0",
- "php": ">=7.3",
- "phpunit/php-file-iterator": "^3.0.6",
- "phpunit/php-text-template": "^2.0.4",
- "sebastian/code-unit-reverse-lookup": "^2.0.3",
- "sebastian/complexity": "^2.0.3",
- "sebastian/environment": "^5.1.5",
- "sebastian/lines-of-code": "^1.0.4",
- "sebastian/version": "^3.0.2",
+ "php": ">=8.1",
+ "phpunit/php-file-iterator": "^4.1.0",
+ "phpunit/php-text-template": "^3.0.1",
+ "sebastian/code-unit-reverse-lookup": "^3.0.0",
+ "sebastian/complexity": "^3.2.0",
+ "sebastian/environment": "^6.1.0",
+ "sebastian/lines-of-code": "^2.0.2",
+ "sebastian/version": "^4.0.1",
"theseer/tokenizer": "^1.2.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.6"
+ "phpunit/phpunit": "^10.1"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@@ -8685,7 +9490,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "9.2.x-dev"
+ "dev-main": "10.1.x-dev"
}
},
"autoload": {
@@ -8714,7 +9519,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16"
},
"funding": [
{
@@ -8722,32 +9527,32 @@
"type": "github"
}
],
- "time": "2024-08-22T04:23:01+00:00"
+ "time": "2024-08-22T04:31:57+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "3.0.6",
+ "version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
+ "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
- "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c",
+ "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -8774,7 +9579,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
+ "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0"
},
"funding": [
{
@@ -8782,28 +9588,28 @@
"type": "github"
}
],
- "time": "2021-12-02T12:48:52+00:00"
+ "time": "2023-08-31T06:24:48+00:00"
},
{
"name": "phpunit/php-invoker",
- "version": "3.1.1",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
"ext-pcntl": "*",
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"suggest": {
"ext-pcntl": "*"
@@ -8811,7 +9617,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -8837,7 +9643,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-invoker/issues",
- "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0"
},
"funding": [
{
@@ -8845,32 +9651,32 @@
"type": "github"
}
],
- "time": "2020-09-28T05:58:55+00:00"
+ "time": "2023-02-03T06:56:09+00:00"
},
{
"name": "phpunit/php-text-template",
- "version": "2.0.4",
+ "version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
+ "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748",
+ "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -8896,7 +9702,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
- "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ "security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1"
},
"funding": [
{
@@ -8904,32 +9711,32 @@
"type": "github"
}
],
- "time": "2020-10-26T05:33:50+00:00"
+ "time": "2023-08-31T14:07:24+00:00"
},
{
"name": "phpunit/php-timer",
- "version": "5.0.3",
+ "version": "6.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.0-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -8955,7 +9762,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
- "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0"
},
"funding": [
{
@@ -8963,24 +9770,23 @@
"type": "github"
}
],
- "time": "2020-10-26T13:16:10+00:00"
+ "time": "2023-02-03T06:57:52+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "9.6.34",
+ "version": "10.5.63",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "b36f02317466907a230d3aa1d34467041271ef4a"
+ "reference": "33198268dad71e926626b618f3ec3966661e4d90"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b36f02317466907a230d3aa1d34467041271ef4a",
- "reference": "b36f02317466907a230d3aa1d34467041271ef4a",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/33198268dad71e926626b618f3ec3966661e4d90",
+ "reference": "33198268dad71e926626b618f3ec3966661e4d90",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.5.0 || ^2",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
@@ -8990,27 +9796,26 @@
"myclabs/deep-copy": "^1.13.4",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
- "php": ">=7.3",
- "phpunit/php-code-coverage": "^9.2.32",
- "phpunit/php-file-iterator": "^3.0.6",
- "phpunit/php-invoker": "^3.1.1",
- "phpunit/php-text-template": "^2.0.4",
- "phpunit/php-timer": "^5.0.3",
- "sebastian/cli-parser": "^1.0.2",
- "sebastian/code-unit": "^1.0.8",
- "sebastian/comparator": "^4.0.10",
- "sebastian/diff": "^4.0.6",
- "sebastian/environment": "^5.1.5",
- "sebastian/exporter": "^4.0.8",
- "sebastian/global-state": "^5.0.8",
- "sebastian/object-enumerator": "^4.0.4",
- "sebastian/resource-operations": "^3.0.4",
- "sebastian/type": "^3.2.1",
- "sebastian/version": "^3.0.2"
+ "php": ">=8.1",
+ "phpunit/php-code-coverage": "^10.1.16",
+ "phpunit/php-file-iterator": "^4.1.0",
+ "phpunit/php-invoker": "^4.0.0",
+ "phpunit/php-text-template": "^3.0.1",
+ "phpunit/php-timer": "^6.0.0",
+ "sebastian/cli-parser": "^2.0.1",
+ "sebastian/code-unit": "^2.0.0",
+ "sebastian/comparator": "^5.0.5",
+ "sebastian/diff": "^5.1.1",
+ "sebastian/environment": "^6.1.0",
+ "sebastian/exporter": "^5.1.4",
+ "sebastian/global-state": "^6.0.2",
+ "sebastian/object-enumerator": "^5.0.0",
+ "sebastian/recursion-context": "^5.0.1",
+ "sebastian/type": "^4.0.0",
+ "sebastian/version": "^4.0.1"
},
"suggest": {
- "ext-soap": "To be able to generate mocks based on WSDL files",
- "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ "ext-soap": "To be able to generate mocks based on WSDL files"
},
"bin": [
"phpunit"
@@ -9018,7 +9823,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.6-dev"
+ "dev-main": "10.5-dev"
}
},
"autoload": {
@@ -9050,7 +9855,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.34"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.63"
},
"funding": [
{
@@ -9074,32 +9879,32 @@
"type": "tidelift"
}
],
- "time": "2026-01-27T05:45:00+00:00"
+ "time": "2026-01-27T05:48:37+00:00"
},
{
"name": "sebastian/cli-parser",
- "version": "1.0.2",
+ "version": "2.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b"
+ "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
- "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084",
+ "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-main": "2.0-dev"
}
},
"autoload": {
@@ -9122,7 +9927,8 @@
"homepage": "https://github.com/sebastianbergmann/cli-parser",
"support": {
"issues": "https://github.com/sebastianbergmann/cli-parser/issues",
- "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2"
+ "security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1"
},
"funding": [
{
@@ -9130,32 +9936,32 @@
"type": "github"
}
],
- "time": "2024-03-02T06:27:43+00:00"
+ "time": "2024-03-02T07:12:49+00:00"
},
{
"name": "sebastian/code-unit",
- "version": "1.0.8",
+ "version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503",
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-main": "2.0-dev"
}
},
"autoload": {
@@ -9178,7 +9984,7 @@
"homepage": "https://github.com/sebastianbergmann/code-unit",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit/issues",
- "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0"
},
"funding": [
{
@@ -9186,32 +9992,32 @@
"type": "github"
}
],
- "time": "2020-10-26T13:08:54+00:00"
+ "time": "2023-02-03T06:58:43+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
- "version": "2.0.3",
+ "version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -9233,7 +10039,7 @@
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
- "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0"
},
"funding": [
{
@@ -9241,34 +10047,36 @@
"type": "github"
}
],
- "time": "2020-09-28T05:30:19+00:00"
+ "time": "2023-02-03T06:59:15+00:00"
},
{
"name": "sebastian/comparator",
- "version": "4.0.10",
+ "version": "5.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d"
+ "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d",
- "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
+ "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
"shasum": ""
},
"require": {
- "php": ">=7.3",
- "sebastian/diff": "^4.0",
- "sebastian/exporter": "^4.0"
+ "ext-dom": "*",
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/diff": "^5.0",
+ "sebastian/exporter": "^5.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-main": "5.0-dev"
}
},
"autoload": {
@@ -9307,7 +10115,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10"
+ "security": "https://github.com/sebastianbergmann/comparator/security/policy",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5"
},
"funding": [
{
@@ -9327,33 +10136,33 @@
"type": "tidelift"
}
],
- "time": "2026-01-24T09:22:56+00:00"
+ "time": "2026-01-24T09:25:16+00:00"
},
{
"name": "sebastian/complexity",
- "version": "2.0.3",
+ "version": "3.2.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a"
+ "reference": "68ff824baeae169ec9f2137158ee529584553799"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a",
- "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799",
+ "reference": "68ff824baeae169ec9f2137158ee529584553799",
"shasum": ""
},
"require": {
"nikic/php-parser": "^4.18 || ^5.0",
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-main": "3.2-dev"
}
},
"autoload": {
@@ -9376,7 +10185,8 @@
"homepage": "https://github.com/sebastianbergmann/complexity",
"support": {
"issues": "https://github.com/sebastianbergmann/complexity/issues",
- "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3"
+ "security": "https://github.com/sebastianbergmann/complexity/security/policy",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0"
},
"funding": [
{
@@ -9384,33 +10194,33 @@
"type": "github"
}
],
- "time": "2023-12-22T06:19:30+00:00"
+ "time": "2023-12-21T08:37:17+00:00"
},
{
"name": "sebastian/diff",
- "version": "4.0.6",
+ "version": "5.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc"
+ "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc",
- "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e",
+ "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3",
- "symfony/process": "^4.2 || ^5"
+ "phpunit/phpunit": "^10.0",
+ "symfony/process": "^6.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-main": "5.1-dev"
}
},
"autoload": {
@@ -9442,7 +10252,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6"
+ "security": "https://github.com/sebastianbergmann/diff/security/policy",
+ "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1"
},
"funding": [
{
@@ -9450,27 +10261,27 @@
"type": "github"
}
],
- "time": "2024-03-02T06:30:58+00:00"
+ "time": "2024-03-02T07:15:17+00:00"
},
{
"name": "sebastian/environment",
- "version": "5.1.5",
+ "version": "6.1.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
+ "reference": "8074dbcd93529b357029f5cc5058fd3e43666984"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
- "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984",
+ "reference": "8074dbcd93529b357029f5cc5058fd3e43666984",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"suggest": {
"ext-posix": "*"
@@ -9478,7 +10289,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.1-dev"
+ "dev-main": "6.1-dev"
}
},
"autoload": {
@@ -9497,7 +10308,7 @@
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "homepage": "https://github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
@@ -9505,7 +10316,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
+ "security": "https://github.com/sebastianbergmann/environment/security/policy",
+ "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0"
},
"funding": [
{
@@ -9513,34 +10325,34 @@
"type": "github"
}
],
- "time": "2023-02-03T06:03:51+00:00"
+ "time": "2024-03-23T08:47:14+00:00"
},
{
"name": "sebastian/exporter",
- "version": "4.0.8",
+ "version": "5.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c"
+ "reference": "0735b90f4da94969541dac1da743446e276defa6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c",
- "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6",
+ "reference": "0735b90f4da94969541dac1da743446e276defa6",
"shasum": ""
},
"require": {
- "php": ">=7.3",
- "sebastian/recursion-context": "^4.0"
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/recursion-context": "^5.0"
},
"require-dev": {
- "ext-mbstring": "*",
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-main": "5.1-dev"
}
},
"autoload": {
@@ -9582,7 +10394,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8"
+ "security": "https://github.com/sebastianbergmann/exporter/security/policy",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4"
},
"funding": [
{
@@ -9602,38 +10415,35 @@
"type": "tidelift"
}
],
- "time": "2025-09-24T06:03:27+00:00"
+ "time": "2025-09-24T06:09:11+00:00"
},
{
"name": "sebastian/global-state",
- "version": "5.0.8",
+ "version": "6.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6"
+ "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
- "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
+ "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
"shasum": ""
},
"require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
},
"require-dev": {
"ext-dom": "*",
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-uopz": "*"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.0-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -9652,59 +10462,48 @@
}
],
"description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "homepage": "https://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8"
+ "security": "https://github.com/sebastianbergmann/global-state/security/policy",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
- },
- {
- "url": "https://liberapay.com/sebastianbergmann",
- "type": "liberapay"
- },
- {
- "url": "https://thanks.dev/u/gh/sebastianbergmann",
- "type": "thanks_dev"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state",
- "type": "tidelift"
}
],
- "time": "2025-08-10T07:10:35+00:00"
+ "time": "2024-03-02T07:19:19+00:00"
},
{
"name": "sebastian/lines-of-code",
- "version": "1.0.4",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5"
+ "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5",
- "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0",
+ "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0",
"shasum": ""
},
"require": {
"nikic/php-parser": "^4.18 || ^5.0",
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-main": "2.0-dev"
}
},
"autoload": {
@@ -9727,7 +10526,8 @@
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
"support": {
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
- "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4"
+ "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2"
},
"funding": [
{
@@ -9735,34 +10535,34 @@
"type": "github"
}
],
- "time": "2023-12-22T06:20:34+00:00"
+ "time": "2023-12-21T08:38:20+00:00"
},
{
"name": "sebastian/object-enumerator",
- "version": "4.0.4",
+ "version": "5.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906",
"shasum": ""
},
"require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-main": "5.0-dev"
}
},
"autoload": {
@@ -9784,7 +10584,7 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
- "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0"
},
"funding": [
{
@@ -9792,32 +10592,32 @@
"type": "github"
}
],
- "time": "2020-10-26T13:12:34+00:00"
+ "time": "2023-02-03T07:08:32+00:00"
},
{
"name": "sebastian/object-reflector",
- "version": "2.0.4",
+ "version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957",
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -9839,7 +10639,7 @@
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
- "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0"
},
"funding": [
{
@@ -9847,32 +10647,32 @@
"type": "github"
}
],
- "time": "2020-10-26T13:14:26+00:00"
+ "time": "2023-02-03T07:06:18+00:00"
},
{
"name": "sebastian/recursion-context",
- "version": "4.0.6",
+ "version": "5.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "539c6691e0623af6dc6f9c20384c120f963465a0"
+ "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0",
- "reference": "539c6691e0623af6dc6f9c20384c120f963465a0",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a",
+ "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
+ "phpunit/phpunit": "^10.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.0-dev"
+ "dev-main": "5.0-dev"
}
},
"autoload": {
@@ -9902,7 +10702,8 @@
"homepage": "https://github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6"
+ "security": "https://github.com/sebastianbergmann/recursion-context/security/policy",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1"
},
"funding": [
{
@@ -9922,86 +10723,32 @@
"type": "tidelift"
}
],
- "time": "2025-08-10T06:57:39+00:00"
- },
- {
- "name": "sebastian/resource-operations",
- "version": "3.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
- "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides a list of PHP built-in functions that operate on resources",
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "support": {
- "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2024-03-14T16:00:52+00:00"
+ "time": "2025-08-10T07:50:56+00:00"
},
{
"name": "sebastian/type",
- "version": "3.2.1",
+ "version": "4.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
- "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf",
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"require-dev": {
- "phpunit/phpunit": "^9.5"
+ "phpunit/phpunit": "^10.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.2-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -10024,7 +10771,7 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
+ "source": "https://github.com/sebastianbergmann/type/tree/4.0.0"
},
"funding": [
{
@@ -10032,29 +10779,29 @@
"type": "github"
}
],
- "time": "2023-02-03T06:13:03+00:00"
+ "time": "2023-02-03T07:10:45+00:00"
},
{
"name": "sebastian/version",
- "version": "3.0.2",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
- "reference": "c6c1022351a901512170118436c764e473f6de8c"
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
- "reference": "c6c1022351a901512170118436c764e473f6de8c",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17",
"shasum": ""
},
"require": {
- "php": ">=7.3"
+ "php": ">=8.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -10077,7 +10824,7 @@
"homepage": "https://github.com/sebastianbergmann/version",
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
- "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ "source": "https://github.com/sebastianbergmann/version/tree/4.0.1"
},
"funding": [
{
@@ -10085,7 +10832,7 @@
"type": "github"
}
],
- "time": "2020-09-28T06:39:44+00:00"
+ "time": "2023-02-07T11:34:05+00:00"
},
{
"name": "shalvah/clara",
@@ -10192,70 +10939,6 @@
],
"time": "2024-02-20T11:51:46+00:00"
},
- {
- "name": "spatie/backtrace",
- "version": "1.8.2",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/backtrace.git",
- "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/backtrace/zipball/8ffe78be5ed355b5009e3dd989d183433e9a5adc",
- "reference": "8ffe78be5ed355b5009e3dd989d183433e9a5adc",
- "shasum": ""
- },
- "require": {
- "php": "^7.3 || ^8.0"
- },
- "require-dev": {
- "ext-json": "*",
- "laravel/serializable-closure": "^1.3 || ^2.0",
- "phpunit/phpunit": "^9.3 || ^11.4.3",
- "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.1.6",
- "symfony/var-dumper": "^5.1|^6.0|^7.0|^8.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Spatie\\Backtrace\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Freek Van de Herten",
- "email": "freek@spatie.be",
- "homepage": "https://spatie.be",
- "role": "Developer"
- }
- ],
- "description": "A better backtrace",
- "homepage": "https://github.com/spatie/backtrace",
- "keywords": [
- "Backtrace",
- "spatie"
- ],
- "support": {
- "issues": "https://github.com/spatie/backtrace/issues",
- "source": "https://github.com/spatie/backtrace/tree/1.8.2"
- },
- "funding": [
- {
- "url": "https://github.com/sponsors/spatie",
- "type": "github"
- },
- {
- "url": "https://spatie.be/open-source/support-us",
- "type": "other"
- }
- ],
- "time": "2026-03-11T13:48:28+00:00"
- },
{
"name": "spatie/data-transfer-object",
"version": "3.9.1",
@@ -10320,326 +11003,6 @@
"abandoned": "spatie/laravel-data",
"time": "2022-09-16T13:34:38+00:00"
},
- {
- "name": "spatie/error-solutions",
- "version": "1.1.3",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/error-solutions.git",
- "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/error-solutions/zipball/e495d7178ca524f2dd0fe6a1d99a1e608e1c9936",
- "reference": "e495d7178ca524f2dd0fe6a1d99a1e608e1c9936",
- "shasum": ""
- },
- "require": {
- "php": "^8.0"
- },
- "require-dev": {
- "illuminate/broadcasting": "^10.0|^11.0|^12.0",
- "illuminate/cache": "^10.0|^11.0|^12.0",
- "illuminate/support": "^10.0|^11.0|^12.0",
- "livewire/livewire": "^2.11|^3.5.20",
- "openai-php/client": "^0.10.1",
- "orchestra/testbench": "8.22.3|^9.0|^10.0",
- "pestphp/pest": "^2.20|^3.0",
- "phpstan/phpstan": "^2.1",
- "psr/simple-cache": "^3.0",
- "psr/simple-cache-implementation": "^3.0",
- "spatie/ray": "^1.28",
- "symfony/cache": "^5.4|^6.0|^7.0",
- "symfony/process": "^5.4|^6.0|^7.0",
- "vlucas/phpdotenv": "^5.5"
- },
- "suggest": {
- "openai-php/client": "Require get solutions from OpenAI",
- "simple-cache-implementation": "To cache solutions from OpenAI"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Spatie\\Ignition\\": "legacy/ignition",
- "Spatie\\ErrorSolutions\\": "src",
- "Spatie\\LaravelIgnition\\": "legacy/laravel-ignition"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ruben Van Assche",
- "email": "ruben@spatie.be",
- "role": "Developer"
- }
- ],
- "description": "This is my package error-solutions",
- "homepage": "https://github.com/spatie/error-solutions",
- "keywords": [
- "error-solutions",
- "spatie"
- ],
- "support": {
- "issues": "https://github.com/spatie/error-solutions/issues",
- "source": "https://github.com/spatie/error-solutions/tree/1.1.3"
- },
- "funding": [
- {
- "url": "https://github.com/Spatie",
- "type": "github"
- }
- ],
- "time": "2025-02-14T12:29:50+00:00"
- },
- {
- "name": "spatie/flare-client-php",
- "version": "1.11.1",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/flare-client-php.git",
- "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/53f41b08a27cc039e1a8ed2be9a202e924f31bad",
- "reference": "53f41b08a27cc039e1a8ed2be9a202e924f31bad",
- "shasum": ""
- },
- "require": {
- "illuminate/pipeline": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
- "php": "^8.0",
- "spatie/backtrace": "^1.6.1",
- "symfony/http-foundation": "^5.2|^6.0|^7.0|^8.0",
- "symfony/mime": "^5.2|^6.0|^7.0|^8.0",
- "symfony/process": "^5.2|^6.0|^7.0|^8.0",
- "symfony/var-dumper": "^5.2|^6.0|^7.0|^8.0"
- },
- "require-dev": {
- "dms/phpunit-arraysubset-asserts": "^0.5.0",
- "pestphp/pest": "^1.20|^2.0",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan-deprecation-rules": "^1.0",
- "phpstan/phpstan-phpunit": "^1.0",
- "spatie/pest-plugin-snapshots": "^1.0|^2.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.3.x-dev"
- }
- },
- "autoload": {
- "files": [
- "src/helpers.php"
- ],
- "psr-4": {
- "Spatie\\FlareClient\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Send PHP errors to Flare",
- "homepage": "https://github.com/spatie/flare-client-php",
- "keywords": [
- "exception",
- "flare",
- "reporting",
- "spatie"
- ],
- "support": {
- "issues": "https://github.com/spatie/flare-client-php/issues",
- "source": "https://github.com/spatie/flare-client-php/tree/1.11.1"
- },
- "funding": [
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "time": "2026-05-15T09:31:32+00:00"
- },
- {
- "name": "spatie/ignition",
- "version": "1.16.0",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/ignition.git",
- "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/ignition/zipball/b59385bb7aa24dae81bcc15850ebecfda7b40838",
- "reference": "b59385bb7aa24dae81bcc15850ebecfda7b40838",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "ext-mbstring": "*",
- "php": "^8.0",
- "spatie/backtrace": "^1.7.1",
- "spatie/error-solutions": "^1.1.2",
- "spatie/flare-client-php": "^1.9",
- "symfony/console": "^5.4.42|^6.0|^7.0|^8.0",
- "symfony/http-foundation": "^5.4.42|^6.0|^7.0|^8.0",
- "symfony/mime": "^5.4.42|^6.0|^7.0|^8.0",
- "symfony/var-dumper": "^5.4.42|^6.0|^7.0|^8.0"
- },
- "require-dev": {
- "illuminate/cache": "^9.52|^10.0|^11.0|^12.0|^13.0",
- "mockery/mockery": "^1.4",
- "pestphp/pest": "^1.20|^2.0|^3.0",
- "phpstan/extension-installer": "^1.1",
- "phpstan/phpstan-deprecation-rules": "^1.0",
- "phpstan/phpstan-phpunit": "^1.0",
- "psr/simple-cache-implementation": "*",
- "symfony/cache": "^5.4.38|^6.0|^7.0|^8.0",
- "symfony/process": "^5.4.35|^6.0|^7.0|^8.0",
- "vlucas/phpdotenv": "^5.5"
- },
- "suggest": {
- "openai-php/client": "Require get solutions from OpenAI",
- "simple-cache-implementation": "To cache solutions from OpenAI"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.5.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Spatie\\Ignition\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Spatie",
- "email": "info@spatie.be",
- "role": "Developer"
- }
- ],
- "description": "A beautiful error page for PHP applications.",
- "homepage": "https://flareapp.io/ignition",
- "keywords": [
- "error",
- "flare",
- "laravel",
- "page"
- ],
- "support": {
- "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction",
- "forum": "https://twitter.com/flareappio",
- "issues": "https://github.com/spatie/ignition/issues",
- "source": "https://github.com/spatie/ignition"
- },
- "funding": [
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "time": "2026-03-17T10:51:08+00:00"
- },
- {
- "name": "spatie/laravel-ignition",
- "version": "2.9.1",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/laravel-ignition.git",
- "reference": "1baee07216d6748ebd3a65ba97381b051838707a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/1baee07216d6748ebd3a65ba97381b051838707a",
- "reference": "1baee07216d6748ebd3a65ba97381b051838707a",
- "shasum": ""
- },
- "require": {
- "ext-curl": "*",
- "ext-json": "*",
- "ext-mbstring": "*",
- "illuminate/support": "^10.0|^11.0|^12.0",
- "php": "^8.1",
- "spatie/ignition": "^1.15",
- "symfony/console": "^6.2.3|^7.0",
- "symfony/var-dumper": "^6.2.3|^7.0"
- },
- "require-dev": {
- "livewire/livewire": "^2.11|^3.3.5",
- "mockery/mockery": "^1.5.1",
- "openai-php/client": "^0.8.1|^0.10",
- "orchestra/testbench": "8.22.3|^9.0|^10.0",
- "pestphp/pest": "^2.34|^3.7",
- "phpstan/extension-installer": "^1.3.1",
- "phpstan/phpstan-deprecation-rules": "^1.1.1|^2.0",
- "phpstan/phpstan-phpunit": "^1.3.16|^2.0",
- "vlucas/phpdotenv": "^5.5"
- },
- "suggest": {
- "openai-php/client": "Require get solutions from OpenAI",
- "psr/simple-cache-implementation": "Needed to cache solutions from OpenAI"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "aliases": {
- "Flare": "Spatie\\LaravelIgnition\\Facades\\Flare"
- },
- "providers": [
- "Spatie\\LaravelIgnition\\IgnitionServiceProvider"
- ]
- }
- },
- "autoload": {
- "files": [
- "src/helpers.php"
- ],
- "psr-4": {
- "Spatie\\LaravelIgnition\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Spatie",
- "email": "info@spatie.be",
- "role": "Developer"
- }
- ],
- "description": "A beautiful error page for Laravel applications.",
- "homepage": "https://flareapp.io/ignition",
- "keywords": [
- "error",
- "flare",
- "laravel",
- "page"
- ],
- "support": {
- "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction",
- "forum": "https://twitter.com/flareappio",
- "issues": "https://github.com/spatie/laravel-ignition/issues",
- "source": "https://github.com/spatie/laravel-ignition"
- },
- "funding": [
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "time": "2025-02-20T13:13:55+00:00"
- },
{
"name": "symfony/var-exporter",
"version": "v7.4.9",
@@ -10854,7 +11217,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": "^8.1"
+ "php": "^8.2"
},
"platform-dev": [],
"platform-overrides": {
diff --git a/config/auth.php b/config/auth.php
index 1642fb24..77637fba 100644
--- a/config/auth.php
+++ b/config/auth.php
@@ -10,4 +10,12 @@
],
],
+ 'providers' => [
+ 'users' => [
+ 'driver' => 'eloquent',
+ 'model' => App\User::class,
+ 'table' => 'users',
+ ],
+ ],
+
];
diff --git a/config/cache.php b/config/cache.php
index 4978058c..097e97ad 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -1,13 +1,61 @@
env('CACHE_STORE', 'redis'),
+ 'default' => env('CACHE_DRIVER', 'file'),
+
+
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Stores
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the cache "stores" for your application as
+ | well as their drivers. You may even define multiple stores for the
+ | same cache driver to group types of items stored in your caches.
+ |
+ | Supported drivers: "array", "database", "file", "memcached",
+ | "redis", "dynamodb", "octane", "null"
+ |
+ */
+
'stores' => [
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache'),
'lock_path' => storage_path('framework/cache/data'),
],
+ // 'redis' => [
+ // 'driver' => 'redis',
+ // 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
+ // 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'),
+ // ],
],
+
+ // /*
+ // |--------------------------------------------------------------------------
+ // | Cache Key Prefix
+ // |--------------------------------------------------------------------------
+ // |
+ // | When utilizing the APC, database, memcached, Redis, and DynamoDB cache
+ // | stores, there might be other applications using the same cache. For
+ // | that reason, you may prefix every cache key to avoid collisions.
+ // |
+ // */
+
+ // 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
];
diff --git a/config/laratrust.php b/config/laratrust.php
index b89c6ec5..d250fae5 100644
--- a/config/laratrust.php
+++ b/config/laratrust.php
@@ -14,18 +14,44 @@
/*
|--------------------------------------------------------------------------
- | Which permissions and role checker to use.
+ | Checkers
|--------------------------------------------------------------------------
|
- | Defines if you want to use the roles and permissions checker.
- | Available:
- | - default: Check for the roles and permissions using the method that Laratrust
- has always used.
- | - query: Check for the roles and permissions using direct queries to the database.
- | This method doesn't support cache yet.
+ | Manage Laratrust's role and permissions checkers configurations.
|
- */
- 'checker' => 'default',
+ */
+ 'checkers' => [
+
+ /*
+ |--------------------------------------------------------------------------
+ | Which permissions checker to use.
+ |--------------------------------------------------------------------------
+ |
+ | Defines if you want to use the roles and permissions checker.
+ | Available:
+ | - default: Check for the roles and permissions using the method that Laratrust
+ | has always used.
+ | - query: Check for the roles and permissions using direct queries to the database.
+ | This method doesn't support cache yet.
+ | - class that extends Laratrust\Checkers\User\UserChecker
+ */
+ 'user' => 'default',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Which role checker to use.
+ |--------------------------------------------------------------------------
+ |
+ | Defines if you want to use the roles and permissions checker.
+ | Available:
+ | - default: Check for the roles and permissions using the method that Laratrust
+ has always used.
+ | - query: Check for the roles and permissions using direct queries to the database.
+ | This method doesn't support cache yet.
+ | - class that extends Laratrust\Checkers\Role\RoleChecker
+ */
+ 'role' => 'default',
+ ],
/*
|--------------------------------------------------------------------------
@@ -46,7 +72,7 @@
| NOTE: Currently the database check does not use cache.
|
*/
- 'enabled' => env('LARATRUST_ENABLE_CACHE', true),
+ 'enabled' => env('LARATRUST_ENABLE_CACHE', env('APP_ENV') === 'production'),
/*
|--------------------------------------------------------------------------
@@ -67,7 +93,7 @@
| This is the array that contains the information of the user models.
| This information is used in the add-trait command, for the roles and
| permissions relationships with the possible user models, and the
- | administration panel to attach roles and permissions to the users.
+ | administration panel to add roles and permissions to the users.
|
| The key in the array is the name of the relationship inside the roles and permissions.
|
@@ -151,7 +177,7 @@
/**
* Role foreign key on Laratrust's role_user and permission_user tables.
*/
- 'team' => 'organization_id',
+ 'team' => 'organization_id',
],
/*
@@ -164,13 +190,13 @@
*/
'middleware' => [
/**
- * Define if the laratrust middleware are registered automatically in the service provider
+ * Define if the laratrust middleware are registered automatically in the service provider.
*/
'register' => true,
/**
* Method to be called in the middleware return case.
- * Available: abort|redirect
+ * Available: abort|redirect.
*/
'handling' => 'abort',
@@ -180,7 +206,7 @@
*/
'handlers' => [
/**
- * Aborts the execution with a 403 code and allows you to provide the response text
+ * Aborts the execution with a 403 code and allows you to provide the response text.
*/
'abort' => [
'code' => 403,
@@ -220,16 +246,15 @@
| Strict check for roles/permissions inside teams
|--------------------------------------------------------------------------
|
- | Determines if a strict check should be done when checking if a role or permission
- | is attached inside a team.
+ | Determines if a strict check should be done when checking if a role or permission is added inside a team.
| If it's false, when checking a role/permission without specifying the team,
- | it will check only if the user has attached that role/permission ignoring the team.
+ | it will check only if the user has added that role/permission ignoring the team.
|
*/
'strict_check' => false,
],
- /*
+ /*
|--------------------------------------------------------------------------
| Laratrust Magic 'isAbleTo' Method
|--------------------------------------------------------------------------
@@ -270,6 +295,17 @@
*/
'register' => false,
+ /*
+ |--------------------------------------------------------------------------
+ | Laratrust Panel Domain
+ |--------------------------------------------------------------------------
+ |
+ | This is the Domain Laratrust panel for roles and permissions
+ | will be accessible from.
+ |
+ */
+ 'domain' => env('LARATRUST_PANEL_DOMAIN'),
+
/*
|--------------------------------------------------------------------------
| Laratrust Panel Path
@@ -296,7 +332,7 @@
| Laratrust Panel Route Middleware
|--------------------------------------------------------------------------
|
- | These middleware will get attached onto each Laratrust panel route.
+ | These middleware will get added onto each Laratrust panel route.
|
*/
'middleware' => ['web'],
diff --git a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
index 8cdf36f4..990991e3 100644
--- a/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
+++ b/database/migrations/2023_04_03_095942_add_user_type_to_role_user_and_permission_user_tables.php
@@ -43,7 +43,7 @@ public function up(): void
if (Schema::hasTable('roles') && \App\Role::where('name', 'api-gateway')->count() == 0) {
$api_role = \App\Role::create(['name' => 'api-gateway', 'display_name' => 'API gateway access role', 'description' => 'API gateway access role to get minimal list of (cached) data for API gateway auth. NB: Set user token in AWS Lambda config variables.']);
$api_user = \App\User::create(['name' => 'hcs-api-gateway-user', 'email' => 'hcs@iconize.nl']);
- $api_user->attachRole($api_role->id);
+ $api_user->addRole($api_role->id);
}
}
diff --git a/database/migrations/2026_06_01_000000_rename_password_resets_table.php b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
index c3f94898..485b550b 100644
--- a/database/migrations/2026_06_01_000000_rename_password_resets_table.php
+++ b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
@@ -10,7 +10,9 @@
*/
public function up(): void
{
- Schema::rename('password_resets', 'password_reset_tokens');
+ if (Schema::hasTable('password_resets') && !Schema::hasTable('password_reset_tokens')) {
+ Schema::rename('password_resets', 'password_reset_tokens');
+ }
}
/**
@@ -18,6 +20,8 @@ public function up(): void
*/
public function down(): void
{
- Schema::rename('password_reset_tokens', 'password_resets');
+ if (Schema::hasTable('password_reset_tokens') && !Schema::hasTable('password_resets')) {
+ Schema::rename('password_reset_tokens', 'password_resets');
+ }
}
};
diff --git a/database/migrations/2026_06_02_074531_create_cache_table.php b/database/migrations/2026_06_02_074531_create_cache_table.php
new file mode 100644
index 00000000..b9c106be
--- /dev/null
+++ b/database/migrations/2026_06_02_074531_create_cache_table.php
@@ -0,0 +1,35 @@
+string('key')->primary();
+ $table->mediumText('value');
+ $table->integer('expiration');
+ });
+
+ Schema::create('cache_locks', function (Blueprint $table) {
+ $table->string('key')->primary();
+ $table->string('owner');
+ $table->integer('expiration');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('cache');
+ Schema::dropIfExists('cache_locks');
+ }
+};
diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore
deleted file mode 100755
index d6b7ef32..00000000
--- a/storage/framework/cache/data/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*
-!.gitignore
From e3b267d354936958fdd4f3850b09636adeb92c92 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 12:03:16 +0200
Subject: [PATCH 093/127] fix GET groups 500 error - remove BelongsToMany
return type
---
app/User.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/User.php b/app/User.php
index 1f0f079a..0ed88b0b 100644
--- a/app/User.php
+++ b/app/User.php
@@ -375,7 +375,7 @@ public function allApiaries()
});
}
- public function groupInvitations(): BelongsToMany
+ public function groupInvitations()
{
$user_id = $this->id;
From 57868e8bbf35233a4f99f0d36c2602809f749f33 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:40 +0000
Subject: [PATCH 094/127] Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.
You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.
For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
---
app/Permission.php | 1 -
app/User.php | 1 -
config/cache.php | 7 +++----
config/laratrust.php | 4 ++--
.../2026_06_01_000000_rename_password_resets_table.php | 4 ++--
5 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/app/Permission.php b/app/Permission.php
index f830637f..06356fd8 100644
--- a/app/Permission.php
+++ b/app/Permission.php
@@ -4,7 +4,6 @@
use Laratrust\Models\Permission as LaratrustPermission;
-
class Permission extends LaratrustPermission
{
public $fillable = ['name', 'display_name', 'description'];
diff --git a/app/User.php b/app/User.php
index 0ed88b0b..dac59f72 100644
--- a/app/User.php
+++ b/app/User.php
@@ -23,7 +23,6 @@
use Laratrust\Contracts\LaratrustUser;
use Laratrust\Traits\HasRolesAndPermissions;
-
class User extends Authenticatable implements LaratrustUser
{
use HasFactory;
diff --git a/config/cache.php b/config/cache.php
index 097e97ad..b62bdcfb 100644
--- a/config/cache.php
+++ b/config/cache.php
@@ -1,9 +1,10 @@
env('CACHE_STORE', 'redis'),
- 'default' => env('CACHE_DRIVER', 'file'),
-
+ 'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
@@ -45,7 +45,6 @@
// ],
],
-
// /*
// |--------------------------------------------------------------------------
// | Cache Key Prefix
diff --git a/config/laratrust.php b/config/laratrust.php
index d250fae5..0bc63b22 100644
--- a/config/laratrust.php
+++ b/config/laratrust.php
@@ -177,7 +177,7 @@
/**
* Role foreign key on Laratrust's role_user and permission_user tables.
*/
- 'team' => 'organization_id',
+ 'team' => 'organization_id',
],
/*
@@ -254,7 +254,7 @@
'strict_check' => false,
],
- /*
+ /*
|--------------------------------------------------------------------------
| Laratrust Magic 'isAbleTo' Method
|--------------------------------------------------------------------------
diff --git a/database/migrations/2026_06_01_000000_rename_password_resets_table.php b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
index 485b550b..8456ebfc 100644
--- a/database/migrations/2026_06_01_000000_rename_password_resets_table.php
+++ b/database/migrations/2026_06_01_000000_rename_password_resets_table.php
@@ -10,7 +10,7 @@
*/
public function up(): void
{
- if (Schema::hasTable('password_resets') && !Schema::hasTable('password_reset_tokens')) {
+ if (Schema::hasTable('password_resets') && ! Schema::hasTable('password_reset_tokens')) {
Schema::rename('password_resets', 'password_reset_tokens');
}
}
@@ -20,7 +20,7 @@ public function up(): void
*/
public function down(): void
{
- if (Schema::hasTable('password_reset_tokens') && !Schema::hasTable('password_resets')) {
+ if (Schema::hasTable('password_reset_tokens') && ! Schema::hasTable('password_resets')) {
Schema::rename('password_reset_tokens', 'password_resets');
}
}
From 434f6b3b2d2fcb2174262e81d4b652c17c596bf8 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:48 +0000
Subject: [PATCH 095/127] Shift core files
---
.gitignore | 2 ++
artisan | 7 +++++--
public/.htaccess | 4 ++++
public/index.php | 7 +++++--
4 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 514cb37d..de70737f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,8 +33,10 @@ Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
+/.nova
/.vscode
/.vagrant
/node_modules
dump.rdb
+/storage/pail
diff --git a/artisan b/artisan
index 8e04b422..c35e31d6 100755
--- a/artisan
+++ b/artisan
@@ -1,6 +1,7 @@
#!/usr/bin/env php
handleCommand(new ArgvInput);
+/** @var Application $app */
+$app = require_once __DIR__.'/bootstrap/app.php';
+
+$status = $app->handleCommand(new ArgvInput);
exit($status);
diff --git a/public/.htaccess b/public/.htaccess
index 57d0abde..7f333a39 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -15,6 +15,10 @@
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+ # Handle X-XSRF-Token Header
+ RewriteCond %{HTTP:x-xsrf-token} .
+ RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}]
+
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
diff --git a/public/index.php b/public/index.php
index 947d9896..ee8f07e9 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1,5 +1,6 @@
handleRequest(Request::capture());
+/** @var Application $app */
+$app = require_once __DIR__.'/../bootstrap/app.php';
+
+$app->handleRequest(Request::capture());
From 33287f30faa06cad04dc29aab002e96e78a289af Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:50 +0000
Subject: [PATCH 096/127] Validate via object directly within Controllers
---
app/Http/Controllers/AlertController.php | 4 ++--
app/Http/Controllers/AlertRuleController.php | 4 ++--
app/Http/Controllers/AlertRuleFormulaController.php | 4 ++--
app/Http/Controllers/Api/AlertController.php | 2 +-
app/Http/Controllers/Api/Controller.php | 3 +--
app/Http/Controllers/Api/ResearchDataController.php | 4 ++--
app/Http/Controllers/CategoryInputsController.php | 6 ++----
app/Http/Controllers/ChecklistSvgController.php | 4 ++--
app/Http/Controllers/Controller.php | 3 +--
app/Http/Controllers/DashboardGroupController.php | 4 ++--
app/Http/Controllers/DeviceController.php | 4 ++--
app/Http/Controllers/GroupController.php | 4 ++--
app/Http/Controllers/HiveTagsController.php | 4 ++--
app/Http/Controllers/ResearchController.php | 8 ++++----
app/Http/Controllers/RoleController.php | 4 ++--
app/Http/Controllers/SampleCodeController.php | 4 ++--
app/Http/Controllers/SensorDefinitionController.php | 4 ++--
app/Http/Controllers/UserController.php | 4 ++--
18 files changed, 35 insertions(+), 39 deletions(-)
diff --git a/app/Http/Controllers/AlertController.php b/app/Http/Controllers/AlertController.php
index a779d8b3..0db66eb1 100644
--- a/app/Http/Controllers/AlertController.php
+++ b/app/Http/Controllers/AlertController.php
@@ -59,7 +59,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'alert_rule_id' => 'required',
'measurement_id' => 'required',
'alert_value' => 'required',
@@ -99,7 +99,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'alert_rule_id' => 'required',
'measurement_id' => 'required',
'alert_value' => 'required',
diff --git a/app/Http/Controllers/AlertRuleController.php b/app/Http/Controllers/AlertRuleController.php
index e2d9256b..c88e2acf 100644
--- a/app/Http/Controllers/AlertRuleController.php
+++ b/app/Http/Controllers/AlertRuleController.php
@@ -79,7 +79,7 @@ public function parse(Request $request, $id): RedirectResponse
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'measurement_id' => 'required',
'calculation' => 'required',
'comparator' => 'required',
@@ -142,7 +142,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'measurement_id' => 'required',
'calculation' => 'required',
'comparator' => 'required',
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index 0c4a8df2..54d206bd 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -52,7 +52,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'alert_rule_id' => 'required',
'measurement_id' => 'required',
'calculation' => 'required',
@@ -94,7 +94,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'alert_rule_id' => 'required',
'measurement_id' => 'required',
'calculation' => 'required',
diff --git a/app/Http/Controllers/Api/AlertController.php b/app/Http/Controllers/Api/AlertController.php
index 7c99037c..f93bf00b 100644
--- a/app/Http/Controllers/Api/AlertController.php
+++ b/app/Http/Controllers/Api/AlertController.php
@@ -44,7 +44,7 @@ public function index(Request $request): JsonResponse
*/
public function store(Request $request): JsonResponse
{
- $this->validate($request, [
+ $request->validate([
'alert_rule_id' => 'required|integer|exists:alert_rules,id',
'measurement_id' => 'required|integer|exists:measurements,id',
'alert_value' => 'required|string',
diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php
index 039f64ce..f123d984 100644
--- a/app/Http/Controllers/Api/Controller.php
+++ b/app/Http/Controllers/Api/Controller.php
@@ -4,10 +4,9 @@
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
-use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
- use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+ use AuthorizesRequests, DispatchesJobs;
}
diff --git a/app/Http/Controllers/Api/ResearchDataController.php b/app/Http/Controllers/Api/ResearchDataController.php
index 5355c6de..abee6aed 100644
--- a/app/Http/Controllers/Api/ResearchDataController.php
+++ b/app/Http/Controllers/Api/ResearchDataController.php
@@ -491,7 +491,7 @@ public function user_data(Request $request, $id, $user_id, $item): JsonResponse
return Response::json('unauthorized-for-research', 405);
}
- $this->validate($request, [
+ $request->validate([
'date_start' => 'nullable|date',
'date_until' => 'nullable|date',
'device_id' => 'nullable|integer|exists:sensors,id',
@@ -729,7 +729,7 @@ public function research_data(Request $request, $id, $item): JsonResponse
return Response::json('unauthorized-for-research', 405);
}
- $this->validate($request, [
+ $request->validate([
'date_start' => 'nullable|date',
'date_until' => 'nullable|date',
'year_months' => 'nullable|string',
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index 09579a43..ca0f413f 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -45,8 +45,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request,
- [
+ $request->validate([
'name' => 'required|string',
'type' => 'required|string|unique:category_inputs',
'min' => 'nullable|integer',
@@ -88,8 +87,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request,
- [
+ $request->validate([
'name' => 'required|string',
'type' => Rule::unique('category_inputs')->ignore($id),
'min' => 'nullable|integer',
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index 471b834b..c0f4c507 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -50,7 +50,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'user_id' => 'required',
'checklist_id' => 'required',
]);
@@ -88,7 +88,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'user_id' => 'required',
'checklist_id' => 'required',
]);
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index bd3e17ed..62f1dd97 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -3,10 +3,9 @@
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
abstract class Controller extends BaseController
{
- use AuthorizesRequests, ValidatesRequests;
+ use AuthorizesRequests;
}
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index 972c0adb..3259d3b9 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -62,7 +62,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'code' => 'required|string|min:6',
'hive_ids.*' => 'required|exists:hives,id',
'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
@@ -109,7 +109,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'code' => 'required|string|min:6',
'hive_ids.*' => 'required|exists:hives,id',
'interval' => ['required', Rule::in(array_keys(DashboardGroup::$intervals))],
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index 01f89214..587948bc 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -219,7 +219,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'key' => 'required',
'user_id' => 'required',
@@ -410,7 +410,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'key' => 'required',
'user_id' => 'required',
diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php
index 727960c1..21420054 100644
--- a/app/Http/Controllers/GroupController.php
+++ b/app/Http/Controllers/GroupController.php
@@ -33,7 +33,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'type' => 'required',
]);
@@ -69,7 +69,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'type' => 'required',
]);
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index f37dca69..1d521c38 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -50,7 +50,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'tag' => 'required',
'user_id' => 'required',
]);
@@ -88,7 +88,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'tag' => 'required',
'user_id' => 'required',
]);
diff --git a/app/Http/Controllers/ResearchController.php b/app/Http/Controllers/ResearchController.php
index 1b992112..bad29f06 100644
--- a/app/Http/Controllers/ResearchController.php
+++ b/app/Http/Controllers/ResearchController.php
@@ -171,7 +171,7 @@ public function store(Request $request): RedirectResponse
{
$this->checkAuthorization($request);
- $this->validate($request, [
+ $request->validate([
'name' => 'required|string',
'url' => 'nullable|url',
'image' => 'nullable|image|max:2000',
@@ -223,7 +223,7 @@ public function show(int $id, Request $request): View
{
$this->checkAuthorization($request);
- $this->validate($request, [
+ $request->validate([
'date_start' => 'nullable|date',
'date_until' => 'nullable|date|after:date_start',
'user_ids.*' => 'nullable|exists:users,id',
@@ -984,7 +984,7 @@ public function data(int $id, Request $request): View
{
$this->checkAuthorization($request);
- $this->validate($request, [
+ $request->validate([
'date_start' => 'nullable|date',
'date_until' => 'nullable|date|after:date_start',
'user_ids.*' => 'nullable|exists:users,id',
@@ -1731,7 +1731,7 @@ public function update(Request $request, int $id): RedirectResponse
{
$this->checkAuthorization($request);
- $this->validate($request, [
+ $request->validate([
'name' => 'required|string',
'url' => 'nullable|url',
'image' => 'nullable|image|max:2000',
diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php
index a8b8e02c..b617005e 100644
--- a/app/Http/Controllers/RoleController.php
+++ b/app/Http/Controllers/RoleController.php
@@ -37,7 +37,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'name' => 'required|unique:roles,name',
'display_name' => 'required',
'description' => 'required',
@@ -91,7 +91,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'display_name' => 'required',
'description' => 'required',
'permission' => 'required',
diff --git a/app/Http/Controllers/SampleCodeController.php b/app/Http/Controllers/SampleCodeController.php
index e01832c3..24505d85 100644
--- a/app/Http/Controllers/SampleCodeController.php
+++ b/app/Http/Controllers/SampleCodeController.php
@@ -666,7 +666,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'sample_code' => 'required',
'hive_id' => 'required',
]);
@@ -704,7 +704,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'sample_code' => 'required',
'hive_id' => 'required',
]);
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index b0695d59..e6c1ccaa 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -96,7 +96,7 @@ public function create(): View
*/
public function store(Request $request): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'device_id' => 'required|integer|exists:sensors,id',
'input_measurement_id' => 'integer|exists:measurements,id',
]);
@@ -139,7 +139,7 @@ public function edit(int $id): View
*/
public function update(Request $request, int $id): RedirectResponse
{
- $this->validate($request, [
+ $request->validate([
'device_id' => 'required|integer|exists:sensors,id',
'input_measurement_id' => 'integer|exists:measurements,id',
]);
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index efc5dbef..e3bec843 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -66,7 +66,7 @@ public function store(Request $request): RedirectResponse
return redirect()->route('users.index')->with('error', 'You are not allowed to create this type of user');
}
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'email' => 'required|email|unique:users,email',
'password' => 'required|same:confirm-password',
@@ -151,7 +151,7 @@ public function update(Request $request, int $id): RedirectResponse
}
// Do normal validation
- $this->validate($request, [
+ $request->validate([
'name' => 'required',
'email' => 'required|email|unique:users,email,'.$id,
'password' => 'same:confirm-password',
From 83efeeff23922337a2416e25deb7daf12613feec Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:50 +0000
Subject: [PATCH 097/127] Use `Gate` facade for controller authorization
---
app/Http/Controllers/Api/Controller.php | 3 +--
app/Http/Controllers/Controller.php | 2 --
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php
index f123d984..b18e5d58 100644
--- a/app/Http/Controllers/Api/Controller.php
+++ b/app/Http/Controllers/Api/Controller.php
@@ -2,11 +2,10 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
- use AuthorizesRequests, DispatchesJobs;
+ use DispatchesJobs;
}
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 62f1dd97..0fe932d2 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,10 +2,8 @@
namespace App\Http\Controllers;
-use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller as BaseController;
abstract class Controller extends BaseController
{
- use AuthorizesRequests;
}
From 00e4152f84efaf0249b7f019eccf82a44ecd9542 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:52 +0000
Subject: [PATCH 098/127] Modernize controller middleware
---
.../Api/Auth/VerificationController.php | 15 ++++++++++++---
.../Auth/ForgotPasswordController.php | 15 +++++++--------
app/Http/Controllers/Auth/LoginController.php | 15 +++++++--------
.../Controllers/Auth/RegisterController.php | 15 +++++++--------
.../Auth/ResetPasswordController.php | 15 +++++++--------
.../Auth/VerificationController.php | 19 +++++++++----------
app/Http/Controllers/HomeController.php | 15 +++++++--------
7 files changed, 56 insertions(+), 53 deletions(-)
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index 46e4d875..df5bdd61 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers\Api\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Auth\Events\Verified;
@@ -13,7 +15,7 @@
* @group Api\Auth\VerificationController
* User verification functions
*/
-class VerificationController extends Controller
+class VerificationController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -43,11 +45,18 @@ class VerificationController extends Controller
public function __construct()
{
// $this->middleware('auth');
- $this->middleware('signed')->only('verify');
- $this->middleware('throttle:10,1')->only('verify');
+
$this->redirectTo = env('WEBAPP_URL', '/').env('WEBAPP_EMAIL_VERIFY_URL', 'login').'?msg=email_verified';
}
+ public static function middleware(): array
+ {
+ return [
+ new Middleware('signed', only: ['verify']),
+ new Middleware('throttle:10,1', only: ['verify']),
+ ];
+ }
+
/**
* Show the email verification notice.
*/
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 6a247fef..643b0c5a 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -2,10 +2,12 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
-class ForgotPasswordController extends Controller
+class ForgotPasswordController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -20,13 +22,10 @@ class ForgotPasswordController extends Controller
use SendsPasswordResetEmails;
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('guest');
+ return [
+ 'guest',
+ ];
}
}
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index e6139d8a..234fa292 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -2,12 +2,14 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\RedirectResponse;
-class LoginController extends Controller
+class LoginController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -29,14 +31,11 @@ class LoginController extends Controller
*/
protected $redirectTo = '/home';
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('guest')->except('logout');
+ return [
+ new Middleware('guest', except: ['logout']),
+ ];
}
public function logout(): RedirectResponse
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index f4fc9ca6..39af892b 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -2,6 +2,8 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
@@ -9,7 +11,7 @@
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
-class RegisterController extends Controller
+class RegisterController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -31,14 +33,11 @@ class RegisterController extends Controller
*/
protected $redirectTo = '/home';
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('guest');
+ return [
+ 'guest',
+ ];
}
/**
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index cf726eec..f6b77541 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -2,10 +2,12 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
-class ResetPasswordController extends Controller
+class ResetPasswordController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -27,13 +29,10 @@ class ResetPasswordController extends Controller
*/
protected $redirectTo = '/home';
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('guest');
+ return [
+ 'guest',
+ ];
}
}
diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php
index 89491214..37b6146f 100644
--- a/app/Http/Controllers/Auth/VerificationController.php
+++ b/app/Http/Controllers/Auth/VerificationController.php
@@ -2,10 +2,12 @@
namespace App\Http\Controllers\Auth;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
-class VerificationController extends Controller
+class VerificationController extends Controller implements HasMiddleware
{
/*
|--------------------------------------------------------------------------
@@ -27,15 +29,12 @@ class VerificationController extends Controller
*/
protected $redirectTo = '/home';
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('auth');
- $this->middleware('signed')->only('verify');
- $this->middleware('throttle:10,1')->only('verify', 'resend');
+ return [
+ 'auth',
+ new Middleware('signed', only: ['verify']),
+ new Middleware('throttle:10,1', only: ['verify', 'resend']),
+ ];
}
}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 15ca6916..158fad6e 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -2,18 +2,17 @@
namespace App\Http\Controllers;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
use Illuminate\View\View;
-class HomeController extends Controller
+class HomeController extends Controller implements HasMiddleware
{
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public static function middleware(): array
{
- $this->middleware('auth');
+ return [
+ 'auth',
+ ];
}
/**
From 6a67ffa5d8095da42a0c2856fc561a69e5c46aef Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:52 +0000
Subject: [PATCH 099/127] Dispatch jobs directly
---
app/Http/Controllers/Api/Controller.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php
index b18e5d58..31c5ec66 100644
--- a/app/Http/Controllers/Api/Controller.php
+++ b/app/Http/Controllers/Api/Controller.php
@@ -2,10 +2,8 @@
namespace App\Http\Controllers\Api;
-use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
- use DispatchesJobs;
}
From f8d5d2bf03f1ee7210735e3d2a01cef2d52bd55f Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:52 +0000
Subject: [PATCH 100/127] Remove base controller inheritance
---
app/Http/Controllers/Controller.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 0fe932d2..23dad80d 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,8 +2,7 @@
namespace App\Http\Controllers;
-use Illuminate\Routing\Controller as BaseController;
-abstract class Controller extends BaseController
+abstract class Controller
{
}
From c28070c4571f8e847f9db4b1dbdb4dcd28ebc342 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:57 +0000
Subject: [PATCH 101/127] Default config files
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
---
config/filesystems.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/config/filesystems.php b/config/filesystems.php
index db170670..76691d64 100644
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -7,6 +7,8 @@
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
+ 'serve' => true,
+ 'report' => false,
],
'icons' => [
@@ -38,6 +40,7 @@
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
'throw' => false,
+ 'report' => false,
],
],
From 5e6ae1e727077d9b2e868554d3c75a7ce314024a Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:58 +0000
Subject: [PATCH 102/127] Shift `ENV` variables
---
.env.example | 4 +++-
phpunit.xml | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/.env.example b/.env.example
index 2ac2a2be..fea055f1 100644
--- a/.env.example
+++ b/.env.example
@@ -8,6 +8,8 @@ APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
+# PHP_CLI_SERVER_WORKERS=4
+
BCRYPT_ROUNDS=12
APP_LOCALE=en
@@ -67,7 +69,7 @@ MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=username
MAIL_PASSWORD=password
-MAIL_ENCRYPTION=tls
+MAIL_SCHEME=null
PUSHER_APP_ID=
PUSHER_KEY=
diff --git a/phpunit.xml b/phpunit.xml
index b0ab841d..4150c4ef 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -22,5 +22,7 @@
+
+
From 00c572ed473dd6f1d53bfa675b0bf86bc9f6a01e Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:58 +0000
Subject: [PATCH 103/127] Add Laravel `composer run` scripts
---
composer.json | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index c6fb412c..915927ac 100644
--- a/composer.json
+++ b/composer.json
@@ -42,7 +42,8 @@
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"phpunit/phpunit": "^10.5",
- "fakerphp/faker": "^1.23"
+ "fakerphp/faker": "^1.23",
+ "laravel/pail": "^1.2.2"
},
"config": {
"optimize-autoloader": true,
@@ -88,6 +89,25 @@
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
+ ],
+ "dev": [
+ "Composer\\Config::disableProcessTimeout",
+ "npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite --kill-others"
+ ],
+ "setup": [
+ "composer install",
+ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
+ "@php artisan key:generate",
+ "@php artisan migrate --force",
+ "npm install",
+ "npm run build"
+ ],
+ "test": [
+ "@php artisan config:clear --ansi",
+ "@php artisan test"
+ ],
+ "pre-package-uninstall": [
+ "Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
]
}
}
From 3bbba894441d7d22baa4b980f2b4a5c3d8ecb50c Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:58 +0000
Subject: [PATCH 104/127] Add `storage/app/private` folder
---
storage/app/.gitignore | 1 +
storage/app/private/.gitignore | 2 ++
2 files changed, 3 insertions(+)
create mode 100644 storage/app/private/.gitignore
diff --git a/storage/app/.gitignore b/storage/app/.gitignore
index 2768eca7..61db0864 100755
--- a/storage/app/.gitignore
+++ b/storage/app/.gitignore
@@ -1,4 +1,5 @@
*
+!private/
!public/
!.gitignore
!new_taxonomy_tables.sql
diff --git a/storage/app/private/.gitignore b/storage/app/private/.gitignore
new file mode 100644
index 00000000..d6b7ef32
--- /dev/null
+++ b/storage/app/private/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
From afaf0851aa2f5ab8a20d985167545a397bbb2eca Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:06:59 +0000
Subject: [PATCH 105/127] Bump Composer dependencies
---
composer.json | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/composer.json b/composer.json
index 915927ac..85af06ba 100644
--- a/composer.json
+++ b/composer.json
@@ -16,32 +16,32 @@
"require": {
"php": "^8.2",
"doctrine/dbal": "^3.5",
- "dyrynda/laravel-cascade-soft-deletes": "^4.4",
+ "dyrynda/laravel-cascade-soft-deletes": "^4.5",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
"guzzlehttp/guzzle": "^7.8",
"influxdata/influxdb-client-php": "3.6",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
- "laravel/framework": "^11.51",
- "laravel/tinker": "^2.9",
- "laravel/ui": "^4.4",
+ "laravel/framework": "^12.61",
+ "laravel/tinker": "^2.10.1",
+ "laravel/ui": "^4.6",
"league/flysystem-aws-s3-v3": "^3.0",
"mcamara/laravel-localization": "2.3.0",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
- "santigarcor/laratrust": "^8.3",
+ "santigarcor/laratrust": "^8.4",
"spatie/laravel-html": "^3.11",
"tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
"appzcoder/crud-generator": "^4.0",
- "barryvdh/laravel-debugbar": "^3.10",
+ "barryvdh/laravel-debugbar": "^3.15",
"filp/whoops": "^2.8",
- "knuckleswtf/scribe": "^4.33",
+ "knuckleswtf/scribe": "^5.0",
"mockery/mockery": "^1.6",
- "nunomaduro/collision": "^8.0",
- "phpunit/phpunit": "^10.5",
+ "nunomaduro/collision": "^8.6",
+ "phpunit/phpunit": "^11.5.3",
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.2.2"
},
From 075e31b1ad5d934c6bb425c341526ba46887332a Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:07:09 +0000
Subject: [PATCH 106/127] Adopt Laravel type hints
---
app/User.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/User.php b/app/User.php
index dac59f72..def7aee6 100644
--- a/app/User.php
+++ b/app/User.php
@@ -374,7 +374,7 @@ public function allApiaries()
});
}
- public function groupInvitations()
+ public function groupInvitations(): BelongsToMany
{
$user_id = $this->id;
From 44d09f9390c74d5a7e1828f451b4480c1cb5428e Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 10:07:14 +0000
Subject: [PATCH 107/127] Shift cleanup
---
.../Api/Auth/VerificationController.php | 4 ++--
app/Http/Controllers/Api/Controller.php | 4 +---
.../Auth/ForgotPasswordController.php | 3 +--
app/Http/Controllers/Auth/LoginController.php | 4 ++--
.../Controllers/Auth/RegisterController.php | 3 +--
.../Auth/ResetPasswordController.php | 3 +--
.../Auth/VerificationController.php | 4 ++--
.../Controllers/CategoryInputsController.php | 24 +++++++++----------
app/Http/Controllers/Controller.php | 5 +---
app/Http/Controllers/HomeController.php | 1 -
10 files changed, 23 insertions(+), 32 deletions(-)
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index df5bdd61..4fdd8440 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -2,14 +2,14 @@
namespace App\Http\Controllers\Api\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
/**
* @group Api\Auth\VerificationController
diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php
index 31c5ec66..56d6aced 100644
--- a/app/Http/Controllers/Api/Controller.php
+++ b/app/Http/Controllers/Api/Controller.php
@@ -4,6 +4,4 @@
use Illuminate\Routing\Controller as BaseController;
-class Controller extends BaseController
-{
-}
+class Controller extends BaseController {}
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 643b0c5a..44f05350 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -2,10 +2,9 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
+use Illuminate\Routing\Controllers\HasMiddleware;
class ForgotPasswordController extends Controller implements HasMiddleware
{
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 234fa292..8f53c4bc 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -2,12 +2,12 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\RedirectResponse;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
class LoginController extends Controller implements HasMiddleware
{
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 39af892b..34670213 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -2,11 +2,10 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
+use Illuminate\Routing\Controllers\HasMiddleware;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index f6b77541..f29597f1 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -2,10 +2,9 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
+use Illuminate\Routing\Controllers\HasMiddleware;
class ResetPasswordController extends Controller implements HasMiddleware
{
diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php
index 37b6146f..7a8356ae 100644
--- a/app/Http/Controllers/Auth/VerificationController.php
+++ b/app/Http/Controllers/Auth/VerificationController.php
@@ -2,10 +2,10 @@
namespace App\Http\Controllers\Auth;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
+use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Controllers\Middleware;
class VerificationController extends Controller implements HasMiddleware
{
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index ca0f413f..021bf6fb 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -46,12 +46,12 @@ public function create(): View
public function store(Request $request): RedirectResponse
{
$request->validate([
- 'name' => 'required|string',
- 'type' => 'required|string|unique:category_inputs',
- 'min' => 'nullable|integer',
- 'max' => 'nullable|integer',
- 'decimals' => 'nullable|integer',
- ]);
+ 'name' => 'required|string',
+ 'type' => 'required|string|unique:category_inputs',
+ 'min' => 'nullable|integer',
+ 'max' => 'nullable|integer',
+ 'decimals' => 'nullable|integer',
+ ]);
$requestData = $request->all();
@@ -88,12 +88,12 @@ public function edit(int $id): View
public function update(Request $request, int $id): RedirectResponse
{
$request->validate([
- 'name' => 'required|string',
- 'type' => Rule::unique('category_inputs')->ignore($id),
- 'min' => 'nullable|integer',
- 'max' => 'nullable|integer',
- 'decimals' => 'nullable|integer',
- ]);
+ 'name' => 'required|string',
+ 'type' => Rule::unique('category_inputs')->ignore($id),
+ 'min' => 'nullable|integer',
+ 'max' => 'nullable|integer',
+ 'decimals' => 'nullable|integer',
+ ]);
$categoryinput = CategoryInput::findOrFail($id);
$requestData = $request->all();
diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php
index 23dad80d..2e8af07a 100644
--- a/app/Http/Controllers/Controller.php
+++ b/app/Http/Controllers/Controller.php
@@ -2,7 +2,4 @@
namespace App\Http\Controllers;
-
-abstract class Controller
-{
-}
+abstract class Controller {}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 158fad6e..8788b96a 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -3,7 +3,6 @@
namespace App\Http\Controllers;
use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
use Illuminate\View\View;
class HomeController extends Controller implements HasMiddleware
From ce238e024d9ecbeb5c4222be7018ed9c79ba72a1 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 13:26:42 +0200
Subject: [PATCH 108/127] migrate knuckleswtf/scribe to v5 (+move from
require-dev to require dependencies) + fix GET groups 500 error - remove
BelongsToMany return type (revert Laravel type hints)
---
app/User.php | 2 +-
composer.json | 3 +-
composer.lock | 2463 +++++++++++++++++++++++++--------------------
config/scribe.php | 94 +-
4 files changed, 1394 insertions(+), 1168 deletions(-)
diff --git a/app/User.php b/app/User.php
index def7aee6..dac59f72 100644
--- a/app/User.php
+++ b/app/User.php
@@ -374,7 +374,7 @@ public function allApiaries()
});
}
- public function groupInvitations(): BelongsToMany
+ public function groupInvitations()
{
$user_id = $this->id;
diff --git a/composer.json b/composer.json
index 85af06ba..575a6091 100644
--- a/composer.json
+++ b/composer.json
@@ -21,8 +21,10 @@
"fightbulc/moment": "*",
"guzzlehttp/guzzle": "^7.8",
"influxdata/influxdb-client-php": "3.6",
+ "influxdb/influxdb-php": "^1.15",
"intervention/image": "^2.4.2",
"kalnoy/nestedset": "^6.0",
+ "knuckleswtf/scribe": "5.0",
"laravel/framework": "^12.61",
"laravel/tinker": "^2.10.1",
"laravel/ui": "^4.6",
@@ -38,7 +40,6 @@
"appzcoder/crud-generator": "^4.0",
"barryvdh/laravel-debugbar": "^3.15",
"filp/whoops": "^2.8",
- "knuckleswtf/scribe": "^5.0",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3",
diff --git a/composer.lock b/composer.lock
index be0a20c7..ad823236 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "0d6c61c0640fad2087ae7e47b6d99cd4",
+ "content-hash": "ef50badebd5e646640047360ae7d7ad8",
"packages": [
{
"name": "aws/aws-crt-php",
@@ -1168,6 +1168,56 @@
},
"time": "2016-07-14T12:33:35+00:00"
},
+ {
+ "name": "erusev/parsedown",
+ "version": "1.7.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/erusev/parsedown.git",
+ "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
+ "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Parsedown": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
+ }
+ ],
+ "description": "Parser for Markdown.",
+ "homepage": "http://parsedown.org",
+ "keywords": [
+ "markdown",
+ "parser"
+ ],
+ "support": {
+ "issues": "https://github.com/erusev/parsedown/issues",
+ "source": "https://github.com/erusev/parsedown/tree/1.7.x"
+ },
+ "time": "2019-12-30T22:54:17+00:00"
+ },
{
"name": "ezyang/htmlpurifier",
"version": "v4.19.0",
@@ -1229,6 +1279,69 @@
},
"time": "2025-10-17T16:34:55+00:00"
},
+ {
+ "name": "fakerphp/faker",
+ "version": "v1.24.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FakerPHP/Faker.git",
+ "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
+ "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0",
+ "psr/container": "^1.0 || ^2.0",
+ "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ },
+ "conflict": {
+ "fzaninotto/faker": "*"
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.4.1",
+ "doctrine/persistence": "^1.3 || ^2.0",
+ "ext-intl": "*",
+ "phpunit/phpunit": "^9.5.26",
+ "symfony/phpunit-bridge": "^5.4.16"
+ },
+ "suggest": {
+ "doctrine/orm": "Required to use Faker\\ORM\\Doctrine",
+ "ext-curl": "Required by Faker\\Provider\\Image to download images.",
+ "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.",
+ "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.",
+ "ext-mbstring": "Required for multibyte Unicode string functionality."
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Faker\\": "src/Faker/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "François Zaninotto"
+ }
+ ],
+ "description": "Faker is a PHP library that generates fake data for you.",
+ "keywords": [
+ "data",
+ "faker",
+ "fixtures"
+ ],
+ "support": {
+ "issues": "https://github.com/FakerPHP/Faker/issues",
+ "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1"
+ },
+ "time": "2024-11-21T13:46:39+00:00"
+ },
{
"name": "fightbulc/moment",
"version": "1.35.0",
@@ -1286,6 +1399,77 @@
},
"time": "2025-07-27T08:46:28+00:00"
},
+ {
+ "name": "filp/whoops",
+ "version": "2.18.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/filp/whoops.git",
+ "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d",
+ "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0",
+ "psr/log": "^1.0.1 || ^2.0 || ^3.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.0",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3",
+ "symfony/var-dumper": "^4.0 || ^5.0"
+ },
+ "suggest": {
+ "symfony/var-dumper": "Pretty print complex values better with var-dumper available",
+ "whoops/soap": "Formats errors as SOAP responses"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Whoops\\": "src/Whoops/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Filipe Dobreira",
+ "homepage": "https://github.com/filp",
+ "role": "Developer"
+ }
+ ],
+ "description": "php error handling for cool kids",
+ "homepage": "https://filp.github.io/whoops/",
+ "keywords": [
+ "error",
+ "exception",
+ "handling",
+ "library",
+ "throwable",
+ "whoops"
+ ],
+ "support": {
+ "issues": "https://github.com/filp/whoops/issues",
+ "source": "https://github.com/filp/whoops/tree/2.18.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/denis-sokolov",
+ "type": "github"
+ }
+ ],
+ "time": "2025-08-08T12:00:00+00:00"
+ },
{
"name": "fruitcake/php-cors",
"version": "v1.4.0",
@@ -2035,26 +2219,26 @@
},
{
"name": "kalnoy/nestedset",
- "version": "v6.0.7",
+ "version": "v6.0.6",
"source": {
"type": "git",
"url": "https://github.com/lazychaser/laravel-nestedset.git",
- "reference": "e73b872bc9c5419512e5b69829c0ba09d2dd6b2b"
+ "reference": "3cfc56a9759fb592bc903056166bfc0867f9e679"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/e73b872bc9c5419512e5b69829c0ba09d2dd6b2b",
- "reference": "e73b872bc9c5419512e5b69829c0ba09d2dd6b2b",
+ "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/3cfc56a9759fb592bc903056166bfc0867f9e679",
+ "reference": "3cfc56a9759fb592bc903056166bfc0867f9e679",
"shasum": ""
},
"require": {
- "illuminate/database": ">=7.0,<=12.0",
- "illuminate/events": ">=7.0,<=12.0",
- "illuminate/support": ">=7.0,<=12.0",
+ "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/events": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
"php": "^8.0"
},
"require-dev": {
- "phpunit/phpunit": ">=7.0"
+ "phpunit/phpunit": "7.*|8.*|9.*|^10.5"
},
"type": "library",
"extra": {
@@ -2092,9 +2276,9 @@
],
"support": {
"issues": "https://github.com/lazychaser/laravel-nestedset/issues",
- "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.7"
+ "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.6"
},
- "time": "2026-04-11T13:39:46+00:00"
+ "time": "2025-04-22T19:38:02+00:00"
},
{
"name": "kkszymanowski/traitor",
@@ -2147,92 +2331,189 @@
"time": "2024-01-29T09:23:11+00:00"
},
{
- "name": "laravel/framework",
- "version": "v11.54.0",
+ "name": "knuckleswtf/scribe",
+ "version": "5.0.0",
"source": {
"type": "git",
- "url": "https://github.com/laravel/framework.git",
- "reference": "4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58"
+ "url": "https://github.com/knuckleswtf/scribe.git",
+ "reference": "c5e567728ef85ea4af28f4c264dc1ef2293d7e32"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58",
- "reference": "4e7ae67eedd803eaea8ceb5f7e113f495d2c0c58",
+ "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/c5e567728ef85ea4af28f4c264dc1ef2293d7e32",
+ "reference": "c5e567728ef85ea4af28f4c264dc1ef2293d7e32",
"shasum": ""
},
"require": {
- "brick/math": "^0.9.3|^0.10.2|^0.11|^0.12|^0.13|^0.14",
- "composer-runtime-api": "^2.2",
- "doctrine/inflector": "^2.0.5",
- "dragonmantank/cron-expression": "^3.4",
- "egulias/email-validator": "^3.2.1|^4.0",
- "ext-ctype": "*",
- "ext-filter": "*",
- "ext-hash": "*",
- "ext-mbstring": "*",
- "ext-openssl": "*",
- "ext-session": "*",
- "ext-tokenizer": "*",
- "fruitcake/php-cors": "^1.3",
- "guzzlehttp/guzzle": "^7.8.2",
- "guzzlehttp/uri-template": "^1.0",
- "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0",
- "laravel/serializable-closure": "^1.3|^2.0",
- "league/commonmark": "^2.7",
- "league/flysystem": "^3.25.1",
- "league/flysystem-local": "^3.25.1",
- "league/uri": "^7.5.1",
- "monolog/monolog": "^3.0",
- "nesbot/carbon": "^2.72.6|^3.8.4",
- "nunomaduro/termwind": "^2.0",
- "php": "^8.2",
- "psr/container": "^1.1.1|^2.0.1",
- "psr/log": "^1.0|^2.0|^3.0",
- "psr/simple-cache": "^1.0|^2.0|^3.0",
- "ramsey/uuid": "^4.7",
- "symfony/console": "^7.0.3",
- "symfony/error-handler": "^7.0.3",
- "symfony/finder": "^7.0.3",
- "symfony/http-foundation": "^7.2.0",
- "symfony/http-kernel": "^7.0.3",
- "symfony/mailer": "^7.0.3",
- "symfony/mime": "^7.0.3",
- "symfony/polyfill-php83": "^1.31",
- "symfony/process": "^7.0.3",
- "symfony/routing": "^7.0.3",
- "symfony/uid": "^7.0.3",
- "symfony/var-dumper": "^7.0.3",
- "tijsverkoyen/css-to-inline-styles": "^2.2.5",
- "vlucas/phpdotenv": "^5.6.1",
- "voku/portable-ascii": "^2.0.2"
+ "erusev/parsedown": "1.7.4",
+ "ext-fileinfo": "*",
+ "ext-json": "*",
+ "ext-pdo": "*",
+ "fakerphp/faker": "^1.23.1",
+ "laravel/framework": "^9.0|^10.0|^11.0|^12.0",
+ "league/flysystem": "^3.0",
+ "mpociot/reflection-docblock": "^1.0.1",
+ "nikic/php-parser": "^5.0",
+ "nunomaduro/collision": "^6.0|^7.0|^8.0",
+ "php": ">=8.1",
+ "ramsey/uuid": "^4.2.2",
+ "shalvah/clara": "^3.1.0",
+ "shalvah/upgrader": ">=0.6.0",
+ "spatie/data-transfer-object": "^2.6|^3.0",
+ "symfony/var-exporter": "^6.0|^7.0",
+ "symfony/yaml": "^6.0|^7.0"
},
- "conflict": {
- "tightenco/collect": "<5.5.33"
+ "replace": {
+ "mpociot/laravel-apidoc-generator": "*"
},
- "provide": {
- "psr/container-implementation": "1.1|2.0",
- "psr/log-implementation": "1.0|2.0|3.0",
- "psr/simple-cache-implementation": "1.0|2.0|3.0"
+ "require-dev": {
+ "dms/phpunit-arraysubset-asserts": "^v0.5.0",
+ "laravel/legacy-factories": "^1.3.0",
+ "league/fractal": "^0.20",
+ "nikic/fast-route": "^1.3",
+ "orchestra/testbench": "^7.0|^8.0|^v9.10.0",
+ "pestphp/pest": "^1.21|^2.0|^3.0",
+ "phpstan/phpstan": "^2.1.5",
+ "phpunit/phpunit": "^9.0|^10.0",
+ "spatie/ray": "^1.41",
+ "symfony/css-selector": "^6.0",
+ "symfony/dom-crawler": "^6.0"
},
- "replace": {
- "illuminate/auth": "self.version",
- "illuminate/broadcasting": "self.version",
- "illuminate/bus": "self.version",
- "illuminate/cache": "self.version",
- "illuminate/collections": "self.version",
- "illuminate/concurrency": "self.version",
- "illuminate/conditionable": "self.version",
- "illuminate/config": "self.version",
- "illuminate/console": "self.version",
- "illuminate/container": "self.version",
- "illuminate/contracts": "self.version",
- "illuminate/cookie": "self.version",
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Knuckles\\Scribe\\ScribeServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/Config/helpers.php"
+ ],
+ "psr-4": {
+ "Knuckles\\Camel\\": "camel/",
+ "Knuckles\\Scribe\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Shalvah"
+ }
+ ],
+ "description": "Generate API documentation for humans from your Laravel codebase.✍",
+ "homepage": "http://github.com/knuckleswtf/scribe",
+ "keywords": [
+ "api",
+ "documentation",
+ "laravel"
+ ],
+ "support": {
+ "issues": "https://github.com/knuckleswtf/scribe/issues",
+ "source": "https://github.com/knuckleswtf/scribe/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://patreon.com/shalvah",
+ "type": "patreon"
+ }
+ ],
+ "time": "2025-02-19T10:32:40+00:00"
+ },
+ {
+ "name": "laravel/framework",
+ "version": "v12.61.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/framework.git",
+ "reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/1124062a1ca92d290c8bcb9b7f649920fa6816bf",
+ "reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf",
+ "shasum": ""
+ },
+ "require": {
+ "brick/math": "^0.11|^0.12|^0.13|^0.14",
+ "composer-runtime-api": "^2.2",
+ "doctrine/inflector": "^2.0.5",
+ "dragonmantank/cron-expression": "^3.4",
+ "egulias/email-validator": "^3.2.1|^4.0",
+ "ext-ctype": "*",
+ "ext-filter": "*",
+ "ext-hash": "*",
+ "ext-mbstring": "*",
+ "ext-openssl": "*",
+ "ext-session": "*",
+ "ext-tokenizer": "*",
+ "fruitcake/php-cors": "^1.3",
+ "guzzlehttp/guzzle": "^7.8.2",
+ "guzzlehttp/uri-template": "^1.0",
+ "laravel/prompts": "^0.3.0",
+ "laravel/serializable-closure": "^1.3|^2.0",
+ "league/commonmark": "^2.8.1",
+ "league/flysystem": "^3.25.1",
+ "league/flysystem-local": "^3.25.1",
+ "league/uri": "^7.5.1",
+ "monolog/monolog": "^3.0",
+ "nesbot/carbon": "^3.8.4",
+ "nunomaduro/termwind": "^2.0",
+ "php": "^8.2",
+ "psr/container": "^1.1.1|^2.0.1",
+ "psr/log": "^1.0|^2.0|^3.0",
+ "psr/simple-cache": "^1.0|^2.0|^3.0",
+ "ramsey/uuid": "^4.7",
+ "symfony/console": "^7.2.0",
+ "symfony/error-handler": "^7.2.0",
+ "symfony/finder": "^7.2.0",
+ "symfony/http-foundation": "^7.2.0",
+ "symfony/http-kernel": "^7.2.0",
+ "symfony/mailer": "^7.2.0",
+ "symfony/mime": "^7.2.0",
+ "symfony/polyfill-php83": "^1.33",
+ "symfony/polyfill-php84": "^1.34",
+ "symfony/polyfill-php85": "^1.34",
+ "symfony/process": "^7.2.0",
+ "symfony/routing": "^7.2.0",
+ "symfony/uid": "^7.2.0",
+ "symfony/var-dumper": "^7.2.0",
+ "tijsverkoyen/css-to-inline-styles": "^2.2.5",
+ "vlucas/phpdotenv": "^5.6.1",
+ "voku/portable-ascii": "^2.0.2"
+ },
+ "conflict": {
+ "tightenco/collect": "<5.5.33"
+ },
+ "provide": {
+ "psr/container-implementation": "1.1|2.0",
+ "psr/log-implementation": "1.0|2.0|3.0",
+ "psr/simple-cache-implementation": "1.0|2.0|3.0"
+ },
+ "replace": {
+ "illuminate/auth": "self.version",
+ "illuminate/broadcasting": "self.version",
+ "illuminate/bus": "self.version",
+ "illuminate/cache": "self.version",
+ "illuminate/collections": "self.version",
+ "illuminate/concurrency": "self.version",
+ "illuminate/conditionable": "self.version",
+ "illuminate/config": "self.version",
+ "illuminate/console": "self.version",
+ "illuminate/container": "self.version",
+ "illuminate/contracts": "self.version",
+ "illuminate/cookie": "self.version",
"illuminate/database": "self.version",
"illuminate/encryption": "self.version",
"illuminate/events": "self.version",
"illuminate/filesystem": "self.version",
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
+ "illuminate/json-schema": "self.version",
"illuminate/log": "self.version",
"illuminate/macroable": "self.version",
"illuminate/mail": "self.version",
@@ -2242,6 +2523,7 @@
"illuminate/process": "self.version",
"illuminate/queue": "self.version",
"illuminate/redis": "self.version",
+ "illuminate/reflection": "self.version",
"illuminate/routing": "self.version",
"illuminate/session": "self.version",
"illuminate/support": "self.version",
@@ -2265,17 +2547,18 @@
"league/flysystem-read-only": "^3.25.1",
"league/flysystem-sftp-v3": "^3.25.1",
"mockery/mockery": "^1.6.10",
- "orchestra/testbench-core": "^9.18.0",
- "pda/pheanstalk": "^5.0.6",
+ "opis/json-schema": "^2.4.1",
+ "orchestra/testbench-core": "^10.9.0",
+ "pda/pheanstalk": "^5.0.6|^7.0.0",
"php-http/discovery": "^1.15",
- "phpstan/phpstan": "2.1.41",
- "phpunit/phpunit": "^10.5.35|^11.3.6|^12.0.1",
- "predis/predis": "^2.3",
- "resend/resend-php": "^0.10.0",
- "symfony/cache": "^7.0.3",
- "symfony/http-client": "^7.0.3",
- "symfony/psr-http-message-bridge": "^7.0.3",
- "symfony/translation": "^7.0.3"
+ "phpstan/phpstan": "^2.1.41",
+ "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1",
+ "predis/predis": "^2.3|^3.0",
+ "resend/resend-php": "^0.10.0|^1.0",
+ "symfony/cache": "^7.2.0",
+ "symfony/http-client": "^7.2.0",
+ "symfony/psr-http-message-bridge": "^7.2.0",
+ "symfony/translation": "^7.2.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
@@ -2290,7 +2573,7 @@
"ext-pdo": "Required to use all database features.",
"ext-posix": "Required to use all features of the queue worker.",
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).",
- "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
+ "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).",
@@ -2301,22 +2584,22 @@
"mockery/mockery": "Required to use mocking (^1.6).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).",
"php-http/discovery": "Required to use PSR-7 bridging features (^1.15).",
- "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.3.6|^12.0.1).",
- "predis/predis": "Required to use the predis connector (^2.3).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).",
+ "predis/predis": "Required to use the predis connector (^2.3|^3.0).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
- "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^7.0).",
- "symfony/filesystem": "Required to enable support for relative symbolic links (^7.0).",
- "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.0).",
- "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.0).",
- "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.0).",
- "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.0)."
+ "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0|^1.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^7.2).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).",
+ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).",
+ "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.2).",
+ "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.2).",
+ "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "11.x-dev"
+ "dev-master": "12.x-dev"
}
},
"autoload": {
@@ -2327,6 +2610,7 @@
"src/Illuminate/Filesystem/functions.php",
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Log/functions.php",
+ "src/Illuminate/Reflection/helpers.php",
"src/Illuminate/Support/functions.php",
"src/Illuminate/Support/helpers.php"
],
@@ -2335,7 +2619,8 @@
"Illuminate\\Support\\": [
"src/Illuminate/Macroable/",
"src/Illuminate/Collections/",
- "src/Illuminate/Conditionable/"
+ "src/Illuminate/Conditionable/",
+ "src/Illuminate/Reflection/"
]
}
},
@@ -2359,7 +2644,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2026-05-26T23:41:51+00:00"
+ "time": "2026-05-26T23:41:33+00:00"
},
{
"name": "laravel/prompts",
@@ -3655,6 +3940,59 @@
],
"time": "2026-01-02T08:56:05+00:00"
},
+ {
+ "name": "mpociot/reflection-docblock",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mpociot/reflection-docblock.git",
+ "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mpociot/reflection-docblock/zipball/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587",
+ "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+ "suggest": {
+ "dflydev/markdown": "~1.0",
+ "erusev/parsedown": "~1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Mpociot": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "mike.vanriel@naenius.com"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/mpociot/reflection-docblock/issues",
+ "source": "https://github.com/mpociot/reflection-docblock/tree/master"
+ },
+ "time": "2016-06-20T20:53:12+00:00"
+ },
{
"name": "mtdowling/jmespath.php",
"version": "2.8.0",
@@ -4042,6 +4380,102 @@
},
"time": "2025-12-06T11:56:16+00:00"
},
+ {
+ "name": "nunomaduro/collision",
+ "version": "v8.9.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nunomaduro/collision.git",
+ "reference": "716af8f95a470e9094cfca09ed897b023be191a5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nunomaduro/collision/zipball/716af8f95a470e9094cfca09ed897b023be191a5",
+ "reference": "716af8f95a470e9094cfca09ed897b023be191a5",
+ "shasum": ""
+ },
+ "require": {
+ "filp/whoops": "^2.18.4",
+ "nunomaduro/termwind": "^2.4.0",
+ "php": "^8.2.0",
+ "symfony/console": "^7.4.8 || ^8.0.8"
+ },
+ "conflict": {
+ "laravel/framework": "<11.48.0 || >=14.0.0",
+ "phpunit/phpunit": "<11.5.50 || >=14.0.0"
+ },
+ "require-dev": {
+ "brianium/paratest": "^7.8.5",
+ "larastan/larastan": "^3.9.6",
+ "laravel/framework": "^11.48.0 || ^12.56.0 || ^13.5.0",
+ "laravel/pint": "^1.29.1",
+ "orchestra/testbench-core": "^9.12.0 || ^10.12.1 || ^11.2.1",
+ "pestphp/pest": "^3.8.5 || ^4.4.3 || ^5.0.0",
+ "sebastian/environment": "^7.2.1 || ^8.0.4 || ^9.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider"
+ ]
+ },
+ "branch-alias": {
+ "dev-8.x": "8.x-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "./src/Adapters/Phpunit/Autoload.php"
+ ],
+ "psr-4": {
+ "NunoMaduro\\Collision\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nuno Maduro",
+ "email": "enunomaduro@gmail.com"
+ }
+ ],
+ "description": "Cli error handling for console/command-line PHP applications.",
+ "keywords": [
+ "artisan",
+ "cli",
+ "command-line",
+ "console",
+ "dev",
+ "error",
+ "handling",
+ "laravel",
+ "laravel-zero",
+ "php",
+ "symfony"
+ ],
+ "support": {
+ "issues": "https://github.com/nunomaduro/collision/issues",
+ "source": "https://github.com/nunomaduro/collision"
+ },
+ "funding": [
+ {
+ "url": "https://www.paypal.com/paypalme/enunomaduro",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/nunomaduro",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/nunomaduro",
+ "type": "patreon"
+ }
+ ],
+ "time": "2026-04-21T14:04:20+00:00"
+ },
{
"name": "nunomaduro/termwind",
"version": "v2.4.0",
@@ -5512,28 +5946,197 @@
"time": "2026-03-06T14:10:22+00:00"
},
{
- "name": "spatie/laravel-html",
- "version": "3.13.0",
+ "name": "shalvah/clara",
+ "version": "3.3.0",
"source": {
"type": "git",
- "url": "https://github.com/spatie/laravel-html.git",
- "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25"
+ "url": "https://github.com/shalvah/clara.git",
+ "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/laravel-html/zipball/0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
- "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
+ "url": "https://api.github.com/repos/shalvah/clara/zipball/6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
+ "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
"shasum": ""
},
"require": {
- "illuminate/http": "^10.0|^11.0|^12.0|^13.0",
- "illuminate/support": "^10.0|^11.0|^12.0|^13.0",
- "php": "^8.2"
+ "php": ">=7.4",
+ "symfony/console": "^4.0|^5.0|^6.0|^7.0"
},
"require-dev": {
- "mockery/mockery": "^1.3",
- "orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
- "pestphp/pest": "^2.34|^3.7|^4.0"
+ "eloquent/phony-phpunit": "^7.0",
+ "phpunit/phpunit": "^9.1"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "helpers.php"
+ ],
+ "psr-4": {
+ "Shalvah\\Clara\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "🔊 Simple, pretty, testable console output for CLI apps.",
+ "keywords": [
+ "cli",
+ "log",
+ "logging"
+ ],
+ "support": {
+ "issues": "https://github.com/shalvah/clara/issues",
+ "source": "https://github.com/shalvah/clara/tree/3.3.0"
+ },
+ "time": "2025-10-20T22:26:39+00:00"
+ },
+ {
+ "name": "shalvah/upgrader",
+ "version": "0.6.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/shalvah/upgrader.git",
+ "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/shalvah/upgrader/zipball/d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
+ "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/support": ">=8.0",
+ "nikic/php-parser": "^5.0",
+ "php": ">=8.0"
+ },
+ "require-dev": {
+ "dms/phpunit-arraysubset-asserts": "^0.2.0",
+ "pestphp/pest": "^1.21",
+ "phpstan/phpstan": "^1.0",
+ "spatie/ray": "^1.33"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Shalvah\\Upgrader\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Shalvah",
+ "email": "hello@shalvah.me"
+ }
+ ],
+ "description": "Create automatic upgrades for your package.",
+ "homepage": "http://github.com/shalvah/upgrader",
+ "keywords": [
+ "upgrade"
+ ],
+ "support": {
+ "issues": "https://github.com/shalvah/upgrader/issues",
+ "source": "https://github.com/shalvah/upgrader/tree/0.6.0"
+ },
+ "funding": [
+ {
+ "url": "https://patreon.com/shalvah",
+ "type": "patreon"
+ }
+ ],
+ "time": "2024-02-20T11:51:46+00:00"
+ },
+ {
+ "name": "spatie/data-transfer-object",
+ "version": "3.9.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/data-transfer-object.git",
+ "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
+ "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.0"
+ },
+ "require-dev": {
+ "illuminate/collections": "^8.36",
+ "jetbrains/phpstorm-attributes": "^1.0",
+ "larapack/dd": "^1.1",
+ "phpunit/phpunit": "^9.5.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Spatie\\DataTransferObject\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Brent Roose",
+ "email": "brent@spatie.be",
+ "homepage": "https://spatie.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "Data transfer objects with batteries included",
+ "homepage": "https://github.com/spatie/data-transfer-object",
+ "keywords": [
+ "data-transfer-object",
+ "spatie"
+ ],
+ "support": {
+ "issues": "https://github.com/spatie/data-transfer-object/issues",
+ "source": "https://github.com/spatie/data-transfer-object/tree/3.9.1"
+ },
+ "funding": [
+ {
+ "url": "https://spatie.be/open-source/support-us",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/spatie",
+ "type": "github"
+ }
+ ],
+ "abandoned": "spatie/laravel-data",
+ "time": "2022-09-16T13:34:38+00:00"
+ },
+ {
+ "name": "spatie/laravel-html",
+ "version": "3.13.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/spatie/laravel-html.git",
+ "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/spatie/laravel-html/zipball/0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
+ "reference": "0579bf41959b4c4068206ec9bf1fcd1b59d8fa25",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/http": "^10.0|^11.0|^12.0|^13.0",
+ "illuminate/support": "^10.0|^11.0|^12.0|^13.0",
+ "php": "^8.2"
+ },
+ "require-dev": {
+ "mockery/mockery": "^1.3",
+ "orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
+ "pestphp/pest": "^2.34|^3.7|^4.0"
},
"type": "library",
"extra": {
@@ -7321,6 +7924,86 @@
],
"time": "2026-05-26T12:51:13+00:00"
},
+ {
+ "name": "symfony/polyfill-php84",
+ "version": "v1.38.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php84.git",
+ "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa",
+ "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php84\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-26T12:51:13+00:00"
+ },
{
"name": "symfony/polyfill-php85",
"version": "v1.38.1",
@@ -8160,18 +8843,175 @@
"time": "2026-03-30T13:44:50+00:00"
},
{
- "name": "tijsverkoyen/css-to-inline-styles",
- "version": "v2.4.0",
+ "name": "symfony/var-exporter",
+ "version": "v7.4.9",
"source": {
"type": "git",
- "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
- "reference": "f0292ccf0ec75843d65027214426b6b163b48b41"
+ "url": "https://github.com/symfony/var-exporter.git",
+ "reference": "22e03a49c95ef054a43601cd159b222bfab1c701"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41",
- "reference": "f0292ccf0ec75843d65027214426b6b163b48b41",
- "shasum": ""
+ "url": "https://api.github.com/repos/symfony/var-exporter/zipball/22e03a49c95ef054a43601cd159b222bfab1c701",
+ "reference": "22e03a49c95ef054a43601cd159b222bfab1c701",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3"
+ },
+ "require-dev": {
+ "symfony/property-access": "^6.4|^7.0|^8.0",
+ "symfony/serializer": "^6.4|^7.0|^8.0",
+ "symfony/var-dumper": "^6.4|^7.0|^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\VarExporter\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Allows exporting any serializable PHP data structure to plain PHP code",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "clone",
+ "construct",
+ "export",
+ "hydrate",
+ "instantiate",
+ "lazy-loading",
+ "proxy",
+ "serialize"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/var-exporter/tree/v7.4.9"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-04-18T13:18:21+00:00"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v7.4.13",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
+ "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2",
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/polyfill-ctype": "^1.8"
+ },
+ "conflict": {
+ "symfony/console": "<6.4"
+ },
+ "require-dev": {
+ "symfony/console": "^6.4|^7.0|^8.0"
+ },
+ "bin": [
+ "Resources/bin/yaml-lint"
+ ],
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Loads and dumps YAML files",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/yaml/tree/v7.4.13"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-25T06:06:12+00:00"
+ },
+ {
+ "name": "tijsverkoyen/css-to-inline-styles",
+ "version": "v2.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
+ "reference": "f0292ccf0ec75843d65027214426b6b163b48b41"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41",
+ "reference": "f0292ccf0ec75843d65027214426b6b163b48b41",
+ "shasum": ""
},
"require": {
"ext-dom": "*",
@@ -8576,304 +9416,94 @@
"time": "2026-01-23T15:03:22+00:00"
},
{
- "name": "erusev/parsedown",
- "version": "1.7.4",
+ "name": "hamcrest/hamcrest-php",
+ "version": "v2.1.1",
"source": {
"type": "git",
- "url": "https://github.com/erusev/parsedown.git",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
+ "url": "https://github.com/hamcrest/hamcrest-php.git",
+ "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
+ "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487",
+ "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487",
"shasum": ""
},
"require": {
- "ext-mbstring": "*",
- "php": ">=5.3.0"
+ "php": "^7.4|^8.0"
+ },
+ "replace": {
+ "cordoval/hamcrest-php": "*",
+ "davedevelopment/hamcrest-php": "*",
+ "kodova/hamcrest-php": "*"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35"
+ "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0",
+ "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"type": "library",
- "autoload": {
- "psr-0": {
- "Parsedown": ""
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
}
},
+ "autoload": {
+ "classmap": [
+ "hamcrest"
+ ]
+ },
"notification-url": "https://packagist.org/downloads/",
"license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Emanuil Rusev",
- "email": "hello@erusev.com",
- "homepage": "http://erusev.com"
- }
+ "BSD-3-Clause"
],
- "description": "Parser for Markdown.",
- "homepage": "http://parsedown.org",
+ "description": "This is the PHP port of Hamcrest Matchers",
"keywords": [
- "markdown",
- "parser"
+ "test"
],
"support": {
- "issues": "https://github.com/erusev/parsedown/issues",
- "source": "https://github.com/erusev/parsedown/tree/1.7.x"
+ "issues": "https://github.com/hamcrest/hamcrest-php/issues",
+ "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1"
},
- "time": "2019-12-30T22:54:17+00:00"
+ "time": "2025-04-30T06:54:44+00:00"
},
{
- "name": "fakerphp/faker",
- "version": "v1.24.1",
+ "name": "laravel/breeze",
+ "version": "v2.4.2",
"source": {
"type": "git",
- "url": "https://github.com/FakerPHP/Faker.git",
- "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5"
+ "url": "https://github.com/laravel/breeze.git",
+ "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
- "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
+ "url": "https://api.github.com/repos/laravel/breeze/zipball/4f20e7b2cc8d25daa85d8647241a89c8e0930305",
+ "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305",
"shasum": ""
},
"require": {
- "php": "^7.4 || ^8.0",
- "psr/container": "^1.0 || ^2.0",
- "symfony/deprecation-contracts": "^2.2 || ^3.0"
- },
- "conflict": {
- "fzaninotto/faker": "*"
+ "illuminate/console": "^11.0|^12.0|^13.0",
+ "illuminate/filesystem": "^11.0|^12.0|^13.0",
+ "illuminate/support": "^11.0|^12.0|^13.0",
+ "illuminate/validation": "^11.0|^12.0|^13.0",
+ "php": "^8.2.0",
+ "symfony/console": "^7.0|^8.0"
},
"require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
- "doctrine/persistence": "^1.3 || ^2.0",
- "ext-intl": "*",
- "phpunit/phpunit": "^9.5.26",
- "symfony/phpunit-bridge": "^5.4.16"
- },
- "suggest": {
- "doctrine/orm": "Required to use Faker\\ORM\\Doctrine",
- "ext-curl": "Required by Faker\\Provider\\Image to download images.",
- "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.",
- "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.",
- "ext-mbstring": "Required for multibyte Unicode string functionality."
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Faker\\": "src/Faker/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "François Zaninotto"
- }
- ],
- "description": "Faker is a PHP library that generates fake data for you.",
- "keywords": [
- "data",
- "faker",
- "fixtures"
- ],
- "support": {
- "issues": "https://github.com/FakerPHP/Faker/issues",
- "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1"
- },
- "time": "2024-11-21T13:46:39+00:00"
- },
- {
- "name": "filp/whoops",
- "version": "2.18.4",
- "source": {
- "type": "git",
- "url": "https://github.com/filp/whoops.git",
- "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d",
- "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0",
- "psr/log": "^1.0.1 || ^2.0 || ^3.0"
- },
- "require-dev": {
- "mockery/mockery": "^1.0",
- "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3",
- "symfony/var-dumper": "^4.0 || ^5.0"
- },
- "suggest": {
- "symfony/var-dumper": "Pretty print complex values better with var-dumper available",
- "whoops/soap": "Formats errors as SOAP responses"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.7-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Whoops\\": "src/Whoops/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Filipe Dobreira",
- "homepage": "https://github.com/filp",
- "role": "Developer"
- }
- ],
- "description": "php error handling for cool kids",
- "homepage": "https://filp.github.io/whoops/",
- "keywords": [
- "error",
- "exception",
- "handling",
- "library",
- "throwable",
- "whoops"
- ],
- "support": {
- "issues": "https://github.com/filp/whoops/issues",
- "source": "https://github.com/filp/whoops/tree/2.18.4"
- },
- "funding": [
- {
- "url": "https://github.com/denis-sokolov",
- "type": "github"
- }
- ],
- "time": "2025-08-08T12:00:00+00:00"
- },
- {
- "name": "hamcrest/hamcrest-php",
- "version": "v2.1.1",
- "source": {
- "type": "git",
- "url": "https://github.com/hamcrest/hamcrest-php.git",
- "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487",
- "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487",
- "shasum": ""
- },
- "require": {
- "php": "^7.4|^8.0"
- },
- "replace": {
- "cordoval/hamcrest-php": "*",
- "davedevelopment/hamcrest-php": "*",
- "kodova/hamcrest-php": "*"
- },
- "require-dev": {
- "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0",
- "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.1-dev"
- }
- },
- "autoload": {
- "classmap": [
- "hamcrest"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "description": "This is the PHP port of Hamcrest Matchers",
- "keywords": [
- "test"
- ],
- "support": {
- "issues": "https://github.com/hamcrest/hamcrest-php/issues",
- "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1"
- },
- "time": "2025-04-30T06:54:44+00:00"
- },
- {
- "name": "knuckleswtf/scribe",
- "version": "4.40.0",
- "source": {
- "type": "git",
- "url": "https://github.com/knuckleswtf/scribe.git",
- "reference": "1ad707f229185bb2413ea9ed2fb01747abe78ff6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/1ad707f229185bb2413ea9ed2fb01747abe78ff6",
- "reference": "1ad707f229185bb2413ea9ed2fb01747abe78ff6",
- "shasum": ""
- },
- "require": {
- "erusev/parsedown": "1.7.4",
- "ext-fileinfo": "*",
- "ext-json": "*",
- "ext-pdo": "*",
- "fakerphp/faker": "^1.9.1",
- "illuminate/console": "^8.0|^9.0|^10.0|^11.0",
- "illuminate/routing": "^8.0|^9.0|^10.0|^11.0",
- "illuminate/support": "^8.0|^9.0|^10.0|^11.0",
- "league/flysystem": "^1.1.4|^2.1.1|^3.0",
- "mpociot/reflection-docblock": "^1.0.1",
- "nikic/php-parser": "^5.0",
- "nunomaduro/collision": "^5.10|^6.0|^7.0|^8.0",
- "php": ">=8.0",
- "ramsey/uuid": "^4.2.2",
- "shalvah/clara": "^3.1.0",
- "shalvah/upgrader": ">=0.6.0",
- "spatie/data-transfer-object": "^2.6|^3.0",
- "symfony/var-exporter": "^5.4|^6.0|^7.0",
- "symfony/yaml": "^5.4|^6.0|^7.0"
- },
- "replace": {
- "mpociot/laravel-apidoc-generator": "*"
- },
- "require-dev": {
- "brianium/paratest": "^6.0",
- "dms/phpunit-arraysubset-asserts": "^0.4",
- "laravel/legacy-factories": "^1.3.0",
- "laravel/lumen-framework": "^8.0|^9.0|^10.0",
- "league/fractal": "^0.20",
- "nikic/fast-route": "^1.3",
- "orchestra/testbench": "^6.0|^7.0|^8.0",
- "pestphp/pest": "^1.21",
- "phpstan/phpstan": "^1.0",
- "phpunit/phpunit": "^9.0|^10.0",
- "symfony/css-selector": "^5.4|^6.0",
- "symfony/dom-crawler": "^5.4|^6.0"
+ "laravel/framework": "^11.0|^12.0|^13.0",
+ "orchestra/testbench-core": "^9.0|^10.0|^11.0",
+ "phpstan/phpstan": "^2.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
- "Knuckles\\Scribe\\ScribeServiceProvider"
+ "Laravel\\Breeze\\BreezeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
- "Knuckles\\Camel\\": "camel/",
- "Knuckles\\Scribe\\": "src/"
+ "Laravel\\Breeze\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -8882,67 +9512,70 @@
],
"authors": [
{
- "name": "Shalvah"
+ "name": "Taylor Otwell",
+ "email": "taylor@laravel.com"
}
],
- "description": "Generate API documentation for humans from your Laravel codebase.✍",
- "homepage": "http://github.com/knuckleswtf/scribe",
+ "description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
"keywords": [
- "api",
- "dingo",
- "documentation",
+ "auth",
"laravel"
],
"support": {
- "issues": "https://github.com/knuckleswtf/scribe/issues",
- "source": "https://github.com/knuckleswtf/scribe/tree/4.40.0"
+ "issues": "https://github.com/laravel/breeze/issues",
+ "source": "https://github.com/laravel/breeze"
},
- "funding": [
- {
- "url": "https://patreon.com/shalvah",
- "type": "patreon"
- }
- ],
- "time": "2025-02-03T20:29:15+00:00"
+ "time": "2026-05-14T16:54:25+00:00"
},
{
- "name": "laravel/breeze",
- "version": "v2.4.2",
+ "name": "laravel/pail",
+ "version": "v1.2.7",
"source": {
"type": "git",
- "url": "https://github.com/laravel/breeze.git",
- "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305"
+ "url": "https://github.com/laravel/pail.git",
+ "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/breeze/zipball/4f20e7b2cc8d25daa85d8647241a89c8e0930305",
- "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305",
+ "url": "https://api.github.com/repos/laravel/pail/zipball/2f7d27dada8effc48b8c424445a69cca7007daaa",
+ "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa",
"shasum": ""
},
"require": {
- "illuminate/console": "^11.0|^12.0|^13.0",
- "illuminate/filesystem": "^11.0|^12.0|^13.0",
- "illuminate/support": "^11.0|^12.0|^13.0",
- "illuminate/validation": "^11.0|^12.0|^13.0",
- "php": "^8.2.0",
- "symfony/console": "^7.0|^8.0"
+ "ext-mbstring": "*",
+ "illuminate/console": "^10.24|^11.0|^12.0|^13.0",
+ "illuminate/contracts": "^10.24|^11.0|^12.0|^13.0",
+ "illuminate/log": "^10.24|^11.0|^12.0|^13.0",
+ "illuminate/process": "^10.24|^11.0|^12.0|^13.0",
+ "illuminate/support": "^10.24|^11.0|^12.0|^13.0",
+ "nunomaduro/termwind": "^1.15|^2.0",
+ "php": "^8.2",
+ "symfony/console": "^6.0|^7.0|^8.0"
},
"require-dev": {
- "laravel/framework": "^11.0|^12.0|^13.0",
- "orchestra/testbench-core": "^9.0|^10.0|^11.0",
- "phpstan/phpstan": "^2.0"
+ "laravel/framework": "^10.24|^11.0|^12.0|^13.0",
+ "laravel/pint": "^1.13",
+ "orchestra/testbench-core": "^8.13|^9.17|^10.8|^11.0",
+ "pestphp/pest": "^2.20|^3.0|^4.0",
+ "pestphp/pest-plugin-type-coverage": "^2.3|^3.0|^4.0",
+ "phpstan/phpstan": "^1.12.27",
+ "symfony/var-dumper": "^6.3|^7.0|^8.0",
+ "symfony/yaml": "^6.3|^7.0|^8.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
- "Laravel\\Breeze\\BreezeServiceProvider"
+ "Laravel\\Pail\\PailServiceProvider"
]
+ },
+ "branch-alias": {
+ "dev-main": "1.x-dev"
}
},
"autoload": {
"psr-4": {
- "Laravel\\Breeze\\": "src/"
+ "Laravel\\Pail\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -8953,18 +9586,26 @@
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
+ },
+ {
+ "name": "Nuno Maduro",
+ "email": "enunomaduro@gmail.com"
}
],
- "description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
+ "description": "Easily delve into your Laravel application's log files directly from the command line.",
+ "homepage": "https://github.com/laravel/pail",
"keywords": [
- "auth",
- "laravel"
+ "dev",
+ "laravel",
+ "logs",
+ "php",
+ "tail"
],
"support": {
- "issues": "https://github.com/laravel/breeze/issues",
- "source": "https://github.com/laravel/breeze"
+ "issues": "https://github.com/laravel/pail/issues",
+ "source": "https://github.com/laravel/pail"
},
- "time": "2026-05-14T16:54:25+00:00"
+ "time": "2026-05-20T22:24:57+00:00"
},
{
"name": "mockery/mockery",
@@ -9050,74 +9691,21 @@
"time": "2024-05-16T03:13:13+00:00"
},
{
- "name": "mpociot/reflection-docblock",
- "version": "1.0.1",
+ "name": "myclabs/deep-copy",
+ "version": "1.13.4",
"source": {
"type": "git",
- "url": "https://github.com/mpociot/reflection-docblock.git",
- "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587"
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mpociot/reflection-docblock/zipball/c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587",
- "reference": "c8b2e2b1f5cebbb06e2b5ccbf2958f2198867587",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a",
+ "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0"
- },
- "suggest": {
- "dflydev/markdown": "~1.0",
- "erusev/parsedown": "~1.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0.x-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Mpociot": [
- "src/"
- ]
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Mike van Riel",
- "email": "mike.vanriel@naenius.com"
- }
- ],
- "support": {
- "issues": "https://github.com/mpociot/reflection-docblock/issues",
- "source": "https://github.com/mpociot/reflection-docblock/tree/master"
- },
- "time": "2016-06-20T20:53:12+00:00"
- },
- {
- "name": "myclabs/deep-copy",
- "version": "1.13.4",
- "source": {
- "type": "git",
- "url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a",
- "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
+ "php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/collections": "<1.6.8",
@@ -9162,103 +9750,6 @@
],
"time": "2025-08-01T08:46:24+00:00"
},
- {
- "name": "nunomaduro/collision",
- "version": "v8.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/nunomaduro/collision.git",
- "reference": "f5c101b929c958e849a633283adff296ed5f38f5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f5c101b929c958e849a633283adff296ed5f38f5",
- "reference": "f5c101b929c958e849a633283adff296ed5f38f5",
- "shasum": ""
- },
- "require": {
- "filp/whoops": "^2.16.0",
- "nunomaduro/termwind": "^2.1.0",
- "php": "^8.2.0",
- "symfony/console": "^7.1.5"
- },
- "conflict": {
- "laravel/framework": "<11.0.0 || >=12.0.0",
- "phpunit/phpunit": "<10.5.1 || >=12.0.0"
- },
- "require-dev": {
- "larastan/larastan": "^2.9.8",
- "laravel/framework": "^11.28.0",
- "laravel/pint": "^1.18.1",
- "laravel/sail": "^1.36.0",
- "laravel/sanctum": "^4.0.3",
- "laravel/tinker": "^2.10.0",
- "orchestra/testbench-core": "^9.5.3",
- "pestphp/pest": "^2.36.0 || ^3.4.0",
- "sebastian/environment": "^6.1.0 || ^7.2.0"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider"
- ]
- },
- "branch-alias": {
- "dev-8.x": "8.x-dev"
- }
- },
- "autoload": {
- "files": [
- "./src/Adapters/Phpunit/Autoload.php"
- ],
- "psr-4": {
- "NunoMaduro\\Collision\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nuno Maduro",
- "email": "enunomaduro@gmail.com"
- }
- ],
- "description": "Cli error handling for console/command-line PHP applications.",
- "keywords": [
- "artisan",
- "cli",
- "command-line",
- "console",
- "error",
- "handling",
- "laravel",
- "laravel-zero",
- "php",
- "symfony"
- ],
- "support": {
- "issues": "https://github.com/nunomaduro/collision/issues",
- "source": "https://github.com/nunomaduro/collision"
- },
- "funding": [
- {
- "url": "https://www.paypal.com/paypalme/enunomaduro",
- "type": "custom"
- },
- {
- "url": "https://github.com/nunomaduro",
- "type": "github"
- },
- {
- "url": "https://www.patreon.com/nunomaduro",
- "type": "patreon"
- }
- ],
- "time": "2024-10-15T16:06:32+00:00"
- },
{
"name": "phar-io/manifest",
"version": "2.0.4",
@@ -9453,35 +9944,35 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "10.1.16",
+ "version": "11.0.12",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "7e308268858ed6baedc8704a304727d20bc07c77"
+ "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77",
- "reference": "7e308268858ed6baedc8704a304727d20bc07c77",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2c1ed04922802c15e1de5d7447b4856de949cf56",
+ "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.19.1 || ^5.1.0",
- "php": ">=8.1",
- "phpunit/php-file-iterator": "^4.1.0",
- "phpunit/php-text-template": "^3.0.1",
- "sebastian/code-unit-reverse-lookup": "^3.0.0",
- "sebastian/complexity": "^3.2.0",
- "sebastian/environment": "^6.1.0",
- "sebastian/lines-of-code": "^2.0.2",
- "sebastian/version": "^4.0.1",
- "theseer/tokenizer": "^1.2.3"
+ "nikic/php-parser": "^5.7.0",
+ "php": ">=8.2",
+ "phpunit/php-file-iterator": "^5.1.0",
+ "phpunit/php-text-template": "^4.0.1",
+ "sebastian/code-unit-reverse-lookup": "^4.0.1",
+ "sebastian/complexity": "^4.0.1",
+ "sebastian/environment": "^7.2.1",
+ "sebastian/lines-of-code": "^3.0.1",
+ "sebastian/version": "^5.0.2",
+ "theseer/tokenizer": "^1.3.1"
},
"require-dev": {
- "phpunit/phpunit": "^10.1"
+ "phpunit/phpunit": "^11.5.46"
},
"suggest": {
"ext-pcov": "PHP extension that provides line coverage",
@@ -9490,7 +9981,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "10.1.x-dev"
+ "dev-main": "11.0.x-dev"
}
},
"autoload": {
@@ -9519,40 +10010,52 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.12"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage",
+ "type": "tidelift"
}
],
- "time": "2024-08-22T04:31:57+00:00"
+ "time": "2025-12-24T07:01:01+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "4.1.0",
+ "version": "5.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c"
+ "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c",
- "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903",
+ "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "4.0-dev"
+ "dev-main": "5.1-dev"
}
},
"autoload": {
@@ -9580,36 +10083,48 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0"
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator",
+ "type": "tidelift"
}
],
- "time": "2023-08-31T06:24:48+00:00"
+ "time": "2026-02-02T13:52:54+00:00"
},
{
"name": "phpunit/php-invoker",
- "version": "4.0.0",
+ "version": "5.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7"
+ "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
- "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2",
+ "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
"ext-pcntl": "*",
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"suggest": {
"ext-pcntl": "*"
@@ -9617,7 +10132,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "4.0-dev"
+ "dev-main": "5.0-dev"
}
},
"autoload": {
@@ -9643,7 +10158,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-invoker/issues",
- "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0"
+ "security": "https://github.com/sebastianbergmann/php-invoker/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1"
},
"funding": [
{
@@ -9651,32 +10167,32 @@
"type": "github"
}
],
- "time": "2023-02-03T06:56:09+00:00"
+ "time": "2024-07-03T05:07:44+00:00"
},
{
"name": "phpunit/php-text-template",
- "version": "3.0.1",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748"
+ "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748",
- "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964",
+ "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -9703,7 +10219,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
"security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
- "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1"
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1"
},
"funding": [
{
@@ -9711,32 +10227,32 @@
"type": "github"
}
],
- "time": "2023-08-31T14:07:24+00:00"
+ "time": "2024-07-03T05:08:43+00:00"
},
{
"name": "phpunit/php-timer",
- "version": "6.0.0",
+ "version": "7.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d"
+ "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d",
- "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3",
+ "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "6.0-dev"
+ "dev-main": "7.0-dev"
}
},
"autoload": {
@@ -9762,7 +10278,8 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
- "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0"
+ "security": "https://github.com/sebastianbergmann/php-timer/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1"
},
"funding": [
{
@@ -9770,20 +10287,20 @@
"type": "github"
}
],
- "time": "2023-02-03T06:57:52+00:00"
+ "time": "2024-07-03T05:09:35+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "10.5.63",
+ "version": "11.5.55",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "33198268dad71e926626b618f3ec3966661e4d90"
+ "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/33198268dad71e926626b618f3ec3966661e4d90",
- "reference": "33198268dad71e926626b618f3ec3966661e4d90",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/adc7262fccc12de2b30f12a8aa0b33775d814f00",
+ "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00",
"shasum": ""
},
"require": {
@@ -9796,23 +10313,24 @@
"myclabs/deep-copy": "^1.13.4",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
- "php": ">=8.1",
- "phpunit/php-code-coverage": "^10.1.16",
- "phpunit/php-file-iterator": "^4.1.0",
- "phpunit/php-invoker": "^4.0.0",
- "phpunit/php-text-template": "^3.0.1",
- "phpunit/php-timer": "^6.0.0",
- "sebastian/cli-parser": "^2.0.1",
- "sebastian/code-unit": "^2.0.0",
- "sebastian/comparator": "^5.0.5",
- "sebastian/diff": "^5.1.1",
- "sebastian/environment": "^6.1.0",
- "sebastian/exporter": "^5.1.4",
- "sebastian/global-state": "^6.0.2",
- "sebastian/object-enumerator": "^5.0.0",
- "sebastian/recursion-context": "^5.0.1",
- "sebastian/type": "^4.0.0",
- "sebastian/version": "^4.0.1"
+ "php": ">=8.2",
+ "phpunit/php-code-coverage": "^11.0.12",
+ "phpunit/php-file-iterator": "^5.1.1",
+ "phpunit/php-invoker": "^5.0.1",
+ "phpunit/php-text-template": "^4.0.1",
+ "phpunit/php-timer": "^7.0.1",
+ "sebastian/cli-parser": "^3.0.2",
+ "sebastian/code-unit": "^3.0.3",
+ "sebastian/comparator": "^6.3.3",
+ "sebastian/diff": "^6.0.2",
+ "sebastian/environment": "^7.2.1",
+ "sebastian/exporter": "^6.3.2",
+ "sebastian/global-state": "^7.0.2",
+ "sebastian/object-enumerator": "^6.0.1",
+ "sebastian/recursion-context": "^6.0.3",
+ "sebastian/type": "^5.1.3",
+ "sebastian/version": "^5.0.2",
+ "staabm/side-effects-detector": "^1.0.5"
},
"suggest": {
"ext-soap": "To be able to generate mocks based on WSDL files"
@@ -9823,7 +10341,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "10.5-dev"
+ "dev-main": "11.5-dev"
}
},
"autoload": {
@@ -9855,7 +10373,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.63"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.55"
},
"funding": [
{
@@ -9879,32 +10397,32 @@
"type": "tidelift"
}
],
- "time": "2026-01-27T05:48:37+00:00"
+ "time": "2026-02-18T12:37:06+00:00"
},
{
"name": "sebastian/cli-parser",
- "version": "2.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084"
+ "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084",
- "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180",
+ "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -9928,7 +10446,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/cli-parser/issues",
"security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
- "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1"
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2"
},
"funding": [
{
@@ -9936,32 +10454,32 @@
"type": "github"
}
],
- "time": "2024-03-02T07:12:49+00:00"
+ "time": "2024-07-03T04:41:36+00:00"
},
{
"name": "sebastian/code-unit",
- "version": "2.0.0",
+ "version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "a81fee9eef0b7a76af11d121767abc44c104e503"
+ "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503",
- "reference": "a81fee9eef0b7a76af11d121767abc44c104e503",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64",
+ "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -9984,7 +10502,8 @@
"homepage": "https://github.com/sebastianbergmann/code-unit",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit/issues",
- "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0"
+ "security": "https://github.com/sebastianbergmann/code-unit/security/policy",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3"
},
"funding": [
{
@@ -9992,32 +10511,32 @@
"type": "github"
}
],
- "time": "2023-02-03T06:58:43+00:00"
+ "time": "2025-03-19T07:56:08+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
- "version": "3.0.0",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d"
+ "reference": "183a9b2632194febd219bb9246eee421dad8d45e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
- "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e",
+ "reference": "183a9b2632194febd219bb9246eee421dad8d45e",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -10039,7 +10558,8 @@
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"support": {
"issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
- "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0"
+ "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1"
},
"funding": [
{
@@ -10047,36 +10567,39 @@
"type": "github"
}
],
- "time": "2023-02-03T06:59:15+00:00"
+ "time": "2024-07-03T04:45:54+00:00"
},
{
"name": "sebastian/comparator",
- "version": "5.0.5",
+ "version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d"
+ "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
- "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9",
+ "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
- "php": ">=8.1",
- "sebastian/diff": "^5.0",
- "sebastian/exporter": "^5.0"
+ "php": ">=8.2",
+ "sebastian/diff": "^6.0",
+ "sebastian/exporter": "^6.0"
},
"require-dev": {
- "phpunit/phpunit": "^10.5"
+ "phpunit/phpunit": "^11.4"
+ },
+ "suggest": {
+ "ext-bcmath": "For comparing BcMath\\Number objects"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.0-dev"
+ "dev-main": "6.3-dev"
}
},
"autoload": {
@@ -10116,7 +10639,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"security": "https://github.com/sebastianbergmann/comparator/security/policy",
- "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5"
+ "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3"
},
"funding": [
{
@@ -10136,33 +10659,33 @@
"type": "tidelift"
}
],
- "time": "2026-01-24T09:25:16+00:00"
+ "time": "2026-01-24T09:26:40+00:00"
},
{
"name": "sebastian/complexity",
- "version": "3.2.0",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "68ff824baeae169ec9f2137158ee529584553799"
+ "reference": "ee41d384ab1906c68852636b6de493846e13e5a0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799",
- "reference": "68ff824baeae169ec9f2137158ee529584553799",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0",
+ "reference": "ee41d384ab1906c68852636b6de493846e13e5a0",
"shasum": ""
},
"require": {
- "nikic/php-parser": "^4.18 || ^5.0",
- "php": ">=8.1"
+ "nikic/php-parser": "^5.0",
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.2-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -10186,7 +10709,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/complexity/issues",
"security": "https://github.com/sebastianbergmann/complexity/security/policy",
- "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0"
+ "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1"
},
"funding": [
{
@@ -10194,33 +10717,33 @@
"type": "github"
}
],
- "time": "2023-12-21T08:37:17+00:00"
+ "time": "2024-07-03T04:49:50+00:00"
},
{
"name": "sebastian/diff",
- "version": "5.1.1",
+ "version": "6.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e"
+ "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e",
- "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544",
+ "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0",
- "symfony/process": "^6.4"
+ "phpunit/phpunit": "^11.0",
+ "symfony/process": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.1-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -10253,7 +10776,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"security": "https://github.com/sebastianbergmann/diff/security/policy",
- "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1"
+ "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2"
},
"funding": [
{
@@ -10261,27 +10784,27 @@
"type": "github"
}
],
- "time": "2024-03-02T07:15:17+00:00"
+ "time": "2024-07-03T04:53:05+00:00"
},
{
"name": "sebastian/environment",
- "version": "6.1.0",
+ "version": "7.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "8074dbcd93529b357029f5cc5058fd3e43666984"
+ "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984",
- "reference": "8074dbcd93529b357029f5cc5058fd3e43666984",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4",
+ "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.3"
},
"suggest": {
"ext-posix": "*"
@@ -10289,7 +10812,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "6.1-dev"
+ "dev-main": "7.2-dev"
}
},
"autoload": {
@@ -10317,42 +10840,54 @@
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"security": "https://github.com/sebastianbergmann/environment/security/policy",
- "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0"
+ "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/sebastian/environment",
+ "type": "tidelift"
}
],
- "time": "2024-03-23T08:47:14+00:00"
+ "time": "2025-05-21T11:55:47+00:00"
},
{
"name": "sebastian/exporter",
- "version": "5.1.4",
+ "version": "6.3.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "0735b90f4da94969541dac1da743446e276defa6"
+ "reference": "70a298763b40b213ec087c51c739efcaa90bcd74"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6",
- "reference": "0735b90f4da94969541dac1da743446e276defa6",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74",
+ "reference": "70a298763b40b213ec087c51c739efcaa90bcd74",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
- "php": ">=8.1",
- "sebastian/recursion-context": "^5.0"
+ "php": ">=8.2",
+ "sebastian/recursion-context": "^6.0"
},
"require-dev": {
- "phpunit/phpunit": "^10.5"
+ "phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.1-dev"
+ "dev-main": "6.3-dev"
}
},
"autoload": {
@@ -10395,7 +10930,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"security": "https://github.com/sebastianbergmann/exporter/security/policy",
- "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2"
},
"funding": [
{
@@ -10415,35 +10950,35 @@
"type": "tidelift"
}
],
- "time": "2025-09-24T06:09:11+00:00"
+ "time": "2025-09-24T06:12:51+00:00"
},
{
"name": "sebastian/global-state",
- "version": "6.0.2",
+ "version": "7.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9"
+ "reference": "3be331570a721f9a4b5917f4209773de17f747d7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
- "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7",
+ "reference": "3be331570a721f9a4b5917f4209773de17f747d7",
"shasum": ""
},
"require": {
- "php": ">=8.1",
- "sebastian/object-reflector": "^3.0",
- "sebastian/recursion-context": "^5.0"
+ "php": ">=8.2",
+ "sebastian/object-reflector": "^4.0",
+ "sebastian/recursion-context": "^6.0"
},
"require-dev": {
"ext-dom": "*",
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "6.0-dev"
+ "dev-main": "7.0-dev"
}
},
"autoload": {
@@ -10469,7 +11004,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"security": "https://github.com/sebastianbergmann/global-state/security/policy",
- "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2"
+ "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2"
},
"funding": [
{
@@ -10477,33 +11012,33 @@
"type": "github"
}
],
- "time": "2024-03-02T07:19:19+00:00"
+ "time": "2024-07-03T04:57:36+00:00"
},
{
"name": "sebastian/lines-of-code",
- "version": "2.0.2",
+ "version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0"
+ "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0",
- "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a",
+ "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a",
"shasum": ""
},
"require": {
- "nikic/php-parser": "^4.18 || ^5.0",
- "php": ">=8.1"
+ "nikic/php-parser": "^5.0",
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.0-dev"
+ "dev-main": "3.0-dev"
}
},
"autoload": {
@@ -10527,7 +11062,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
"security": "https://github.com/sebastianbergmann/lines-of-code/security/policy",
- "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2"
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1"
},
"funding": [
{
@@ -10535,34 +11070,34 @@
"type": "github"
}
],
- "time": "2023-12-21T08:38:20+00:00"
+ "time": "2024-07-03T04:58:38+00:00"
},
{
"name": "sebastian/object-enumerator",
- "version": "5.0.0",
+ "version": "6.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906"
+ "reference": "f5b498e631a74204185071eb41f33f38d64608aa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906",
- "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa",
+ "reference": "f5b498e631a74204185071eb41f33f38d64608aa",
"shasum": ""
},
"require": {
- "php": ">=8.1",
- "sebastian/object-reflector": "^3.0",
- "sebastian/recursion-context": "^5.0"
+ "php": ">=8.2",
+ "sebastian/object-reflector": "^4.0",
+ "sebastian/recursion-context": "^6.0"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.0-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -10584,7 +11119,8 @@
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
- "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0"
+ "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1"
},
"funding": [
{
@@ -10592,32 +11128,32 @@
"type": "github"
}
],
- "time": "2023-02-03T07:08:32+00:00"
+ "time": "2024-07-03T05:00:13+00:00"
},
{
"name": "sebastian/object-reflector",
- "version": "3.0.0",
+ "version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "24ed13d98130f0e7122df55d06c5c4942a577957"
+ "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957",
- "reference": "24ed13d98130f0e7122df55d06c5c4942a577957",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9",
+ "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "4.0-dev"
}
},
"autoload": {
@@ -10639,7 +11175,8 @@
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"support": {
"issues": "https://github.com/sebastianbergmann/object-reflector/issues",
- "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0"
+ "security": "https://github.com/sebastianbergmann/object-reflector/security/policy",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1"
},
"funding": [
{
@@ -10647,32 +11184,32 @@
"type": "github"
}
],
- "time": "2023-02-03T07:06:18+00:00"
+ "time": "2024-07-03T05:01:32+00:00"
},
{
"name": "sebastian/recursion-context",
- "version": "5.0.1",
+ "version": "6.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a"
+ "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a",
- "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc",
+ "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.5"
+ "phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "5.0-dev"
+ "dev-main": "6.0-dev"
}
},
"autoload": {
@@ -10703,7 +11240,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"security": "https://github.com/sebastianbergmann/recursion-context/security/policy",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1"
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3"
},
"funding": [
{
@@ -10723,32 +11260,32 @@
"type": "tidelift"
}
],
- "time": "2025-08-10T07:50:56+00:00"
+ "time": "2025-08-13T04:42:22+00:00"
},
{
"name": "sebastian/type",
- "version": "4.0.0",
+ "version": "5.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "462699a16464c3944eefc02ebdd77882bd3925bf"
+ "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf",
- "reference": "462699a16464c3944eefc02ebdd77882bd3925bf",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449",
+ "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"require-dev": {
- "phpunit/phpunit": "^10.0"
+ "phpunit/phpunit": "^11.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "4.0-dev"
+ "dev-main": "5.1-dev"
}
},
"autoload": {
@@ -10771,37 +11308,50 @@
"homepage": "https://github.com/sebastianbergmann/type",
"support": {
"issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/4.0.0"
+ "security": "https://github.com/sebastianbergmann/type/security/policy",
+ "source": "https://github.com/sebastianbergmann/type/tree/5.1.3"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
- }
- ],
- "time": "2023-02-03T07:10:45+00:00"
- },
+ },
+ {
+ "url": "https://liberapay.com/sebastianbergmann",
+ "type": "liberapay"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/sebastianbergmann",
+ "type": "thanks_dev"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/sebastian/type",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-08-09T06:55:48+00:00"
+ },
{
"name": "sebastian/version",
- "version": "4.0.1",
+ "version": "5.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
- "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17"
+ "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17",
- "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874",
+ "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874",
"shasum": ""
},
"require": {
- "php": ">=8.1"
+ "php": ">=8.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "4.0-dev"
+ "dev-main": "5.0-dev"
}
},
"autoload": {
@@ -10824,7 +11374,8 @@
"homepage": "https://github.com/sebastianbergmann/version",
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
- "source": "https://github.com/sebastianbergmann/version/tree/4.0.1"
+ "security": "https://github.com/sebastianbergmann/version/security/policy",
+ "source": "https://github.com/sebastianbergmann/version/tree/5.0.2"
},
"funding": [
{
@@ -10832,333 +11383,59 @@
"type": "github"
}
],
- "time": "2023-02-07T11:34:05+00:00"
- },
- {
- "name": "shalvah/clara",
- "version": "3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/shalvah/clara.git",
- "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/shalvah/clara/zipball/6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
- "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
- "shasum": ""
- },
- "require": {
- "php": ">=7.4",
- "symfony/console": "^4.0|^5.0|^6.0|^7.0"
- },
- "require-dev": {
- "eloquent/phony-phpunit": "^7.0",
- "phpunit/phpunit": "^9.1"
- },
- "type": "library",
- "autoload": {
- "files": [
- "helpers.php"
- ],
- "psr-4": {
- "Shalvah\\Clara\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "🔊 Simple, pretty, testable console output for CLI apps.",
- "keywords": [
- "cli",
- "log",
- "logging"
- ],
- "support": {
- "issues": "https://github.com/shalvah/clara/issues",
- "source": "https://github.com/shalvah/clara/tree/3.3.0"
- },
- "time": "2025-10-20T22:26:39+00:00"
- },
- {
- "name": "shalvah/upgrader",
- "version": "0.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/shalvah/upgrader.git",
- "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/shalvah/upgrader/zipball/d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
- "reference": "d95ed17fe9f5e1ee7d47ad835595f1af080a867f",
- "shasum": ""
- },
- "require": {
- "illuminate/support": ">=8.0",
- "nikic/php-parser": "^5.0",
- "php": ">=8.0"
- },
- "require-dev": {
- "dms/phpunit-arraysubset-asserts": "^0.2.0",
- "pestphp/pest": "^1.21",
- "phpstan/phpstan": "^1.0",
- "spatie/ray": "^1.33"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Shalvah\\Upgrader\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Shalvah",
- "email": "hello@shalvah.me"
- }
- ],
- "description": "Create automatic upgrades for your package.",
- "homepage": "http://github.com/shalvah/upgrader",
- "keywords": [
- "upgrade"
- ],
- "support": {
- "issues": "https://github.com/shalvah/upgrader/issues",
- "source": "https://github.com/shalvah/upgrader/tree/0.6.0"
- },
- "funding": [
- {
- "url": "https://patreon.com/shalvah",
- "type": "patreon"
- }
- ],
- "time": "2024-02-20T11:51:46+00:00"
+ "time": "2024-10-09T05:16:32+00:00"
},
{
- "name": "spatie/data-transfer-object",
- "version": "3.9.1",
+ "name": "staabm/side-effects-detector",
+ "version": "1.0.5",
"source": {
"type": "git",
- "url": "https://github.com/spatie/data-transfer-object.git",
- "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8"
+ "url": "https://github.com/staabm/side-effects-detector.git",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
- "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
+ "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163",
+ "reference": "d8334211a140ce329c13726d4a715adbddd0a163",
"shasum": ""
},
"require": {
- "php": "^8.0"
- },
- "require-dev": {
- "illuminate/collections": "^8.36",
- "jetbrains/phpstorm-attributes": "^1.0",
- "larapack/dd": "^1.1",
- "phpunit/phpunit": "^9.5.5"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Spatie\\DataTransferObject\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Brent Roose",
- "email": "brent@spatie.be",
- "homepage": "https://spatie.be",
- "role": "Developer"
- }
- ],
- "description": "Data transfer objects with batteries included",
- "homepage": "https://github.com/spatie/data-transfer-object",
- "keywords": [
- "data-transfer-object",
- "spatie"
- ],
- "support": {
- "issues": "https://github.com/spatie/data-transfer-object/issues",
- "source": "https://github.com/spatie/data-transfer-object/tree/3.9.1"
- },
- "funding": [
- {
- "url": "https://spatie.be/open-source/support-us",
- "type": "custom"
- },
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "abandoned": "spatie/laravel-data",
- "time": "2022-09-16T13:34:38+00:00"
- },
- {
- "name": "symfony/var-exporter",
- "version": "v7.4.9",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/var-exporter.git",
- "reference": "22e03a49c95ef054a43601cd159b222bfab1c701"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/var-exporter/zipball/22e03a49c95ef054a43601cd159b222bfab1c701",
- "reference": "22e03a49c95ef054a43601cd159b222bfab1c701",
- "shasum": ""
- },
- "require": {
- "php": ">=8.2",
- "symfony/deprecation-contracts": "^2.5|^3"
+ "ext-tokenizer": "*",
+ "php": "^7.4 || ^8.0"
},
"require-dev": {
- "symfony/property-access": "^6.4|^7.0|^8.0",
- "symfony/serializer": "^6.4|^7.0|^8.0",
- "symfony/var-dumper": "^6.4|^7.0|^8.0"
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^1.12.6",
+ "phpunit/phpunit": "^9.6.21",
+ "symfony/var-dumper": "^5.4.43",
+ "tomasvotruba/type-coverage": "1.0.0",
+ "tomasvotruba/unused-public": "1.0.0"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Symfony\\Component\\VarExporter\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
+ "classmap": [
+ "lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Allows exporting any serializable PHP data structure to plain PHP code",
- "homepage": "https://symfony.com",
+ "description": "A static analysis tool to detect side effects in PHP code",
"keywords": [
- "clone",
- "construct",
- "export",
- "hydrate",
- "instantiate",
- "lazy-loading",
- "proxy",
- "serialize"
+ "static analysis"
],
"support": {
- "source": "https://github.com/symfony/var-exporter/tree/v7.4.9"
+ "issues": "https://github.com/staabm/side-effects-detector/issues",
+ "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5"
},
"funding": [
{
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://github.com/nicolas-grekas",
+ "url": "https://github.com/staabm",
"type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
}
],
- "time": "2026-04-18T13:18:21+00:00"
- },
- {
- "name": "symfony/yaml",
- "version": "v7.4.13",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
- "reference": "a7ec3b1156faf8815db7683ec7c1e7338e6f977c",
- "shasum": ""
- },
- "require": {
- "php": ">=8.2",
- "symfony/deprecation-contracts": "^2.5|^3",
- "symfony/polyfill-ctype": "^1.8"
- },
- "conflict": {
- "symfony/console": "<6.4"
- },
- "require-dev": {
- "symfony/console": "^6.4|^7.0|^8.0"
- },
- "bin": [
- "Resources/bin/yaml-lint"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Yaml\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Loads and dumps YAML files",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/yaml/tree/v7.4.13"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://github.com/nicolas-grekas",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2026-05-25T06:06:12+00:00"
+ "time": "2024-10-20T05:08:20+00:00"
},
{
"name": "theseer/tokenizer",
diff --git a/config/scribe.php b/config/scribe.php
index 62f51ae1..7b952b90 100644
--- a/config/scribe.php
+++ b/config/scribe.php
@@ -43,10 +43,6 @@
*/
'domains' => ['*'],
- /*
- * [Dingo router only] Match only routes registered under this version. Wildcards are not supported.
- */
- 'versions' => ['v1'],
],
/*
@@ -64,73 +60,6 @@
'exclude' => [
'api/user', 'api/register', 'api/user/*', 'api/email/*', 'api/password/*', 'api/weather', 'api/queens', 'api/queens/*', 'api/settings',
],
-
- /*
- * Settings to be applied to all the matched routes in this group when generating documentation
- */
- 'apply' => [
- /*
- * Additional headers to be added to the example requests
- */
- 'headers' => [
- 'Content-Type' => 'application/json',
- 'Accept' => 'application/json',
- 'Accept-language' => 'en',
- ],
-
- /*
- * If no @response or @transformer declarations are found for the route,
- * Scribe will try to get a sample response by attempting an API call.
- * Configure the settings for the API call here.
- */
- 'response_calls' => [
- /*
- * API calls will be made only for routes in this group matching these HTTP methods (GET, POST, etc).
- * List the methods here or use '*' to mean all methods. Leave empty to disable API calls.
- */
- 'methods' => ['GET'],
-
- /*
- * Laravel config variables which should be set for the API call.
- * This is a good place to ensure that notifications, emails and other external services
- * are not triggered during the documentation API calls.
- * You can also create a `.env.docs` file and run the generate command with `--env docs`.
- */
- 'config' => [
- 'app.env' => 'documentation',
- 'app.debug' => false,
- ],
-
- /*
- * Query parameters which should be sent with the API call.
- */
- 'queryParams' => [
- // 'key' => 'value',
- ],
-
- /*
- * Body parameters which should be sent with the API call.
- */
- 'bodyParams' => [
- // 'key' => 'value',
- ],
-
- /*
- * Files which should be sent with the API call.
- * Each value should be a valid path (absolute or relative to your project directory) to a file on this machine (but not in the project root).
- */
- 'fileParams' => [
- // 'key' => 'storage/app/image.png',
- ],
-
- /*
- * Cookies which should be sent with the API call.
- */
- 'cookies' => [
- // 'name' => 'value'
- ],
- ],
- ],
],
],
@@ -339,7 +268,6 @@
],
'urlParameters' => [
Strategies\UrlParameters\GetFromLaravelAPI::class,
- Strategies\UrlParameters\GetFromLumenAPI::class,
Strategies\UrlParameters\GetFromUrlParamTag::class,
],
'queryParameters' => [
@@ -348,8 +276,12 @@
Strategies\QueryParameters\GetFromQueryParamTag::class,
],
'headers' => [
- Strategies\Headers\GetFromRouteRules::class,
Strategies\Headers\GetFromHeaderTag::class,
+ Strategies\StaticData::withSettings(data: [
+ 'Content-Type' => 'application/json',
+ 'Accept' => 'application/json',
+ 'Accept-language' => 'en',
+ ]),
],
'bodyParameters' => [
Strategies\BodyParameters\GetFromFormRequest::class,
@@ -362,6 +294,22 @@
Strategies\Responses\UseResponseTag::class,
Strategies\Responses\UseResponseFileTag::class,
Strategies\Responses\ResponseCalls::class,
+ Strategies\Responses\ResponseCalls::withSettings(
+ only: ['GET *'],
+ /*
+ * Laravel config variables which should be set for the API call.
+ * This is a good place to ensure that notifications, emails and other external services
+ * are not triggered during the documentation API calls.
+ * You can also create a `.env.docs` file and run the generate command with `--env docs`.
+ */
+ config: [
+ 'app.env' => 'documentation',
+ 'app.debug' => false,
+ ]
+ // bodyParams: [
+ // 'go' => 'there'
+ // ]
+ ),
],
'responseFields' => [
Strategies\ResponseFields\GetFromResponseFieldTag::class,
From 2bec4dd0665b2ac1fb1ba29e03628693345ea927 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:30:08 +0000
Subject: [PATCH 109/127] Ignore PHPUnit cache folder
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index de70737f..8c1ad07d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,7 @@ Homestead.json
Homestead.yaml
.env
.env.docs
-.phpunit.result.cache
+/.phpunit.cache
.DS_Store
.phpintel
.log
From ee2b01a13bbc7ed6c3056eebff9dc85a3cc654f5 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:30:08 +0000
Subject: [PATCH 110/127] Define test classes as `final`
---
tests/ExampleTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
index 709f5a49..5ef495aa 100644
--- a/tests/ExampleTest.php
+++ b/tests/ExampleTest.php
@@ -1,6 +1,6 @@
Date: Tue, 2 Jun 2026 13:34:28 +0200
Subject: [PATCH 111/127] auto-upgrade config file phpunit
---
phpunit.xml | 52 ++++++++++++++++++++++++-------------------------
phpunit.xml.bak | 28 ++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 26 deletions(-)
create mode 100644 phpunit.xml.bak
diff --git a/phpunit.xml b/phpunit.xml
index 4150c4ef..aaa75883 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,28 +1,28 @@
-
-
-
- ./tests/Unit
-
-
- ./tests/Feature
-
-
-
-
- ./app
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ ./tests/Unit
+
+
+ ./tests/Feature
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ./app
+
+
diff --git a/phpunit.xml.bak b/phpunit.xml.bak
new file mode 100644
index 00000000..4150c4ef
--- /dev/null
+++ b/phpunit.xml.bak
@@ -0,0 +1,28 @@
+
+
+
+
+ ./tests/Unit
+
+
+ ./tests/Feature
+
+
+
+
+ ./app
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From dbc7a6bc09df2d1c7307aa769894a44ba5ea2599 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 13:37:04 +0200
Subject: [PATCH 112/127] fix assets url (AWS_URL) by adding /
---
.env.example | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.env.example b/.env.example
index fea055f1..51d44f7d 100644
--- a/.env.example
+++ b/.env.example
@@ -93,7 +93,7 @@ AWS_ACCESS_KEY_ID=null
AWS_SECRET_ACCESS_KEY=null
AWS_DEFAULT_REGION=eu-central-1
AWS_BUCKET=null
-AWS_URL=https://assets.beep.nl
+AWS_URL=https://assets.beep.nl/
IMAGE_STORAGE=public
IMAGE_RESIZE_PIXELS=2000
From 8c06102d54466250b0d514136c9da4ed034272d9 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:46:46 +0000
Subject: [PATCH 113/127] Shift core files
---
.gitignore | 1 +
bootstrap/app.php | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/.gitignore b/.gitignore
index 8c1ad07d..5f838376 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.log
/vendor
!resources/views/vendor/
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 4a0c04fb..0f079add 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -4,6 +4,7 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
+use Illuminate\Http\Request;
return Application::configure(basePath: dirname(__DIR__))
->withProviders([
@@ -44,5 +45,8 @@
]);
})
->withExceptions(function (Exceptions $exceptions) {
+ $exceptions->shouldRenderJsonWhen(
+ fn (Request $request) => $request->is('api/*') || $request->expectsJson(),
+ );
//
})->create();
From bd3ec470133b567cb485dac8f30573b9e19f3d00 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:09 +0000
Subject: [PATCH 114/127] Adopt PHP attributes for class properties
---
app/BeeRace.php | 11 +++---
app/Category.php | 20 +++++-----
app/CategoryInput.php | 16 ++++----
app/Checklist.php | 33 ++++-------------
app/Continent.php | 11 +++---
app/Device.php | 24 ++++++------
app/Group.php | 16 ++++----
app/Hive.php | 20 +++++-----
app/HiveLayer.php | 20 +++++-----
app/HiveLayerFrame.php | 20 +++++-----
.../Api/Auth/VerificationController.php | 15 ++------
.../Auth/ForgotPasswordController.php | 11 ++----
app/Http/Controllers/Auth/LoginController.php | 13 ++-----
.../Controllers/Auth/RegisterController.php | 12 ++----
.../Auth/ResetPasswordController.php | 11 ++----
.../Auth/VerificationController.php | 16 +++-----
app/Http/Controllers/HomeController.php | 12 ++----
app/Image.php | 29 +++------------
app/Inspection.php | 37 +++++--------------
app/InspectionItem.php | 37 +++++--------------
app/Language.php | 12 +++---
app/Location.php | 20 +++++-----
app/Measurement.php | 36 ++++--------------
app/Models/Alert.php | 33 ++++-------------
app/Models/AlertRule.php | 33 ++++-------------
app/Models/AlertRuleFormula.php | 26 ++-----------
app/Models/CalculationModel.php | 25 ++-----------
app/Models/ChecklistSvg.php | 25 ++-----------
app/Models/DashboardGroup.php | 29 +++------------
app/Models/FlashLog.php | 33 ++++-------------
app/Models/HiveTag.php | 29 +++------------
app/PhysicalQuantity.php | 16 ++++----
app/Queen.php | 20 +++++-----
app/Research.php | 33 ++++-------------
app/SampleCode.php | 25 ++-----------
app/SensorDefinition.php | 35 ++++--------------
app/Setting.php | 17 ++++-----
app/Taxonomy.php | 20 +++++-----
app/Translation.php | 8 ++--
app/User.php | 18 ++++-----
40 files changed, 276 insertions(+), 601 deletions(-)
diff --git a/app/BeeRace.php b/app/BeeRace.php
index c790ad34..8cb69872 100644
--- a/app/BeeRace.php
+++ b/app/BeeRace.php
@@ -2,11 +2,10 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
use Illuminate\Database\Eloquent\Model;
-class BeeRace extends Model
-{
- protected $fillable = ['name', 'type', 'synonyms', 'continents'];
-
- protected $guarded = ['id'];
-}
+#[Fillable('name', 'type', 'synonyms', 'continents')]
+#[Guarded('id')]
+class BeeRace extends Model {}
diff --git a/app/Category.php b/app/Category.php
index b70c9dcb..8b54305a 100644
--- a/app/Category.php
+++ b/app/Category.php
@@ -3,26 +3,26 @@
namespace App;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
+#[Table('categories')]
+#[Fillable('name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type', 'required')]
+#[Guarded('id')]
+#[Hidden('created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'input_type', 'options', 'old_id')]
+#[Appends('input', 'trans', 'unit')]
class Category extends Model
{
use NodeTrait;
- protected $table = 'categories';
-
- protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type', 'required'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'input_type', 'options', 'old_id'];
-
- protected $appends = ['input', 'trans', 'unit']; // 'parent'
-
public static $types =
[
'checklist' => 'Hive checklist item',
diff --git a/app/CategoryInput.php b/app/CategoryInput.php
index c261849e..65231292 100644
--- a/app/CategoryInput.php
+++ b/app/CategoryInput.php
@@ -2,20 +2,20 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use LaravelLocalization;
+#[Table('category_inputs')]
+#[WithoutTimestamps]
+#[Fillable('name', 'type', 'min', 'max', 'decimals', 'icon')]
+#[Hidden('icon')]
class CategoryInput extends Model
{
- protected $table = 'category_inputs';
-
- public $fillable = ['name', 'type', 'min', 'max', 'decimals', 'icon'];
-
- public $hidden = ['icon'];
-
- public $timestamps = false;
-
// Relations
public function category(): BelongsTo
diff --git a/app/Checklist.php b/app/Checklist.php
index f4a4d340..6fade093 100644
--- a/app/Checklist.php
+++ b/app/Checklist.php
@@ -3,40 +3,23 @@
namespace App;
use Auth;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
+#[Table('checklists', 'id')]
+#[Fillable('name', 'type', 'description')]
+#[Hidden('pivot', 'deleted_at', 'users')]
+#[Appends('category_ids', 'required_ids', 'owner', 'researches')]
class Checklist extends Model
{
use SoftDeletes;
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'checklists';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['name', 'type', 'description'];
-
- protected $hidden = ['pivot', 'deleted_at', 'users'];
-
- protected $appends = ['category_ids', 'required_ids', 'owner', 'researches'];
-
// check for deletion of linked items
protected static function boot()
{
diff --git a/app/Continent.php b/app/Continent.php
index 33174970..1174d8b4 100644
--- a/app/Continent.php
+++ b/app/Continent.php
@@ -2,11 +2,10 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
use Illuminate\Database\Eloquent\Model;
-class Continent extends Model
-{
- protected $fillable = ['name', 'abbr'];
-
- protected $guarded = ['id'];
-}
+#[Fillable('name', 'abbr')]
+#[Guarded('id')]
+class Continent extends Model {}
diff --git a/app/Device.php b/app/Device.php
index 5e181c64..740c6499 100644
--- a/app/Device.php
+++ b/app/Device.php
@@ -8,6 +8,12 @@
use Cache;
use DB;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -16,24 +22,18 @@
use InfluxDB;
use Moment\Moment;
+#[Table('sensors')]
+#[WithoutTimestamps]
+#[Fillable('user_id', 'hive_id', 'category_id', 'name', 'key', 'last_message_received', 'hardware_id', 'firmware_version', 'hardware_version', 'boot_count', 'measurement_interval_min', 'measurement_transmission_ratio', 'ble_pin', 'battery_voltage', 'next_downlink_message', 'last_downlink_result', 'datetime', 'datetime_offset_sec', 'former_key_list', 'rtc', 'log_file_info')]
+#[Guarded('id')]
+#[Hidden('user_id', 'category_id', 'deleted_at', 'hive', 'former_key_list')]
+#[Appends('type', 'hive_name', 'location_name', 'owner', 'online')]
class Device extends Model
{
use CascadeSoftDeletes, SoftDeletes;
- protected $table = 'sensors';
-
protected $cascadeDeletes = ['sensorDefinitions'];
- protected $fillable = ['user_id', 'hive_id', 'category_id', 'name', 'key', 'last_message_received', 'hardware_id', 'firmware_version', 'hardware_version', 'boot_count', 'measurement_interval_min', 'measurement_transmission_ratio', 'ble_pin', 'battery_voltage', 'next_downlink_message', 'last_downlink_result', 'datetime', 'datetime_offset_sec', 'former_key_list', 'rtc', 'log_file_info'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['user_id', 'category_id', 'deleted_at', 'hive', 'former_key_list'];
-
- protected $appends = ['type', 'hive_name', 'location_name', 'owner', 'online'];
-
- public $timestamps = false;
-
public static function boot()
{
parent::boot();
diff --git a/app/Group.php b/app/Group.php
index 25142cbf..83bb6bc5 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -6,23 +6,23 @@
use Cache;
use DB;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[WithoutTimestamps]
+#[Fillable('type', 'name', 'description', 'hex_color', 'icon')]
+#[Hidden('pivot', 'deleted_at', 'type', 'icon')]
+#[Appends('hives', 'users', 'admin', 'creator')]
class Group extends Model
{
use CascadeSoftDeletes, SoftDeletes;
- public $timestamps = false;
-
- public $fillable = ['type', 'name', 'description', 'hex_color', 'icon'];
-
- protected $hidden = ['pivot', 'deleted_at', 'type', 'icon'];
-
- public $appends = ['hives', 'users', 'admin', 'creator']; // 'hive_ids'
-
// Caching
public static function boot()
{
diff --git a/app/Hive.php b/app/Hive.php
index 48588dc8..505d483f 100644
--- a/app/Hive.php
+++ b/app/Hive.php
@@ -5,6 +5,11 @@
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -15,6 +20,11 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[WithoutTimestamps]
+#[Fillable('user_id', 'location_id', 'hive_type_id', 'color', 'name', 'bb_width_cm', 'bb_depth_cm', 'bb_height_cm', 'fr_width_cm', 'fr_height_cm', 'order')]
+#[Guarded('id')]
+#[Hidden('user_id', 'deleted_at', 'pivot')]
+#[Appends('type', 'location', 'attention', 'impression', 'notes', 'reminder', 'reminder_date', 'inspection_count', 'sensors', 'owner', 'editable', 'group_ids', 'last_inspection_date')]
class Hive extends Model
{
use CascadeSoftDeletes, SoftDeletes;
@@ -22,16 +32,6 @@ class Hive extends Model
protected $cascadeDeletes = ['queen', 'inspections', 'layers', 'frames'];
- protected $fillable = ['user_id', 'location_id', 'hive_type_id', 'color', 'name', 'bb_width_cm', 'bb_depth_cm', 'bb_height_cm', 'fr_width_cm', 'fr_height_cm', 'order'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['user_id', 'deleted_at', 'pivot'];
-
- protected $appends = ['type', 'location', 'attention', 'impression', 'notes', 'reminder', 'reminder_date', 'inspection_count', 'sensors', 'owner', 'editable', 'group_ids', 'last_inspection_date'];
-
- public $timestamps = false;
-
public static function boot()
{
parent::boot();
diff --git a/app/HiveLayer.php b/app/HiveLayer.php
index 9e7675b6..ee8a700e 100644
--- a/app/HiveLayer.php
+++ b/app/HiveLayer.php
@@ -3,6 +3,11 @@
namespace App;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -10,21 +15,16 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[WithoutTimestamps]
+#[Fillable('hive_id', 'category_id', 'order', 'color')]
+#[Guarded('id')]
+#[Hidden('category_id', 'hive_id', 'created_at', 'deleted_at', 'frames')]
+#[Appends('type', 'framecount')]
class HiveLayer extends Model
{
use HasFactory;
use SoftDeletes;
- protected $fillable = ['hive_id', 'category_id', 'order', 'color'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['category_id', 'hive_id', 'created_at', 'deleted_at', 'frames'];
-
- protected $appends = ['type', 'framecount'];
-
- public $timestamps = false;
-
// Cache functions
public static function boot()
{
diff --git a/app/HiveLayerFrame.php b/app/HiveLayerFrame.php
index 20e82edd..005769c5 100644
--- a/app/HiveLayerFrame.php
+++ b/app/HiveLayerFrame.php
@@ -2,26 +2,26 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
+#[WithoutTimestamps]
+#[Fillable('layer_id', 'category_id', 'present', 'order')]
+#[Guarded('id')]
+#[Hidden('category_id', 'layer_id', 'created_at', 'deleted_at')]
+#[Appends('type')]
class HiveLayerFrame extends Model
{
use HasFactory;
use SoftDeletes;
- protected $fillable = ['layer_id', 'category_id', 'present', 'order'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['category_id', 'layer_id', 'created_at', 'deleted_at'];
-
- protected $appends = ['type'];
-
- public $timestamps = false;
-
// Relations
public function getTypeAttribute()
{
diff --git a/app/Http/Controllers/Api/Auth/VerificationController.php b/app/Http/Controllers/Api/Auth/VerificationController.php
index 4fdd8440..b7527ca5 100644
--- a/app/Http/Controllers/Api/Auth/VerificationController.php
+++ b/app/Http/Controllers/Api/Auth/VerificationController.php
@@ -8,14 +8,15 @@
use Illuminate\Foundation\Auth\VerifiesEmails;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
/**
* @group Api\Auth\VerificationController
* User verification functions
*/
-class VerificationController extends Controller implements HasMiddleware
+#[Middleware('signed', only: ['verify'])]
+#[Middleware('throttle:10,1', only: ['verify'])]
+class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -49,14 +50,6 @@ public function __construct()
$this->redirectTo = env('WEBAPP_URL', '/').env('WEBAPP_EMAIL_VERIFY_URL', 'login').'?msg=email_verified';
}
- public static function middleware(): array
- {
- return [
- new Middleware('signed', only: ['verify']),
- new Middleware('throttle:10,1', only: ['verify']),
- ];
- }
-
/**
* Show the email verification notice.
*/
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 44f05350..226b249d 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -4,9 +4,10 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
-use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
-class ForgotPasswordController extends Controller implements HasMiddleware
+#[Middleware('guest')]
+class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -21,10 +22,4 @@ class ForgotPasswordController extends Controller implements HasMiddleware
use SendsPasswordResetEmails;
- public static function middleware(): array
- {
- return [
- 'guest',
- ];
- }
}
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php
index 8f53c4bc..d2d869be 100644
--- a/app/Http/Controllers/Auth/LoginController.php
+++ b/app/Http/Controllers/Auth/LoginController.php
@@ -6,10 +6,10 @@
use Auth;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\RedirectResponse;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
-class LoginController extends Controller implements HasMiddleware
+#[Middleware('guest', except: ['logout'])]
+class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -31,13 +31,6 @@ class LoginController extends Controller implements HasMiddleware
*/
protected $redirectTo = '/home';
- public static function middleware(): array
- {
- return [
- new Middleware('guest', except: ['logout']),
- ];
- }
-
public function logout(): RedirectResponse
{
Auth::logout();
diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php
index 34670213..54626271 100644
--- a/app/Http/Controllers/Auth/RegisterController.php
+++ b/app/Http/Controllers/Auth/RegisterController.php
@@ -5,12 +5,13 @@
use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
-use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
-class RegisterController extends Controller implements HasMiddleware
+#[Middleware('guest')]
+class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -32,13 +33,6 @@ class RegisterController extends Controller implements HasMiddleware
*/
protected $redirectTo = '/home';
- public static function middleware(): array
- {
- return [
- 'guest',
- ];
- }
-
/**
* Get a validator for an incoming registration request.
*/
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index f29597f1..1c8bd782 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -4,9 +4,10 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
-use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
-class ResetPasswordController extends Controller implements HasMiddleware
+#[Middleware('guest')]
+class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -28,10 +29,4 @@ class ResetPasswordController extends Controller implements HasMiddleware
*/
protected $redirectTo = '/home';
- public static function middleware(): array
- {
- return [
- 'guest',
- ];
- }
}
diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php
index 7a8356ae..66278a84 100644
--- a/app/Http/Controllers/Auth/VerificationController.php
+++ b/app/Http/Controllers/Auth/VerificationController.php
@@ -4,10 +4,12 @@
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
-use Illuminate\Routing\Controllers\HasMiddleware;
-use Illuminate\Routing\Controllers\Middleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
-class VerificationController extends Controller implements HasMiddleware
+#[Middleware('auth')]
+#[Middleware('signed', only: ['verify'])]
+#[Middleware('throttle:10,1', only: ['verify', 'resend'])]
+class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
@@ -29,12 +31,4 @@ class VerificationController extends Controller implements HasMiddleware
*/
protected $redirectTo = '/home';
- public static function middleware(): array
- {
- return [
- 'auth',
- new Middleware('signed', only: ['verify']),
- new Middleware('throttle:10,1', only: ['verify', 'resend']),
- ];
- }
}
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 8788b96a..0d724f76 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -2,18 +2,12 @@
namespace App\Http\Controllers;
-use Illuminate\Routing\Controllers\HasMiddleware;
+use Illuminate\Routing\Attributes\Controllers\Middleware;
use Illuminate\View\View;
-class HomeController extends Controller implements HasMiddleware
+#[Middleware('auth')]
+class HomeController extends Controller
{
- public static function middleware(): array
- {
- return [
- 'auth',
- ];
- }
-
/**
* Show the application dashboard.
*/
diff --git a/app/Image.php b/app/Image.php
index 4c56234b..9a43f8d9 100644
--- a/app/Image.php
+++ b/app/Image.php
@@ -3,6 +3,9 @@
namespace App;
use Auth;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
@@ -10,6 +13,9 @@
use Moment\Moment;
use Storage;
+#[Table('images', 'id')]
+#[Fillable('storage', 'filename', 'image_url', 'thumb_url', 'description', 'type', 'height', 'width', 'size_kb', 'date', 'user_id', 'hive_id', 'category_id', 'inspection_id')]
+#[Hidden('storage', 'user_id')]
class Image extends Model
{
public static $storage = 'public';
@@ -24,29 +30,6 @@ class Image extends Model
public static $thumbDir = 'thumbs';
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'images';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['storage', 'filename', 'image_url', 'thumb_url', 'description', 'type', 'height', 'width', 'size_kb', 'date', 'user_id', 'hive_id', 'category_id', 'inspection_id'];
-
- protected $hidden = ['storage', 'user_id'];
-
public function category(): BelongsTo
{
return $this->belongsTo(Category::class);
diff --git a/app/Inspection.php b/app/Inspection.php
index 00db53ae..9fbb7a5e 100644
--- a/app/Inspection.php
+++ b/app/Inspection.php
@@ -5,6 +5,11 @@
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
@@ -15,39 +20,17 @@
use LaravelLocalization;
use Moment\Moment;
+#[Table('inspections', 'id')]
+#[WithoutTimestamps]
+#[Fillable('notes', 'created_at', 'impression', 'attention', 'reminder', 'reminder_date', 'checklist_id', 'image_id')]
+#[Hidden('pivot', 'deleted_at', 'hives', 'locations', 'items')]
+#[Appends('owner', 'thumb_url', 'hive_id', 'location_id', 'item_count', 'searchable')]
class Inspection extends Model
{
use CascadeSoftDeletes, SoftDeletes;
protected $cascadeDeletes = ['items'];
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'inspections';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['notes', 'created_at', 'impression', 'attention', 'reminder', 'reminder_date', 'checklist_id', 'image_id'];
-
- protected $hidden = ['pivot', 'deleted_at', 'hives', 'locations', 'items'];
-
- protected $appends = ['owner', 'thumb_url', 'hive_id', 'location_id', 'item_count', 'searchable'];
-
- public $timestamps = false;
-
public static function boot()
{
parent::boot();
diff --git a/app/InspectionItem.php b/app/InspectionItem.php
index 448938b9..31a22f44 100644
--- a/app/InspectionItem.php
+++ b/app/InspectionItem.php
@@ -2,41 +2,24 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
+#[Table('inspection_items', 'id')]
+#[WithoutTimestamps]
+#[Fillable('value', 'inspection_id', 'category_id')]
+#[Appends('val', 'unit', 'type')]
+#[Hidden('category', 'deleted_at', 'inspection_id')]
class InspectionItem extends Model
{
use SoftDeletes;
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'inspection_items';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['value', 'inspection_id', 'category_id'];
-
- protected $appends = ['val', 'unit', 'type'];
-
- protected $hidden = ['category', 'deleted_at', 'inspection_id'];
-
- public $timestamps = false;
-
public function getNameAttribute()
{
return $this->name();
diff --git a/app/Language.php b/app/Language.php
index 5517118e..96036aed 100644
--- a/app/Language.php
+++ b/app/Language.php
@@ -2,17 +2,17 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+#[WithoutTimestamps]
+#[Fillable('name', 'name_english', 'icon', 'abbreviation', 'twochar')]
+#[Appends('lang')]
class Language extends Model
{
- protected $fillable = ['name', 'name_english', 'icon', 'abbreviation', 'twochar'];
-
- protected $appends = ['lang'];
-
- public $timestamps = false;
-
public function getLangAttribute()
{
return $this->twochar;
diff --git a/app/Location.php b/app/Location.php
index 464ce8fb..a31884ce 100644
--- a/app/Location.php
+++ b/app/Location.php
@@ -5,6 +5,11 @@
use Auth;
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -15,6 +20,11 @@
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[WithoutTimestamps]
+#[Fillable('user_id', 'continent_id', 'category_id', 'name', 'coordinate_lat', 'coordinate_lon', 'street', 'street_no', 'postal_code', 'country_code', 'city', 'roofed', 'last_weather_time', 'hex_color')]
+#[Guarded('id')]
+#[Hidden('user_id', 'continent_id', 'category_id')]
+#[Appends('type', 'continent', 'owner')]
class Location extends Model
{
use CascadeSoftDeletes, SoftDeletes;
@@ -22,16 +32,6 @@ class Location extends Model
protected $cascadeDeletes = ['hives', 'inspections'];
- protected $fillable = ['user_id', 'continent_id', 'category_id', 'name', 'coordinate_lat', 'coordinate_lon', 'street', 'street_no', 'postal_code', 'country_code', 'city', 'roofed', 'last_weather_time', 'hex_color'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['user_id', 'continent_id', 'category_id'];
-
- protected $appends = ['type', 'continent', 'owner'];
-
- public $timestamps = false;
-
// Caching
public static function boot()
{
diff --git a/app/Measurement.php b/app/Measurement.php
index 16e7e0de..272a144c 100644
--- a/app/Measurement.php
+++ b/app/Measurement.php
@@ -3,40 +3,20 @@
namespace App;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use LaravelLocalization;
+#[Table('measurements', 'id')]
+#[Fillable('abbreviation', 'physical_quantity_id', 'show_in_charts', 'chart_group', 'min_value', 'max_value', 'hex_color', 'show_in_alerts', 'show_in_dials', 'weather', 'data_source_type', 'data_api_url', 'data_repository_url', 'future')]
+#[Hidden('created_at', 'updated_at')]
+#[Appends('pq', 'unit', 'pq_name_unit', 'low_value', 'high_value')]
class Measurement extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'measurements';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- * data_source_type : type of data source $data_types
- * data_api_url : (external) url to call data from
- * data_repository_url : Github repository URL with explanation, and background of measurement source
- *
- * @var array
- */
- protected $fillable = ['abbreviation', 'physical_quantity_id', 'show_in_charts', 'chart_group', 'min_value', 'max_value', 'hex_color', 'show_in_alerts', 'show_in_dials', 'weather', 'data_source_type', 'data_api_url', 'data_repository_url', 'future'];
-
- protected $hidden = ['created_at', 'updated_at']; // 'parent'
-
- protected $appends = ['pq', 'unit', 'pq_name_unit', 'low_value', 'high_value']; // 'parent'
-
public static $data_source_types = ['db_influx' => 'Influx Database', 'api' => 'API', 'lambda_model' => 'Lambda Model', 'open_weather' => 'Open Weather'];
public static function boot()
diff --git a/app/Models/Alert.php b/app/Models/Alert.php
index 02f3e8a6..a71c362b 100644
--- a/app/Models/Alert.php
+++ b/app/Models/Alert.php
@@ -7,36 +7,19 @@
use App\Location;
use App\Measurement;
use App\User;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[Table('alerts', 'id')]
+#[Fillable('alert_rule_id', 'alert_function', 'alert_value', 'measurement_id', 'show', 'location_name', 'hive_name', 'device_name', 'location_id', 'hive_id', 'device_id', 'user_id', 'count')]
+#[Hidden('show', 'alert_rule')]
+#[Appends('alert_rule_name')]
class Alert extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'alerts';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['alert_rule_id', 'alert_function', 'alert_value', 'measurement_id', 'show', 'location_name', 'hive_name', 'device_name', 'location_id', 'hive_id', 'device_id', 'user_id', 'count'];
-
- protected $hidden = ['show', 'alert_rule']; // 2021-03-09: not (yet) required in front-end, alerts will be deleted
-
- protected $appends = ['alert_rule_name'];
-
// Relations
public function getAlertRuleNameAttribute()
{
diff --git a/app/Models/AlertRule.php b/app/Models/AlertRule.php
index c32c271f..5a6b68fd 100644
--- a/app/Models/AlertRule.php
+++ b/app/Models/AlertRule.php
@@ -7,6 +7,10 @@
use App\Measurement;
use App\User;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -17,33 +21,12 @@
use Moment\Moment;
use Translation;
+#[Table('alert_rules', 'id')]
+#[Fillable('name', 'description', 'measurement_id', 'calculation', 'calculation_minutes', 'comparator', 'comparison', 'threshold_value', 'exclude_months', 'exclude_hours', 'exclude_hive_ids', 'alert_via_email', 'webhook_url', 'active', 'user_id', 'default_rule', 'timezone', 'alert_on_occurences', 'last_calculated_at', 'last_evaluated_at')]
+#[Hidden('last_calculated_at', 'alert_rule_formulas')]
+#[Appends('formulas', 'no_value')]
class AlertRule extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'alert_rules';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['name', 'description', 'measurement_id', 'calculation', 'calculation_minutes', 'comparator', 'comparison', 'threshold_value', 'exclude_months', 'exclude_hours', 'exclude_hive_ids', 'alert_via_email', 'webhook_url', 'active', 'user_id', 'default_rule', 'timezone', 'alert_on_occurences', 'last_calculated_at', 'last_evaluated_at'];
-
- protected $hidden = ['last_calculated_at', 'alert_rule_formulas'];
-
- protected $appends = ['formulas', 'no_value'];
-
public static $calculations = ['min' => 'Minimum', 'max' => 'Maximum', 'ave' => 'Average', 'cnt' => 'Count']; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
public static $influx_calc = ['min' => 'MIN', 'max' => 'MAX', 'ave' => 'MEAN', 'der' => 'DERIVATIVE', 'cnt' => 'COUNT'];
diff --git a/app/Models/AlertRuleFormula.php b/app/Models/AlertRuleFormula.php
index dc91e06b..71149e5b 100644
--- a/app/Models/AlertRuleFormula.php
+++ b/app/Models/AlertRuleFormula.php
@@ -4,35 +4,17 @@
use App\Measurement;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use LaravelLocalization;
use Translation;
+#[Table('alert_rule_formulas', 'id')]
+#[Fillable('alert_rule_id', 'measurement_id', 'calculation', 'comparator', 'comparison', 'logical', 'period_minutes', 'threshold_value', 'future')]
class AlertRuleFormula extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'alert_rule_formulas';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['alert_rule_id', 'measurement_id', 'calculation', 'comparator', 'comparison', 'logical', 'period_minutes', 'threshold_value', 'future'];
-
- protected $hidden = [];
// protected $appends = ['calculation_minutes']; // CAUSES LOOP BY append of alert_rule->formulas
public static $calculations = ['min' => 'Minimum', 'max' => 'Maximum', 'ave' => 'Average', 'cnt' => 'Count']; // exclude "der"=>"Derivative" for the moment (because of user interpretation complexity)
diff --git a/app/Models/CalculationModel.php b/app/Models/CalculationModel.php
index 4995ee76..7affa5c8 100644
--- a/app/Models/CalculationModel.php
+++ b/app/Models/CalculationModel.php
@@ -6,34 +6,17 @@
use App\Measurement;
use Cache;
use GuzzleHttp\Client;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Log;
use Moment\Moment;
+#[Table('calculation_models', 'id')]
+#[Fillable('name', 'measurement_id', 'data_measurement_id', 'data_interval', 'data_relative_interval', 'data_interval_index', 'data_api_url', 'data_api_http_request', 'data_last_call', 'calculation', 'repository_url', 'data_interval_amount', 'calculation_interval_minutes')]
class CalculationModel extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'calculation_models';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['name', 'measurement_id', 'data_measurement_id', 'data_interval', 'data_relative_interval', 'data_interval_index', 'data_api_url', 'data_api_http_request', 'data_last_call', 'calculation', 'repository_url', 'data_interval_amount', 'calculation_interval_minutes'];
-
/**
* Model properties:
* name
diff --git a/app/Models/ChecklistSvg.php b/app/Models/ChecklistSvg.php
index c9af2d63..4e99e3f3 100644
--- a/app/Models/ChecklistSvg.php
+++ b/app/Models/ChecklistSvg.php
@@ -4,32 +4,15 @@
use App\Checklist;
use App\User;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[Table('checklist_svgs', 'id')]
+#[Fillable('user_id', 'checklist_id', 'name', 'svg', 'pages', 'last_print', 'app_version')]
class ChecklistSvg extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'checklist_svgs';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['user_id', 'checklist_id', 'name', 'svg', 'pages', 'last_print', 'app_version'];
-
public function checklist(): BelongsTo
{
return $this->belongsTo(Checklist::class);
diff --git a/app/Models/DashboardGroup.php b/app/Models/DashboardGroup.php
index c7b1698a..f7220944 100644
--- a/app/Models/DashboardGroup.php
+++ b/app/Models/DashboardGroup.php
@@ -3,34 +3,17 @@
namespace App\Models;
use App\User;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[Table('dashboard_groups', 'id')]
+#[Fillable('user_id', 'code', 'name', 'hive_ids', 'speed', 'interval', 'show_inspections', 'show_all', 'hide_measurements', 'logo_url', 'description')]
+#[Hidden('user_id', 'user', 'created_at', 'updated_at')]
class DashboardGroup extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'dashboard_groups';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['user_id', 'code', 'name', 'hive_ids', 'speed', 'interval', 'show_inspections', 'show_all', 'hide_measurements', 'logo_url', 'description'];
-
- protected $hidden = ['user_id', 'user', 'created_at', 'updated_at'];
-
public static $intervals = ['hour' => 'Hour', 'day' => 'Day', 'week' => 'Week', 'month' => 'Month', 'year' => 'Year', 'selection' => 'Selection'];
protected function casts(): array
diff --git a/app/Models/FlashLog.php b/app/Models/FlashLog.php
index 8a5598ee..9f8741f5 100644
--- a/app/Models/FlashLog.php
+++ b/app/Models/FlashLog.php
@@ -8,6 +8,10 @@
use App\Traits\MeasurementLoRaDecoderTrait;
use App\User;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Log;
@@ -15,6 +19,10 @@
use Moment\Moment;
use Storage;
+#[Table('flash_logs', 'id')]
+#[Fillable('user_id', 'device_id', 'hive_id', 'log_messages', 'log_saved', 'log_parsed', 'log_has_timestamps', 'bytes_received', 'log_file', 'log_file_stripped', 'log_file_parsed', 'log_size_bytes', 'log_erased', 'time_percentage', 'persisted_days', 'persisted_measurements', 'persisted_block_ids', 'log_date_start', 'log_date_end', 'logs_per_day', 'csv_url', 'meta_data', 'time_corrections', 'valid_override')]
+#[Hidden('device', 'hive', 'user', 'persisted_block_ids')]
+#[Appends('device_name', 'hive_name', 'user_name')]
class FlashLog extends Model
{
use MeasurementLoRaDecoderTrait;
@@ -27,31 +35,6 @@ class FlashLog extends Model
protected static $minUnixTime = 1546297200; // min time for Flashlog internal time is: 2019-01-01 00:00:00
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'flash_logs';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['user_id', 'device_id', 'hive_id', 'log_messages', 'log_saved', 'log_parsed', 'log_has_timestamps', 'bytes_received', 'log_file', 'log_file_stripped', 'log_file_parsed', 'log_size_bytes', 'log_erased', 'time_percentage', 'persisted_days', 'persisted_measurements', 'persisted_block_ids', 'log_date_start', 'log_date_end', 'logs_per_day', 'csv_url', 'meta_data', 'time_corrections', 'valid_override'];
-
- protected $hidden = ['device', 'hive', 'user', 'persisted_block_ids'];
-
- protected $appends = ['device_name', 'hive_name', 'user_name'];
-
protected function casts(): array
{
return [
diff --git a/app/Models/HiveTag.php b/app/Models/HiveTag.php
index aecd1109..09cbfae0 100644
--- a/app/Models/HiveTag.php
+++ b/app/Models/HiveTag.php
@@ -4,34 +4,17 @@
use App\Hive;
use App\User;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[Table('hive_tags', 'id')]
+#[Fillable('user_id', 'tag', 'hive_id', 'action_id', 'router_link')]
+#[Hidden('id', 'created_at', 'updated_at', 'user_id')]
class HiveTag extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'hive_tags';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['user_id', 'tag', 'hive_id', 'action_id', 'router_link'];
-
- protected $hidden = ['id', 'created_at', 'updated_at', 'user_id'];
-
protected function casts(): array
{
return [
diff --git a/app/PhysicalQuantity.php b/app/PhysicalQuantity.php
index 7702f23e..a61c2006 100644
--- a/app/PhysicalQuantity.php
+++ b/app/PhysicalQuantity.php
@@ -4,20 +4,20 @@
use Cache;
use DB;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Table;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use LaravelLocalization;
+#[Table('physical_quantities')]
+#[WithoutTimestamps]
+#[Appends('trans')]
+#[Fillable('name', 'unit', 'abbreviation', 'low_value', 'high_value')]
class PhysicalQuantity extends Model
{
- protected $table = 'physical_quantities';
-
- protected $appends = ['trans'];
-
- public $fillable = ['name', 'unit', 'abbreviation', 'low_value', 'high_value'];
-
- public $timestamps = false;
-
public static function boot()
{
parent::boot();
diff --git a/app/Queen.php b/app/Queen.php
index 7f36dbd3..1f54cb38 100644
--- a/app/Queen.php
+++ b/app/Queen.php
@@ -4,26 +4,26 @@
use Cache;
use Dyrynda\Database\Support\CascadeSoftDeletes;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[WithoutTimestamps]
+#[Fillable('hive_id', 'created_at', 'race_id', 'quality', 'color', 'name', 'fertilized', 'clipped', 'fertilizing_location', 'origin', 'tree', 'line', 'mother_id', 'marker', 'goal', 'description', 'birth_date')]
+#[Guarded('id')]
+#[Hidden('fertilizing_location', 'marker', 'goal', 'deleted_at', 'laravel_through_key', 'created_at')]
+#[Appends('race')]
class Queen extends Model
{
use CascadeSoftDeletes, SoftDeletes;
- protected $fillable = ['hive_id', 'created_at', 'race_id', 'quality', 'color', 'name', 'fertilized', 'clipped', 'fertilizing_location', 'origin', 'tree', 'line', 'mother_id', 'marker', 'goal', 'description', 'birth_date'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['fertilizing_location', 'marker', 'goal', 'deleted_at', 'laravel_through_key', 'created_at'];
-
- protected $appends = ['race'];
-
- public $timestamps = false;
-
// Caching
public static function boot()
{
diff --git a/app/Research.php b/app/Research.php
index e2b1ea24..cc1d03a5 100644
--- a/app/Research.php
+++ b/app/Research.php
@@ -4,37 +4,20 @@
use Auth;
use DB;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
+#[Table('researches', 'id')]
+#[Fillable('description', 'name', 'url', 'image_id', 'type', 'institution', 'type_of_data_used', 'start_date', 'end_date', 'user_id', 'default_user_ids', 'visible', 'on_invite_only')]
+#[Hidden('users', 'deleted_at', 'user_id', 'owner', 'viewers', 'visible')]
+#[Appends('consent', 'consent_history', 'checklist_names', 'thumb_url')]
class Research extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'researches';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['description', 'name', 'url', 'image_id', 'type', 'institution', 'type_of_data_used', 'start_date', 'end_date', 'user_id', 'default_user_ids', 'visible', 'on_invite_only'];
-
- protected $hidden = ['users', 'deleted_at', 'user_id', 'owner', 'viewers', 'visible'];
-
- protected $appends = ['consent', 'consent_history', 'checklist_names', 'thumb_url'];
-
public static $pictureType = 'research';
protected function casts(): array
diff --git a/app/SampleCode.php b/app/SampleCode.php
index c6aa63b9..870a3861 100644
--- a/app/SampleCode.php
+++ b/app/SampleCode.php
@@ -2,32 +2,15 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[Table('sample_codes', 'id')]
+#[Fillable('sample_code', 'sample_note', 'sample_date', 'test_result', 'test', 'test_date', 'test_lab_name', 'user_id', 'hive_id', 'queen_id')]
class SampleCode extends Model
{
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'sample_codes';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
- protected $fillable = ['sample_code', 'sample_note', 'sample_date', 'test_result', 'test', 'test_date', 'test_lab_name', 'user_id', 'hive_id', 'queen_id'];
-
public function hive(): BelongsTo
{
return $this->belongsTo(Hive::class);
diff --git a/app/SensorDefinition.php b/app/SensorDefinition.php
index fedd13db..04255f79 100644
--- a/app/SensorDefinition.php
+++ b/app/SensorDefinition.php
@@ -3,42 +3,23 @@
namespace App;
use Cache;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;
+#[Table('sensor_definitions', 'id')]
+#[Fillable('name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id', 'updated_at', 'recalculate')]
+#[Appends('input_abbr', 'output_abbr')]
+#[Hidden('input_measurement', 'output_measurement', 'deleted_at')]
class SensorDefinition extends Model
{
use SoftDeletes;
- /**
- * The database table used by the model.
- *
- * @var string
- */
- protected $table = 'sensor_definitions';
-
- /**
- * The database primary key value.
- *
- * @var string
- */
- protected $primaryKey = 'id';
-
- /**
- * Attributes that should be mass-assignable.
- *
- * @var array
- */
-
- // recalculate: true => on the fly correction + at sensor value storage, false (default) => only calculate at sensor value storage
- protected $fillable = ['name', 'inside', 'offset', 'multiplier', 'input_measurement_id', 'output_measurement_id', 'device_id', 'updated_at', 'recalculate'];
-
- protected $appends = ['input_abbr', 'output_abbr'];
-
- protected $hidden = ['input_measurement', 'output_measurement', 'deleted_at'];
-
public static function boot()
{
parent::boot();
diff --git a/app/Setting.php b/app/Setting.php
index 8fba0ce7..88728424 100644
--- a/app/Setting.php
+++ b/app/Setting.php
@@ -2,20 +2,19 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+#[WithoutTimestamps]
+#[Fillable('user_id', 'category_id', 'name', 'value', 'number')]
+#[Guarded('id')]
+#[Hidden('user_id', 'category_id', 'id', 'deleted_at')]
class Setting extends Model
{
- protected $fillable = ['user_id', 'category_id', 'name', 'value', 'number'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['user_id', 'category_id', 'id', 'deleted_at'];
- // protected $appends = ['type'];
-
- public $timestamps = false;
-
// Relations
public function getTypeAttribute()
{
diff --git a/app/Taxonomy.php b/app/Taxonomy.php
index 2e06df29..6409bfca 100644
--- a/app/Taxonomy.php
+++ b/app/Taxonomy.php
@@ -2,6 +2,11 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
+use Illuminate\Database\Eloquent\Attributes\Table;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
@@ -9,22 +14,17 @@
use Kalnoy\Nestedset\NodeTrait;
use LaravelLocalization;
+#[Table('categories')]
+#[Fillable('name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type')]
+#[Guarded('id')]
+#[Hidden('created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'old_id', 'description', 'type', 'input_type', 'options', 'parent_id', 'source', 'name', 'required')]
+#[Appends('icon', 'text')]
class Taxonomy extends Model
{
// This model is used for the creation of the object tree for the JSTree elements
use NodeTrait;
- protected $table = 'categories';
-
- protected $fillable = ['name', 'category_input_id', 'physical_quantity_id', 'parent_id', 'description', 'source', 'icon', 'type'];
-
- protected $guarded = ['id'];
-
- protected $hidden = ['created_at', 'updated_at', 'category_input_id', 'physical_quantity_id', '_lft', '_rgt', 'pivot', 'old_id', 'description', 'type', 'input_type', 'options', 'parent_id', 'source', 'name', 'required'];
-
- protected $appends = ['icon', 'text'];
-
public static $types =
[
'checklist' => 'Hive checklist item',
diff --git a/app/Translation.php b/app/Translation.php
index d988e434..3814055d 100644
--- a/app/Translation.php
+++ b/app/Translation.php
@@ -2,17 +2,17 @@
namespace App;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\WithoutTimestamps;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Support\Facades\DB;
use LaravelLocalization;
+#[WithoutTimestamps]
+#[Fillable('name', 'language_id', 'type', 'translation')]
class Translation extends Model
{
- public $fillable = ['name', 'language_id', 'type', 'translation'];
-
- public $timestamps = false;
-
public static function boot()
{
parent::boot();
diff --git a/app/User.php b/app/User.php
index dac59f72..95caf4a3 100644
--- a/app/User.php
+++ b/app/User.php
@@ -13,6 +13,10 @@
use Auth;
use Cache;
use DB;
+use Illuminate\Database\Eloquent\Attributes\Appends;
+use Illuminate\Database\Eloquent\Attributes\Fillable;
+use Illuminate\Database\Eloquent\Attributes\Guarded;
+use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -23,22 +27,16 @@
use Laratrust\Contracts\LaratrustUser;
use Laratrust\Traits\HasRolesAndPermissions;
+#[Fillable('name', 'email', 'password', 'api_token', 'last_login', 'policy_accepted', 'locale', 'avatar', 'rate_limit_per_min')]
+#[Hidden('password', 'remember_token', 'researchesVisible', 'researchesOwned')]
+#[Guarded('id')]
+#[Appends('app_debug', 'admin', 'permissions')]
class User extends Authenticatable implements LaratrustUser
{
use HasFactory;
use HasRolesAndPermissions;
use Notifiable;
- protected $fillable = ['name', 'email', 'password', 'api_token', 'last_login', 'policy_accepted', 'locale', 'avatar', 'rate_limit_per_min'];
-
- protected $hidden = ['password', 'remember_token', 'researchesVisible', 'researchesOwned'];
-
- protected $guarded = ['id'];
-
- // protected $cascadeDeletes = ['hives','checklists','inspections','locations','sensors']; // for soft deletes
-
- protected $appends = ['app_debug', 'admin', 'permissions'];
-
// Fix for Trebol\Entrust permissions that do not check
// public function can($permission, $arguments=[])
// {
From 4f99772313fd98b4aefd480a33420aa6226aeb7f Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:12 +0000
Subject: [PATCH 115/127] Refactor deprecated request access
---
.../Controllers/AlertRuleFormulaController.php | 2 +-
app/Http/Controllers/Api/UserController.php | 4 ++--
.../Controllers/CalculationModelController.php | 2 +-
app/Http/Controllers/CategoryInputsController.php | 2 +-
app/Http/Controllers/ChecklistSvgController.php | 2 +-
app/Http/Controllers/DashboardGroupController.php | 2 +-
app/Http/Controllers/DeviceController.php | 14 +++++++-------
app/Http/Controllers/FlashLogController.php | 14 +++++++-------
app/Http/Controllers/HiveTagsController.php | 2 +-
app/Http/Controllers/ImageController.php | 2 +-
app/Http/Controllers/InspectionItemsController.php | 2 +-
app/Http/Controllers/LanguageController.php | 2 +-
app/Http/Controllers/MeasurementController.php | 2 +-
app/Http/Controllers/PermissionController.php | 2 +-
.../Controllers/PhysicalQuantityController.php | 2 +-
.../Controllers/SensorDefinitionController.php | 12 ++++++------
app/Http/Controllers/UserController.php | 2 +-
17 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/app/Http/Controllers/AlertRuleFormulaController.php b/app/Http/Controllers/AlertRuleFormulaController.php
index 54d206bd..96eeda18 100644
--- a/app/Http/Controllers/AlertRuleFormulaController.php
+++ b/app/Http/Controllers/AlertRuleFormulaController.php
@@ -14,7 +14,7 @@ class AlertRuleFormulaController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 25;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/Api/UserController.php b/app/Http/Controllers/Api/UserController.php
index e12b8ab9..95db69a7 100644
--- a/app/Http/Controllers/Api/UserController.php
+++ b/app/Http/Controllers/Api/UserController.php
@@ -80,8 +80,8 @@ public function login(Request $request)
{
$credentials =
[
- 'email' => $request->get('email'),
- 'password' => $request->get('password'),
+ 'email' => $request->input('email'),
+ 'password' => $request->input('password'),
];
if (Auth::attempt($credentials)) {
diff --git a/app/Http/Controllers/CalculationModelController.php b/app/Http/Controllers/CalculationModelController.php
index e111a7b5..8e0e72e2 100644
--- a/app/Http/Controllers/CalculationModelController.php
+++ b/app/Http/Controllers/CalculationModelController.php
@@ -14,7 +14,7 @@ class CalculationModelController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 25;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/CategoryInputsController.php b/app/Http/Controllers/CategoryInputsController.php
index 021bf6fb..c3e40bf3 100644
--- a/app/Http/Controllers/CategoryInputsController.php
+++ b/app/Http/Controllers/CategoryInputsController.php
@@ -15,7 +15,7 @@ class CategoryInputsController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 1000;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/ChecklistSvgController.php b/app/Http/Controllers/ChecklistSvgController.php
index c0f4c507..797016f9 100644
--- a/app/Http/Controllers/ChecklistSvgController.php
+++ b/app/Http/Controllers/ChecklistSvgController.php
@@ -14,7 +14,7 @@ class ChecklistSvgController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 25;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/DashboardGroupController.php b/app/Http/Controllers/DashboardGroupController.php
index 3259d3b9..ab49deea 100644
--- a/app/Http/Controllers/DashboardGroupController.php
+++ b/app/Http/Controllers/DashboardGroupController.php
@@ -18,7 +18,7 @@ class DashboardGroupController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 100;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/DeviceController.php b/app/Http/Controllers/DeviceController.php
index 587948bc..39b40af4 100644
--- a/app/Http/Controllers/DeviceController.php
+++ b/app/Http/Controllers/DeviceController.php
@@ -23,9 +23,9 @@ class DeviceController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
- $search_user = $request->get('user');
- $search_res = $request->get('research');
+ $keyword = $request->input('search');
+ $search_user = $request->input('user');
+ $search_res = $request->input('research');
$perPage = 50;
$devices = Device::withTrashed()->where('id', '!=', null);
@@ -88,10 +88,10 @@ public function index(Request $request): View
*/
public function data(Request $request): View
{
- $keyword = $request->get('search');
- $search_user = $request->get('user');
- $search_res = $request->get('research');
- $high_weight = boolval($request->get('high_weight', false));
+ $keyword = $request->input('search');
+ $search_user = $request->input('user');
+ $search_res = $request->input('research');
+ $high_weight = boolval($request->input('high_weight', false));
$perPage = 10;
$devices = Device::withTrashed()->where('id', '!=', null);
diff --git a/app/Http/Controllers/FlashLogController.php b/app/Http/Controllers/FlashLogController.php
index a555d5fd..c0285b12 100644
--- a/app/Http/Controllers/FlashLogController.php
+++ b/app/Http/Controllers/FlashLogController.php
@@ -20,13 +20,13 @@ class FlashLogController extends Controller
*/
public function index(Request $request): View
{
- $bytes = $request->filled('mb') ? intval($request->get('mb') * 1024 * 1024) : null;
- $log_parsed = $request->filled('log_parsed') ? boolval($request->get('log_parsed')) : null;
- $log_has_ts = $request->filled('log_has_timestamps') ? boolval($request->get('log_has_timestamps')) : null;
- $log_csv_url = $request->filled('csv_url') ? (boolval($request->get('csv_url')) ? '!=' : '=') : null; // != null / = null
- $search_user = $request->get('user');
- $search_dev = $request->get('device');
- $device_id = $request->get('device_id');
+ $bytes = $request->filled('mb') ? intval($request->input('mb') * 1024 * 1024) : null;
+ $log_parsed = $request->filled('log_parsed') ? boolval($request->input('log_parsed')) : null;
+ $log_has_ts = $request->filled('log_has_timestamps') ? boolval($request->input('log_has_timestamps')) : null;
+ $log_csv_url = $request->filled('csv_url') ? (boolval($request->input('csv_url')) ? '!=' : '=') : null; // != null / = null
+ $search_user = $request->input('user');
+ $search_dev = $request->input('device');
+ $device_id = $request->input('device_id');
$perPage = 50;
$flashlogs = FlashLog::where('id', '!=', null);
diff --git a/app/Http/Controllers/HiveTagsController.php b/app/Http/Controllers/HiveTagsController.php
index 1d521c38..c81928de 100644
--- a/app/Http/Controllers/HiveTagsController.php
+++ b/app/Http/Controllers/HiveTagsController.php
@@ -14,7 +14,7 @@ class HiveTagsController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 25;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php
index 52657aa1..14974cc1 100644
--- a/app/Http/Controllers/ImageController.php
+++ b/app/Http/Controllers/ImageController.php
@@ -14,7 +14,7 @@ class ImageController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 25;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/InspectionItemsController.php b/app/Http/Controllers/InspectionItemsController.php
index 75bc3ea2..0744b133 100644
--- a/app/Http/Controllers/InspectionItemsController.php
+++ b/app/Http/Controllers/InspectionItemsController.php
@@ -14,7 +14,7 @@ class InspectionItemsController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 100;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/LanguageController.php b/app/Http/Controllers/LanguageController.php
index 0e78de6f..965a2b45 100644
--- a/app/Http/Controllers/LanguageController.php
+++ b/app/Http/Controllers/LanguageController.php
@@ -14,7 +14,7 @@ class LanguageController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 1000;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/MeasurementController.php b/app/Http/Controllers/MeasurementController.php
index d73cbf52..0245ae40 100644
--- a/app/Http/Controllers/MeasurementController.php
+++ b/app/Http/Controllers/MeasurementController.php
@@ -15,7 +15,7 @@ class MeasurementController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
if (! empty($keyword)) {
$measurement = Measurement::where('abbreviation', 'LIKE', "%$keyword%")->get();
diff --git a/app/Http/Controllers/PermissionController.php b/app/Http/Controllers/PermissionController.php
index dbf5290c..77bbc2b3 100644
--- a/app/Http/Controllers/PermissionController.php
+++ b/app/Http/Controllers/PermissionController.php
@@ -14,7 +14,7 @@ class PermissionController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 1000;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/PhysicalQuantityController.php b/app/Http/Controllers/PhysicalQuantityController.php
index 51c051a9..ea5d22ee 100644
--- a/app/Http/Controllers/PhysicalQuantityController.php
+++ b/app/Http/Controllers/PhysicalQuantityController.php
@@ -14,7 +14,7 @@ class PhysicalQuantityController extends Controller
*/
public function index(Request $request): View
{
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 1000;
if (! empty($keyword)) {
diff --git a/app/Http/Controllers/SensorDefinitionController.php b/app/Http/Controllers/SensorDefinitionController.php
index e6c1ccaa..7f936a7d 100644
--- a/app/Http/Controllers/SensorDefinitionController.php
+++ b/app/Http/Controllers/SensorDefinitionController.php
@@ -17,12 +17,12 @@ class SensorDefinitionController extends Controller
*/
public function index(Request $request): View
{
- $page = $request->get('page');
- $keyword = $request->get('search');
- $search_user = $request->get('user');
- $search_dev = $request->get('device');
- $search_mid = $request->get('measurement_id');
- $device_id = $request->get('device_id');
+ $page = $request->input('page');
+ $keyword = $request->input('search');
+ $search_user = $request->input('user');
+ $search_dev = $request->input('device');
+ $search_mid = $request->input('measurement_id');
+ $device_id = $request->input('device_id');
$perPage = 50;
$defs = SensorDefinition::where('id', '!=', null);
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index e3bec843..14854394 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -26,7 +26,7 @@ public function index(Request $request): View
$show_stats = $request->filled('stats');
if (Auth::user()->hasRole('superadmin')) {
- $keyword = $request->get('search');
+ $keyword = $request->input('search');
$perPage = 50;
$users = User::where('id', '!=', null);
From 3bc7aa0fba505f7595bef0b56b5bf285c392ad5c Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:17 +0000
Subject: [PATCH 116/127] Bump Composer dependencies
---
composer.json | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/composer.json b/composer.json
index 575a6091..82a85eea 100644
--- a/composer.json
+++ b/composer.json
@@ -14,37 +14,37 @@
"license": "MIT",
"type": "project",
"require": {
- "php": "^8.2",
+ "php": "^8.3",
"doctrine/dbal": "^3.5",
- "dyrynda/laravel-cascade-soft-deletes": "^4.5",
+ "dyrynda/laravel-cascade-soft-deletes": "^4.6",
"ellipsesynergie/api-response": "0.12.*",
"fightbulc/moment": "*",
"guzzlehttp/guzzle": "^7.8",
"influxdata/influxdb-client-php": "3.6",
"influxdb/influxdb-php": "^1.15",
"intervention/image": "^2.4.2",
- "kalnoy/nestedset": "^6.0",
- "knuckleswtf/scribe": "5.0",
- "laravel/framework": "^12.61",
- "laravel/tinker": "^2.10.1",
+ "kalnoy/nestedset": "^7.0",
+ "knuckleswtf/scribe": "^5.8",
+ "laravel/framework": "^13.12",
+ "laravel/tinker": "^3.0",
"laravel/ui": "^4.6",
"league/flysystem-aws-s3-v3": "^3.0",
- "mcamara/laravel-localization": "2.3.0",
+ "mcamara/laravel-localization": "^2.4",
"phpoffice/phpspreadsheet": "^1.15",
"predis/predis": "^2.2",
- "santigarcor/laratrust": "^8.4",
- "spatie/laravel-html": "^3.11",
+ "santigarcor/laratrust": "^8.5",
+ "spatie/laravel-html": "^3.13",
"tray-labs/laravel-influxdb": "1.0.12"
},
"require-dev": {
"appzcoder/crud-generator": "^4.0",
- "barryvdh/laravel-debugbar": "^3.15",
+ "barryvdh/laravel-debugbar": "^4.0",
"filp/whoops": "^2.8",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"phpunit/phpunit": "^11.5.3",
"fakerphp/faker": "^1.23",
- "laravel/pail": "^1.2.2"
+ "laravel/pail": "^1.2.5"
},
"config": {
"optimize-autoloader": true,
From 246b2b7f6853e55c4d0e975df4888c88f1ad38bd Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:22 +0000
Subject: [PATCH 117/127] Rename Bootstrap 3 pagination templates
---
.../pagination/{default.blade.php => bootstrap-3.blade.php} | 0
.../{simple-default.blade.php => simple-bootstrap-3.blade.php} | 0
2 files changed, 0 insertions(+), 0 deletions(-)
rename resources/views/vendor/pagination/{default.blade.php => bootstrap-3.blade.php} (100%)
rename resources/views/vendor/pagination/{simple-default.blade.php => simple-bootstrap-3.blade.php} (100%)
diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/bootstrap-3.blade.php
similarity index 100%
rename from resources/views/vendor/pagination/default.blade.php
rename to resources/views/vendor/pagination/bootstrap-3.blade.php
diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-bootstrap-3.blade.php
similarity index 100%
rename from resources/views/vendor/pagination/simple-default.blade.php
rename to resources/views/vendor/pagination/simple-bootstrap-3.blade.php
From 81b652deec71dcebe9ed9c74a15d60ba4027df13 Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:22 +0000
Subject: [PATCH 118/127] Default core files
---
...01_add_expiration_index_to_cache_table.php | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 database/migrations/2026_06_02_000001_add_expiration_index_to_cache_table.php
diff --git a/database/migrations/2026_06_02_000001_add_expiration_index_to_cache_table.php b/database/migrations/2026_06_02_000001_add_expiration_index_to_cache_table.php
new file mode 100644
index 00000000..0893b75a
--- /dev/null
+++ b/database/migrations/2026_06_02_000001_add_expiration_index_to_cache_table.php
@@ -0,0 +1,30 @@
+index('expiration');
+ });
+
+ Schema::table('cache_locks', function (Blueprint $table) {
+ $table->index('expiration');
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('cache', function (Blueprint $table) {
+ $table->dropIndex(['expiration']);
+ });
+
+ Schema::table('cache_locks', function (Blueprint $table) {
+ $table->dropIndex(['expiration']);
+ });
+ }
+};
From 5412da31d882471039623232ce6f1d2c5645962b Mon Sep 17 00:00:00 2001
From: Shift
Date: Tue, 2 Jun 2026 11:47:28 +0000
Subject: [PATCH 119/127] Shift cleanup
---
app/Http/Controllers/Auth/ForgotPasswordController.php | 1 -
app/Http/Controllers/Auth/ResetPasswordController.php | 1 -
app/Http/Controllers/Auth/VerificationController.php | 1 -
3 files changed, 3 deletions(-)
diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php
index 226b249d..6037dbcd 100644
--- a/app/Http/Controllers/Auth/ForgotPasswordController.php
+++ b/app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -21,5 +21,4 @@ class ForgotPasswordController extends Controller
*/
use SendsPasswordResetEmails;
-
}
diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php
index 1c8bd782..134eb399 100644
--- a/app/Http/Controllers/Auth/ResetPasswordController.php
+++ b/app/Http/Controllers/Auth/ResetPasswordController.php
@@ -28,5 +28,4 @@ class ResetPasswordController extends Controller
* @var string
*/
protected $redirectTo = '/home';
-
}
diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php
index 66278a84..dda40bcc 100644
--- a/app/Http/Controllers/Auth/VerificationController.php
+++ b/app/Http/Controllers/Auth/VerificationController.php
@@ -30,5 +30,4 @@ class VerificationController extends Controller
* @var string
*/
protected $redirectTo = '/home';
-
}
From e48bdaa7514df94f43e123437d81d2eb989e84d5 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 15:05:26 +0200
Subject: [PATCH 120/127] Removed incompatible appzcoder/crud-generator but
composer install fails with Class
"Appzcoder\CrudGenerator\CrudGeneratorServiceProvider" not found - crud
generator is needed after all
---
composer.json | 5 +-
composer.lock | 928 +++++++++++++++++++++++-------------------------
public/herd.yml | 2 +-
3 files changed, 446 insertions(+), 489 deletions(-)
diff --git a/composer.json b/composer.json
index 82a85eea..a3166225 100644
--- a/composer.json
+++ b/composer.json
@@ -34,10 +34,9 @@
"predis/predis": "^2.2",
"santigarcor/laratrust": "^8.5",
"spatie/laravel-html": "^3.13",
- "tray-labs/laravel-influxdb": "1.0.12"
+ "tray-labs/laravel-influxdb": "^1.0.13"
},
"require-dev": {
- "appzcoder/crud-generator": "^4.0",
"barryvdh/laravel-debugbar": "^4.0",
"filp/whoops": "^2.8",
"mockery/mockery": "^1.6",
@@ -51,7 +50,7 @@
"preferred-install": "dist",
"sort-packages": true,
"platform": {
- "php": "8.2"
+ "php": "8.3"
},
"allow-plugins": {
"kylekatarnls/update-helper": true,
diff --git a/composer.lock b/composer.lock
index ad823236..4d888e5d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "ef50badebd5e646640047360ae7d7ad8",
+ "content-hash": "5784454da808321664f781e136c03a85",
"packages": [
{
"name": "aws/aws-crt-php",
@@ -992,26 +992,26 @@
},
{
"name": "dyrynda/laravel-cascade-soft-deletes",
- "version": "4.5.0",
+ "version": "4.6.1",
"source": {
"type": "git",
"url": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes.git",
- "reference": "df5fee4003fc183c8ef46dc9055c1cada4182494"
+ "reference": "9c2dd92c70dcdf4eec61b8fbbf09740c2a8b62b4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/df5fee4003fc183c8ef46dc9055c1cada4182494",
- "reference": "df5fee4003fc183c8ef46dc9055c1cada4182494",
+ "url": "https://api.github.com/repos/michaeldyrynda/laravel-cascade-soft-deletes/zipball/9c2dd92c70dcdf4eec61b8fbbf09740c2a8b62b4",
+ "reference": "9c2dd92c70dcdf4eec61b8fbbf09740c2a8b62b4",
"shasum": ""
},
"require": {
- "illuminate/database": "^11.0 || ^12.0",
- "illuminate/events": "^11.0 || ^12.0",
- "php": "^8.2"
+ "illuminate/database": "^11.0 || ^12.0 || ^13.0",
+ "illuminate/events": "^11.0 || ^12.0 || ^13.0",
+ "php": "^8.3"
},
"require-dev": {
- "pestphp/pest": "^2.34 || ^3.7",
- "pestphp/pest-plugin-drift": "^2.5"
+ "laravel/pint": "^1.29",
+ "pestphp/pest": "^4.4.2"
},
"type": "utility",
"autoload": {
@@ -1033,9 +1033,9 @@
"description": "Cascading deletes for Eloquent models that implement soft deletes",
"support": {
"issues": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/issues",
- "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.5.0"
+ "source": "https://github.com/michaeldyrynda/laravel-cascade-soft-deletes/tree/4.6.1"
},
- "time": "2025-02-26T10:22:40+00:00"
+ "time": "2026-03-20T21:07:23+00:00"
},
{
"name": "egulias/email-validator",
@@ -1168,56 +1168,6 @@
},
"time": "2016-07-14T12:33:35+00:00"
},
- {
- "name": "erusev/parsedown",
- "version": "1.7.4",
- "source": {
- "type": "git",
- "url": "https://github.com/erusev/parsedown.git",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
- "reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
- "shasum": ""
- },
- "require": {
- "ext-mbstring": "*",
- "php": ">=5.3.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "Parsedown": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Emanuil Rusev",
- "email": "hello@erusev.com",
- "homepage": "http://erusev.com"
- }
- ],
- "description": "Parser for Markdown.",
- "homepage": "http://parsedown.org",
- "keywords": [
- "markdown",
- "parser"
- ],
- "support": {
- "issues": "https://github.com/erusev/parsedown/issues",
- "source": "https://github.com/erusev/parsedown/tree/1.7.x"
- },
- "time": "2019-12-30T22:54:17+00:00"
- },
{
"name": "ezyang/htmlpurifier",
"version": "v4.19.0",
@@ -1605,25 +1555,26 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.10.6",
+ "version": "7.11.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94"
+ "reference": "c987f8ce84b8434fa430795eca0f3430663da72b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e7412b3180912c01650cc66647f18c1d1cbe9b94",
- "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c987f8ce84b8434fa430795eca0f3430663da72b",
+ "reference": "c987f8ce84b8434fa430795eca0f3430663da72b",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^2.3",
- "guzzlehttp/psr7": "^2.8",
+ "guzzlehttp/promises": "^2.5",
+ "guzzlehttp/psr7": "^2.11",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
- "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ "symfony/deprecation-contracts": "^2.5 || ^3.0",
+ "symfony/polyfill-php80": "^1.24"
},
"provide": {
"psr/http-client-implementation": "1.0"
@@ -1712,7 +1663,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.10.6"
+ "source": "https://github.com/guzzle/guzzle/tree/7.11.0"
},
"funding": [
{
@@ -1728,24 +1679,25 @@
"type": "tidelift"
}
],
- "time": "2026-06-01T13:06:22+00:00"
+ "time": "2026-06-02T12:40:51+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "2.4.1",
+ "version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2"
+ "reference": "4360e982f87f5f258bf872d094647791db2f4c8e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2",
- "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e",
+ "reference": "4360e982f87f5f258bf872d094647791db2f4c8e",
"shasum": ""
},
"require": {
- "php": "^7.2.5 || ^8.0"
+ "php": "^7.2.5 || ^8.0",
+ "symfony/deprecation-contracts": "^2.5 || ^3.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
@@ -1795,7 +1747,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/2.4.1"
+ "source": "https://github.com/guzzle/promises/tree/2.5.0"
},
"funding": [
{
@@ -1811,27 +1763,29 @@
"type": "tidelift"
}
],
- "time": "2026-05-20T22:57:30+00:00"
+ "time": "2026-06-02T12:23:43+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "2.10.4",
+ "version": "2.11.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "d2a1a094e396da8957e797489fddaf860c340cfc"
+ "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/d2a1a094e396da8957e797489fddaf860c340cfc",
- "reference": "d2a1a094e396da8957e797489fddaf860c340cfc",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f",
+ "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
- "ralouphie/getallheaders": "^3.0"
+ "ralouphie/getallheaders": "^3.0",
+ "symfony/deprecation-contracts": "^2.5 || ^3.0",
+ "symfony/polyfill-php80": "^1.24"
},
"provide": {
"psr/http-factory-implementation": "1.0",
@@ -1912,7 +1866,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.10.4"
+ "source": "https://github.com/guzzle/psr7/tree/2.11.0"
},
"funding": [
{
@@ -1928,7 +1882,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-29T12:59:07+00:00"
+ "time": "2026-06-02T12:30:48+00:00"
},
{
"name": "guzzlehttp/uri-template",
@@ -2219,26 +2173,26 @@
},
{
"name": "kalnoy/nestedset",
- "version": "v6.0.6",
+ "version": "v7.0.0",
"source": {
"type": "git",
"url": "https://github.com/lazychaser/laravel-nestedset.git",
- "reference": "3cfc56a9759fb592bc903056166bfc0867f9e679"
+ "reference": "4e9ad66a3c6a8867dd69eea53e7954c3b150af6d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/3cfc56a9759fb592bc903056166bfc0867f9e679",
- "reference": "3cfc56a9759fb592bc903056166bfc0867f9e679",
+ "url": "https://api.github.com/repos/lazychaser/laravel-nestedset/zipball/4e9ad66a3c6a8867dd69eea53e7954c3b150af6d",
+ "reference": "4e9ad66a3c6a8867dd69eea53e7954c3b150af6d",
"shasum": ""
},
"require": {
- "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/events": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/database": ">=13.0",
+ "illuminate/events": ">=13.0",
+ "illuminate/support": ">=13.0",
"php": "^8.0"
},
"require-dev": {
- "phpunit/phpunit": "7.*|8.*|9.*|^10.5"
+ "phpunit/phpunit": ">=7.0"
},
"type": "library",
"extra": {
@@ -2276,9 +2230,9 @@
],
"support": {
"issues": "https://github.com/lazychaser/laravel-nestedset/issues",
- "source": "https://github.com/lazychaser/laravel-nestedset/tree/v6.0.6"
+ "source": "https://github.com/lazychaser/laravel-nestedset/tree/v7.0.0"
},
- "time": "2025-04-22T19:38:02+00:00"
+ "time": "2026-04-11T13:45:58+00:00"
},
{
"name": "kkszymanowski/traitor",
@@ -2332,52 +2286,50 @@
},
{
"name": "knuckleswtf/scribe",
- "version": "5.0.0",
+ "version": "5.10.0",
"source": {
"type": "git",
"url": "https://github.com/knuckleswtf/scribe.git",
- "reference": "c5e567728ef85ea4af28f4c264dc1ef2293d7e32"
+ "reference": "d4da86e57e49dac4694b200354cfa962bfae3168"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/c5e567728ef85ea4af28f4c264dc1ef2293d7e32",
- "reference": "c5e567728ef85ea4af28f4c264dc1ef2293d7e32",
+ "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/d4da86e57e49dac4694b200354cfa962bfae3168",
+ "reference": "d4da86e57e49dac4694b200354cfa962bfae3168",
"shasum": ""
},
"require": {
- "erusev/parsedown": "1.7.4",
"ext-fileinfo": "*",
- "ext-json": "*",
"ext-pdo": "*",
"fakerphp/faker": "^1.23.1",
- "laravel/framework": "^9.0|^10.0|^11.0|^12.0",
+ "laravel/framework": "^9.21 || ^10.0 || ^11.0 || ^12.0 || ^13.0",
"league/flysystem": "^3.0",
"mpociot/reflection-docblock": "^1.0.1",
"nikic/php-parser": "^5.0",
- "nunomaduro/collision": "^6.0|^7.0|^8.0",
+ "nunomaduro/collision": "^6.0 || ^7.0 || ^8.0",
+ "parsedown/parsedown": "^1.7",
"php": ">=8.1",
"ramsey/uuid": "^4.2.2",
- "shalvah/clara": "^3.1.0",
- "shalvah/upgrader": ">=0.6.0",
- "spatie/data-transfer-object": "^2.6|^3.0",
- "symfony/var-exporter": "^6.0|^7.0",
- "symfony/yaml": "^6.0|^7.0"
+ "shalvah/upgrader": "^0.6.0",
+ "symfony/var-exporter": "^6.0 || ^7.0 || ^8.0",
+ "symfony/yaml": "^6.0 || ^7.0 || ^8.0"
},
"replace": {
"mpociot/laravel-apidoc-generator": "*"
},
"require-dev": {
- "dms/phpunit-arraysubset-asserts": "^v0.5.0",
+ "dms/phpunit-arraysubset-asserts": "^0.5.0",
"laravel/legacy-factories": "^1.3.0",
+ "laravel/pint": "^1.20",
"league/fractal": "^0.20",
"nikic/fast-route": "^1.3",
- "orchestra/testbench": "^7.0|^8.0|^v9.10.0",
- "pestphp/pest": "^1.21|^2.0|^3.0",
+ "orchestra/testbench": "^7.0 || ^8.0 || ^9.10 || ^10.0 || ^11.0",
+ "pestphp/pest": "^1.21 || ^2.0 || ^3.0 || ^4.0",
"phpstan/phpstan": "^2.1.5",
- "phpunit/phpunit": "^9.0|^10.0",
+ "phpunit/phpunit": "^9.0 || ^10.0 || ^11.0 || ^12.0",
"spatie/ray": "^1.41",
- "symfony/css-selector": "^6.0",
- "symfony/dom-crawler": "^6.0"
+ "symfony/css-selector": "^6.0 || ^7.0 || ^8.0",
+ "symfony/dom-crawler": "^6.0 || ^7.0 || ^8.0"
},
"type": "library",
"extra": {
@@ -2406,7 +2358,7 @@
}
],
"description": "Generate API documentation for humans from your Laravel codebase.✍",
- "homepage": "http://github.com/knuckleswtf/scribe",
+ "homepage": "https://github.com/knuckleswtf/scribe",
"keywords": [
"api",
"documentation",
@@ -2414,7 +2366,7 @@
],
"support": {
"issues": "https://github.com/knuckleswtf/scribe/issues",
- "source": "https://github.com/knuckleswtf/scribe/tree/5.0.0"
+ "source": "https://github.com/knuckleswtf/scribe/tree/5.10.0"
},
"funding": [
{
@@ -2422,28 +2374,28 @@
"type": "patreon"
}
],
- "time": "2025-02-19T10:32:40+00:00"
+ "time": "2026-05-09T21:49:49+00:00"
},
{
"name": "laravel/framework",
- "version": "v12.61.0",
+ "version": "v13.12.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf"
+ "reference": "6ac27a7fcfa728250c9f77921cb8fb955546b591"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/1124062a1ca92d290c8bcb9b7f649920fa6816bf",
- "reference": "1124062a1ca92d290c8bcb9b7f649920fa6816bf",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/6ac27a7fcfa728250c9f77921cb8fb955546b591",
+ "reference": "6ac27a7fcfa728250c9f77921cb8fb955546b591",
"shasum": ""
},
"require": {
- "brick/math": "^0.11|^0.12|^0.13|^0.14",
+ "brick/math": "^0.14.2 || ^0.15 || ^0.16 || ^0.17",
"composer-runtime-api": "^2.2",
"doctrine/inflector": "^2.0.5",
"dragonmantank/cron-expression": "^3.4",
- "egulias/email-validator": "^3.2.1|^4.0",
+ "egulias/email-validator": "^4.0",
"ext-ctype": "*",
"ext-filter": "*",
"ext-hash": "*",
@@ -2453,9 +2405,10 @@
"ext-tokenizer": "*",
"fruitcake/php-cors": "^1.3",
"guzzlehttp/guzzle": "^7.8.2",
+ "guzzlehttp/promises": "^2.0.3",
"guzzlehttp/uri-template": "^1.0",
"laravel/prompts": "^0.3.0",
- "laravel/serializable-closure": "^1.3|^2.0",
+ "laravel/serializable-closure": "^2.0.10",
"league/commonmark": "^2.8.1",
"league/flysystem": "^3.25.1",
"league/flysystem-local": "^3.25.1",
@@ -2463,25 +2416,25 @@
"monolog/monolog": "^3.0",
"nesbot/carbon": "^3.8.4",
"nunomaduro/termwind": "^2.0",
- "php": "^8.2",
- "psr/container": "^1.1.1|^2.0.1",
- "psr/log": "^1.0|^2.0|^3.0",
- "psr/simple-cache": "^1.0|^2.0|^3.0",
+ "php": "^8.3",
+ "psr/container": "^1.1.1 || ^2.0.1",
+ "psr/log": "^1.0 || ^2.0 || ^3.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
"ramsey/uuid": "^4.7",
- "symfony/console": "^7.2.0",
- "symfony/error-handler": "^7.2.0",
- "symfony/finder": "^7.2.0",
- "symfony/http-foundation": "^7.2.0",
- "symfony/http-kernel": "^7.2.0",
- "symfony/mailer": "^7.2.0",
- "symfony/mime": "^7.2.0",
- "symfony/polyfill-php83": "^1.33",
- "symfony/polyfill-php84": "^1.34",
- "symfony/polyfill-php85": "^1.34",
- "symfony/process": "^7.2.0",
- "symfony/routing": "^7.2.0",
- "symfony/uid": "^7.2.0",
- "symfony/var-dumper": "^7.2.0",
+ "symfony/console": "^7.4.0 || ^8.0.0",
+ "symfony/error-handler": "^7.4.0 || ^8.0.0",
+ "symfony/finder": "^7.4.0 || ^8.0.0",
+ "symfony/http-foundation": "^7.4.0 || ^8.0.0",
+ "symfony/http-kernel": "^7.4.0 || ^8.0.0",
+ "symfony/mailer": "^7.4.0 || ^8.0.0",
+ "symfony/mime": "^7.4.0 || ^8.0.0",
+ "symfony/polyfill-php84": "^1.36",
+ "symfony/polyfill-php85": "^1.36",
+ "symfony/polyfill-php86": "^1.36",
+ "symfony/process": "^7.4.5 || ^8.0.5",
+ "symfony/routing": "^7.4.0 || ^8.0.0",
+ "symfony/uid": "^7.4.0 || ^8.0.0",
+ "symfony/var-dumper": "^7.4.0 || ^8.0.0",
"tijsverkoyen/css-to-inline-styles": "^2.2.5",
"vlucas/phpdotenv": "^5.6.1",
"voku/portable-ascii": "^2.0.2"
@@ -2490,9 +2443,9 @@
"tightenco/collect": "<5.5.33"
},
"provide": {
- "psr/container-implementation": "1.1|2.0",
- "psr/log-implementation": "1.0|2.0|3.0",
- "psr/simple-cache-implementation": "1.0|2.0|3.0"
+ "psr/container-implementation": "1.1 || 2.0",
+ "psr/log-implementation": "1.0 || 2.0 || 3.0",
+ "psr/simple-cache-implementation": "1.0 || 2.0 || 3.0"
},
"replace": {
"illuminate/auth": "self.version",
@@ -2538,8 +2491,7 @@
"aws/aws-sdk-php": "^3.322.9",
"ext-gmp": "*",
"fakerphp/faker": "^1.24",
- "guzzlehttp/promises": "^2.0.3",
- "guzzlehttp/psr7": "^2.4",
+ "guzzlehttp/psr7": "^2.9",
"laravel/pint": "^1.18",
"league/flysystem-aws-s3-v3": "^3.25.1",
"league/flysystem-ftp": "^3.25.1",
@@ -2548,22 +2500,23 @@
"league/flysystem-sftp-v3": "^3.25.1",
"mockery/mockery": "^1.6.10",
"opis/json-schema": "^2.4.1",
- "orchestra/testbench-core": "^10.9.0",
- "pda/pheanstalk": "^5.0.6|^7.0.0",
+ "orchestra/testbench-core": "^11.0.0",
+ "pda/pheanstalk": "^7.0.0 || ^8.0.0",
"php-http/discovery": "^1.15",
- "phpstan/phpstan": "^2.1.41",
- "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1",
- "predis/predis": "^2.3|^3.0",
- "resend/resend-php": "^0.10.0|^1.0",
- "symfony/cache": "^7.2.0",
- "symfony/http-client": "^7.2.0",
- "symfony/psr-http-message-bridge": "^7.2.0",
- "symfony/translation": "^7.2.0"
+ "phpstan/phpstan": "^2.0",
+ "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3",
+ "predis/predis": "^2.3 || ^3.0",
+ "rector/rector": "^2.3",
+ "resend/resend-php": "^1.0",
+ "symfony/cache": "^7.4.0 || ^8.0.0",
+ "symfony/http-client": "^7.4.0 || ^8.0.0",
+ "symfony/psr-http-message-bridge": "^7.4.0 || ^8.0.0",
+ "symfony/translation": "^7.4.0 || ^8.0.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).",
- "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).",
+ "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).",
"ext-apcu": "Required to use the APC cache driver.",
"ext-fileinfo": "Required to use the Filesystem class.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
@@ -2572,7 +2525,7 @@
"ext-pcntl": "Required to use all features of the queue worker and console signal trapping.",
"ext-pdo": "Required to use all database features.",
"ext-posix": "Required to use all features of the queue worker.",
- "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).",
+ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).",
"fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).",
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
@@ -2582,24 +2535,25 @@
"league/flysystem-read-only": "Required to use read-only disks (^3.25.1)",
"league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).",
"mockery/mockery": "Required to use mocking (^1.6).",
- "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).",
+ "pda/pheanstalk": "Required to use the beanstalk queue driver (^7.0 || ^8.0).",
"php-http/discovery": "Required to use PSR-7 bridging features (^1.15).",
- "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).",
- "predis/predis": "Required to use the predis connector (^2.3|^3.0).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^11.5.50 || ^12.5.8 || ^13.0.3).",
+ "predis/predis": "Required to use the predis connector (^2.3 || ^3.0).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
- "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).",
- "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0|^1.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^7.2).",
- "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).",
- "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).",
- "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.2).",
- "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.2).",
- "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)."
+ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0 || ^7.0).",
+ "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0 || ^1.0).",
+ "spatie/fork": "Required to use the 'fork' concurrency driver (^1.2).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^7.4 || ^8.0).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^7.4 || ^8.0).",
+ "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.4 || ^8.0).",
+ "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.4 || ^8.0).",
+ "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.4 || ^8.0).",
+ "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.4 || ^8.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "12.x-dev"
+ "dev-master": "13.0.x-dev"
}
},
"autoload": {
@@ -2644,7 +2598,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2026-05-26T23:41:33+00:00"
+ "time": "2026-05-26T23:39:26+00:00"
},
{
"name": "laravel/prompts",
@@ -2768,33 +2722,33 @@
},
{
"name": "laravel/tinker",
- "version": "v2.11.1",
+ "version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/tinker.git",
- "reference": "c9f80cc835649b5c1842898fb043f8cc098dd741"
+ "reference": "4faba77764bd33411735936acdf30446d058c78b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/tinker/zipball/c9f80cc835649b5c1842898fb043f8cc098dd741",
- "reference": "c9f80cc835649b5c1842898fb043f8cc098dd741",
+ "url": "https://api.github.com/repos/laravel/tinker/zipball/4faba77764bd33411735936acdf30446d058c78b",
+ "reference": "4faba77764bd33411735936acdf30446d058c78b",
"shasum": ""
},
"require": {
- "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
- "php": "^7.2.5|^8.0",
- "psy/psysh": "^0.11.1|^0.12.0",
- "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0|^8.0"
+ "illuminate/console": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
+ "illuminate/contracts": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
+ "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
+ "php": "^8.1",
+ "psy/psysh": "^0.12.0",
+ "symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0"
},
"require-dev": {
"mockery/mockery": "~1.3.3|^1.4.2",
"phpstan/phpstan": "^1.10",
- "phpunit/phpunit": "^8.5.8|^9.3.3|^10.0"
+ "phpunit/phpunit": "^10.5|^11.5"
},
"suggest": {
- "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0)."
+ "illuminate/database": "The Illuminate Database package (^8.0|^9.0|^10.0|^11.0|^12.0|^13.0)."
},
"type": "library",
"extra": {
@@ -2802,6 +2756,9 @@
"providers": [
"Laravel\\Tinker\\TinkerServiceProvider"
]
+ },
+ "branch-alias": {
+ "dev-master": "3.x-dev"
}
},
"autoload": {
@@ -2828,9 +2785,9 @@
],
"support": {
"issues": "https://github.com/laravel/tinker/issues",
- "source": "https://github.com/laravel/tinker/tree/v2.11.1"
+ "source": "https://github.com/laravel/tinker/tree/v3.0.2"
},
- "time": "2026-02-06T14:12:35+00:00"
+ "time": "2026-03-17T14:54:13+00:00"
},
{
"name": "laravel/ui",
@@ -3578,31 +3535,31 @@
},
{
"name": "maennchen/zipstream-php",
- "version": "3.1.2",
+ "version": "3.2.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
- "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
+ "reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
- "reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
+ "reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
- "php-64bit": "^8.2"
+ "php-64bit": "^8.3"
},
"require-dev": {
"brianium/paratest": "^7.7",
"ext-zip": "*",
- "friendsofphp/php-cs-fixer": "^3.16",
+ "friendsofphp/php-cs-fixer": "^3.86",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
- "phpunit/phpunit": "^11.0",
+ "phpunit/phpunit": "^12.0",
"vimeo/psalm": "^6.0"
},
"suggest": {
@@ -3644,7 +3601,7 @@
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
- "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.2"
},
"funding": [
{
@@ -3652,7 +3609,7 @@
"type": "github"
}
],
- "time": "2025-01-27T12:07:53+00:00"
+ "time": "2026-04-11T18:38:28+00:00"
},
{
"name": "markbaker/complex",
@@ -3763,25 +3720,25 @@
},
{
"name": "mcamara/laravel-localization",
- "version": "v2.3.0",
+ "version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/mcamara/laravel-localization.git",
- "reference": "af91f489f518fb1907944de8622a19266159d28f"
+ "reference": "b4b530b8d892cc8787b94059085a53b37224009b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/af91f489f518fb1907944de8622a19266159d28f",
- "reference": "af91f489f518fb1907944de8622a19266159d28f",
+ "url": "https://api.github.com/repos/mcamara/laravel-localization/zipball/b4b530b8d892cc8787b94059085a53b37224009b",
+ "reference": "b4b530b8d892cc8787b94059085a53b37224009b",
"shasum": ""
},
"require": {
- "laravel/framework": "^10.0|^11.0|^12.0",
+ "laravel/framework": "^11.0|^12.0|^13.0",
"php": "^8.2"
},
"require-dev": {
- "orchestra/testbench-browser-kit": "^8.5|^9.0|^10.0",
- "phpunit/phpunit": "^10.1|^11.0"
+ "orchestra/testbench": "^9.0|^10.0|^11.0",
+ "phpunit/phpunit": "^10.1|^11.0|^12.5.12"
},
"suggest": {
"ext-intl": "*"
@@ -3823,7 +3780,7 @@
],
"support": {
"issues": "https://github.com/mcamara/laravel-localization/issues",
- "source": "https://github.com/mcamara/laravel-localization/tree/v2.3.0"
+ "source": "https://github.com/mcamara/laravel-localization/tree/v2.4.0"
},
"funding": [
{
@@ -3835,7 +3792,7 @@
"type": "github"
}
],
- "time": "2025-02-26T06:38:01+00:00"
+ "time": "2026-03-17T19:24:07+00:00"
},
{
"name": "monolog/monolog",
@@ -4563,6 +4520,56 @@
],
"time": "2026-02-16T23:10:27+00:00"
},
+ {
+ "name": "parsedown/parsedown",
+ "version": "1.8.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/parsedown/parsedown.git",
+ "reference": "96baaad00f71ba04d76e45b4620f54d3beabd6f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/parsedown/parsedown/zipball/96baaad00f71ba04d76e45b4620f54d3beabd6f7",
+ "reference": "96baaad00f71ba04d76e45b4620f54d3beabd6f7",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.5|^8.5|^9.6"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Parsedown": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
+ }
+ ],
+ "description": "Parser for Markdown.",
+ "homepage": "http://parsedown.org",
+ "keywords": [
+ "markdown",
+ "parser"
+ ],
+ "support": {
+ "issues": "https://github.com/parsedown/parsedown/issues",
+ "source": "https://github.com/parsedown/parsedown/tree/1.8.0"
+ },
+ "time": "2026-02-16T11:41:01+00:00"
+ },
{
"name": "php-http/client-common",
"version": "2.7.3",
@@ -5945,53 +5952,6 @@
],
"time": "2026-03-06T14:10:22+00:00"
},
- {
- "name": "shalvah/clara",
- "version": "3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/shalvah/clara.git",
- "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/shalvah/clara/zipball/6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
- "reference": "6b30f389d71bfdd3f6e09f9b9537205ac7e118de",
- "shasum": ""
- },
- "require": {
- "php": ">=7.4",
- "symfony/console": "^4.0|^5.0|^6.0|^7.0"
- },
- "require-dev": {
- "eloquent/phony-phpunit": "^7.0",
- "phpunit/phpunit": "^9.1"
- },
- "type": "library",
- "autoload": {
- "files": [
- "helpers.php"
- ],
- "psr-4": {
- "Shalvah\\Clara\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "🔊 Simple, pretty, testable console output for CLI apps.",
- "keywords": [
- "cli",
- "log",
- "logging"
- ],
- "support": {
- "issues": "https://github.com/shalvah/clara/issues",
- "source": "https://github.com/shalvah/clara/tree/3.3.0"
- },
- "time": "2025-10-20T22:26:39+00:00"
- },
{
"name": "shalvah/upgrader",
"version": "0.6.0",
@@ -6050,70 +6010,6 @@
],
"time": "2024-02-20T11:51:46+00:00"
},
- {
- "name": "spatie/data-transfer-object",
- "version": "3.9.1",
- "source": {
- "type": "git",
- "url": "https://github.com/spatie/data-transfer-object.git",
- "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/spatie/data-transfer-object/zipball/1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
- "reference": "1df0906c4e9e3aebd6c0506fd82c8b7d5548c1c8",
- "shasum": ""
- },
- "require": {
- "php": "^8.0"
- },
- "require-dev": {
- "illuminate/collections": "^8.36",
- "jetbrains/phpstorm-attributes": "^1.0",
- "larapack/dd": "^1.1",
- "phpunit/phpunit": "^9.5.5"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Spatie\\DataTransferObject\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Brent Roose",
- "email": "brent@spatie.be",
- "homepage": "https://spatie.be",
- "role": "Developer"
- }
- ],
- "description": "Data transfer objects with batteries included",
- "homepage": "https://github.com/spatie/data-transfer-object",
- "keywords": [
- "data-transfer-object",
- "spatie"
- ],
- "support": {
- "issues": "https://github.com/spatie/data-transfer-object/issues",
- "source": "https://github.com/spatie/data-transfer-object/tree/3.9.1"
- },
- "funding": [
- {
- "url": "https://spatie.be/open-source/support-us",
- "type": "custom"
- },
- {
- "url": "https://github.com/spatie",
- "type": "github"
- }
- ],
- "abandoned": "spatie/laravel-data",
- "time": "2022-09-16T13:34:38+00:00"
- },
{
"name": "spatie/laravel-html",
"version": "3.13.0",
@@ -8084,6 +7980,86 @@
],
"time": "2026-05-26T02:25:22+00:00"
},
+ {
+ "name": "symfony/polyfill-php86",
+ "version": "v1.38.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php86.git",
+ "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php86/zipball/fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad",
+ "reference": "fcec68d64f46dc84e1f6ffcf2c6dda40ff3143ad",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "url": "https://github.com/symfony/polyfill",
+ "name": "symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php86\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.6+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php86/tree/v1.38.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-25T11:52:35+00:00"
+ },
{
"name": "symfony/polyfill-uuid",
"version": "v1.37.0",
@@ -9056,20 +9032,20 @@
},
{
"name": "tray-labs/laravel-influxdb",
- "version": "1.0.12",
+ "version": "1.0.13",
"source": {
"type": "git",
"url": "https://github.com/tray-labs/laravel-influxdb.git",
- "reference": "f918e0f75c739311e95fc1bf0ffc046294ea2310"
+ "reference": "5658189d642df49396a114c68a24eca0800a0b77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tray-labs/laravel-influxdb/zipball/f918e0f75c739311e95fc1bf0ffc046294ea2310",
- "reference": "f918e0f75c739311e95fc1bf0ffc046294ea2310",
+ "url": "https://api.github.com/repos/tray-labs/laravel-influxdb/zipball/5658189d642df49396a114c68a24eca0800a0b77",
+ "reference": "5658189d642df49396a114c68a24eca0800a0b77",
"shasum": ""
},
"require": {
- "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
+ "illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0",
"influxdb/influxdb-php": "^1.15"
},
"type": "library",
@@ -9101,9 +9077,9 @@
"description": "A service made to provide, set up and use the library from influxdata influxphp in Laravel.",
"support": {
"issues": "https://github.com/tray-labs/laravel-influxdb/issues",
- "source": "https://github.com/tray-labs/laravel-influxdb/tree/1.0.12"
+ "source": "https://github.com/tray-labs/laravel-influxdb/tree/1.0.13"
},
- "time": "2025-05-12T12:23:08+00:00"
+ "time": "2026-03-17T17:41:37+00:00"
},
{
"name": "vlucas/phpdotenv",
@@ -9265,111 +9241,55 @@
}
],
"packages-dev": [
- {
- "name": "appzcoder/crud-generator",
- "version": "v4.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/sohelamin/crud-generator.git",
- "reference": "46dd9b21aaac8b24465956ebd82ef1dd27cb4325"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sohelamin/crud-generator/zipball/46dd9b21aaac8b24465956ebd82ef1dd27cb4325",
- "reference": "46dd9b21aaac8b24465956ebd82ef1dd27cb4325",
- "shasum": ""
- },
- "require": {
- "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0",
- "laravel/breeze": "^1.10|^2.0",
- "php": "^8.0"
- },
- "require-dev": {
- "mockery/mockery": "^1.0",
- "orchestra/testbench": "^3.3|^4.0|^5.0",
- "phpunit/phpunit": "^5.7|^8.0|^9.0"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "Appzcoder\\CrudGenerator\\CrudGeneratorServiceProvider"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "Appzcoder\\CrudGenerator\\": "src/"
- },
- "classmap": [
- "tests"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Sohel Amin",
- "email": "sohelamincse@gmail.com",
- "homepage": "http://www.appzcoder.com"
- }
- ],
- "description": "Laravel CRUD Generator",
- "keywords": [
- "API generator",
- "crud",
- "crud generator",
- "laravel",
- "laravel crud generator"
- ],
- "support": {
- "issues": "https://github.com/sohelamin/crud-generator/issues",
- "source": "https://github.com/sohelamin/crud-generator/tree/v4.0.0"
- },
- "time": "2024-03-13T18:06:47+00:00"
- },
{
"name": "barryvdh/laravel-debugbar",
- "version": "v3.16.5",
+ "version": "v4.2.8",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
- "reference": "e85c0a8464da67e5b4a53a42796d46a43fc06c9a"
+ "reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/e85c0a8464da67e5b4a53a42796d46a43fc06c9a",
- "reference": "e85c0a8464da67e5b4a53a42796d46a43fc06c9a",
+ "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/799d70c1101d3f8840dd76ff68ff6a78f9352905",
+ "reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905",
"shasum": ""
},
"require": {
- "illuminate/routing": "^10|^11|^12",
- "illuminate/session": "^10|^11|^12",
- "illuminate/support": "^10|^11|^12",
- "php": "^8.1",
- "php-debugbar/php-debugbar": "^2.2.4",
- "symfony/finder": "^6|^7|^8"
+ "illuminate/routing": "^11|^12|^13.0",
+ "illuminate/session": "^11|^12|^13.0",
+ "illuminate/support": "^11|^12|^13.0",
+ "php": "^8.2",
+ "php-debugbar/php-debugbar": "^3.7.2",
+ "php-debugbar/symfony-bridge": "^1.1"
},
"require-dev": {
+ "larastan/larastan": "^3",
+ "laravel/octane": "^2",
+ "laravel/pennant": "^1",
+ "laravel/pint": "^1",
+ "laravel/telescope": "^5.16",
+ "livewire/livewire": "^3.7|^4",
"mockery/mockery": "^1.3.3",
- "orchestra/testbench-dusk": "^7|^8|^9|^10",
- "phpunit/phpunit": "^9.5.10|^10|^11",
- "squizlabs/php_codesniffer": "^3.5"
+ "orchestra/testbench-dusk": "^9|^10|^11",
+ "php-debugbar/twig-bridge": "^2.0",
+ "phpstan/phpstan-phpunit": "^2",
+ "phpstan/phpstan-strict-rules": "^2.0",
+ "phpunit/phpunit": "^11",
+ "shipmonk/phpstan-rules": "^4.3"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
- "Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar"
+ "Debugbar": "Fruitcake\\LaravelDebugbar\\Facades\\Debugbar"
},
"providers": [
- "Barryvdh\\Debugbar\\ServiceProvider"
+ "Fruitcake\\LaravelDebugbar\\ServiceProvider"
]
},
"branch-alias": {
- "dev-master": "3.16-dev"
+ "dev-master": "4.2-dev"
}
},
"autoload": {
@@ -9377,7 +9297,7 @@
"src/helpers.php"
],
"psr-4": {
- "Barryvdh\\Debugbar\\": "src/"
+ "Fruitcake\\LaravelDebugbar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -9385,6 +9305,10 @@
"MIT"
],
"authors": [
+ {
+ "name": "Fruitcake",
+ "homepage": "https://fruitcake.nl"
+ },
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
@@ -9392,6 +9316,7 @@
],
"description": "PHP Debugbar integration for Laravel",
"keywords": [
+ "barryvdh",
"debug",
"debugbar",
"dev",
@@ -9401,7 +9326,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
- "source": "https://github.com/fruitcake/laravel-debugbar/tree/v3.16.5"
+ "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.8"
},
"funding": [
{
@@ -9413,7 +9338,7 @@
"type": "github"
}
],
- "time": "2026-01-23T15:03:22+00:00"
+ "time": "2026-04-20T13:31:29+00:00"
},
{
"name": "hamcrest/hamcrest-php",
@@ -9466,67 +9391,6 @@
},
"time": "2025-04-30T06:54:44+00:00"
},
- {
- "name": "laravel/breeze",
- "version": "v2.4.2",
- "source": {
- "type": "git",
- "url": "https://github.com/laravel/breeze.git",
- "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/laravel/breeze/zipball/4f20e7b2cc8d25daa85d8647241a89c8e0930305",
- "reference": "4f20e7b2cc8d25daa85d8647241a89c8e0930305",
- "shasum": ""
- },
- "require": {
- "illuminate/console": "^11.0|^12.0|^13.0",
- "illuminate/filesystem": "^11.0|^12.0|^13.0",
- "illuminate/support": "^11.0|^12.0|^13.0",
- "illuminate/validation": "^11.0|^12.0|^13.0",
- "php": "^8.2.0",
- "symfony/console": "^7.0|^8.0"
- },
- "require-dev": {
- "laravel/framework": "^11.0|^12.0|^13.0",
- "orchestra/testbench-core": "^9.0|^10.0|^11.0",
- "phpstan/phpstan": "^2.0"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "Laravel\\Breeze\\BreezeServiceProvider"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "Laravel\\Breeze\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Taylor Otwell",
- "email": "taylor@laravel.com"
- }
- ],
- "description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
- "keywords": [
- "auth",
- "laravel"
- ],
- "support": {
- "issues": "https://github.com/laravel/breeze/issues",
- "source": "https://github.com/laravel/breeze"
- },
- "time": "2026-05-14T16:54:25+00:00"
- },
{
"name": "laravel/pail",
"version": "v1.2.7",
@@ -9870,47 +9734,63 @@
},
{
"name": "php-debugbar/php-debugbar",
- "version": "v2.2.6",
+ "version": "v3.7.6",
"source": {
"type": "git",
"url": "https://github.com/php-debugbar/php-debugbar.git",
- "reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8"
+ "reference": "1690ee1728827f9deb4b60457fa387cf44672c56"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
- "reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
+ "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/1690ee1728827f9deb4b60457fa387cf44672c56",
+ "reference": "1690ee1728827f9deb4b60457fa387cf44672c56",
"shasum": ""
},
"require": {
- "php": "^8.1",
+ "php": "^8.2",
"psr/log": "^1|^2|^3",
- "symfony/var-dumper": "^5.4|^6.4|^7.3|^8.0"
+ "symfony/var-dumper": "^5.4|^6|^7|^8"
},
"replace": {
"maximebf/debugbar": "self.version"
},
"require-dev": {
- "dbrekelmans/bdi": "^1",
+ "dbrekelmans/bdi": "^1.4",
+ "friendsofphp/php-cs-fixer": "^3.92",
+ "monolog/monolog": "^3.9",
+ "php-debugbar/doctrine-bridge": "^3@dev",
+ "php-debugbar/monolog-bridge": "^1@dev",
+ "php-debugbar/symfony-bridge": "^1@dev",
+ "php-debugbar/twig-bridge": "^2@dev",
+ "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^10",
- "symfony/browser-kit": "^6.0|7.0",
+ "predis/predis": "^3.3",
+ "shipmonk/phpstan-rules": "^4.3",
+ "symfony/browser-kit": "^6.4|7.0",
+ "symfony/dom-crawler": "^6.4|^7",
+ "symfony/event-dispatcher": "^5.4|^6.4|^7.3|^8.0",
+ "symfony/http-foundation": "^5.4|^6.4|^7.3|^8.0",
+ "symfony/mailer": "^5.4|^6.4|^7.3|^8.0",
"symfony/panther": "^1|^2.1",
"twig/twig": "^3.11.2"
},
"suggest": {
- "kriswallsmith/assetic": "The best way to manage assets",
- "monolog/monolog": "Log using Monolog",
- "predis/predis": "Redis storage"
+ "php-debugbar/doctrine-bridge": "To integrate Doctrine with php-debugbar.",
+ "php-debugbar/monolog-bridge": "To integrate Monolog with php-debugbar.",
+ "php-debugbar/symfony-bridge": "To integrate Symfony with php-debugbar.",
+ "php-debugbar/twig-bridge": "To integrate Twig with php-debugbar."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
- "DebugBar\\": "src/DebugBar/"
+ "DebugBar\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -9934,13 +9814,91 @@
"debug",
"debug bar",
"debugbar",
- "dev"
+ "dev",
+ "profiler",
+ "toolbar"
],
"support": {
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
- "source": "https://github.com/php-debugbar/php-debugbar/tree/v2.2.6"
+ "source": "https://github.com/php-debugbar/php-debugbar/tree/v3.7.6"
+ },
+ "funding": [
+ {
+ "url": "https://fruitcake.nl",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/barryvdh",
+ "type": "github"
+ }
+ ],
+ "time": "2026-04-30T07:31:44+00:00"
+ },
+ {
+ "name": "php-debugbar/symfony-bridge",
+ "version": "v1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-debugbar/symfony-bridge.git",
+ "reference": "e37d2debe5d316408b00d0ab2688d9c2cf59b5ad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-debugbar/symfony-bridge/zipball/e37d2debe5d316408b00d0ab2688d9c2cf59b5ad",
+ "reference": "e37d2debe5d316408b00d0ab2688d9c2cf59b5ad",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.2",
+ "php-debugbar/php-debugbar": "^3.1",
+ "symfony/http-foundation": "^5.4|^6.4|^7.3|^8.0"
+ },
+ "require-dev": {
+ "dbrekelmans/bdi": "^1.4",
+ "phpunit/phpunit": "^10",
+ "symfony/browser-kit": "^6|^7",
+ "symfony/dom-crawler": "^6|^7",
+ "symfony/mailer": "^5.4|^6.4|^7.3|^8.0",
+ "symfony/panther": "^1|^2.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "DebugBar\\Bridge\\Symfony\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Maxime Bouroumeau-Fuseau",
+ "email": "maxime.bouroumeau@gmail.com",
+ "homepage": "http://maximebf.com"
+ },
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "barryvdh@gmail.com"
+ }
+ ],
+ "description": "Symfony bridge for PHP Debugbar",
+ "homepage": "https://github.com/php-debugbar/php-debugbar",
+ "keywords": [
+ "debugbar",
+ "dev",
+ "symfony"
+ ],
+ "support": {
+ "issues": "https://github.com/php-debugbar/symfony-bridge/issues",
+ "source": "https://github.com/php-debugbar/symfony-bridge/tree/v1.1.0"
},
- "time": "2025-12-22T13:21:32+00:00"
+ "time": "2026-01-15T14:47:34+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -11494,11 +11452,11 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
- "php": "^8.2"
+ "php": "^8.3"
},
"platform-dev": [],
"platform-overrides": {
- "php": "8.2"
+ "php": "8.3"
},
"plugin-api-version": "2.6.0"
}
diff --git a/public/herd.yml b/public/herd.yml
index 18389a30..9747939c 100644
--- a/public/herd.yml
+++ b/public/herd.yml
@@ -1,5 +1,5 @@
name: BEEP
-php: '8.2'
+php: '8.3'
secured: true
aliases:
- BEEP.test
From 7d56add107aeaf0217d3a55025ed2720dac634f7 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Tue, 2 Jun 2026 15:10:37 +0200
Subject: [PATCH 121/127] composer update
---
composer.lock | 50 +++++++++++++++++++++++++++-----------------------
1 file changed, 27 insertions(+), 23 deletions(-)
diff --git a/composer.lock b/composer.lock
index ad823236..017fd43f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1605,25 +1605,26 @@
},
{
"name": "guzzlehttp/guzzle",
- "version": "7.10.6",
+ "version": "7.11.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
- "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94"
+ "reference": "c987f8ce84b8434fa430795eca0f3430663da72b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e7412b3180912c01650cc66647f18c1d1cbe9b94",
- "reference": "e7412b3180912c01650cc66647f18c1d1cbe9b94",
+ "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c987f8ce84b8434fa430795eca0f3430663da72b",
+ "reference": "c987f8ce84b8434fa430795eca0f3430663da72b",
"shasum": ""
},
"require": {
"ext-json": "*",
- "guzzlehttp/promises": "^2.3",
- "guzzlehttp/psr7": "^2.8",
+ "guzzlehttp/promises": "^2.5",
+ "guzzlehttp/psr7": "^2.11",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
- "symfony/deprecation-contracts": "^2.2 || ^3.0"
+ "symfony/deprecation-contracts": "^2.5 || ^3.0",
+ "symfony/polyfill-php80": "^1.24"
},
"provide": {
"psr/http-client-implementation": "1.0"
@@ -1712,7 +1713,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.10.6"
+ "source": "https://github.com/guzzle/guzzle/tree/7.11.0"
},
"funding": [
{
@@ -1728,24 +1729,25 @@
"type": "tidelift"
}
],
- "time": "2026-06-01T13:06:22+00:00"
+ "time": "2026-06-02T12:40:51+00:00"
},
{
"name": "guzzlehttp/promises",
- "version": "2.4.1",
+ "version": "2.5.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
- "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2"
+ "reference": "4360e982f87f5f258bf872d094647791db2f4c8e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/09e8a212562fb1fb6a512c4156ed71525969d6c2",
- "reference": "09e8a212562fb1fb6a512c4156ed71525969d6c2",
+ "url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e",
+ "reference": "4360e982f87f5f258bf872d094647791db2f4c8e",
"shasum": ""
},
"require": {
- "php": "^7.2.5 || ^8.0"
+ "php": "^7.2.5 || ^8.0",
+ "symfony/deprecation-contracts": "^2.5 || ^3.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
@@ -1795,7 +1797,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/2.4.1"
+ "source": "https://github.com/guzzle/promises/tree/2.5.0"
},
"funding": [
{
@@ -1811,27 +1813,29 @@
"type": "tidelift"
}
],
- "time": "2026-05-20T22:57:30+00:00"
+ "time": "2026-06-02T12:23:43+00:00"
},
{
"name": "guzzlehttp/psr7",
- "version": "2.10.4",
+ "version": "2.11.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
- "reference": "d2a1a094e396da8957e797489fddaf860c340cfc"
+ "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/d2a1a094e396da8957e797489fddaf860c340cfc",
- "reference": "d2a1a094e396da8957e797489fddaf860c340cfc",
+ "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f",
+ "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
- "ralouphie/getallheaders": "^3.0"
+ "ralouphie/getallheaders": "^3.0",
+ "symfony/deprecation-contracts": "^2.5 || ^3.0",
+ "symfony/polyfill-php80": "^1.24"
},
"provide": {
"psr/http-factory-implementation": "1.0",
@@ -1912,7 +1916,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.10.4"
+ "source": "https://github.com/guzzle/psr7/tree/2.11.0"
},
"funding": [
{
@@ -1928,7 +1932,7 @@
"type": "tidelift"
}
],
- "time": "2026-05-29T12:59:07+00:00"
+ "time": "2026-06-02T12:30:48+00:00"
},
{
"name": "guzzlehttp/uri-template",
From 2baf5689fdcd704f1b2d84ba62b155d7c7a6dcee Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 4 Jun 2026 10:19:02 +0200
Subject: [PATCH 122/127] remove crud-generator functionality as not really
needed + not compatible with laravel 13 (+ composer update)
---
app/Providers/AppServiceProvider.php | 7 +++---
composer.lock | 34 ++++++++++++++--------------
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php
index caa95747..b458a53c 100644
--- a/app/Providers/AppServiceProvider.php
+++ b/app/Providers/AppServiceProvider.php
@@ -75,9 +75,10 @@ public function register(): void
return new ChecklistFactory;
});
- if ($this->app->environment() == 'local') {
- $this->app->register('Appzcoder\CrudGenerator\CrudGeneratorServiceProvider');
- }
+ // if needed install crud generator package compatible with laravel 13+, such as ibex/crud-generator, and register it here for local environment
+ // if ($this->app->environment() == 'local') {
+ // $this->app->register('Appzcoder\CrudGenerator\CrudGeneratorServiceProvider');
+ // }
}
public function bootRoute(): void
diff --git a/composer.lock b/composer.lock
index 4d888e5d..d303e5b3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
- "version": "3.383.2",
+ "version": "3.384.2",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "11c2de39e4511dc99e44f049c7dfc8087e051867"
+ "reference": "a6c85b3a1f5f8327076291040329214b3a2caf2b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/11c2de39e4511dc99e44f049c7dfc8087e051867",
- "reference": "11c2de39e4511dc99e44f049c7dfc8087e051867",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a6c85b3a1f5f8327076291040329214b3a2caf2b",
+ "reference": "a6c85b3a1f5f8327076291040329214b3a2caf2b",
"shasum": ""
},
"require": {
@@ -153,9 +153,9 @@
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.383.2"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.384.2"
},
- "time": "2026-06-01T18:08:21+00:00"
+ "time": "2026-06-03T18:07:33+00:00"
},
{
"name": "brick/math",
@@ -2378,16 +2378,16 @@
},
{
"name": "laravel/framework",
- "version": "v13.12.0",
+ "version": "v13.13.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "6ac27a7fcfa728250c9f77921cb8fb955546b591"
+ "reference": "1daa6d3b4defe46976ccfa4fb0a7ab62717712a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/6ac27a7fcfa728250c9f77921cb8fb955546b591",
- "reference": "6ac27a7fcfa728250c9f77921cb8fb955546b591",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/1daa6d3b4defe46976ccfa4fb0a7ab62717712a2",
+ "reference": "1daa6d3b4defe46976ccfa4fb0a7ab62717712a2",
"shasum": ""
},
"require": {
@@ -2598,7 +2598,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2026-05-26T23:39:26+00:00"
+ "time": "2026-06-02T14:28:17+00:00"
},
{
"name": "laravel/prompts",
@@ -9243,16 +9243,16 @@
"packages-dev": [
{
"name": "barryvdh/laravel-debugbar",
- "version": "v4.2.8",
+ "version": "v4.3.0",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
- "reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905"
+ "reference": "3d76ea8d78b82225b92789de65fc630c1cd8e80c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/799d70c1101d3f8840dd76ff68ff6a78f9352905",
- "reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905",
+ "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/3d76ea8d78b82225b92789de65fc630c1cd8e80c",
+ "reference": "3d76ea8d78b82225b92789de65fc630c1cd8e80c",
"shasum": ""
},
"require": {
@@ -9326,7 +9326,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
- "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.8"
+ "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.3.0"
},
"funding": [
{
@@ -9338,7 +9338,7 @@
"type": "github"
}
],
- "time": "2026-04-20T13:31:29+00:00"
+ "time": "2026-06-04T07:54:01+00:00"
},
{
"name": "hamcrest/hamcrest-php",
From 46c61a26b40e8cb3fd1cbe9d0f46286d8afe10e1 Mon Sep 17 00:00:00 2001
From: JuliaBD
Date: Thu, 4 Jun 2026 11:23:23 +0200
Subject: [PATCH 123/127] upgrade jquery to 3.0.0 to fix console errors + fix
font awesome icons that were escaped to html by spatie/laravel-html
---
public/docs/source/assets/js/lib/jquery.min.js | 8 ++++----
public/js/jquery.js | 8 ++++----
public/js/scripts-base.js | 6 +++---
public/js/scripts-portal.js | 4 ++--
resources/views/categories/partials/details.blade.php | 2 +-
resources/views/devices/index.blade.php | 2 +-
resources/views/groups/index.blade.php | 2 +-
resources/views/layouts/app.blade.php | 2 +-
resources/views/roles/index.blade.php | 2 +-
resources/views/users/index.blade.php | 2 +-
10 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/public/docs/source/assets/js/lib/jquery.min.js b/public/docs/source/assets/js/lib/jquery.min.js
index c5e1bfe2..84bf7b80 100644
--- a/public/docs/source/assets/js/lib/jquery.min.js
+++ b/public/docs/source/assets/js/lib/jquery.min.js
@@ -1,4 +1,4 @@
-/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML=" ",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML=" ","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML=" ",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)
-},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""," "],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
-},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec=/#.*$/,fc=/([?&])_=[^&]*/,gc=/^(.*?):[ \t]*([^\r\n]*)$/gm,hc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ic=/^(?:GET|HEAD)$/,jc=/^\/\//,kc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lc={},mc={},nc="*/".concat("*"),oc=a.location.href,pc=kc.exec(oc.toLowerCase())||[];function qc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rc(a,b,c,d){var e={},f=a===mc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function uc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:oc,type:"GET",isLocal:hc.test(pc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sc(sc(a,n.ajaxSettings),b):sc(n.ajaxSettings,a)},ajaxPrefilter:qc(lc),ajaxTransport:qc(mc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gc.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||oc)+"").replace(ec,"").replace(jc,pc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pc[1]&&h[2]===pc[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pc[3]||("http:"===pc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rc(lc,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ic.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fc.test(d)?d.replace(fc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rc(mc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tc(k,v,f)),u=uc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vc=/%20/g,wc=/\[\]$/,xc=/\r?\n/g,yc=/^(?:submit|button|image|reset|file)$/i,zc=/^(?:input|select|textarea|keygen)/i;function Ac(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wc.test(a)?d(a,e):Ac(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ac(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ac(c,a[c],b,e);return d.join("&").replace(vc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zc.test(this.nodeName)&&!yc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xc,"\r\n")}}):{name:b.name,value:c.replace(xc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bc=0,Cc={},Dc={0:200,1223:204},Ec=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cc)Cc[a]()}),k.cors=!!Ec&&"withCredentials"in Ec,k.ajax=Ec=!!Ec,n.ajaxTransport(function(a){var b;return k.cors||Ec&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Dc[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MENU
-
-
-
-
-
-
-
- bash
- javascript
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Introduction
-
BEEP API specification
-
This documentation aims to provide all the information you need to work with our API.
-
As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
-You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).
-
-Base URL
-
-
https://api.beep.nl/
-
-
Authenticating requests
-
This API is authenticated by sending an Authorization header with the value "Bearer your-token" .
-
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
-
You can retrieve your token by enabling the development option of your browser and logging in at app.beep.nl. Then get your api_token from the /authenticate response and use it as your Bearer [api_token].
-
-
Api\AlertController
-
-
Manage your alerts
-
-
api/alerts GET
-List all user alerts that are not deleted.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/alerts" \
- --header "Authorization: Bearer afdED8ka46v6ehPbV3c5g1Z" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alerts"
-);
-
-const headers = {
- "Authorization": "Bearer afdED8ka46v6ehPbV3c5g1Z",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alerts/{id} POST
-Create the specified user alert.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/alerts" \
- --header "Authorization: Bearer d5aE14cgVDhe6vbZ683kafP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"alert_rule_id\": 20,
- \"measurement_id\": 3,
- \"alert_value\": \"mollitia\",
- \"show\": false
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alerts"
-);
-
-const headers = {
- "Authorization": "Bearer d5aE14cgVDhe6vbZ683kafP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "alert_rule_id": 20,
- "measurement_id": 3,
- "alert_value": "mollitia",
- "show": false
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alerts/{id} GET
-Display the specified user alert.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/alerts/1" \
- --header "Authorization: Bearer Dd6hZ5aE6vb3a4Pegc1fVk8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alerts/1"
-);
-
-const headers = {
- "Authorization": "Bearer Dd6hZ5aE6vb3a4Pegc1fVk8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alerts/{id} PATCH
-Update the specified user alert.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/alerts/1" \
- --header "Authorization: Bearer avdVZk8436be6EPg1hcafD5" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"show\": false
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alerts/1"
-);
-
-const headers = {
- "Authorization": "Bearer avdVZk8436be6EPg1hcafD5",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "show": false
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alerts/{id} DELETE
-Delete the specified user alert, or all if id === 'all', or specific id's when provided &alert_ids=1,4,7
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/alerts/1" \
- --header "Authorization: Bearer k1aZd4bf8ePv3E6cV56gDah" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alerts/1"
-);
-
-const headers = {
- "Authorization": "Bearer k1aZd4bf8ePv3E6cV56gDah",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\AlertRuleController
-
-
Manage your alert rules
-
-
api/alert-rules GET
-List all user alert rules that are not deleted.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/alert-rules" \
- --header "Authorization: Bearer a64aPdv1cVhk5E3gfe6DbZ8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules"
-);
-
-const headers = {
- "Authorization": "Bearer a64aPdv1cVhk5E3gfe6DbZ8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alert-rules/{id} POST
-Create the specified user alert rule.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/alert-rules" \
- --header "Authorization: Bearer k6h6b3cgafv8PaD145VEdeZ" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"repellendus\",
- \"description\": \"nihil\",
- \"measurement_id\": 12,
- \"threshold_value\": 3527054.7321377,
- \"formulas\": [
- {
- \"alert_rule_id\": 2,
- \"measurement_id\": 1,
- \"calculation\": \"mollitia\",
- \"comparator\": \"commodi\",
- \"comparison\": \"fuga\",
- \"period_minutes\": 0,
- \"threshold_value\": 323.6134619,
- \"future\": false
- }
- ],
- \"calculation_minutes\": \"totam\",
- \"alert_on_occurrences\": 19,
- \"alert_via_email\": false,
- \"webhook_url\": \"voluptas\",
- \"active\": true,
- \"exclude_months\": [
- 1,
- 2,
- 3,
- 11,
- 12
- ],
- \"exclude_hours\": [
- 0,
- 1,
- 2,
- 3,
- 22,
- 23
- ],
- \"exclude_hive_ids\": [
- \"corporis\"
- ]
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules"
-);
-
-const headers = {
- "Authorization": "Bearer k6h6b3cgafv8PaD145VEdeZ",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "repellendus",
- "description": "nihil",
- "measurement_id": 12,
- "threshold_value": 3527054.7321377,
- "formulas": [
- {
- "alert_rule_id": 2,
- "measurement_id": 1,
- "calculation": "mollitia",
- "comparator": "commodi",
- "comparison": "fuga",
- "period_minutes": 0,
- "threshold_value": 323.6134619,
- "future": false
- }
- ],
- "calculation_minutes": "totam",
- "alert_on_occurrences": 19,
- "alert_via_email": false,
- "webhook_url": "voluptas",
- "active": true,
- "exclude_months": [
- 1,
- 2,
- 3,
- 11,
- 12
- ],
- "exclude_hours": [
- 0,
- 1,
- 2,
- 3,
- 22,
- 23
- ],
- "exclude_hive_ids": [
- "corporis"
- ]
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alert-rules/{id} GET
-Display the specified user alert rules.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/alert-rules/1" \
- --header "Authorization: Bearer 6ae1ZfkEPVd3bc48g65vhDa" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules/1"
-);
-
-const headers = {
- "Authorization": "Bearer 6ae1ZfkEPVd3bc48g65vhDa",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alert-rules/{id} PATCH
-Update the specified user alert rule.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/alert-rules/1" \
- --header "Authorization: Bearer f61aPeV68abkvgZ543dcEhD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"dignissimos\",
- \"description\": \"id\",
- \"measurement_id\": 18,
- \"calculation\": \"dolorem\",
- \"comparator\": \"voluptas\",
- \"comparison\": \"qui\",
- \"threshold_value\": 0.39,
- \"formulas\": [
- {
- \"measurement_id\": 12,
- \"calculation\": \"molestiae\",
- \"comparator\": \"dicta\",
- \"comparison\": \"recusandae\",
- \"period_minutes\": 0,
- \"threshold_value\": 708013.2,
- \"future\": true
- }
- ],
- \"calculation_minutes\": 7,
- \"alert_on_occurrences\": 16,
- \"alert_via_email\": true,
- \"webhook_url\": \"et\",
- \"active\": false,
- \"exclude_months\": [
- 1,
- 2,
- 3,
- 11,
- 12
- ],
- \"exclude_hours\": [
- 0,
- 1,
- 2,
- 3,
- 22,
- 23
- ],
- \"exclude_hive_ids\": [
- \"et\"
- ]
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules/1"
-);
-
-const headers = {
- "Authorization": "Bearer f61aPeV68abkvgZ543dcEhD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "dignissimos",
- "description": "id",
- "measurement_id": 18,
- "calculation": "dolorem",
- "comparator": "voluptas",
- "comparison": "qui",
- "threshold_value": 0.39,
- "formulas": [
- {
- "measurement_id": 12,
- "calculation": "molestiae",
- "comparator": "dicta",
- "comparison": "recusandae",
- "period_minutes": 0,
- "threshold_value": 708013.2,
- "future": true
- }
- ],
- "calculation_minutes": 7,
- "alert_on_occurrences": 16,
- "alert_via_email": true,
- "webhook_url": "et",
- "active": false,
- "exclude_months": [
- 1,
- 2,
- 3,
- 11,
- 12
- ],
- "exclude_hours": [
- 0,
- 1,
- 2,
- 3,
- 22,
- 23
- ],
- "exclude_hive_ids": [
- "et"
- ]
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alert-rules/{id} DELETE
-Delete the specified user alert rule.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/alert-rules/1" \
- --header "Authorization: Bearer b5E6D6ce3kZVdaPf4a1ghv8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules/1"
-);
-
-const headers = {
- "Authorization": "Bearer b5E6D6ce3kZVdaPf4a1ghv8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/alert-rules-default GET
-List all default alert rules that are available.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/alert-rules-default" \
- --header "Authorization: Bearer ge5f1Dd6P364bEcakV8haZv" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/alert-rules-default"
-);
-
-const headers = {
- "Authorization": "Bearer ge5f1Dd6P364bEcakV8haZv",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\CategoryController
-
-
All categories in the categorization tree used for hive inspections
-Only used to get listing (index) or one category (show)
-
-
api/categories
-Display a listing of the inspection categories.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/categories" \
- --header "Authorization: Bearer gZ5DhEfVd3a16684vePabkc" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/categories"
-);
-
-const headers = {
- "Authorization": "Bearer gZ5DhEfVd3a16684vePabkc",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-[
- {
- "id": 1,
- "type": "system",
- "name": "apiary",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list",
- "trans": {
- "en": "Apiary",
- "nl": "Bijenstand",
- "de": "Bienenstand",
- "fr": "Rucher",
- "ro": "Stupină",
- "pt": "Apiário",
- "es": "Apiario",
- "da": "Bigård"
- },
- "unit": null,
- "children": [
- {
- "id": 2,
- "type": "0",
- "name": "name",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "text",
- "trans": {
- "en": "Name",
- "nl": "Naam",
- "de": "Name",
- "fr": "Nom",
- "ro": "Nume",
- "pt": "Nome",
- "es": "Nombre",
- "da": "Navn"
- },
- "unit": null
- },
- {
- "id": 3,
- "type": "list",
- "name": "location",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "select_location",
- "trans": {
- "en": "Location",
- "nl": "Locatie",
- "de": "Ort",
- "fr": "Lieux",
- "ro": "Locație",
- "pt": "Localização",
- "es": "Ubicación",
- "da": "Lokation"
- },
- "unit": null
- },
- {
- "id": 12,
- "type": "1",
- "name": "number_of_bee_colonies",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number_positive",
- "trans": {
- "en": "Number of bee colonies",
- "nl": "Aantal bijenvolken",
- "de": "Anzahl an Bienenvölkern",
- "fr": "Nombre de colonies",
- "ro": "Număr de colonii",
- "pt": "Número de colónias",
- "es": "Número de colonias de abejas melíferas",
- "da": "Antal bifamilier"
- },
- "unit": null
- },
- {
- "id": 13,
- "type": "list",
- "name": "orientation",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "options",
- "trans": {
- "en": "Orientation",
- "nl": "Orientatie",
- "de": "Orientierung",
- "fr": "Orientation",
- "ro": "Orientare",
- "pt": "Orientação",
- "es": "Orientación",
- "da": "Retning"
- },
- "unit": null
- },
- {
- "id": 25,
- "type": "list",
- "name": "status",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "options",
- "trans": {
- "en": "Status",
- "nl": "Status",
- "de": "Status",
- "fr": "Statut",
- "ro": "Stare",
- "pt": "Estado",
- "es": "Estado",
- "da": "Status"
- },
- "unit": null
- },
- {
- "id": 28,
- "type": "system",
- "name": "photo",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "image",
- "trans": {
- "en": "Photo",
- "nl": "Foto",
- "de": "Foto",
- "fr": "Photo",
- "ro": "Poză",
- "pt": "Fotografia",
- "es": "Foto",
- "da": "Foto"
- },
- "unit": null
- },
- {
- "id": 913,
- "type": null,
- "name": "can_be_removed",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list",
- "trans": {
- "de": "kann entfernt werden",
- "ro": "poate fi înlăturat",
- "es": "Puede ser removido"
- },
- "unit": null
- },
- {
- "id": 932,
- "type": "checklist",
- "name": "type",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "select",
- "trans": {
- "en": "Type",
- "nl": "Type",
- "de": "Typ",
- "fr": "type",
- "ro": "Tip",
- "pt": "Tipo",
- "es": "Tipo",
- "da": "Type"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 29,
- "type": "system",
- "name": "hive",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list",
- "trans": {
- "en": "Hive",
- "nl": "Kast",
- "de": "Beute",
- "fr": "Ruche",
- "ro": "Stup",
- "pt": "Colmeia",
- "es": "Colmena",
- "da": "Stade"
- },
- "unit": null,
- "children": [
- {
- "id": 30,
- "type": "system",
- "name": "id",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "ID",
- "nl": "ID",
- "de": "ID",
- "fr": "ID",
- "ro": "ID",
- "pt": "ID",
- "es": "ID",
- "da": "ID"
- },
- "unit": null
- },
- {
- "id": 34,
- "type": "system",
- "name": "type",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Type",
- "nl": "Type",
- "de": "Typ",
- "fr": "type",
- "ro": "Tip",
- "pt": "Tipo",
- "es": "Tipo",
- "da": "Type"
- },
- "unit": null
- },
- {
- "id": 64,
- "type": "system",
- "name": "frame_size",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Frame size",
- "nl": "Raam afmetingen",
- "de": "Rähmchengröße",
- "fr": "Taille des cadres",
- "ro": "Dimensiune ramă",
- "pt": "Tamanho do quadro",
- "es": "Tamaño de marco",
- "da": "Rammestørrelse"
- },
- "unit": null
- },
- {
- "id": 84,
- "type": "system",
- "name": "configuration",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Configuration",
- "nl": "Samenstelling",
- "de": "Konfiguration",
- "fr": "Configuration",
- "ro": "Configurație",
- "pt": "Configuração",
- "es": "Configuración",
- "da": "Opbygning"
- },
- "unit": null
- },
- {
- "id": 136,
- "type": "system",
- "name": "location",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Location",
- "nl": "Locatie",
- "de": "Ort",
- "fr": "Lieux",
- "ro": "Locație",
- "pt": "Localização",
- "es": "Ubicación",
- "da": "Lokation"
- },
- "unit": null
- },
- {
- "id": 614,
- "type": "checklist",
- "name": "weight",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number_2_decimals",
- "trans": {
- "en": "Weight",
- "nl": "Gewicht",
- "de": "Gewicht",
- "fr": "Poids",
- "ro": "Greutate",
- "pt": "Peso",
- "es": "Peso",
- "da": "Vægt"
- },
- "unit": "kg"
- },
- {
- "id": 795,
- "type": "system",
- "name": "photo",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "image",
- "trans": {
- "en": "Photo",
- "nl": "Foto",
- "de": "Foto",
- "fr": "Photo",
- "ro": "Poză",
- "pt": "Fotografia",
- "es": "Foto",
- "da": "Foto"
- },
- "unit": null
- },
- {
- "id": 818,
- "type": "system",
- "name": "app",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list",
- "trans": {
- "nl": "App",
- "en": "App",
- "de": "App",
- "fr": "App",
- "ro": "Aplicație",
- "pt": "Aplicação (app)",
- "es": "App",
- "da": "App"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 149,
- "type": "list",
- "name": "bee_colony",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Bee colony",
- "nl": "Bijenvolk",
- "de": "Bienenvolk",
- "fr": "Colonie",
- "ro": "Colonie de albine",
- "pt": "Colónia",
- "es": "Colonia de abejas",
- "da": "Bifamilie"
- },
- "unit": null,
- "children": [
- {
- "id": 73,
- "type": "checklist",
- "name": "space",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Space",
- "nl": "Ruimte",
- "de": "Platz",
- "fr": "Espacement",
- "ro": "Spațiu",
- "pt": "Espaço",
- "es": "Espacio",
- "da": "Mellemrum"
- },
- "unit": null
- },
- {
- "id": 150,
- "type": "system",
- "name": "origin",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Origin",
- "nl": "Oorsprong",
- "de": "Ursprung",
- "fr": "Origine",
- "ro": "Origine",
- "pt": "Origem",
- "es": "Origen",
- "da": "Oprindelse"
- },
- "unit": null
- },
- {
- "id": 165,
- "type": "list",
- "name": "activity",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Activity",
- "nl": "Activiteit",
- "de": "Aktivität",
- "fr": "Activité",
- "ro": "Activitate",
- "pt": "Actividade",
- "es": "Actividad",
- "da": "Aktivitet"
- },
- "unit": null
- },
- {
- "id": 208,
- "type": "system",
- "name": "status",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Status",
- "nl": "Status",
- "de": "Status",
- "fr": "Statut",
- "ro": "Stare",
- "pt": "Estado",
- "es": "Estado",
- "da": "Status"
- },
- "unit": null
- },
- {
- "id": 213,
- "type": "list",
- "name": "characteristics",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Characteristics",
- "nl": "Eigenschappen",
- "de": "Charakteristiken",
- "fr": "Caracteristique",
- "ro": "Caracteristici",
- "pt": "Características",
- "es": "Características",
- "da": "Egenskaber"
- },
- "unit": null
- },
- {
- "id": 253,
- "type": "checklist",
- "name": "swarm_prevention",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Swarm prevention",
- "nl": "Zwermverhindering",
- "de": "Schwarmverhinderung",
- "fr": "Prévention de l'essaimage",
- "ro": "Prevenirea roirii",
- "pt": "Prevenção de enxameamento",
- "es": "Prevención de enjambrazón",
- "da": "Sværmehindring"
- },
- "unit": null
- },
- {
- "id": 263,
- "type": "list",
- "name": "brood",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Brood",
- "nl": "Broed",
- "de": "Brut",
- "fr": "Couvain",
- "ro": "Puiet",
- "pt": "Criação",
- "es": "Cría",
- "da": "Yngel"
- },
- "unit": null
- },
- {
- "id": 333,
- "type": "checklist",
- "name": "queen",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Queen",
- "nl": "Moer",
- "de": "Königin",
- "fr": "Reine",
- "ro": "Matcă",
- "pt": "Raínha",
- "es": "Reina",
- "da": "Dronning"
- },
- "unit": null
- },
- {
- "id": 442,
- "type": "list",
- "name": "drones",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Drones",
- "nl": "Darren",
- "de": "Drohnen",
- "fr": "Mâles",
- "ro": "Trântori",
- "pt": "Zangões",
- "es": "Zánganos",
- "da": "Droner"
- },
- "unit": null
- },
- {
- "id": 448,
- "type": "checklist",
- "name": "uniting_colonies",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Uniting colonies",
- "nl": "Volken samenvoegen",
- "de": "Volksvereinigung",
- "fr": "Reunion de colonies",
- "ro": "Unificare colonii",
- "pt": "União de colónias",
- "es": "Colmenas fusionadas",
- "da": "Samling af bifamilier"
- },
- "unit": null
- },
- {
- "id": 453,
- "type": "list",
- "name": "bees_added",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Bees added",
- "nl": "Bijen toegevoegd",
- "de": "Bienen hinzugefügt",
- "fr": "Ajout d'abeille",
- "ro": "Albine adăugate",
- "pt": "Abelhas adicionadas",
- "es": "Abejas agregadas",
- "da": "Bier tilføjet"
- },
- "unit": null
- },
- {
- "id": 459,
- "type": "list",
- "name": "loss",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Loss",
- "nl": "Verlies",
- "de": "Verluste",
- "fr": "Perdu",
- "ro": "Pierderi",
- "pt": "Perdas",
- "es": "Pérdida",
- "da": "Tab"
- },
- "unit": null
- },
- {
- "id": 472,
- "type": "list",
- "name": "removal",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Removal",
- "nl": "Verwijdering",
- "de": "Entfernt",
- "fr": "Suppression",
- "ro": "Înlăturare",
- "pt": "Remoção",
- "es": "Remoción",
- "da": "Fjernelse"
- },
- "unit": null
- },
- {
- "id": 755,
- "type": "system",
- "name": "reminder",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "nl": "Herinnnering",
- "en": "Reminder",
- "de": "Erinnerung",
- "fr": "Rappel",
- "ro": "Aducere aminte",
- "pt": "Lembrete",
- "es": "Recordatorio",
- "da": "Påmindelse"
- },
- "unit": null
- },
- {
- "id": 771,
- "type": "checklist",
- "name": "size",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "nl": "Grootte",
- "en": "Size",
- "de": "Größe",
- "fr": "Taille",
- "ro": "Mărime",
- "pt": "Tamanho",
- "es": "Tamaño",
- "da": "Størrelse"
- },
- "unit": null
- },
- {
- "id": 776,
- "type": "checklist",
- "name": "splitting_colony",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "nl": "Volk splitsen",
- "en": "Splitting colony",
- "de": "Aufgeteiltes Volk",
- "fr": "Division de colonie",
- "ro": "Împărțirea coloniei",
- "pt": "Colónia desdobrada",
- "es": "División de colonia",
- "da": "Opdeling af bifamilie"
- },
- "unit": null
- },
- {
- "id": 867,
- "type": "system",
- "name": "purpose",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Purpose",
- "nl": "Doel",
- "de": "Zweck",
- "fr": "Raison",
- "ro": "Scop",
- "pt": "Propósito",
- "es": "Propósito",
- "da": "Formål"
- },
- "unit": null
- },
- {
- "id": 960,
- "type": "checklist",
- "name": "comb_replacement",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Comb replacement",
- "nl": "Raat vervanging",
- "de": "Wabenerneuerung",
- "fr": "Remplacement de rayon",
- "ro": "Înlocuirea fagurelui",
- "pt": "Substituição de favos",
- "es": "Reemplazo de panal",
- "da": "Tavleudskiftning"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 475,
- "type": "list",
- "name": "food",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Food",
- "nl": "Voedsel",
- "de": "Futter",
- "fr": "Nourriture",
- "ro": "Hrană",
- "pt": "Comida",
- "es": "Alimento",
- "da": "Føde"
- },
- "unit": null,
- "children": [
- {
- "id": 476,
- "type": "checklist",
- "name": "feeding",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Feeding",
- "nl": "Bijvoeren",
- "de": "Fütterung",
- "fr": "Nourrissement",
- "ro": "Hrănire",
- "pt": "Alimentação",
- "es": "Alimentación",
- "da": "Fodring"
- },
- "unit": null
- },
- {
- "id": 493,
- "type": "checklist",
- "name": "stock",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Stock",
- "nl": "Voorraad",
- "de": "Vorrat",
- "fr": "Stock",
- "ro": "Stoc",
- "pt": "Stock",
- "es": "Stock",
- "da": "Lager"
- },
- "unit": null
- },
- {
- "id": 500,
- "type": "list",
- "name": "forage",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Forage",
- "nl": "Dracht",
- "de": "Futter",
- "fr": "Butinage",
- "ro": "Cules",
- "pt": "Forrageamento",
- "es": "Forraje"
- },
- "unit": null
- },
- {
- "id": 891,
- "type": "checklist",
- "name": "water",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Water",
- "nl": "Water",
- "de": "Wasser",
- "fr": "Eau",
- "ro": "Apă",
- "pt": "Água",
- "es": "Agua",
- "da": "Vand"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 513,
- "type": "list",
- "name": "disorder",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Disorder",
- "nl": "Aandoening",
- "de": "Störung",
- "fr": "Problème",
- "ro": "Boală",
- "pt": "Problemas",
- "es": "Problema",
- "da": "Sygdom"
- },
- "unit": null,
- "children": [
- {
- "id": 514,
- "type": "list",
- "name": "type",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Type",
- "nl": "Type",
- "de": "Typ",
- "fr": "type",
- "ro": "Tip",
- "pt": "Tipo",
- "es": "Tipo",
- "da": "Type"
- },
- "unit": null
- },
- {
- "id": 582,
- "type": "list",
- "name": "severity",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "score_amount",
- "trans": {
- "en": "Severity",
- "nl": "Ernst",
- "de": "Schweregrad",
- "fr": "Sévérité",
- "ro": "Severitate",
- "pt": "Severidade",
- "da": "Alvorlighed"
- },
- "unit": null
- },
- {
- "id": 589,
- "type": "checklist",
- "name": "laboratory_test",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Laboratory test",
- "nl": "Laboratorium test",
- "de": "Labortest",
- "fr": "Test laboratoire",
- "ro": "Test de laborator",
- "pt": "Teste laboratorial",
- "es": "Test de laboratorio",
- "da": "Laboratorietest"
- },
- "unit": null
- },
- {
- "id": 594,
- "type": "list",
- "name": "treatment",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Treatment",
- "nl": "Behandeling",
- "de": "Behandlung",
- "fr": "Traitement",
- "ro": "Tratament",
- "pt": "Tratamento",
- "es": "Tratamiento",
- "da": "Behandling"
- },
- "unit": null
- },
- {
- "id": 830,
- "type": "checklist",
- "name": "varroa",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Varroa",
- "nl": "Varroa",
- "de": "Varoa",
- "fr": "Varroa",
- "ro": "Varroa",
- "pt": "Varroa",
- "es": "Varroa",
- "da": "Varroa"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 612,
- "type": "checklist",
- "name": "weather",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Weather",
- "nl": "Weer",
- "de": "Wetter",
- "fr": "Météo",
- "ro": "Vreme",
- "pt": "Clima",
- "es": "Tiempo atmosférico",
- "da": "Vejr"
- },
- "unit": null,
- "children": [
- {
- "id": 615,
- "type": "checklist",
- "name": "ambient_temperature",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number",
- "trans": {
- "en": "Ambient temperature",
- "nl": "Omgevingstemperatuur",
- "de": "Umgebungstemperatur",
- "fr": "Température ambiante",
- "ro": "Temperatura ambientală",
- "pt": "Temperatura ambiente",
- "es": "Temperatura ambiental",
- "da": "Omgivelsestemperatur"
- },
- "unit": "°C"
- },
- {
- "id": 620,
- "type": "checklist",
- "name": "humidity",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number_percentage",
- "trans": {
- "en": "Humidity",
- "nl": "Luchtvochtigheid",
- "de": "Feuchtigkeit",
- "fr": "Humidité",
- "ro": "Umiditate",
- "pt": "Humidade",
- "es": "Humedad",
- "da": "Fugtighed"
- },
- "unit": "%"
- },
- {
- "id": 621,
- "type": "checklist",
- "name": "cloud_cover",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "options",
- "trans": {
- "en": "Cloud cover",
- "nl": "Wolken",
- "de": "Wolkendecke",
- "fr": "Couverture nuageuse",
- "ro": "Nebulozitate",
- "pt": "Nebulosidade",
- "es": "Cubierto de nubes",
- "da": "Skydække"
- },
- "unit": null
- },
- {
- "id": 628,
- "type": "checklist",
- "name": "wind",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number",
- "trans": {
- "en": "Wind",
- "nl": "Wind",
- "de": "Wind",
- "fr": "Vent",
- "ro": "Vânt",
- "pt": "Vento",
- "es": "Viento",
- "da": "Vind"
- },
- "unit": "bft"
- },
- {
- "id": 629,
- "type": "checklist",
- "name": "precipitation",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "number_positive",
- "trans": {
- "en": "Precipitation",
- "nl": "Neerslag",
- "de": "Niederschlag",
- "fr": "Précipitation",
- "ro": "Precipitații",
- "pt": "Precipitação",
- "es": "Precipitación",
- "da": "Nedbør"
- },
- "unit": "mm"
- }
- ]
- },
- {
- "id": 658,
- "type": "system",
- "name": "beekeeper",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list",
- "trans": {
- "en": "Beekeeper",
- "nl": "Imker",
- "de": "Imker",
- "fr": "Apiculteur",
- "ro": "Apicultor",
- "pt": "Apicultor",
- "es": "Apicultor(a)",
- "da": "Biavler"
- },
- "unit": null,
- "children": [
- {
- "id": 659,
- "type": "0",
- "name": "name",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "boolean",
- "trans": {
- "en": "Name",
- "nl": "Naam",
- "de": "Name",
- "fr": "Nom",
- "ro": "Nume",
- "pt": "Nome",
- "es": "Nombre",
- "da": "Navn"
- },
- "unit": null
- },
- {
- "id": 660,
- "type": "list",
- "name": "location",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "select_location",
- "trans": {
- "en": "Location",
- "nl": "Locatie",
- "de": "Ort",
- "fr": "Lieux",
- "ro": "Locație",
- "pt": "Localização",
- "es": "Ubicación",
- "da": "Lokation"
- },
- "unit": null
- },
- {
- "id": 666,
- "type": "1",
- "name": "telephone",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list_item",
- "trans": {
- "en": "Telephone",
- "nl": "Telefoon",
- "de": "Telefon",
- "fr": "Telephone",
- "ro": "Telefon",
- "pt": "Telefone",
- "es": "Teléfono",
- "da": "Telefon"
- },
- "unit": null
- },
- {
- "id": 667,
- "type": "2",
- "name": "email",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list_item",
- "trans": {
- "en": "Email",
- "nl": "Email",
- "de": "Email",
- "fr": "Email",
- "ro": "Email",
- "pt": "Email",
- "es": "Email",
- "da": "Email"
- },
- "unit": null
- },
- {
- "id": 668,
- "type": "3",
- "name": "date_of_birth",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "date",
- "trans": {
- "en": "Date of birth",
- "nl": "Geboortedatum",
- "de": "Geburtsdatum",
- "fr": "Date de naissance",
- "ro": "Data nașterii",
- "pt": "Data de nascimento",
- "es": "Fecha de Nacimiento",
- "da": "Fødselsdato"
- },
- "unit": null
- },
- {
- "id": 669,
- "type": "4",
- "name": "gender",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list_item",
- "trans": {
- "en": "Gender",
- "nl": "Geslacht",
- "de": "Geschlecht",
- "fr": "Genre",
- "ro": "Gen",
- "pt": "Género",
- "es": "Género",
- "da": "Køn"
- },
- "unit": null
- },
- {
- "id": 670,
- "type": "list",
- "name": "beekeeper_since",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Beekeeper since",
- "nl": "Imker sinds",
- "de": "Imker seit",
- "fr": "Apiculteur depuis",
- "ro": "Apicultor din",
- "pt": "Apicultor desde",
- "es": "Apicultor desde",
- "da": "Biavler siden"
- },
- "unit": null
- },
- {
- "id": 672,
- "type": "5",
- "name": "beekeeper_id",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "text",
- "trans": {
- "en": "Beekeeper ID",
- "nl": "Imker ID",
- "de": "Imker ID",
- "fr": "ID apiculteur",
- "ro": "ID apicultor",
- "pt": "Número de apicultor",
- "es": "ID Apicultor",
- "da": "Biavler ID"
- },
- "unit": null
- },
- {
- "id": 673,
- "type": "list",
- "name": "company",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Company",
- "nl": "Bedrijf",
- "de": "Betrieb",
- "fr": "Société",
- "ro": "Companie",
- "pt": "Empresa",
- "es": "Compañía/Empresa",
- "da": "Firma"
- },
- "unit": null
- },
- {
- "id": 680,
- "type": "list",
- "name": "method",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "options",
- "trans": {
- "en": "Method",
- "nl": "Methode",
- "de": "Methode",
- "fr": "Méthode",
- "ro": "Metodă",
- "pt": "Método",
- "es": "Método",
- "da": "Metode"
- },
- "unit": null
- },
- {
- "id": 688,
- "type": "list",
- "name": "role",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "options",
- "trans": {
- "en": "Role",
- "nl": "Rol",
- "fr": "Rôle",
- "ro": "Rol",
- "pt": "Papel",
- "es": "Rol",
- "da": "Rolle"
- },
- "unit": null
- },
- {
- "id": 691,
- "type": "system",
- "name": "photo",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "list_item",
- "trans": {
- "en": "Photo",
- "nl": "Foto",
- "de": "Foto",
- "fr": "Photo",
- "ro": "Poză",
- "pt": "Fotografia",
- "es": "Foto",
- "da": "Foto"
- },
- "unit": null
- },
- {
- "id": 692,
- "type": "list",
- "name": "inspection_role",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Inspection role",
- "nl": "Inspectie rol",
- "fr": "Rôle d'inspection",
- "ro": "Scopul inspecției",
- "pt": "Inspecção",
- "es": "Rol durante la inspección"
- },
- "unit": null
- }
- ]
- },
- {
- "id": 698,
- "type": "list",
- "name": "production",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Production",
- "nl": "Productie",
- "de": "Produktion",
- "fr": "Production",
- "ro": "Producție",
- "pt": "Produção",
- "es": "Producción",
- "da": "Produktion"
- },
- "unit": null,
- "children": [
- {
- "id": 851,
- "type": "checklist",
- "name": "honey",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Honey",
- "nl": "Honing",
- "de": "Honig",
- "fr": "Miel",
- "ro": "Miere",
- "pt": "Mel",
- "es": "Miel",
- "da": "Honning"
- },
- "unit": null
- },
- {
- "id": 852,
- "type": "checklist",
- "name": "other",
- "icon": null,
- "source": null,
- "required": 0,
- "input": "label",
- "trans": {
- "en": "Other",
- "nl": "Andere",
- "de": "andere",
- "fr": "Autre",
- "ro": "Alte",
- "pt": "Outros",
- "es": "Otro",
- "da": "Andet"
- },
- "unit": null
- }
- ]
- }
-]
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/categories/{id}
-Display the specified category.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/categories/1" \
- --header "Authorization: Bearer Deh3PZ1V56fc46dbvkag8aE" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/categories/1"
-);
-
-const headers = {
- "Authorization": "Bearer Deh3PZ1V56fc46dbvkag8aE",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/categoryinputs" \
- --header "Authorization: Bearer PDecVf6845bakEghva6d3Z1" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/categoryinputs"
-);
-
-const headers = {
- "Authorization": "Bearer PDecVf6845bakEghva6d3Z1",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-[
- {
- "id": 1,
- "name": "List",
- "type": "list",
- "min": null,
- "max": null,
- "decimals": null
- },
- {
- "id": 2,
- "name": "List item",
- "type": "list_item",
- "min": null,
- "max": null,
- "decimals": null
- },
- {
- "id": 3,
- "name": "Boolean (yes = green)",
- "type": "boolean",
- "min": null,
- "max": null,
- "decimals": null
- }
-]
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ChecklistController
-
-
Manage your personal inspection checklists
-
-
Display a listing of the resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/checklists" \
- --header "Authorization: Bearer 3aPb4VcfZa65DdegEv81hk6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklists"
-);
-
-const headers = {
- "Authorization": "Bearer 3aPb4VcfZa65DdegEv81hk6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
POST api/checklists
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/checklists" \
- --header "Authorization: Bearer 4gP3dcvV8EbDka615feh6aZ" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklists"
-);
-
-const headers = {
- "Authorization": "Bearer 4gP3dcvV8EbDka615feh6aZ",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/checklists/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/checklists/8" \
- --header "Authorization: Bearer 16DvdZg3e56ac4hab8EkVPf" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklists/8"
-);
-
-const headers = {
- "Authorization": "Bearer 16DvdZg3e56ac4hab8EkVPf",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
PUT api/checklists/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/checklists/8" \
- --header "Authorization: Bearer cZ8f6ad35aePVvg4h16EbkD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklists/8"
-);
-
-const headers = {
- "Authorization": "Bearer cZ8f6ad35aePVvg4h16EbkD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PUT",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
DELETE api/checklists/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/checklists/8" \
- --header "Authorization: Bearer egfhaE68VP1Dv5cZb64da3k" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklists/8"
-);
-
-const headers = {
- "Authorization": "Bearer egfhaE68VP1Dv5cZb64da3k",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ChecklistSvgController
-
-
Manage stored SVG checklists (for off-line input)
-
-
api/checklist-svg GET
-Show your list of stored SVG inspections
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/checklist-svg" \
- --header "Authorization: Bearer Ebc4P6hgf83VZ6Da1k5vaed" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklist-svg"
-);
-
-const headers = {
- "Authorization": "Bearer Ebc4P6hgf83VZ6Da1k5vaed",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/checklist-svg POST
-Store an SVG inspection
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/checklist-svg" \
- --header "Authorization: Bearer vZb3eghVdaEa6c15PD4k6f8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"checklist_id\": 9,
- \"svg\": \"excepturi\",
- \"pages\": 11,
- \"name\": \"dignissimos\",
- \"last_print\": \"nihil\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklist-svg"
-);
-
-const headers = {
- "Authorization": "Bearer vZb3eghVdaEa6c15PD4k6f8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "checklist_id": 9,
- "svg": "excepturi",
- "pages": 11,
- "name": "dignissimos",
- "last_print": "nihil"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/checklist-svg/{id} GET
-Show an SVG inspection
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/checklist-svg/10" \
- --header "Authorization: Bearer v6Ze8D4aa6bfhc1kPEdg5V3" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklist-svg/10"
-);
-
-const headers = {
- "Authorization": "Bearer v6Ze8D4aa6bfhc1kPEdg5V3",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/checklist-svg/{id} PATCH
-Edit an SVG inspection
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/checklist-svg/5" \
- --header "Authorization: Bearer 85bE6ZaDhgvPcefV4a1d63k" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklist-svg/5"
-);
-
-const headers = {
- "Authorization": "Bearer 85bE6ZaDhgvPcefV4a1d63k",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PUT",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/checklist-svg/{id} DELETE
-Delete an SVG inspection
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/checklist-svg/2" \
- --header "Authorization: Bearer 615cbhaveaEPD8Vdf6g4Zk3" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/checklist-svg/2"
-);
-
-const headers = {
- "Authorization": "Bearer 615cbhaveaEPD8Vdf6g4Zk3",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\DashboardGroupController
-
-
Store and retreive DashboardGroups to create public dashboard with a fixed set of measurements
-
-
api/dashboard/{sode} GET
-Get public user Dashboard groups
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/dashboard/sequi" \
- --header "Authorization: Bearer 3acfaDg1bEvPZVh6ek56d84" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"code\": \"gcvl\",
- \"hive_id\": 14
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboard/sequi"
-);
-
-const headers = {
- "Authorization": "Bearer 3acfaDg1bEvPZVh6ek56d84",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "code": "gcvl",
- "hive_id": 14
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/dashboardgroups GET
-List all user Dashboard groups
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/dashboardgroups" \
- --header "Authorization: Bearer hadfaE1k5vcbDZ4V683e6gP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboardgroups"
-);
-
-const headers = {
- "Authorization": "Bearer hadfaE1k5vcbDZ4V683e6gP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
POST api/dashboardgroups
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/dashboardgroups" \
- --header "Authorization: Bearer kEa6h3861Ze4cVg5bdvPfDa" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"interval\": \"nulla\",
- \"speed\": 60488,
- \"name\": \"rerum\",
- \"description\": \"doloremque\",
- \"logo_url\": \"http:\\/\\/www.mertz.com\\/incidunt-perspiciatis-tempore-voluptas-et-ducimus\",
- \"show_inspections\": true,
- \"show_all\": true,
- \"hide_measurements\": false,
- \"hive_ids\": [
- \"expedita\"
- ]
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboardgroups"
-);
-
-const headers = {
- "Authorization": "Bearer kEa6h3861Ze4cVg5bdvPfDa",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "interval": "nulla",
- "speed": 60488,
- "name": "rerum",
- "description": "doloremque",
- "logo_url": "http:\/\/www.mertz.com\/incidunt-perspiciatis-tempore-voluptas-et-ducimus",
- "show_inspections": true,
- "show_all": true,
- "hide_measurements": false,
- "hive_ids": [
- "expedita"
- ]
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/dashboardgroups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/dashboardgroups/1" \
- --header "Authorization: Bearer bvf83aeEDd5cVa64Zk1g6hP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboardgroups/1"
-);
-
-const headers = {
- "Authorization": "Bearer bvf83aeEDd5cVa64Zk1g6hP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
PUT api/dashboardgroups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/dashboardgroups/1" \
- --header "Authorization: Bearer D1ce34aV5bf6hEPZ8kavdg6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"interval\": \"doloribus\",
- \"speed\": 39048,
- \"name\": \"et\",
- \"description\": \"illo\",
- \"logo_url\": \"http:\\/\\/sipes.info\\/consequatur-cupiditate-laboriosam-voluptatem-aut-sit-repudiandae-illum\",
- \"show_inspections\": true,
- \"show_all\": false,
- \"hide_measurements\": false,
- \"hive_ids\": [
- \"dignissimos\"
- ]
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboardgroups/1"
-);
-
-const headers = {
- "Authorization": "Bearer D1ce34aV5bf6hEPZ8kavdg6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "interval": "doloribus",
- "speed": 39048,
- "name": "et",
- "description": "illo",
- "logo_url": "http:\/\/sipes.info\/consequatur-cupiditate-laboriosam-voluptatem-aut-sit-repudiandae-illum",
- "show_inspections": true,
- "show_all": false,
- "hide_measurements": false,
- "hive_ids": [
- "dignissimos"
- ]
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
DELETE api/dashboardgroups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/dashboardgroups/1" \
- --header "Authorization: Bearer c81vZfPE6ka4bh6VdeDag53" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/dashboardgroups/1"
-);
-
-const headers = {
- "Authorization": "Bearer c81vZfPE6ka4bh6VdeDag53",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\DeviceController
-
-
Store and retreive Devices that produce measurements
-
-
api/devices/multiple POST
-Store/update multiple Devices in an array of Device objects
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/devices/multiple" \
- --header "Authorization: Bearer 84EZb6afkP5aecDdvh1gV36" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 19,
- \"key\": \"aut\",
- \"hardware_id\": \"iusto\",
- \"name\": \"repellendus\",
- \"hive_id\": 14,
- \"type\": \"atque\",
- \"last_message_received\": \"aspernatur\",
- \"firmware_version\": \"nesciunt\",
- \"hardware_version\": \"autem\",
- \"boot_count\": 14,
- \"measurement_interval_min\": 125.74838,
- \"measurement_transmission_ratio\": 109,
- \"ble_pin\": \"aliquid\",
- \"battery_voltage\": 322602517.931274,
- \"next_downlink_message\": \"dolore\",
- \"last_downlink_result\": \"ut\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices/multiple"
-);
-
-const headers = {
- "Authorization": "Bearer 84EZb6afkP5aecDdvh1gV36",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 19,
- "key": "aut",
- "hardware_id": "iusto",
- "name": "repellendus",
- "hive_id": 14,
- "type": "atque",
- "last_message_received": "aspernatur",
- "firmware_version": "nesciunt",
- "hardware_version": "autem",
- "boot_count": 14,
- "measurement_interval_min": 125.74838,
- "measurement_transmission_ratio": 109,
- "ble_pin": "aliquid",
- "battery_voltage": 322602517.931274,
- "next_downlink_message": "dolore",
- "last_downlink_result": "ut"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices/ttn/{dev_id} GET
-Get a BEEP TTS Cloud Device by Device ID (BEEP hardware_id)
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/devices/ttn/laboriosam" \
- --header "Authorization: Bearer 8cgb6e1V3Z6Evd4Dha5fPak" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices/ttn/laboriosam"
-);
-
-const headers = {
- "Authorization": "Bearer 8cgb6e1V3Z6Evd4Dha5fPak",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices/ttn/{dev_id} POST
-Create a BEEP TTS Cloud Device by Device ID, lorawan_device.dev_eui, and lorawan_device.app_key
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/devices/ttn/saepe" \
- --header "Authorization: Bearer ekhDa4abP1Z6dvcE68gV35f" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"lorawan_device\": {
- \"dev_eui\": \"lxiiadxuokzhlfsi\",
- \"app_key\": \"ueijmdpnaqyrulhwzoqnivzrgmnjuoyh\"
- }
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices/ttn/saepe"
-);
-
-const headers = {
- "Authorization": "Bearer ekhDa4abP1Z6dvcE68gV35f",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "lorawan_device": {
- "dev_eui": "lxiiadxuokzhlfsi",
- "app_key": "ueijmdpnaqyrulhwzoqnivzrgmnjuoyh"
- }
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices GET
-List all user Devices
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/devices" \
- --header "Authorization: Bearer avfb6V1eED48P5gakc3dh6Z" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"hardware_id\": \"et\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices"
-);
-
-const headers = {
- "Authorization": "Bearer avfb6V1eED48P5gakc3dh6Z",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "hardware_id": "et"
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-[
- {
- "id": 1,
- "hive_id": 2,
- "name": "BEEPBASE-0000",
- "key": "000000000000000",
- "created_at": "2020-01-22 09:43:03",
- "last_message_received": null,
- "hardware_id": null,
- "firmware_version": null,
- "hardware_version": null,
- "boot_count": null,
- "measurement_interval_min": null,
- "measurement_transmission_ratio": null,
- "ble_pin": null,
- "battery_voltage": null,
- "next_downlink_message": null,
- "last_downlink_result": null,
- "type": "beep",
- "hive_name": "Hive 2",
- "location_name": "Test stand 1",
- "owner": true,
- "sensor_definitions": [
- {
- "id": 7,
- "name": null,
- "inside": null,
- "offset": 8131,
- "multiplier": null,
- "input_measurement_id": 7,
- "output_measurement_id": 20,
- "device_id": 1,
- "input_abbr": "w_v",
- "output_abbr": "weight_kg"
- }
- ]
- }
-]
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices POST
-Create or Update a Device
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/devices" \
- --header "Authorization: Bearer ad1c4vaDkgVbZe685PEh36f" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 13,
- \"key\": \"voluptates\",
- \"hardware_id\": \"quia\",
- \"name\": \"occaecati\",
- \"hive_id\": 6,
- \"type\": \"dolorum\",
- \"last_message_received\": \"quod\",
- \"firmware_version\": \"aliquam\",
- \"hardware_version\": \"eos\",
- \"boot_count\": 3,
- \"measurement_interval_min\": 5696055.393,
- \"measurement_transmission_ratio\": 3800,
- \"ble_pin\": \"rerum\",
- \"battery_voltage\": 1502985.31,
- \"next_downlink_message\": \"illo\",
- \"last_downlink_result\": \"dignissimos\",
- \"create_ttn_device\": true,
- \"app_key\": \"fuga\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices"
-);
-
-const headers = {
- "Authorization": "Bearer ad1c4vaDkgVbZe685PEh36f",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 13,
- "key": "voluptates",
- "hardware_id": "quia",
- "name": "occaecati",
- "hive_id": 6,
- "type": "dolorum",
- "last_message_received": "quod",
- "firmware_version": "aliquam",
- "hardware_version": "eos",
- "boot_count": 3,
- "measurement_interval_min": 5696055.393,
- "measurement_transmission_ratio": 3800,
- "ble_pin": "rerum",
- "battery_voltage": 1502985.31,
- "next_downlink_message": "illo",
- "last_downlink_result": "dignissimos",
- "create_ttn_device": true,
- "app_key": "fuga"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices/{id} GET
-List one Device by id
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/devices/1" \
- --header "Authorization: Bearer 1a4568PdDgbfZeaVv3hcEk6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices/1"
-);
-
-const headers = {
- "Authorization": "Bearer 1a4568PdDgbfZeaVv3hcEk6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/devices PUT/PATCH
-Update an existing Device
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/devices/1" \
- --header "Authorization: Bearer 1eDVcg3Edk854habaf66PvZ" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 12,
- \"key\": \"quis\",
- \"hardware_id\": \"ea\",
- \"name\": \"tenetur\",
- \"hive_id\": 2,
- \"type\": \"veritatis\",
- \"delete\": false,
- \"last_message_received\": \"nihil\",
- \"firmware_version\": \"porro\",
- \"hardware_version\": \"fugit\",
- \"boot_count\": 7,
- \"measurement_interval_min\": 66723158.67244781,
- \"measurement_transmission_ratio\": 222015999.57199,
- \"ble_pin\": \"distinctio\",
- \"battery_voltage\": 64171328.7,
- \"next_downlink_message\": \"voluptas\",
- \"last_downlink_result\": \"incidunt\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/devices/1"
-);
-
-const headers = {
- "Authorization": "Bearer 1eDVcg3Edk854habaf66PvZ",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 12,
- "key": "quis",
- "hardware_id": "ea",
- "name": "tenetur",
- "hive_id": 2,
- "type": "veritatis",
- "delete": false,
- "last_message_received": "nihil",
- "firmware_version": "porro",
- "hardware_version": "fugit",
- "boot_count": 7,
- "measurement_interval_min": 66723158.67244781,
- "measurement_transmission_ratio": 222015999.57199,
- "ble_pin": "distinctio",
- "battery_voltage": 64171328.7,
- "next_downlink_message": "voluptas",
- "last_downlink_result": "incidunt"
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ExportController
-
-
Export all data to an Excel file by email (GDPR)
-
-
api/export/csv POST
-Generate a CSV measurement data export from InfluxDB. Make sure not to load a too large timespan (i.e. > 30 days), because the call will not succeed due to memory overload.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/export/csv" \
- --header "Authorization: Bearer Zf6Evh6e1cDVad345bgaPk8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"device_id\": \"non\",
- \"start\": \"2020-05-27 16:16\",
- \"end\": \"2020-05-30 00:00\",
- \"separator\": \";\",
- \"measurements\": \"\'am2315_t,am2315_h,mhz_co2\'\",
- \"link\": true
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/export/csv"
-);
-
-const headers = {
- "Authorization": "Bearer Zf6Evh6e1cDVad345bgaPk8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "device_id": "non",
- "start": "2020-05-27 16:16",
- "end": "2020-05-30 00:00",
- "separator": ";",
- "measurements": "'am2315_t,am2315_h,mhz_co2'",
- "link": true
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/export GET
-Generate an Excel file with all user data and send by e-mail or as download link
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/export" \
- --header "Authorization: Bearer 58431vPDgec6Eda6VafkZbh" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"groupdata\": false,
- \"sensordata\": false,
- \"link\": true
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/export"
-);
-
-const headers = {
- "Authorization": "Bearer 58431vPDgec6Eda6VafkZbh",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "groupdata": false,
- "sensordata": false,
- "link": true
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\FlashLogController
-
-
-
-
api/flashlogs GET
-Provide a list of the available flashlogs
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/flashlogs" \
- --header "Authorization: Bearer dE658kchaVb46vfPDge31Za" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/flashlogs"
-);
-
-const headers = {
- "Authorization": "Bearer dE658kchaVb46vfPDge31Za",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/flashlogs/{id} GET
-Provide the contents of the log_file_parsed property of the flashlog
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/flashlogs/1?id=16" \
- --header "Authorization: Bearer 6Va83h4fv1Pc65kadbZgEDe" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"matches_min\": 2,
- \"match_props\": 7,
- \"db_records\": 15,
- \"block_id\": 1,
- \"block_data_index\": 0,
- \"data_minutes\": 17,
- \"from_cache\": false,
- \"save_result\": false,
- \"csv\": 0,
- \"json\": 0
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/flashlogs/1"
-);
-
-const params = {
- "id": "16",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Authorization": "Bearer 6Va83h4fv1Pc65kadbZgEDe",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "matches_min": 2,
- "match_props": 7,
- "db_records": 15,
- "block_id": 1,
- "block_data_index": 0,
- "data_minutes": 17,
- "from_cache": false,
- "save_result": false,
- "csv": 0,
- "json": 0
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/flashlogs/{id} POST
-Fill the missing database values with Flashlog values that match
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/flashlogs/1?id=5" \
- --header "Authorization: Bearer 5kDbv3d6e8aPcfZE14gaV6h" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"matches_min\": 2,
- \"match_props\": 7,
- \"db_records\": 15,
- \"block_id\": 1,
- \"from_cache\": false,
- \"save_result\": false
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/flashlogs/1"
-);
-
-const params = {
- "id": "5",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Authorization": "Bearer 5kDbv3d6e8aPcfZE14gaV6h",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "matches_min": 2,
- "match_props": 7,
- "db_records": 15,
- "block_id": 1,
- "from_cache": false,
- "save_result": false
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/flashlogs/{id} DELETE
-Delete a block of data (block_id filled), or the whole Flashlog file
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/flashlogs/1?id=7" \
- --header "Authorization: Bearer 8DPc6v3b5Eh1V4faZegkda6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"block_id\": 20
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/flashlogs/1"
-);
-
-const params = {
- "id": "7",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Authorization": "Bearer 8DPc6v3b5Eh1V4faZegkda6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "block_id": 20
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\GroupController
-
-
Manage collaboration groups
-
-
api/groups/checktoken POST
-Check a token for a group id, and accept or decline the invite
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/groups/checktoken" \
- --header "Authorization: Bearer 6hbcZ36kPfvDg85ed41EaVa" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"token\": \"non\",
- \"group_id\": \"esse\",
- \"decline\": true
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups/checktoken"
-);
-
-const headers = {
- "Authorization": "Bearer 6hbcZ36kPfvDg85ed41EaVa",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "token": "non",
- "group_id": "esse",
- "decline": true
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/groups
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/groups" \
- --header "Authorization: Bearer 3Z8hvP6E51f4abcagdeDk6V" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups"
-);
-
-const headers = {
- "Authorization": "Bearer 3Z8hvP6E51f4abcagdeDk6V",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
POST api/groups
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/groups" \
- --header "Authorization: Bearer 4gPDZvf5habc3E68ekdVa61" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups"
-);
-
-const headers = {
- "Authorization": "Bearer 4gPDZvf5habc3E68ekdVa61",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/groups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/groups/1" \
- --header "Authorization: Bearer a81EdcDP6gZbe64a3v5hkVf" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups/1"
-);
-
-const headers = {
- "Authorization": "Bearer a81EdcDP6gZbe64a3v5hkVf",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
PUT api/groups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/groups/1" \
- --header "Authorization: Bearer 51k3dgPaevcbZVaEh8D66f4" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups/1"
-);
-
-const headers = {
- "Authorization": "Bearer 51k3dgPaevcbZVaEh8D66f4",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PUT",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
DELETE api/groups/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/groups/1" \
- --header "Authorization: Bearer dv568VP4Ea16ehZ3bfDgcka" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups/1"
-);
-
-const headers = {
- "Authorization": "Bearer dv568VP4Ea16ehZ3bfDgcka",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
DELETE api/groups/detach/{id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/groups/detach/et" \
- --header "Authorization: Bearer PveE43dgf5b8ac16ZaD6hkV" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/groups/detach/et"
-);
-
-const headers = {
- "Authorization": "Bearer PveE43dgf5b8ac16ZaD6hkV",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\HiveController
-
-
Manage your hives
-
-
api/hives GET
-Display a listing of user hives.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/hives" \
- --header "Authorization: Bearer Eka8VPD315fb46hcvaedg6Z" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hives"
-);
-
-const headers = {
- "Authorization": "Bearer Eka8VPD315fb46hcvaedg6Z",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "hives": [
- {
- "id": 1,
- "location_id": 1,
- "hive_type_id": 43,
- "color": "#35f200",
- "name": "Kast 1",
- "created_at": "2017-07-13 23:34:49",
- "type": "spaarkast",
- "location": "",
- "attention": null,
- "impression": null,
- "reminder": null,
- "reminder_date": null,
- "inspection_count": 0,
- "sensors": [
- 3,
- 19
- ],
- "owner": true,
- "layers": [
- {
- "id": 1,
- "order": 0,
- "color": "#35f200",
- "type": "brood",
- "framecount": 10
- },
- {
- "id": 2,
- "order": 1,
- "color": "#35f200",
- "type": "brood",
- "framecount": 10
- },
- {
- "id": 3,
- "order": 2,
- "color": "#35f200",
- "type": "honey",
- "framecount": 10
- }
- ],
- "queen": null
- }
- ]
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/hives POST
-Store a newly created Hive in storage for the authenticated user.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/hives" \
- --header "Authorization: Bearer ecVbvd546Eg3PhaZa1Dk6f8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"optio\",
- \"location_id\": 7,
- \"brood_layers\": 0,
- \"honey_layers\": 0,
- \"frames\": 0,
- \"order\": 2,
- \"layers\": [
- \"aut\"
- ],
- \"color\": \"kbljro\",
- \"hive_type_id\": 20,
- \"bb_width_cm\": 0,
- \"bb_depth_cm\": 0,
- \"bb_height_cm\": 0,
- \"fr_width_cm\": 0,
- \"fr_height_cm\": 0,
- \"queen\": {
- \"race_id\": 17,
- \"birth_date\": \"2025-02-17T13:45:54\",
- \"name\": \"laborum\",
- \"description\": \"iste\",
- \"line\": \"neque\",
- \"tree\": \"sed\",
- \"color\": \"s\",
- \"clipped\": 12,
- \"fertilized\": 4
- },
- \"timezone\": \"America\\/Chihuahua\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hives"
-);
-
-const headers = {
- "Authorization": "Bearer ecVbvd546Eg3PhaZa1Dk6f8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "optio",
- "location_id": 7,
- "brood_layers": 0,
- "honey_layers": 0,
- "frames": 0,
- "order": 2,
- "layers": [
- "aut"
- ],
- "color": "kbljro",
- "hive_type_id": 20,
- "bb_width_cm": 0,
- "bb_depth_cm": 0,
- "bb_height_cm": 0,
- "fr_width_cm": 0,
- "fr_height_cm": 0,
- "queen": {
- "race_id": 17,
- "birth_date": "2025-02-17T13:45:54",
- "name": "laborum",
- "description": "iste",
- "line": "neque",
- "tree": "sed",
- "color": "s",
- "clipped": 12,
- "fertilized": 4
- },
- "timezone": "America\/Chihuahua"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/hives/{id} GET
-Display the specified resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/hives/1" \
- --header "Authorization: Bearer dD4g5bcEVh1k6vaa863ZPfe" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hives/1"
-);
-
-const headers = {
- "Authorization": "Bearer dD4g5bcEVh1k6vaa863ZPfe",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/hives/{id} PATCH
-Update the specified user Hive in storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/hives/1" \
- --header "Authorization: Bearer vc6d6eDb5a4fkP8ZagE3Vh1" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"alias\",
- \"location_id\": 13,
- \"brood_layers\": 0,
- \"honey_layers\": 0,
- \"frames\": 0,
- \"order\": 6,
- \"layers\": [
- \"unde\"
- ],
- \"color\": \"fiwrj\",
- \"hive_type_id\": 20,
- \"bb_width_cm\": 0,
- \"bb_depth_cm\": 0,
- \"bb_height_cm\": 0,
- \"fr_width_cm\": 0,
- \"fr_height_cm\": 0,
- \"queen\": {
- \"race_id\": 7,
- \"birth_date\": \"2025-02-17T13:45:54\",
- \"name\": \"ratione\",
- \"description\": \"nam\",
- \"line\": \"consectetur\",
- \"tree\": \"illo\",
- \"color\": \"yjz\",
- \"clipped\": 16,
- \"fertilized\": 3
- },
- \"timezone\": \"America\\/Edmonton\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hives/1"
-);
-
-const headers = {
- "Authorization": "Bearer vc6d6eDb5a4fkP8ZagE3Vh1",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "alias",
- "location_id": 13,
- "brood_layers": 0,
- "honey_layers": 0,
- "frames": 0,
- "order": 6,
- "layers": [
- "unde"
- ],
- "color": "fiwrj",
- "hive_type_id": 20,
- "bb_width_cm": 0,
- "bb_depth_cm": 0,
- "bb_height_cm": 0,
- "fr_width_cm": 0,
- "fr_height_cm": 0,
- "queen": {
- "race_id": 7,
- "birth_date": "2025-02-17T13:45:54",
- "name": "ratione",
- "description": "nam",
- "line": "consectetur",
- "tree": "illo",
- "color": "yjz",
- "clipped": 16,
- "fertilized": 3
- },
- "timezone": "America\/Edmonton"
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/hives/{id} DELETE
-Remove the specified user Hive from storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/hives/1" \
- --header "Authorization: Bearer 8vc6kaa5dZ4e6gVhbEP1Df3" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hives/1"
-);
-
-const headers = {
- "Authorization": "Bearer 8vc6kaa5dZ4e6gVhbEP1Df3",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ImageController
-
-
Store and retreive image metadata (image_url, thumb_url, width, category_id, etc.)
-
-
Display a listing of the resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/images" \
- --header "Authorization: Bearer 5aDfEevP8h346Zgabc1Vk6d" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/images"
-);
-
-const headers = {
- "Authorization": "Bearer 5aDfEevP8h346Zgabc1Vk6d",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Store a newly created resource in storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/images" \
- --header "Authorization: Bearer D48ga3ke5bVZEda6h6c1vfP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/images"
-);
-
-const headers = {
- "Authorization": "Bearer D48ga3ke5bVZEda6h6c1vfP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Display the specified resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/images/1" \
- --header "Authorization: Bearer Zb1hefV6v53dE6agk4acP8D" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/images/1"
-);
-
-const headers = {
- "Authorization": "Bearer Zb1hefV6v53dE6agk4acP8D",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Update the specified resource in storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/images/1" \
- --header "Authorization: Bearer D65E8fegPacva1Vb43Z6khd" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/images/1"
-);
-
-const headers = {
- "Authorization": "Bearer D65E8fegPacva1Vb43Z6khd",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PUT",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Remove the specified resource from storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/images" \
- --header "Authorization: Bearer Dd1v36hZVagEa6e584bPfck" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/images"
-);
-
-const headers = {
- "Authorization": "Bearer Dd1v36hZVagEa6e584bPfck",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\InspectionsController
-
-
Manage manual hive inspections
-
-
api/inspections GET
-Show the 'inspections' list with objects reflecting only the general inspection data.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/inspections" \
- --header "Authorization: Bearer Z84hdf31bE6gVaeD5cavkP6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"hive_ids\": [
- \"neque\"
- ],
- \"search\": \"test\",
- \"id\": 23,
- \"start\": \"2024-02-14 00:00:00\",
- \"end\": \"2024-02-18 00:00:00\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections"
-);
-
-const headers = {
- "Authorization": "Bearer Z84hdf31bE6gVaeD5cavkP6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "hive_ids": [
- "neque"
- ],
- "search": "test",
- "id": 23,
- "start": "2024-02-14 00:00:00",
- "end": "2024-02-18 00:00:00"
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/inspections/lists GET
-List checklists and its inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/inspections/lists" \
- --header "Authorization: Bearer a1fZ34PDV68ah5Ee6cdkgvb" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 20
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections/lists"
-);
-
-const headers = {
- "Authorization": "Bearer a1fZ34PDV68ah5Ee6cdkgvb",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 20
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "checklists": [
- {
- "id": 810,
- "type": "beep_v2_copy",
- "name": "Beep v2 - info@beep.nl",
- "description": null,
- "created_at": "2020-01-13 18:30:02",
- "updated_at": "2020-01-13 19:58:47",
- "category_ids": [
- 149,
- 771,
- 963,
- 964,
- 965,
- 966,
- 263,
- 265,
- 270,
- 276
- ],
- "required_ids": [],
- "owner": true,
- "researches": []
- }
- ]
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/inspections/{id} GET
-Show the 'inspection' object. The object reflects only the general inspection data.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/inspections/ratione" \
- --header "Authorization: Bearer gk6ec3VbfZ8vh64DadEP1a5" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections/ratione"
-);
-
-const headers = {
- "Authorization": "Bearer gk6ec3VbfZ8vh64DadEP1a5",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/inspections/hive/{hive_id} GET
-List all inspections linked to Hive id. The 'inspections' object contains a descending date ordered list of general inspection data. The 'items_by_date' object contains a list of (rows of) inspection items that can be placed (in columns) under the inspections by created_at date (table format). NB: Use 'Accept-Language' Header (default nl_NL) to provide localized category names (anc, name) in items_by_date.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/inspections/hive/alias" \
- --header "Authorization: Bearer E6hvg8b5akP43Df1cZeda6V" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"search\": \"15\",
- \"impression\": \"2,3\",
- \"attention\": true,
- \"reminder\": true,
- \"start\": \"2024-02-14 00:00:00\",
- \"end\": \"2024-02-18 00:00:00\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections/hive/alias"
-);
-
-const headers = {
- "Authorization": "Bearer E6hvg8b5akP43Df1cZeda6V",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "search": "15",
- "impression": "2,3",
- "attention": true,
- "reminder": true,
- "start": "2024-02-14 00:00:00",
- "end": "2024-02-18 00:00:00"
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "inspections": [
- {
- "id": 93,
- "notes": null,
- "reminder": null,
- "reminder_date": null,
- "impression": 1,
- "attention": null,
- "created_at": "2020-05-18 12:34:00",
- "checklist_id": 829,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 42
- },
- {
- "id": 91,
- "notes": null,
- "reminder": null,
- "reminder_date": null,
- "impression": 3,
- "attention": 0,
- "created_at": "2020-05-18 11:43:00",
- "checklist_id": 829,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 42
- }
- ],
- "items_by_date": [
- {
- "anc": null,
- "name": "Bee colony",
- "items": null
- },
- {
- "anc": "Bee colony > Brood > ",
- "name": "Pattern consistency",
- "type": "score",
- "range": "min: 1 - max: 5",
- "items": [
- {
- "id": 138,
- "value": "3",
- "inspection_id": 93,
- "category_id": 279,
- "val": "3",
- "unit": null,
- "type": "score"
- },
- ""
- ]
- },
- {
- "anc": "Bee colony > Brood > Status > ",
- "name": "All stages",
- "type": "boolean",
- "range": null,
- "items": [
- "",
- {
- "id": 77,
- "value": "1",
- "inspection_id": 91,
- "category_id": 868,
- "val": "Yes",
- "unit": null,
- "type": "boolean"
- }
- ]
- },
- {
- "anc": "Bee colony > Brood > Status > ",
- "name": "Eggs",
- "type": "boolean",
- "range": null,
- "items": [
- "",
- {
- "id": 308,
- "value": "1",
- "inspection_id": 91,
- "category_id": 270,
- "val": "Yes",
- "unit": null,
- "type": "boolean"
- }
- ]
- }
- ]
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/inspections POST
-Register a new hive inspection the 'inspection' object. The object reflects only the general inspection data.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/inspections/store" \
- --header "Authorization: Bearer h4d6c6DE83ae15vZfabkVgP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"date\": \"2020-05-18 16:16\",
- \"items\": {
- \"547\": 0,
- \"595\": 1,
- \"845\": \"814\"
- },
- \"hive_id\": 11,
- \"hive_ids\": 42,
- \"location_id\": \"2\",
- \"id\": 15,
- \"impression\": -1,
- \"attention\": 1,
- \"reminder\": \"This is an inspection reminder\",
- \"reminder_date\": \"2020-05-27 16:16\",
- \"notes\": \"This is an inspection note\",
- \"checklist_id\": 829
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections/store"
-);
-
-const headers = {
- "Authorization": "Bearer h4d6c6DE83ae15vZfabkVgP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "date": "2020-05-18 16:16",
- "items": {
- "547": 0,
- "595": 1,
- "845": "814"
- },
- "hive_id": 11,
- "hive_ids": 42,
- "location_id": "2",
- "id": 15,
- "impression": -1,
- "attention": 1,
- "reminder": "This is an inspection reminder",
- "reminder_date": "2020-05-27 16:16",
- "notes": "This is an inspection note",
- "checklist_id": 829
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Remove the specified resource from storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/inspections/1" \
- --header "Authorization: Bearer ZPk6edg61cvh5faab3EV8D4" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/inspections/1"
-);
-
-const headers = {
- "Authorization": "Bearer ZPk6edg61cvh5faab3EV8D4",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\LocationController
-
-
Manage Apiaries
-
-
Display a listing of the resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/locations" \
- --header "Authorization: Bearer Dd3e1PVgaf56ha8vkZ4bE6c" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/locations"
-);
-
-const headers = {
- "Authorization": "Bearer Dd3e1PVgaf56ha8vkZ4bE6c",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Store a newly created resource in storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/locations" \
- --header "Authorization: Bearer kePVcvdD4fh3Ea6a81b65Zg" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"nulla\",
- \"hive_type_id\": 1
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/locations"
-);
-
-const headers = {
- "Authorization": "Bearer kePVcvdD4fh3Ea6a81b65Zg",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "nulla",
- "hive_type_id": 1
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Display the specified resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/locations/2" \
- --header "Authorization: Bearer PkZehf85aV63adE4cvgb1D6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/locations/2"
-);
-
-const headers = {
- "Authorization": "Bearer PkZehf85aV63adE4cvgb1D6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Update the specified resource in storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/locations/2" \
- --header "Authorization: Bearer 6c85g31hbaf4EkVad6ZeDvP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"est\",
- \"hive_type_id\": 1
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/locations/2"
-);
-
-const headers = {
- "Authorization": "Bearer 6c85g31hbaf4EkVad6ZeDvP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "est",
- "hive_type_id": 1
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Remove the specified resource from storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/locations/2" \
- --header "Authorization: Bearer f8kbPgh643Z51Vad6EaDcev" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/locations/2"
-);
-
-const headers = {
- "Authorization": "Bearer f8kbPgh643Z51Vad6EaDcev",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\MeasurementController
-
-
Store and retreive sensor data (both LoRa and API POSTs) from a Device
-
-
api/sensors POST
-Store sensor measurement data (see BEEP sensor data API definition) from API, or TTN. See /sensors/measurement_types?locale=en which measurement types can be used to POST data to.
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensors?key/data=sed" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\\/data\": \"voluptas\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors"
-);
-
-const params = {
- "key/data": "sed",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key\/data": "voluptas"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/lora_sensors POST
-Store sensor measurement data (see BEEP sensor data API definition) from TTN or KPN (Simpoint)
-When Simpoint payload is supplied, the LoRa HEX to key/value pairs decoding is done within function $this->parse_ttn_payload()
-When TTN payload is supplied, the TTN HTTP integration decoder/converter is assumed to have already converted the payload from LoRa HEX to key/value conversion
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/lora_sensors" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\": \"id\",
- \"payload_raw\": \"officiis\",
- \"payload_fields\": \"in\",
- \"DevEUI_uplink\": \"in\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/lora_sensors"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key": "id",
- "payload_raw": "officiis",
- "payload_fields": "in",
- "DevEUI_uplink": "in"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/measurement_types GET
-Request all currently available sensor measurement types that can be POSTed to
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/measurement_types?locale=en" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/measurement_types"
-);
-
-const params = {
- "locale": "en",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors POST
-Store sensor measurement data (see BEEP sensor data API definition) from API, or TTN. See /sensors/measurement_types?locale=en which measurement types can be used to POST data to.
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensors_auth?key/data=mollitia" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\\/data\": \"eum\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors_auth"
-);
-
-const params = {
- "key/data": "mollitia",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key\/data": "eum"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/lora_sensors POST
-Store sensor measurement data (see BEEP sensor data API definition) from TTN or KPN (Simpoint)
-When Simpoint payload is supplied, the LoRa HEX to key/value pairs decoding is done within function $this->parse_ttn_payload()
-When TTN payload is supplied, the TTN HTTP integration decoder/converter is assumed to have already converted the payload from LoRa HEX to key/value conversion
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/lora_sensors_auth" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\": \"aperiam\",
- \"payload_raw\": \"sed\",
- \"payload_fields\": \"totam\",
- \"DevEUI_uplink\": \"praesentium\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/lora_sensors_auth"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key": "aperiam",
- "payload_raw": "sed",
- "payload_fields": "totam",
- "DevEUI_uplink": "praesentium"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/measurements GET
-Request all sensor measurements from a certain interval (hour, day, week, month, year) and index (0=until now, 1=previous interval, etc.)
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/measurements" \
- --header "Authorization: Bearer kfegda8b41cV5a3DEv6Ph6Z" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 2,
- \"key\": \"omnis\",
- \"hive_id\": 6,
- \"start\": \"2020-05-27 16:16\",
- \"end\": \"2020-05-30 00:00\",
- \"index\": 8,
- \"interval\": \"dolores\",
- \"timeGroup\": \"et\",
- \"names\": \"omnis\",
- \"weather\": 1,
- \"clean_weight\": 8,
- \"timezone\": \"Europe\\/Amsterdam\",
- \"relative_interval\": 14
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/measurements"
-);
-
-const headers = {
- "Authorization": "Bearer kfegda8b41cV5a3DEv6Ph6Z",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 2,
- "key": "omnis",
- "hive_id": 6,
- "start": "2020-05-27 16:16",
- "end": "2020-05-30 00:00",
- "index": 8,
- "interval": "dolores",
- "timeGroup": "et",
- "names": "omnis",
- "weather": 1,
- "clean_weight": 8,
- "timezone": "Europe\/Amsterdam",
- "relative_interval": 14
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/lastvalues GET
-Request last measurement values of all sensor measurements from a Device
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/lastvalues" \
- --header "Authorization: Bearer a4bfd1vPDaZhc6V3e8Ek5g6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\": \"omnis\",
- \"id\": 19,
- \"hive_id\": 20
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/lastvalues"
-);
-
-const headers = {
- "Authorization": "Bearer a4bfd1vPDaZhc6V3e8Ek5g6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key": "omnis",
- "id": 19,
- "hive_id": 20
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/lastweight GET
-Request last weight related measurement values from a sensor (Device), used by legacy webapp to show calibration data: ['w_fl', 'w_fr', 'w_bl', 'w_br', 'w_v', 'weight_kg', 'weight_kg_corrected', 'calibrating_weight', 'w_v_offset', 'w_v_kg_per_val', 'w_fl_offset', 'w_fr_offset', 'w_bl_offset', 'w_br_offset']
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/lastweight" \
- --header "Authorization: Bearer h8b6k4Z5ad1vP3eEg6VafcD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"key\": \"accusantium\",
- \"id\": 15,
- \"hive_id\": 20
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/lastweight"
-);
-
-const headers = {
- "Authorization": "Bearer h8b6k4Z5ad1vP3eEg6VafcD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "key": "accusantium",
- "id": 15,
- "hive_id": 20
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/calibrateweight
-Legacy method, used by legacy webapp to store weight calibration value e.g.[w_v_kg_per_val] in Influx database, to lookup and calculate [weight_kg] at incoming measurement value storage
-
-
-
-
-
At the next measurement coming in, calibrate each weight sensor with it's part of a given weight.
-Because the measurements can come in only each hour/ 3hrs, set a value to trigger the calculation on next measurement
-
-If $next_measurement == true: save 'calibrating' = true in Influx with the sensor key
-If $next_measurement == false: save 'calibrating' = false in Influx with the sensor key and...
-Get the last measured weight values for this sensor key,
-Divide the given weight (in kg) with the amount of sensor values > 1.0 (assuming the weight is evenly distributed)
-Calculate the multiplier per sensor by dividing the multiplier = weight_part / (value - offset)
-Save the multiplier as $device_name.'_kg_per_val' in Influx
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensors/calibrateweight" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"next_measurement\": true,
- \"weight_kg\": 142125817.9803
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/calibrateweight"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "next_measurement": true,
- "weight_kg": 142125817.9803
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
POST api/sensors/offsetweight
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensors/offsetweight" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/offsetweight"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/sensors/measurement_types_available
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/measurement_types_available" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/measurement_types_available"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/flashlog
-POST data from BEEP base fw 1.5.0+ FLASH log (with timestamp), interpret data and store in InlfuxDB (overwriting existing data). BEEP base BLE cmd: when the response is 200 OK and erase_mx_flash > -1, provide the ERASE_MX_FLASH BLE command (0x21) to the BEEP base with the last byte being the HEX value of the erase_mx_flash value (0 = 0x00, 1 = 0x01, i.e.0x2100, or 0x2101, i.e. erase_type:"fatfs", or erase_type:"full")
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensors/flashlog?show=3&save=1&fill=17&log_size_bytes=19" \
- --header "Authorization: Bearer 5ba8EZk4dDvh1fPVecg63a6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 6,
- \"hardware_id\": \"exercitationem\",
- \"key\": \"et\",
- \"data\": \"fugit\",
- \"file\": \"qui\",
- \"show\": false,
- \"save\": true,
- \"fill\": false,
- \"log_size_bytes\": 8
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/flashlog"
-);
-
-const params = {
- "show": "3",
- "save": "1",
- "fill": "17",
- "log_size_bytes": "19",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Authorization": "Bearer 5ba8EZk4dDvh1fPVecg63a6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 6,
- "hardware_id": "exercitationem",
- "key": "et",
- "data": "fugit",
- "file": "qui",
- "show": false,
- "save": true,
- "fill": false,
- "log_size_bytes": 8
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
-"lines_received": 20039,
-"bytes_received": 9872346,
-"log_saved": true,
-"log_parsed": false,
-"log_messages":29387823
-"erase_mx_flash": -1,
-"erase":false,
-"erase_type":"fatfs"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
GET api/sensors/decode/p/{port}/pl/{payload}
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/decode/p/delectus/pl/odit" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/decode/p/delectus/pl/odit"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensors/comparemeasurements GET
-Request mean measurements for multiple hives from a certain interval (hour, day, week, month, year) and index (0=until now, 1=previous interval, etc.)
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensors/comparemeasurements" \
- --header "Authorization: Bearer 6gPc1D4a8Vk5b6EZhfadve3" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"id\": 2,
- \"key\": \"saepe\",
- \"hive_id\": 4,
- \"start\": \"2020-05-27 16:16\",
- \"end\": \"2020-05-30 00:00\",
- \"index\": 15,
- \"interval\": \"beatae\",
- \"timeGroup\": \"placeat\",
- \"names\": \"ut\",
- \"weather\": 1,
- \"timezone\": \"Europe\\/Amsterdam\",
- \"relative_interval\": 2
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensors/comparemeasurements"
-);
-
-const headers = {
- "Authorization": "Bearer 6gPc1D4a8Vk5b6EZhfadve3",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "id": 2,
- "key": "saepe",
- "hive_id": 4,
- "start": "2020-05-27 16:16",
- "end": "2020-05-30 00:00",
- "index": 15,
- "interval": "beatae",
- "timeGroup": "placeat",
- "names": "ut",
- "weather": 1,
- "timezone": "Europe\/Amsterdam",
- "relative_interval": 2
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ResearchController
-
-
Manage your research consent
-
-
Display a listing of the resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/research" \
- --header "Authorization: Bearer EfvZe3h56a4cDVkP86agd1b" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/research"
-);
-
-const headers = {
- "Authorization": "Bearer EfvZe3h56a4cDVkP86agd1b",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
research/{id}/add_consent POST
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/research/14/add_consent" \
- --header "Authorization: Bearer fbv63Dk6Zcd5Veg1a4Ea8hP" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"location_ids\": [
- \"debitis\"
- ],
- \"hive_ids\": [
- \"quae\"
- ],
- \"device_ids\": [
- \"harum\"
- ]
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/research/14/add_consent"
-);
-
-const headers = {
- "Authorization": "Bearer fbv63Dk6Zcd5Veg1a4Ea8hP",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "location_ids": [
- "debitis"
- ],
- "hive_ids": [
- "quae"
- ],
- "device_ids": [
- "harum"
- ]
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
POST api/research/{id}/remove_consent
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/research/1/remove_consent" \
- --header "Authorization: Bearer 6P6ec5vZ13dghf8DVka4bEa" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/research/1/remove_consent"
-);
-
-const headers = {
- "Authorization": "Bearer 6P6ec5vZ13dghf8DVka4bEa",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
PATCH api/research/{id}/edit/{consent_id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PATCH \
- "https://api.beep.nl/api/research/1/edit/beatae" \
- --header "Authorization: Bearer aa4f8VvD66PZgceh13bd5Ek" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/research/1/edit/beatae"
-);
-
-const headers = {
- "Authorization": "Bearer aa4f8VvD66PZgceh13bd5Ek",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PATCH",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
DELETE api/research/{id}/delete/{consent_id}
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/research/1/delete/ut" \
- --header "Authorization: Bearer avEaZ5cVg46eP8fDk1h6b3d" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/research/1/delete/ut"
-);
-
-const headers = {
- "Authorization": "Bearer avEaZ5cVg46eP8fDk1h6b3d",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\ResearchDataController
-
-
Retreive owned or viewable Research data
-
-
api/researchdata GET
-List all available Researches
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/researchdata" \
- --header "Authorization: Bearer D6gcV351ea8hfP4ZEbdva6k" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/researchdata"
-);
-
-const headers = {
- "Authorization": "Bearer D6gcV351ea8hfP4ZEbdva6k",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-[
- {
- "id": 1,
- "created_at": "2020-02-25 03:01:57",
- "updated_at": "2020-11-13 17:08:31",
- "name": "B-GOOD",
- "url": "https://b-good-project.eu/",
- "description": "B-GOOD has the overall goal to provide guidance for beekeepers and help them make better and more informed decisions.",
- "type": "research-b-good",
- "institution": "Wageningen University & Research",
- "type_of_data_used": "Hive inspections, hive settings, BEEP base measurement data",
- "start_date": "2019-07-01 00:00:00",
- "end_date": "2023-06-30 00:00:00",
- "image_id": 1,
- "consent": true,
- "consent_history": [
- {
- "id": 185,
- "created_at": "2020-11-12 22:28:09",
- "updated_at": "2020-06-12 22:28:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 1,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- },
- {
- "id": 1,
- "created_at": "2020-02-25 03:02:23",
- "updated_at": "2020-05-27 03:03:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 0,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- },
- {
- "id": 97,
- "created_at": "2020-05-14 16:24:41",
- "updated_at": "2020-03-14 16:24:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 1,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- }
- ],
- "checklist_names": [
- "1 Winter",
- "2 Varroa",
- "3 Summer+",
- "4 Summer",
- "5 Health"
- ],
- "thumb_url": "/storage/users/1/thumbs/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "image": {
- "id": 1,
- "created_at": "2020-02-25 03:01:57",
- "updated_at": "2020-02-25 03:01:57",
- "filename": "6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "image_url": "/storage/users/1/images/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "thumb_url": "/storage/users/1/thumbs/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "description": "B-GOOD has the overall goal to provide guidance for beekeepers and help them make better and more informed decisions.",
- "type": "research",
- "height": 1271,
- "width": 1271,
- "size_kb": 51,
- "date": "2020-02-25 03:01:57",
- "hive_id": null,
- "category_id": null,
- "inspection_id": null
- }
- }
-]
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/researchdata/{id} GET
-List one Research by id with list of consent_users
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/researchdata/placeat" \
- --header "Authorization: Bearer V4Dv16f3eg85aZhkaE6dPbc" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/researchdata/placeat"
-);
-
-const headers = {
- "Authorization": "Bearer V4Dv16f3eg85aZhkaE6dPbc",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "research": {
- "id": 1,
- "created_at": "2020-02-25 03:01:57",
- "updated_at": "2020-11-18 10:33:23",
- "name": "B-GOOD",
- "url": "https://b-good-project.eu/",
- "description": "B-GOOD has the overall goal to provide guidance for beekeepers and help them make better and more informed decisions.",
- "type": "research-b-good",
- "institution": "Wageningen University & Research",
- "type_of_data_used": "Hive inspections, hive settings, BEEP base measurement data",
- "start_date": "2019-07-01 00:00:00",
- "end_date": "2023-06-30 00:00:00",
- "image_id": 1,
- "consent": true,
- "consent_history": [
- {
- "id": 185,
- "created_at": "2020-11-12 22:28:09",
- "updated_at": "2020-06-12 22:28:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 1,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- },
- {
- "id": 1,
- "created_at": "2020-02-25 03:02:23",
- "updated_at": "2020-05-27 03:03:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 0,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- },
- {
- "id": 97,
- "created_at": "2020-05-14 16:24:41",
- "updated_at": "2020-03-14 16:24:00",
- "user_id": 1,
- "research_id": 1,
- "consent": 1,
- "consent_location_ids": null,
- "consent_hive_ids": null,
- "consent_sensor_ids": null
- }
- ],
- "checklist_names": [
- "1 Winter",
- "2 Varroa",
- "3 Summer+",
- "4 Summer",
- "5 Health"
- ],
- "thumb_url": "/storage/users/1/thumbs/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "image": {
- "id": 1,
- "created_at": "2020-02-25 03:01:57",
- "updated_at": "2020-02-25 03:01:57",
- "filename": "6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "image_url": "/storage/users/1/images/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "thumb_url": "/storage/users/1/thumbs/research/6LJEp35dodWWtfxnm3xfRnL05qvvJrHbn8IXAJqNCFZj2vFjwyLXbmWscKVz.jpg",
- "description": "B-GOOD has the overall goal to provide guidance for beekeepers and help them make better and more informed decisions.",
- "type": "research",
- "height": 1271,
- "width": 1271,
- "size_kb": 51,
- "date": "2020-02-25 03:01:57",
- "hive_id": null,
- "category_id": null,
- "inspection_id": null
- }
- },
- "consent_users": [
- {
- "id": 1,
- "name": "Beep",
- "email": "pim@beep.nl",
- "created_at": "2017-07-14 03:34:10",
- "updated_at": "2020-05-27 03:03:00",
- "last_login": "2020-11-18 10:32:16",
- "locale": null,
- "consent": 0
- },
- {
- "id": 2371,
- "name": "app@beep.nl",
- "email": "app@beep.nl",
- "created_at": "2019-10-24 17:15:55",
- "updated_at": "2020-02-25 11:46:59",
- "last_login": "2020-08-20 18:24:22",
- "locale": null,
- "consent": 0
- },
- {
- "id": 1,
- "name": "Beep",
- "email": "pim@beep.nl",
- "created_at": "2017-07-14 03:34:10",
- "updated_at": "2020-06-12 22:28:00",
- "last_login": "2020-11-18 10:32:16",
- "locale": null,
- "consent": 1
- }
- ]
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/researchdata/{id}/user/{user_id}/{item} GET
-List all user 'item' data within the consent=1 periods of a specific user within a Research. The 'item' field indicates the type of user data (apiaries/locations/hives/devices/flashlogs/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/user/1/inspections.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/researchdata/1/user/1/inspections" \
- --header "Authorization: Bearer 5d64aDf8PEV3bc1hagZekv6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"date_start\": \"2020-01-01 00:00:00\",
- \"date_until\": \"2020-09-29 23:59:59\",
- \"device_id\": 1,
- \"location_id\": 2,
- \"measurements\": \"non\",
- \"decimals\": 1,
- \"interval\": \"5m\",
- \"calculation\": \"MEAN\",
- \"calculation_prop\": \"DERIVATIVE\",
- \"limit\": 10,
- \"precision\": \"rfc3339\",
- \"index\": 0,
- \"timezone\": \"Asia\\/Almaty\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/researchdata/1/user/1/inspections"
-);
-
-const headers = {
- "Authorization": "Bearer 5d64aDf8PEV3bc1hagZekv6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "date_start": "2020-01-01 00:00:00",
- "date_until": "2020-09-29 23:59:59",
- "device_id": 1,
- "location_id": 2,
- "measurements": "non",
- "decimals": 1,
- "interval": "5m",
- "calculation": "MEAN",
- "calculation_prop": "DERIVATIVE",
- "limit": 10,
- "precision": "rfc3339",
- "index": 0,
- "timezone": "Asia\/Almaty"
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-[
- {
- "id": 35211,
- "notes": "test",
- "reminder": null,
- "reminder_date": null,
- "impression": 2,
- "attention": 1,
- "created_at": "2020-03-26 18:28:00",
- "checklist_id": 798,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 280,
- "items": []
- },
- {
- "id": 40162,
- "notes": "Input Liebefeld",
- "reminder": null,
- "reminder_date": null,
- "impression": null,
- "attention": null,
- "created_at": "2020-04-24 11:03:00",
- "checklist_id": 3206,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 280,
- "items": [
- {
- "id": 326538,
- "value": "0.6",
- "inspection_id": 40162,
- "category_id": 977,
- "val": "0.6",
- "unit": "x 25cm2",
- "type": "square_25cm2"
- },
- {
- "id": 326539,
- "value": "4",
- "inspection_id": 40162,
- "category_id": 978,
- "val": "4",
- "unit": "x 25cm2",
- "type": "square_25cm2"
- },
- {
- "id": 326540,
- "value": "2",
- "inspection_id": 40162,
- "category_id": 979,
- "val": "2",
- "unit": "x 25cm2",
- "type": "square_25cm2"
- }
- ]
- },
- {
- "id": 40163,
- "notes": "Brood photograph",
- "reminder": null,
- "reminder_date": null,
- "impression": null,
- "attention": null,
- "created_at": "2020-04-24 11:07:00",
- "checklist_id": 3206,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 280,
- "items": [
- {
- "id": 326567,
- "value": "1",
- "inspection_id": 40163,
- "category_id": 399,
- "val": "Ja",
- "unit": null,
- "type": "boolean"
- },
- {
- "id": 326568,
- "value": "https://assets.beep.nl/users/1/thumbs/inspection/jIcycTYnO8zYq6SHCvAwPHb97BDLFkZaDmfZUop5.png",
- "inspection_id": 40163,
- "category_id": 973,
- "val": "https://assets.beep.nl/users/1/thumbs/inspection/jIcycTYnO8zYq6SHCvAwPHb97BDLFkZaDmfZUop5.png",
- "unit": null,
- "type": "image"
- }
- ]
- },
- {
- "id": 68477,
- "notes": null,
- "reminder": null,
- "reminder_date": null,
- "impression": 3,
- "attention": 1,
- "created_at": "2020-10-23 12:43:00",
- "checklist_id": 3206,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 281,
- "items": []
- },
- {
- "id": 68478,
- "notes": "Hive change",
- "reminder": null,
- "reminder_date": null,
- "impression": null,
- "attention": null,
- "created_at": "2020-10-23 13:12:33",
- "checklist_id": null,
- "image_id": null,
- "owner": true,
- "thumb_url": null,
- "hive_id": 281,
- "items": [
- {
- "id": 522496,
- "value": "2",
- "inspection_id": 68478,
- "category_id": 85,
- "val": "2",
- "unit": null,
- "type": "number_positive"
- },
- {
- "id": 522497,
- "value": "2",
- "inspection_id": 68478,
- "category_id": 87,
- "val": "2",
- "unit": null,
- "type": "number"
- },
- {
- "id": 522498,
- "value": "10",
- "inspection_id": 68478,
- "category_id": 89,
- "val": "10",
- "unit": null,
- "type": "number_positive"
- }
- ]
- }
-]
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/researchdata/{id}/data/{item} GET
-List all research 'item' data within the consent=1 periods within a Research. The 'item' field indicates the type of data (apiaries/locations/devices/inspections/measurements/weather) to request within the research (which the user gave consent for to use). Example: inspectionsResponse: api/researchdata/1/inspections.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/researchdata/1/data/inspections" \
- --header "Authorization: Bearer 61PD8ZaEf36d5Ve4ckahbgv" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"date_start\": \"2020-01-01 00:00:00\",
- \"date_until\": \"2020-09-29 23:59:59\",
- \"year_months\": \"2020-01,2021-02\",
- \"device_ids\": \"1,3,6\",
- \"device_id\": 1,
- \"location_ids\": \"1,3,6\",
- \"location_id\": 2,
- \"measurements\": \"dolorem\",
- \"decimals\": 1,
- \"interval\": \"5m\",
- \"calculation\": \"MAX\",
- \"calculation_prop\": \"5\",
- \"limit\": 500,
- \"precision\": \"rfc3339\",
- \"index\": 0,
- \"timezone\": \"Europe\\/Amsterdam\",
- \"output_csv_links\": true
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/researchdata/1/data/inspections"
-);
-
-const headers = {
- "Authorization": "Bearer 61PD8ZaEf36d5Ve4ckahbgv",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "date_start": "2020-01-01 00:00:00",
- "date_until": "2020-09-29 23:59:59",
- "year_months": "2020-01,2021-02",
- "device_ids": "1,3,6",
- "device_id": 1,
- "location_ids": "1,3,6",
- "location_id": 2,
- "measurements": "dolorem",
- "decimals": 1,
- "interval": "5m",
- "calculation": "MAX",
- "calculation_prop": "5",
- "limit": 500,
- "precision": "rfc3339",
- "index": 0,
- "timezone": "Europe\/Amsterdam",
- "output_csv_links": true
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (500):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Server Error"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\SampleCodeController
-
-
Research lab result sample code controller
-
-
Display a listing of the resource.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/samplecode" \
- --header "Authorization: Bearer a1c65VdgPhfbekD463EvaZ8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/samplecode"
-);
-
-const headers = {
- "Authorization": "Bearer a1c65VdgPhfbekD463EvaZ8",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/samplecode POST
-Create a sample code for lab results
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/samplecode" \
- --header "Authorization: Bearer 65EZak6vcaP1gbD38hfV4ed" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/samplecode"
-);
-
-const headers = {
- "Authorization": "Bearer 65EZak6vcaP1gbD38hfV4ed",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Show not used
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/samplecode/1" \
- --header "Authorization: Bearer V5Dkbf66gc1d8Pv3Ze4aahE" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/samplecode/1"
-);
-
-const headers = {
- "Authorization": "Bearer V5Dkbf66gc1d8Pv3Ze4aahE",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Update not used
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/samplecode/1" \
- --header "Authorization: Bearer 4f58h6a163cbkPdgaVEZveD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/samplecode/1"
-);
-
-const headers = {
- "Authorization": "Bearer 4f58h6a163cbkPdgaVEZveD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "PUT",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Remove the specified resource from storage.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/samplecode" \
- --header "Authorization: Bearer 6PZvhaDbe84E6kg5cfV31da" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/samplecode"
-);
-
-const headers = {
- "Authorization": "Bearer 6PZvhaDbe84E6kg5cfV31da",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\SensorDefinitionController
-
-
Manage your sensor definitions
-
-
api/sensordefinition GET
-Display a listing of all sensordefinitions that belong to a device
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensordefinition" \
- --header "Authorization: Bearer acbPZ6dvha3EVf1ke56Dg48" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"device_id\": 5,
- \"hardware_id\": \"labore\",
- \"device_hardware_id\": \"architecto\",
- \"input_measurement_abbreviation\": \"et\",
- \"limit\": 3
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensordefinition"
-);
-
-const headers = {
- "Authorization": "Bearer acbPZ6dvha3EVf1ke56Dg48",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "device_id": 5,
- "hardware_id": "labore",
- "device_hardware_id": "architecto",
- "input_measurement_abbreviation": "et",
- "limit": 3
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensordefinition POST
-Store a newly created sensordefinition
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/sensordefinition" \
- --header "Authorization: Bearer 6a5fVP6bEegaDkZh143dv8c" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"name\": \"nihil\",
- \"inside\": false,
- \"offset\": 4.8005514,
- \"multiplier\": 77.910918,
- \"input_measurement_id\": 5,
- \"input_measurement_abbreviation\": \"w_v\",
- \"output_measurement_id\": 6,
- \"output_measurement_abbreviation\": \"t_i\",
- \"device_id\": 9,
- \"hardware_id\": \"deleniti\",
- \"device_hardware_id\": \"eius\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensordefinition"
-);
-
-const headers = {
- "Authorization": "Bearer 6a5fVP6bEegaDkZh143dv8c",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "name": "nihil",
- "inside": false,
- "offset": 4.8005514,
- "multiplier": 77.910918,
- "input_measurement_id": 5,
- "input_measurement_abbreviation": "w_v",
- "output_measurement_id": 6,
- "output_measurement_abbreviation": "t_i",
- "device_id": 9,
- "hardware_id": "deleniti",
- "device_hardware_id": "eius"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensordefinition/{id} GET
-Display the specified sensordefinition
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/sensordefinition/est" \
- --header "Authorization: Bearer a4c8bk6gv6h5DaZPVE1df3e" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"device_id\": 6,
- \"hardware_id\": \"consequuntur\",
- \"device_hardware_id\": \"alias\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensordefinition/est"
-);
-
-const headers = {
- "Authorization": "Bearer a4c8bk6gv6h5DaZPVE1df3e",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "device_id": 6,
- "hardware_id": "consequuntur",
- "device_hardware_id": "alias"
-};
-
-fetch(url, {
- method: "GET",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensordefinition/{id} PATCH
-Update the specified sensordefinition
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/sensordefinition/eveniet" \
- --header "Authorization: Bearer 1vacdPV4ak63g5EZ8f6hebD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"device_id\": 3,
- \"hardware_id\": \"ea\",
- \"device_hardware_id\": \"libero\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensordefinition/eveniet"
-);
-
-const headers = {
- "Authorization": "Bearer 1vacdPV4ak63g5EZ8f6hebD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "device_id": 3,
- "hardware_id": "ea",
- "device_hardware_id": "libero"
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/sensordefinition/{id} DELETE
-Remove the specified sensordefinition
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/sensordefinition/eligendi" \
- --header "Authorization: Bearer e6d6E1vVgabZ5fkc4a38PhD" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"device_id\": 3,
- \"hardware_id\": \"asperiores\",
- \"device_hardware_id\": \"nulla\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/sensordefinition/eligendi"
-);
-
-const headers = {
- "Authorization": "Bearer e6d6E1vVgabZ5fkc4a38PhD",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "device_id": 3,
- "hardware_id": "asperiores",
- "device_hardware_id": "nulla"
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\TaxonomyController
-
-
-
-
api/taxonomy/lists
-List of current state of the standard categories.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/taxonomy/lists" \
- --header "Authorization: Bearer 66gfc3vD1Pbd4hE8aZk5Vae" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/taxonomy/lists"
-);
-
-const headers = {
- "Authorization": "Bearer 66gfc3vD1Pbd4hE8aZk5Vae",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/taxonomy/taxonomy
-List of current state of the standard categories, translated, unordered/ordered in hierachy/flat.
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/taxonomy/taxonomy?locale=magni&flat=1&order=" \
- --header "Authorization: Bearer f8V3ZPcb6ka6d5D1avE4heg" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/taxonomy/taxonomy"
-);
-
-const params = {
- "locale": "magni",
- "flat": "1",
- "order": "0",
-};
-Object.keys(params)
- .forEach(key => url.searchParams.append(key, params[key]));
-
-const headers = {
- "Authorization": "Bearer f8V3ZPcb6ka6d5D1avE4heg",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Api\UserController
-
-
APIs for managing users
-
-
api/login
-Login via login form
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/login" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"email\": \"test@test.com\",
- \"password\": \"testtest\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/login"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "email": "test@test.com",
- "password": "testtest"
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "id": 1317,
- "name": "test@test.com",
- "email": "test@test.com",
- "avatar": "default.jpg",
- "api_token": "1snu2aRRiwQNl2Tul567hLF0XpKuZO8hqkgXU4GvjzZ3f3pOCiDPFbBDea7W",
- "created_at": "2018-12-30 23:57:35",
- "updated_at": "2020-01-09 16:31:32",
- "last_login": "2020-01-09 16:31:32",
- "policy_accepted": "beep_terms_2018_05_25_avg_v1",
- "email_verified_at": "2018-05-25 00:00:00"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/authenticate
-Authorize a user and login with an api_token. Used for persistent login in webapp.
-
-
-requires authentication
-
-
-
Header parameter with Bearer [api_token] from the user object. Example: Bearer 1snu2aRRiwQNl2Tul5F0XpKuZO8hqkgXU4GvjzZ3f3pOCiDPFbBDea7W
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/authenticate" \
- --header "Authorization: Bearer 3afb8vD5d1aegPZch4VE6k6" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/authenticate"
-);
-
-const headers = {
- "Authorization": "Bearer 3afb8vD5d1aegPZch4VE6k6",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "POST",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (200):
-
-
-
-{
- "id": 1317,
- "name": "test@test.com",
- "email": "test@test.com",
- "avatar": "default.jpg",
- "api_token": "1snu2aRRiwQNl2Tul567hLF0XpKuZO8hqkgXU4GvjzZ3f3pOCiDPFbBDea7W",
- "created_at": "2018-12-30 23:57:35",
- "updated_at": "2020-01-09 16:31:32",
- "last_login": "2020-01-09 16:31:32",
- "policy_accepted": "beep_terms_2018_05_25_avg_v1",
- "email_verified_at": "2018-05-25 00:00:00"
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
api/userlocale PATCH
-Edit the user locale only, do not update api_key
-
-
-requires authentication
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PATCH \
- "https://api.beep.nl/api/userlocale" \
- --header "Authorization: Bearer 16hc4akgbEDf36av85eVPZd" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"locale\": \"eaque\"
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/userlocale"
-);
-
-const headers = {
- "Authorization": "Bearer 16hc4akgbEDf36av85eVPZd",
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "locale": "eaque"
-};
-
-fetch(url, {
- method: "PATCH",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Endpoints
-
-
-
-
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/hive-tags" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hive-tags"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
Store a newly created resource in storage.
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request POST \
- "https://api.beep.nl/api/hive-tags" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"tag\": \"voluptas\",
- \"router_link\": \"voluptatem\",
- \"hive_id\": 12,
- \"action_id\": 11
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hive-tags"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "tag": "voluptas",
- "router_link": "voluptatem",
- "hive_id": 12,
- "action_id": 11
-};
-
-fetch(url, {
- method: "POST",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request GET \
- --get "https://api.beep.nl/api/hive-tags/18" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hive-tags/18"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "GET",
- headers,
-}).then(response => response.json());
-
-
-
-
-
- Example response (401):
-
-
-
- Show headers
-
- cache-control: no-cache, private
-content-type: application/json
-access-control-allow-origin: *
-
-
-
-{
- "message": "Unauthenticated."
-}
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request PUT \
- "https://api.beep.nl/api/hive-tags/4" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en" \
- --data "{
- \"tag\": \"est\",
- \"router_link\": \"delectus\",
- \"hive_id\": 7,
- \"action_id\": 4
-}"
-
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hive-tags/4"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-let body = {
- "tag": "est",
- "router_link": "delectus",
- "hive_id": 7,
- "action_id": 4
-};
-
-fetch(url, {
- method: "PUT",
- headers,
- body: JSON.stringify(body),
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
-
-
-
-
-
-
-
-Example request:
-
-
-
-
curl --request DELETE \
- "https://api.beep.nl/api/hive-tags/8" \
- --header "Content-Type: application/json" \
- --header "Accept: application/json" \
- --header "Accept-language: en"
-
-
-
-
const url = new URL(
- "https://api.beep.nl/api/hive-tags/8"
-);
-
-const headers = {
- "Content-Type": "application/json",
- "Accept": "application/json",
- "Accept-language": "en",
-};
-
-fetch(url, {
- method: "DELETE",
- headers,
-}).then(response => response.json());
-
-
-
-
-
-
- Received response :
-
-
-
-
- Request failed with error:
-
-
-
-
-
-
-
-
-
-
- bash
- javascript
-
-
-
-
-