Merge branch 'feature/findServerErrorByAmir' into 'develop'
Feature/find server error by amir See merge request witelgroup/rms_v2!1
This commit is contained in:
58
.env.example
Normal file
58
.env.example
Normal file
@@ -0,0 +1,58 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:R0FQ6mq9Ar2n5ToqeseUNN6zh94JGDnECsjF/pLOqaM=
|
||||
APP_DEBUG=false
|
||||
APP_URL=https://rms.witel.ir
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=rms_db
|
||||
DB_USERNAME=rms_user
|
||||
DB_PASSWORD=1qaz@WSX
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
|
||||
PAYMENT_USERNAME="cspay"
|
||||
PAYMENT_PASSWORD="cspay123"
|
||||
PAYMENT_LINK="https://payment.rmto.ir"
|
||||
|
||||
RMS_VERSION=3.0
|
||||
RMS_CTO_PHONE_NUMBER="09380220400"
|
||||
|
||||
TELESCOPE_RESPONSE_SIZE_LIMIT=128
|
||||
|
||||
DEBUGBAR_ENABLED=false
|
||||
@@ -98,9 +98,9 @@ class Cities implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
|
||||
$query .= " group by edarat_id order by province_id ASC;";
|
||||
|
||||
$item_data = DB::select(DB::raw($query));
|
||||
|
||||
$item_data = DB::select($query);
|
||||
|
||||
$array = array();
|
||||
foreach ($item_data as $key => $value) {
|
||||
$array[$value->province_id]['city'][$value->edarat_id]['data']['MarematRooyeCount']= $value->MarematRooyeCount;
|
||||
$array[$value->province_id]['city'][$value->edarat_id]['data']['PaksaziCount']= $value->PaksaziCount;
|
||||
@@ -165,7 +165,8 @@ class Cities implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
return view('excel.CurrentActivities.Report1-City', [
|
||||
'roads' => $array,
|
||||
'fromFa' => $fromDate,
|
||||
'toFa' => $toDate
|
||||
'toFa' => $toDate,
|
||||
'has_province_filter' => $province ? true : false,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class Provinces implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
|
||||
$query .= " group by province_id;";
|
||||
|
||||
$item_data = DB::select(DB::raw($query));
|
||||
$item_data = DB::select($query);
|
||||
|
||||
$sum['MarematRooyeCount'] = 0;
|
||||
$sum['PaksaziCount'] = 0;
|
||||
|
||||
@@ -63,7 +63,7 @@ class Cities implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
|
||||
$query .= " AND activity_date_time BETWEEN '{$fromDate}' AND '{$toDate}' GROUP BY city_id ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$temp =[];
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
@@ -73,7 +73,7 @@ class Province implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
|
||||
$query .= " AND activity_date_time BETWEEN '{$fromDate}' AND '{$toDate}' GROUP BY province_id ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
|
||||
$countryQuery = "SELECT
|
||||
@@ -121,7 +121,7 @@ class Province implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
|
||||
$countryQuery .= " AND activity_date_time BETWEEN '{$fromDate}' AND '{$toDate}';";
|
||||
|
||||
$country = DB::select(DB::raw($countryQuery));
|
||||
$country = DB::select($countryQuery);
|
||||
|
||||
|
||||
return view('excel.CurrentActivities.Report2-Province', [
|
||||
|
||||
@@ -74,10 +74,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 101 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 101 THEN operation_type_amount4
|
||||
END)) AS AsphaltGarmDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 101 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 101 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 101 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 101 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 101 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 101 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 101 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 101 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS AsphaltGarmDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN operation_type_amount1
|
||||
@@ -85,10 +85,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 102 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 102 THEN operation_type_amount4
|
||||
END)) AS MaseAsphaltDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 102 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 102 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 102 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 102 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 102 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 102 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 102 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS MaseAsphaltDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN operation_type_amount1
|
||||
@@ -96,10 +96,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 103 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 103 THEN operation_type_amount4
|
||||
END)) AS BazyaftSardGarmDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 103 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 103 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 103 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 103 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 103 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 103 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 103 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS BazyaftSardGarmDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN operation_type_amount1
|
||||
@@ -107,10 +107,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 104 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 104 THEN operation_type_amount4
|
||||
END)) AS mirosurfacingDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 104 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 104 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 104 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 104 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 104 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 104 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 104 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS mirosurfacingDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN operation_type_amount1
|
||||
@@ -118,10 +118,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 105 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 105 THEN operation_type_amount4
|
||||
END)) AS ChipSailDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 105 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 105 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 105 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 105 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 105 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 105 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 105 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS ChipSailDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN operation_type_amount1
|
||||
@@ -129,10 +129,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 106 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 106 THEN operation_type_amount4
|
||||
END)) AS SlarySaildDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 106 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 106 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 106 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 106 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 106 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 106 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 106 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS SlarySaildDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN operation_type_amount1
|
||||
@@ -140,10 +140,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 107 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 107 THEN operation_type_amount4
|
||||
END)) AS ScrubSailDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 107 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 107 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 107 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 107 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 107 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 107 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 107 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS ScrubSailDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN operation_type_amount1
|
||||
@@ -151,10 +151,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 108 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 108 THEN operation_type_amount4
|
||||
END)) AS FogSailDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 108 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 108 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 108 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 108 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 108 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 108 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 108 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS FogSailDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN operation_type_amount1
|
||||
@@ -162,10 +162,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 109 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 109 THEN operation_type_amount4
|
||||
END)) AS SailKatDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 109 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 109 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 109 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 109 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 109 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 109 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 109 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS SailKatDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN operation_type_amount1
|
||||
@@ -173,10 +173,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 110 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 110 THEN operation_type_amount4
|
||||
END)) AS KipSailDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 110 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 110 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 110 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 110 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 110 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 110 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 110 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS KipSailDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN operation_type_amount1
|
||||
@@ -184,10 +184,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 111 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 111 THEN operation_type_amount4
|
||||
END)) AS AsphaltRedmixDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 111 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 111 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 111 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 111 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 111 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 111 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 111 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS AsphaltRedmixDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN operation_type_amount1
|
||||
@@ -195,10 +195,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 112 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 112 THEN operation_type_amount4
|
||||
END)) AS LakegiriDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 112 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 112 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 112 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 112 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 112 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 112 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 112 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS LakegiriDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN operation_type_amount1
|
||||
@@ -206,10 +206,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 113 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 113 THEN operation_type_amount4
|
||||
END)) AS DarzgiriDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 113 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 113 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 113 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 113 THEN (CAST(operation_type_amount1 AS signed) * CAST(operation_type_progress1 AS signed))/100
|
||||
WHEN operation_type_id2 = 113 THEN (CAST(operation_type_amount2 AS signed) * CAST(operation_type_progress2 AS signed))/100
|
||||
WHEN operation_type_id3 = 113 THEN (CAST(operation_type_amount3 AS signed) * CAST(operation_type_progress3 AS signed))/100
|
||||
WHEN operation_type_id4 = 113 THEN (CAST(operation_type_amount4 AS signed) * CAST(operation_type_progress4 AS signed))/100
|
||||
END)) AS DarzgiriDone,
|
||||
COUNT(*) AS countAll
|
||||
FROM contract_subitems
|
||||
@@ -223,7 +223,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'AsphaltGarmDoingSum' => 0,
|
||||
|
||||
@@ -440,7 +440,7 @@ class summaryAcidentPerformanceCity implements FromView, ShouldAutoSize, WithEve
|
||||
$query .= " GROUP BY city_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$array[$value->city_id] = [
|
||||
|
||||
@@ -415,7 +415,7 @@ class summaryAcidentPerformanceProject implements FromView, ShouldAutoSize, With
|
||||
$query .= " GROUP BY unique_code
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
|
||||
return view('excel.Maintanance.summaryAccidentPerformanceProject', [
|
||||
|
||||
@@ -433,7 +433,7 @@ class summaryAcidentPerformanceProvince implements FromView, ShouldAutoSize, Wit
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'AsphaltGarmDone' => 0,
|
||||
|
||||
@@ -229,7 +229,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'TarizRahCount' => 0,
|
||||
@@ -262,31 +262,31 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
foreach ($data as $value) {
|
||||
$array[$value->province_id] = [
|
||||
'province_fa' => $value->province_fa,
|
||||
'TarizRahCount' => $value->TarizRahCount ?? '-',
|
||||
'EslahGhosCount' => $value->EslahGhosCount ?? '-',
|
||||
'TaransheBardariCount' => $value->TaransheBardariCount ?? '-',
|
||||
'EhdasMeydanCount' => $value->EhdasMeydanCount ?? '-',
|
||||
'EhdasTaghatoCount' => $value->EhdasTaghatoCount ?? '-',
|
||||
'ImenSaziCount' => $value->ImenSaziCount ?? '-',
|
||||
'EslahVoroodiCount' => $value->EslahVoroodiCount ?? '-',
|
||||
'EhdasToonelCount' => $value->EhdasToonelCount ?? '-',
|
||||
'EhdasVariantCount' => $value->EhdasVariantCount ?? '-',
|
||||
'TarizAbnieFaniCount' => $value->TarizAbnieFaniCount ?? '-',
|
||||
'SakhtHaelCount' => $value->SakhtHaelCount ?? '-',
|
||||
'SayerCount' => $value->SakhtHaelCount ?? '-',
|
||||
'countAll' => $value->countAll ?? '-',
|
||||
'TarizRahAvg' => $value->TarizRahAvg ?? '-',
|
||||
'EslahGhosAvg' => $value->EslahGhosAvg ?? '-',
|
||||
'TaransheBardariAvg' => $value->TaransheBardariAvg ?? '-',
|
||||
'EhdasMeydanAvg' => $value->EhdasMeydanAvg ?? '-',
|
||||
'EhdasTaghatoAvg' => $value->EhdasTaghatoAvg ?? '-',
|
||||
'ImenSaziAvg' => $value->ImenSaziAvg ?? '-',
|
||||
'EslahVoroodiAvg' => $value->EslahVoroodiAvg ?? '-',
|
||||
'EhdasToonelAvg' => $value->EhdasToonelAvg ?? '-',
|
||||
'EhdasVariantAvg' => $value->EhdasVariantAvg ?? '-',
|
||||
'TarizAbnieFaniAvg' => $value->TarizAbnieFaniAvg ?? '-',
|
||||
'SakhtHaelAvg' => $value->SakhtHaelAvg ?? '-',
|
||||
'SayerAvg' => $value->SakhtHaelAvg ?? '-',
|
||||
'TarizRahCount' => $value->TarizRahCount ?? 0,
|
||||
'EslahGhosCount' => $value->EslahGhosCount ?? 0,
|
||||
'TaransheBardariCount' => $value->TaransheBardariCount ?? 0,
|
||||
'EhdasMeydanCount' => $value->EhdasMeydanCount ?? 0,
|
||||
'EhdasTaghatoCount' => $value->EhdasTaghatoCount ?? 0,
|
||||
'ImenSaziCount' => $value->ImenSaziCount ?? 0,
|
||||
'EslahVoroodiCount' => $value->EslahVoroodiCount ?? 0,
|
||||
'EhdasToonelCount' => $value->EhdasToonelCount ?? 0,
|
||||
'EhdasVariantCount' => $value->EhdasVariantCount ?? 0,
|
||||
'TarizAbnieFaniCount' => $value->TarizAbnieFaniCount ?? 0,
|
||||
'SakhtHaelCount' => $value->SakhtHaelCount ?? 0,
|
||||
'SayerCount' => $value->SakhtHaelCount ?? 0,
|
||||
'countAll' => $value->countAll ?? 0,
|
||||
'TarizRahAvg' => $value->TarizRahAvg ?? 0,
|
||||
'EslahGhosAvg' => $value->EslahGhosAvg ?? 0,
|
||||
'TaransheBardariAvg' => $value->TaransheBardariAvg ?? 0,
|
||||
'EhdasMeydanAvg' => $value->EhdasMeydanAvg ?? 0,
|
||||
'EhdasTaghatoAvg' => $value->EhdasTaghatoAvg ?? 0,
|
||||
'ImenSaziAvg' => $value->ImenSaziAvg ?? 0,
|
||||
'EslahVoroodiAvg' => $value->EslahVoroodiAvg ?? 0,
|
||||
'EhdasToonelAvg' => $value->EhdasToonelAvg ?? 0,
|
||||
'EhdasVariantAvg' => $value->EhdasVariantAvg ?? 0,
|
||||
'TarizAbnieFaniAvg' => $value->TarizAbnieFaniAvg ?? 0,
|
||||
'SakhtHaelAvg' => $value->SakhtHaelAvg ?? 0,
|
||||
'SayerAvg' => $value->SakhtHaelAvg ?? 0,
|
||||
];
|
||||
|
||||
$sum['TarizRahCount'] += $value->TarizRahCount;
|
||||
|
||||
@@ -167,7 +167,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'BotoniDoing' => 0,
|
||||
|
||||
@@ -69,11 +69,11 @@ class RoadUpgradeSafeties implements FromView, ShouldAutoSize, WithEvents, WithD
|
||||
'RoshanayiNoghteyi' => $road->operation_type_id1 == '304' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '304' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '304' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 : 0))),
|
||||
'AlaemImeni' => $road->operation_type_id1 == '305' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '305' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '305' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 : 0))),
|
||||
'Khatkeshi' => $road->operation_type_id1 == '306' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '306' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '306' ? $road->operation_type_amount3 :
|
||||
@@ -101,11 +101,11 @@ class RoadUpgradeSafeties implements FromView, ShouldAutoSize, WithEvents, WithD
|
||||
'RoshanayiNoghteyi' => $road->operation_type_id1 == '304' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '304' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '304' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '304' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
'AlaemImeni' => $road->operation_type_id1 == '305' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '305' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '305' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '305' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
'Khatkeshi' => $road->operation_type_id1 == '306' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '306' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '306' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
|
||||
@@ -290,7 +290,7 @@ class summaryAccidentPerformanceCity implements FromView, ShouldAutoSize, WithEv
|
||||
$query .= " GROUP BY city_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$array[$value->city_id] = [
|
||||
|
||||
@@ -271,7 +271,7 @@ class summaryAccidentPerformanceProject implements FromView, ShouldAutoSize, Wit
|
||||
$query .= " GROUP BY unique_code
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
return view('excel.Upgrade.summaryAccidentPerformanceProject', [
|
||||
'array' => $data,
|
||||
|
||||
@@ -281,7 +281,7 @@ class summaryAccidentPerformanceProvince implements FromView, ShouldAutoSize, Wi
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$provinces = \App\Models\Province::select('id', 'name_fa')
|
||||
->when($province, function($query, $province) {
|
||||
|
||||
@@ -149,7 +149,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'EhdasCount' => 0,
|
||||
|
||||
@@ -48,7 +48,7 @@ class summaryAccidentPerformanceCity implements FromView, ShouldAutoSize, WithEv
|
||||
$array[$value->city_id] = [
|
||||
'province_fa' => $value->province_fa,
|
||||
'city_fa' => $value->city_fa,
|
||||
'avg' => '-',
|
||||
'avg' => 0,
|
||||
'count' => '-'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ class UserActivity implements FromView, ShouldAutoSize, WithEvents, WithDrawings
|
||||
ORDER BY cnt desc";
|
||||
|
||||
$data = [
|
||||
'activity_time' => $ids_list ? DB::select(DB::raw($temp_sql_for_activity_time))[0]->activity : null,
|
||||
'average' => round(($ids_list ? DB::select(DB::raw($temp_sql_for_activity_time))[0]->activity : 0) / count($role->users()->get()),2) ,
|
||||
'activity_list' => $ids_list ? DB::select(DB::raw($temp_sql_for_activity_list)) : null,
|
||||
'activity_time' => $ids_list ? DB::select($temp_sql_for_activity_time)[0]->activity : null,
|
||||
'average' => round(($ids_list ? DB::select($temp_sql_for_activity_time)[0]->activity : 0) / count($role->users()->get()),2) ,
|
||||
'activity_list' => $ids_list ? DB::select($temp_sql_for_activity_list) : null,
|
||||
'group_name' => $role->name_fa,
|
||||
'user_count' => count($role->users()->get()),
|
||||
'group_id' => $role->id
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V2\Receipt\ReceiptTable;
|
||||
namespace App\Exports\V2\Receipt\RecieptTable;
|
||||
|
||||
use App\Exports\V2\Receipt\ReceiptTable\Provinces;
|
||||
use App\Exports\V2\Receipt\RecieptTable\Provinces;
|
||||
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
|
||||
use App\Exports\V2\Receipt\ReceiptTable\Cities;
|
||||
use App\Exports\V2\Receipt\RecieptTable\Cities;
|
||||
|
||||
class AllSheets implements WithMultipleSheets
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V2\Receipt\ReceiptTable;
|
||||
namespace App\Exports\V2\Receipt\RecieptTable;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\V2\Receipt\ReceiptTable;
|
||||
namespace App\Exports\V2\Receipt\RecieptTable;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
@@ -39,6 +39,8 @@ class ReportComplaintsExport implements FromView, ShouldAutoSize, WithEvents, Wi
|
||||
$fromDate = $this->fromDate ? $this->fromDate . ' 00:00:00': null;
|
||||
$toDate = $this->toDate ? $this->toDate . ' 23:59:59': null;
|
||||
|
||||
$data = [];
|
||||
|
||||
if (auth()->user()->hasPermissionTo('show-fast-react')) {
|
||||
$data = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')
|
||||
->where('rms_status', "<>", 0)
|
||||
@@ -101,6 +103,7 @@ class ReportComplaintsExport implements FromView, ShouldAutoSize, WithEvents, Wi
|
||||
|
||||
|
||||
}
|
||||
|
||||
return view('excel.V2.RoadObservation.report_complaints', [
|
||||
'data' => $data,
|
||||
'fromDate' => $fromDate,
|
||||
|
||||
@@ -57,10 +57,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 601 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 601 THEN operation_type_amount4
|
||||
END)) AS KhakiDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 601 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 601 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 601 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 601 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 601 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 601 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 601 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 601 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS KhakiDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN operation_type_amount1
|
||||
@@ -68,10 +68,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 602 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 602 THEN operation_type_amount4
|
||||
END)) AS RosaziDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 602 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 602 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 602 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 602 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 602 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 602 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 602 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS RosaziDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN operation_type_amount1
|
||||
@@ -79,10 +79,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 603 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 603 THEN operation_type_amount4
|
||||
END)) AS AbneyehDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 603 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 603 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 603 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 603 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 603 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 603 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 603 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS AbneyehDone,
|
||||
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN operation_type_amount1
|
||||
@@ -90,10 +90,10 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
WHEN operation_type_id3 = 604 THEN operation_type_amount3
|
||||
WHEN operation_type_id4 = 604 THEN operation_type_amount4
|
||||
END)) AS AsphaltDoing,
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN (cast(operation_type_amount1 as int) * cast(operation_type_progress1 as int))/100
|
||||
WHEN operation_type_id2 = 604 THEN (cast(operation_type_amount2 as int) * cast(operation_type_progress2 as int))/100
|
||||
WHEN operation_type_id3 = 604 THEN (cast(operation_type_amount3 as int) * cast(operation_type_progress3 as int))/100
|
||||
WHEN operation_type_id4 = 604 THEN (cast(operation_type_amount4 as int) * cast(operation_type_progress4 as int))/100
|
||||
ROUND(SUM(CASE WHEN operation_type_id1 = 604 THEN (cast(operation_type_amount1 as unsigned) * cast(operation_type_progress1 as unsigned))/100
|
||||
WHEN operation_type_id2 = 604 THEN (cast(operation_type_amount2 as unsigned) * cast(operation_type_progress2 as unsigned))/100
|
||||
WHEN operation_type_id3 = 604 THEN (cast(operation_type_amount3 as unsigned) * cast(operation_type_progress3 as unsigned))/100
|
||||
WHEN operation_type_id4 = 604 THEN (cast(operation_type_amount4 as unsigned) * cast(operation_type_progress4 as unsigned))/100
|
||||
END)) AS AsphaltDone,
|
||||
COUNT(*) AS countAll,
|
||||
province_fa,
|
||||
@@ -113,7 +113,7 @@ class CompareProgramAndFunction implements FromView, ShouldAutoSize, WithEvents,
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'KhakiDoing' => 0,
|
||||
|
||||
@@ -62,7 +62,7 @@ class Village implements FromView, ShouldAutoSize, WithEvents, WithDrawings, Wit
|
||||
'Abnie' => $road->operation_type_id1 == '603' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '603' ? $road->operation_type_amount2 :
|
||||
($road->operation_type_id3 == '603' ? $road->operation_type_amount3 :
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 : "-"))),
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 : 0))),
|
||||
|
||||
'Asphalt' => $road->operation_type_id1 == '604' ? $road->operation_type_amount1 :
|
||||
($road->operation_type_id2 == '604' ? $road->operation_type_amount2 :
|
||||
@@ -82,7 +82,7 @@ class Village implements FromView, ShouldAutoSize, WithEvents, WithDrawings, Wit
|
||||
'Abnie' => $road->operation_type_id1 == '603' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '603' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
($road->operation_type_id3 == '603' ? $road->operation_type_amount3 * $road->operation_type_progress3 / 100 :
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : "-"))),
|
||||
($road->operation_type_id4 == '603' ? $road->operation_type_amount4 * $road->operation_type_progress4 / 100 : 0))),
|
||||
|
||||
'Asphalt' => $road->operation_type_id1 == '604' ? $road->operation_type_amount1 * $road->operation_type_progress1 / 100 :
|
||||
($road->operation_type_id2 == '604' ? $road->operation_type_amount2 * $road->operation_type_progress2 / 100 :
|
||||
|
||||
@@ -224,7 +224,7 @@ class summaryAcidentPerformanceCity implements FromView, ShouldAutoSize, WithEve
|
||||
$query .= " GROUP BY city_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$array[$value->city_id] = [
|
||||
|
||||
@@ -209,7 +209,7 @@ class summaryAcidentPerformanceProject implements FromView, ShouldAutoSize, With
|
||||
$query .= " GROUP BY unique_code
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
return view('excel.Village.summaryAccidentPerformanceProject', [
|
||||
'array' => $data,
|
||||
|
||||
@@ -211,7 +211,7 @@ class summaryAcidentPerformanceProvince implements FromView, ShouldAutoSize, Wit
|
||||
$query .= " GROUP BY province_id
|
||||
ORDER BY province_id ASC;";
|
||||
|
||||
$data = DB::select(DB::raw($query));
|
||||
$data = DB::select($query);
|
||||
|
||||
$sum = [
|
||||
'KhakiDone' => 0,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Facades\Sms;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use SoapFault;
|
||||
@@ -11,6 +12,8 @@ class SmsClass
|
||||
{
|
||||
public function sendSms($mobile, $msg)
|
||||
{
|
||||
if (App::environment('production')) {
|
||||
|
||||
|
||||
$client = new SoapClient("http://sms1000.ir/webservice/sms.asmx?WSDL");
|
||||
$date = date('d-m-y h:i:s');
|
||||
@@ -29,9 +32,9 @@ class SmsClass
|
||||
)
|
||||
);
|
||||
|
||||
$x = $result->SendResult;
|
||||
return $result->SendResult;
|
||||
}
|
||||
|
||||
return $x;
|
||||
|
||||
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
||||
// $result = $client->doSendSMS(
|
||||
|
||||
@@ -20,6 +20,8 @@ use SoapClient;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Carbon\Carbon;
|
||||
use App\Facades\Sms\Sms;
|
||||
use App\Services\NominatimService;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ContractSubItemsController extends Controller
|
||||
{
|
||||
@@ -101,7 +103,7 @@ class ContractSubItemsController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function storeForDevelop(Request $request)
|
||||
public function storeForDevelop(Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
|
||||
if ($request->has('operation_type_id1') && $request->operation_type_progress1 == null) {
|
||||
@@ -137,9 +139,9 @@ class ContractSubItemsController extends Controller
|
||||
|
||||
|
||||
$contract = Contracts::where('id', $request->contract_id)->first();
|
||||
|
||||
$parent_contract_date = explode('-', $contract->contract_date);
|
||||
$parent_contract_date = Verta::getGregorian($parent_contract_date[0], $parent_contract_date[1], $parent_contract_date[2]);
|
||||
// dd(Verta::jalaliToGregorian($parent_contract_date[0], $parent_contract_date[1], $parent_contract_date[2]));
|
||||
$parent_contract_date = Verta::jalaliToGregorian($parent_contract_date[0], $parent_contract_date[1], $parent_contract_date[2]);
|
||||
|
||||
$city_fa = City::where('id', $request->city_id)->first();
|
||||
$province_fa = Province::where('id', $request->province_id)->first();
|
||||
@@ -204,8 +206,8 @@ class ContractSubItemsController extends Controller
|
||||
$contractSubItem->contract_date_from_parent_contract = $parent_contract_date[0].'-'.$parent_contract_date[1].'-'.$parent_contract_date[2];
|
||||
$contractSubItem->created_at_fa = Verta::instance(Verta::now());
|
||||
$contractSubItem->updated_at_fa = Verta::instance(Verta::now());
|
||||
$contractSubItem->start_way_id = self::get_way_id_from_nominatim($request->start_lat, $request->start_lng);
|
||||
$contractSubItem->end_way_id = self::get_way_id_from_nominatim($request->end_lat, $request->end_lng);
|
||||
$contractSubItem->start_way_id = $nominatimService->get_way_id_from_nominatim($request->start_lat, $request->start_lng);
|
||||
$contractSubItem->end_way_id = $nominatimService->get_way_id_from_nominatim($request->end_lat, $request->end_lng);
|
||||
$contractSubItem->user_id = Auth::user()->id;
|
||||
$contractSubItem->contract_moshaver_tarahi = $contract->contract_moshaver_tarahi;
|
||||
$contractSubItem->contract_moshaver_nezarat = $contract->contract_moshaver_nezarat;
|
||||
@@ -238,7 +240,7 @@ class ContractSubItemsController extends Controller
|
||||
$countRoadFiles = count($roadProjectHistoriesFiles);
|
||||
}
|
||||
|
||||
$uuid = \Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
if ($request->has('image1')) {
|
||||
$file1 = $request->file('image1');
|
||||
$destinationPath1 = 'storage/contract_subitems/' . now()->year . '/' . now()->month . '/';
|
||||
@@ -296,7 +298,7 @@ class ContractSubItemsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function updateForDevelop(Request $request, $id)
|
||||
public function updateForDevelop(Request $request, $id, NominatimService $nominatimService)
|
||||
{
|
||||
if ($request->operation_type_id1 != 0 && $request->operation_type_progress1 == null) {
|
||||
return response()->json(['message' => 'Operation type progress1 is NULL'], 400);
|
||||
@@ -462,8 +464,8 @@ class ContractSubItemsController extends Controller
|
||||
$contractSubItem->last_function_operator = $request->last_function_operator;
|
||||
$contractSubItem->last_payable_operator = $request->last_payable_operator;
|
||||
$contractSubItem->complete_payable = $request->complete_payable;
|
||||
$contractSubItem->start_way_id = self::get_way_id_from_nominatim($request->start_lat, $request->start_lng);
|
||||
$contractSubItem->end_way_id = self::get_way_id_from_nominatim($request->end_lat, $request->end_lng);
|
||||
$contractSubItem->start_way_id = $nominatimService->get_way_id_from_nominatim($request->start_lat, $request->start_lng);
|
||||
$contractSubItem->end_way_id = $nominatimService->get_way_id_from_nominatim($request->end_lat, $request->end_lng);
|
||||
$contractSubItem->updated_at_fa = Verta::instance(Verta::now());
|
||||
$contractSubItem->user_id = Auth::user()->id;
|
||||
$contractSubItem->last_date_update = Carbon::now();
|
||||
@@ -474,7 +476,7 @@ class ContractSubItemsController extends Controller
|
||||
|
||||
$contractSubItem->save();
|
||||
|
||||
$uuid = \Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
if ($request->has('image1')) {
|
||||
$file1 = $request->file('image1');
|
||||
$destinationPath1 = 'storage/contract_subitems/' . now()->year . '/' . now()->month . '/';
|
||||
|
||||
@@ -8,6 +8,7 @@ use Hekmatinasser\Verta\Verta;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class CampController extends Controller
|
||||
@@ -332,7 +333,7 @@ class CampController extends Controller
|
||||
$camp->submited_at = new Verta();
|
||||
$camp->save();
|
||||
|
||||
$uuid = \Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
|
||||
$id = $camp->id;
|
||||
if ($request->file('image_1')) {
|
||||
@@ -646,7 +647,7 @@ class CampController extends Controller
|
||||
$camp->block_axis_desc = $request->block_axis_desc;
|
||||
$camp->submited_at = new Verta();
|
||||
$camp->save();
|
||||
$uuid = \Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
|
||||
$id = $camp->id;
|
||||
if ($request->file('image_1')) {
|
||||
|
||||
@@ -436,11 +436,10 @@ class ContractsController extends Controller
|
||||
$contract->save();
|
||||
// document end
|
||||
|
||||
|
||||
// for updating sub contract contract date
|
||||
foreach ($contract->subitems as $key => $value) {
|
||||
$tmp = explode('-', $request->contract_date);
|
||||
$tmp = Verta::getGregorian($tmp[0], $tmp[1], $tmp[2]);
|
||||
$tmp = Verta::jalaliToGregorian($tmp[0], $tmp[1], $tmp[2]);
|
||||
$value->contract_date_from_parent_contract = $tmp[0].'-'.$tmp[1].'-'.$tmp[2];
|
||||
$value->save();
|
||||
}
|
||||
@@ -540,7 +539,7 @@ class ContractsController extends Controller
|
||||
order by project_type_id"
|
||||
;
|
||||
|
||||
foreach (DB::select(DB::raw($summaryProjectsStatus)) as $key => $value) {
|
||||
foreach (DB::select($summaryProjectsStatus) as $key => $value) {
|
||||
$summaryProjectsStatusExecute[$value->project_type_id] = [
|
||||
'project_count' => $value->project_count,
|
||||
'AvgProgressProjects' => $value->AvgProgressProjects,
|
||||
@@ -555,7 +554,7 @@ class ContractsController extends Controller
|
||||
where province_id = {$request->province}"
|
||||
;
|
||||
|
||||
$summaryProjectsAllExecute = DB::select(DB::raw($summaryProjectsAll));
|
||||
$summaryProjectsAllExecute = DB::select($summaryProjectsAll);
|
||||
|
||||
/// summary project status by last status
|
||||
$summaryProjectsStatusByLastStatus = "SELECT
|
||||
@@ -572,7 +571,7 @@ class ContractsController extends Controller
|
||||
GROUP BY last_status_id"
|
||||
;
|
||||
|
||||
$summaryProjectsStatusByLastStatusExecute = DB::select(DB::raw($summaryProjectsStatusByLastStatus));
|
||||
$summaryProjectsStatusByLastStatusExecute = DB::select($summaryProjectsStatusByLastStatus);
|
||||
|
||||
/// project status divide by cities
|
||||
$projectsStatusByCities = "SELECT
|
||||
@@ -591,7 +590,7 @@ class ContractsController extends Controller
|
||||
GROUP BY city_id"
|
||||
;
|
||||
|
||||
$projectsStatusByCitiesExecute = DB::select(DB::raw($projectsStatusByCities));
|
||||
$projectsStatusByCitiesExecute = DB::select($projectsStatusByCities);
|
||||
|
||||
/// important maintanance projects
|
||||
$importantMaintananceProjects = "SELECT
|
||||
@@ -613,7 +612,7 @@ class ContractsController extends Controller
|
||||
GROUP BY unique_code) AS temp_table"
|
||||
;
|
||||
|
||||
$importantMaintananceProjectsExecute = DB::select(DB::raw($importantMaintananceProjects));
|
||||
$importantMaintananceProjectsExecute = DB::select($importantMaintananceProjects);
|
||||
|
||||
|
||||
/// important danger points projects
|
||||
@@ -632,7 +631,7 @@ class ContractsController extends Controller
|
||||
AND project_type_id = 2"
|
||||
;
|
||||
|
||||
$importantDangerPointsProjectExecute = DB::select(DB::raw($importantDangerPointsProject));
|
||||
$importantDangerPointsProjectExecute = DB::select($importantDangerPointsProject);
|
||||
|
||||
/// important road upgrade safeties projects
|
||||
$importantRoadUpgradeSafetiesProject = "SELECT
|
||||
@@ -655,7 +654,7 @@ class ContractsController extends Controller
|
||||
GROUP BY unique_code) AS temp_table"
|
||||
;
|
||||
|
||||
$importantRoadUpgradeSafetiesProjectExecute = DB::select(DB::raw($importantRoadUpgradeSafetiesProject));
|
||||
$importantRoadUpgradeSafetiesProjectExecute = DB::select($importantRoadUpgradeSafetiesProject);
|
||||
|
||||
/// important techincal projects
|
||||
$importantTechnicalProject = "SELECT
|
||||
@@ -673,7 +672,7 @@ class ContractsController extends Controller
|
||||
AND project_type_id = 4"
|
||||
;
|
||||
|
||||
$importantTechnicalProjectExecute = DB::select(DB::raw($importantTechnicalProject));
|
||||
$importantTechnicalProjectExecute = DB::select($importantTechnicalProject);
|
||||
|
||||
/// important Tollhouse projects
|
||||
$importantTollhouseProject = "SELECT
|
||||
@@ -691,7 +690,7 @@ class ContractsController extends Controller
|
||||
AND project_type_id = 5"
|
||||
;
|
||||
|
||||
$importantTollhouseProjectExecute = DB::select(DB::raw($importantTollhouseProject));
|
||||
$importantTollhouseProjectExecute = DB::select($importantTollhouseProject);
|
||||
|
||||
/// important VillageRoad projects
|
||||
$importantVillageRoadProject = "SELECT
|
||||
@@ -713,7 +712,7 @@ class ContractsController extends Controller
|
||||
GROUP BY unique_code) AS temp_table"
|
||||
;
|
||||
|
||||
$importantVillageRoadProjectExecute = DB::select(DB::raw($importantVillageRoadProject));
|
||||
$importantVillageRoadProjectExecute = DB::select($importantVillageRoadProject);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\Storage;
|
||||
use Carbon\Carbon;
|
||||
use App\Http\Requests\DailyAccidentRequest;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
|
||||
use App\Services\NominatimService;
|
||||
|
||||
|
||||
class DailyAccidentController extends Controller
|
||||
@@ -131,9 +131,9 @@ class DailyAccidentController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function store(DailyAccidentRequest $request)
|
||||
public function store(DailyAccidentRequest $request, NominatimService $nominatimService)
|
||||
{
|
||||
DB::transaction(function () use ($request) {
|
||||
DB::transaction(function () use ($request, $nominatimService) {
|
||||
$new_daily_accident = new DailyAccident();
|
||||
|
||||
$new_daily_accident->province_id = $request->province_id;
|
||||
@@ -217,7 +217,7 @@ class DailyAccidentController extends Controller
|
||||
$new_daily_accident->accident_reason_ebham_dar_masir = $request->accident_reason_ebham_dar_masir ?? 0;
|
||||
$new_daily_accident->accident_reason_qus_tond_ofoghi = $request->accident_reason_qus_tond_ofoghi ?? 0;
|
||||
|
||||
$new_daily_accident->way_id = self::get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
$new_daily_accident->way_id = $nominatimService->get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
|
||||
$new_daily_accident->save();
|
||||
|
||||
@@ -521,9 +521,9 @@ class DailyAccidentController extends Controller
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function update(DailyAccident $accident, Request $request)
|
||||
public function update(DailyAccident $accident, Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
DB::transaction(function () use ($request, $accident) {
|
||||
DB::transaction(function () use ($request, $accident, $nominatimService) {
|
||||
;
|
||||
auth()->user()->addActivityComplete(1119, $accident);
|
||||
|
||||
@@ -608,7 +608,7 @@ class DailyAccidentController extends Controller
|
||||
$accident->accident_reason_ebham_dar_masir = $request->accident_reason_ebham_dar_masir ?? 0;
|
||||
$accident->accident_reason_qus_tond_ofoghi = $request->accident_reason_qus_tond_ofoghi ?? 0;
|
||||
|
||||
$accident->way_id = self::get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
$accident->way_id = $nominatimService->get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
|
||||
$accident->save();
|
||||
|
||||
@@ -708,6 +708,8 @@ class DailyAccidentController extends Controller
|
||||
'day_part' => 'in:day,night',
|
||||
]);
|
||||
|
||||
// dd($request->province_ids);
|
||||
|
||||
$from_date = $request->from_date;
|
||||
$to_date = $request->to_date;
|
||||
|
||||
@@ -744,6 +746,7 @@ class DailyAccidentController extends Controller
|
||||
})
|
||||
->get();
|
||||
|
||||
|
||||
return response()->json([
|
||||
'succuss' => true,
|
||||
'data' => $data
|
||||
|
||||
@@ -74,49 +74,50 @@ class HomeProjectController extends Controller
|
||||
'data' => $projectsArray
|
||||
], 200);
|
||||
}
|
||||
// sharareh begin
|
||||
// public function getFastReactionProjectPoints(Request $request)
|
||||
// {
|
||||
// $province = $request->province_id;
|
||||
// $edare_shahri = $request->edare_shahri_id;
|
||||
// $status = $request->status;
|
||||
// $rms_status = $request->rms_status;
|
||||
|
||||
public function getFastReactionProjectPoints(Request $request)
|
||||
{
|
||||
$province = $request->province_id;
|
||||
$edare_shahri = $request->edare_shahri_id;
|
||||
$status = $request->status;
|
||||
$rms_status = $request->rms_status;
|
||||
// if ($request->date_from && $request->date_to) {
|
||||
// $date_from = $request->date_from.' 00:00:00';
|
||||
// $date_to = $request->date_to.' 23:59:59';
|
||||
// } else {
|
||||
// $date_from = Date('Y-m-d');
|
||||
// $date_to = new \DateTime('tomorrow');
|
||||
// $date_to = $date_to->format('Y-m-d');
|
||||
// }
|
||||
|
||||
if ($request->date_from && $request->date_to) {
|
||||
$date_from = $request->date_from.' 00:00:00';
|
||||
$date_to = $request->date_to.' 23:59:59';
|
||||
} else {
|
||||
$date_from = Date('Y-m-d');
|
||||
$date_to = new \DateTime('tomorrow');
|
||||
$date_to = $date_to->format('Y-m-d');
|
||||
}
|
||||
|
||||
$projects = RoadObserved::select('id', 'lng', 'lat','status')
|
||||
->whereBetween('created_at', [$date_from, $date_to])
|
||||
->when($province, function ($query) use ($province) {
|
||||
return $query->where('province_id', $province);
|
||||
})
|
||||
->when($rms_status, function ($query) use ($rms_status) {
|
||||
if ($rms_status == 2) {
|
||||
return $query->where('rms_status', '<>',0);
|
||||
} else {
|
||||
return $query->where('rms_status', 0);
|
||||
}
|
||||
})
|
||||
->when($edare_shahri, function ($query) use ($edare_shahri) {
|
||||
return $query->where('edarate_shahri_id', $edare_shahri);
|
||||
})
|
||||
->when($status, function ($query) use ($status) {
|
||||
return $query->where('status', $status);
|
||||
})
|
||||
// ->toSql();
|
||||
->get();
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
'message' => '',
|
||||
'data' => $projects
|
||||
], 200);
|
||||
}
|
||||
// $projects = RoadObserved::select('id', 'lng', 'lat','status')
|
||||
// ->whereBetween('created_at', [$date_from, $date_to])
|
||||
// ->when($province, function ($query) use ($province) {
|
||||
// return $query->where('province_id', $province);
|
||||
// })
|
||||
// ->when($rms_status, function ($query) use ($rms_status) {
|
||||
// if ($rms_status == 2) {
|
||||
// return $query->where('rms_status', '<>',0);
|
||||
// } else {
|
||||
// return $query->where('rms_status', 0);
|
||||
// }
|
||||
// })
|
||||
// ->when($edare_shahri, function ($query) use ($edare_shahri) {
|
||||
// return $query->where('edarate_shahri_id', $edare_shahri);
|
||||
// })
|
||||
// ->when($status, function ($query) use ($status) {
|
||||
// return $query->where('status', $status);
|
||||
// })
|
||||
// // ->toSql();
|
||||
// ->get();
|
||||
// return response()->json([
|
||||
// 'status' => 'succeed',
|
||||
// 'message' => '',
|
||||
// 'data' => $projects
|
||||
// ], 200);
|
||||
// }
|
||||
// sharareh begin
|
||||
|
||||
public function getFastReactionProjectPointsFor141(Request $request)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ use Webpatser\Uuid\Uuid;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\RandDVoting;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\RandDVotingPaperAnswer;
|
||||
|
||||
class NewRandDCtrl extends Controller
|
||||
@@ -204,7 +205,7 @@ class NewRandDCtrl extends Controller
|
||||
}
|
||||
}
|
||||
// Make Unique Code
|
||||
$uuid = Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
|
||||
// Upload Final report 1
|
||||
if ($request->has('proj_rfp_file')) {
|
||||
@@ -308,7 +309,7 @@ class NewRandDCtrl extends Controller
|
||||
}
|
||||
|
||||
// Make Unique Code
|
||||
$uuid = Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
// Upload Final report 1
|
||||
$rfp_file = $newRandD->rfp_file;
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Arr;
|
||||
use App\Facades\Sms\Sms;
|
||||
use App\Services\NominatimService;
|
||||
|
||||
|
||||
class ReceiptController extends Controller
|
||||
{
|
||||
@@ -68,9 +70,9 @@ class ReceiptController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
DB::transaction(function () use ($request) {
|
||||
DB::transaction(function () use ($request, $nominatimService) {
|
||||
$new_accident = new Accident();
|
||||
|
||||
|
||||
@@ -96,7 +98,8 @@ class ReceiptController extends Controller
|
||||
$new_accident->accident_date = $request->accident_date;
|
||||
$new_accident->accident_time = $request->accident_time;
|
||||
|
||||
$new_accident->way_id = get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
// $new_accident->way_id = get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
$new_accident->way_id = $nominatimService->get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
|
||||
$new_accident->save();
|
||||
|
||||
@@ -152,9 +155,9 @@ class ReceiptController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function update(Accident $accident, Request $request)
|
||||
public function update(Accident $accident, Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
DB::transaction(function () use ($request, $accident) {
|
||||
DB::transaction(function () use ($request, $accident, $nominatimService) {
|
||||
$accident->province_fa = Province::where('id', $request->province_id)->first()->name_fa;
|
||||
$accident->province_id = $request->province_id;
|
||||
|
||||
@@ -175,7 +178,7 @@ class ReceiptController extends Controller
|
||||
$accident->accident_date = $request->accident_date;
|
||||
$accident->accident_time = $request->accident_time;
|
||||
|
||||
$accident->way_id = get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
$accident->way_id = $nominatimService->get_way_id_from_nominatim($request->lat, $request->lng);
|
||||
|
||||
$accident->save();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ use Illuminate\View\View;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
use App\Exports\V2\Receipt\ReceiptTable\AllSheets as ReceiptTable;
|
||||
use App\Exports\V2\Receipt\RecieptTable\AllSheets as ReceiptTable;
|
||||
|
||||
|
||||
class ReceiptReportController extends Controller
|
||||
|
||||
@@ -11,6 +11,7 @@ use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\SetadProvince;
|
||||
use phpDocumentor\Reflection\Utils;
|
||||
use Webpatser\Uuid\Uuid;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ResearchDevController extends Controller
|
||||
@@ -370,7 +371,7 @@ class ResearchDevController extends Controller
|
||||
}
|
||||
|
||||
// Make Unique Code
|
||||
$uuid = Uuid::generate();
|
||||
$uuid = Str::uuid();
|
||||
|
||||
|
||||
switch ($request->domain_id) {
|
||||
|
||||
@@ -430,56 +430,58 @@ class RoadItemsProjectController extends Controller
|
||||
]);
|
||||
}
|
||||
////// function show items on map
|
||||
public function show_item(Request $request)
|
||||
{
|
||||
$province = $request->province_id;
|
||||
$city = $request->city_id;
|
||||
$sub = $request->sub_id;
|
||||
// sharareh begin
|
||||
// public function show_item(Request $request)
|
||||
// {
|
||||
// $province = $request->province_id;
|
||||
// $city = $request->city_id;
|
||||
// $sub = $request->sub_id;
|
||||
|
||||
if ($request->date_from && $request->date_to) {
|
||||
$date_from = $request->date_from.' 00:00:00';
|
||||
$date_to = $request->date_to.' 23:59:59';
|
||||
} else {
|
||||
$date_from = Date('Y-m-d');
|
||||
$date_to = new \DateTime('tomorrow');
|
||||
$date_to = $date_to->format('Y-m-d');
|
||||
}
|
||||
// if ($request->date_from && $request->date_to) {
|
||||
// $date_from = $request->date_from.' 00:00:00';
|
||||
// $date_to = $request->date_to.' 23:59:59';
|
||||
// } else {
|
||||
// $date_from = Date('Y-m-d');
|
||||
// $date_to = new \DateTime('tomorrow');
|
||||
// $date_to = $date_to->format('Y-m-d');
|
||||
// }
|
||||
// $datass = DB::table('road_items_projects')
|
||||
// ->where('is_new', 1)
|
||||
// ->when($province, function ($query, $province) {
|
||||
// return $query->where('road_items_projects.province_id', $province);
|
||||
// })
|
||||
// ->when($city, function ($query, $city) {
|
||||
// return $query->where('road_items_projects.city_id', $city);
|
||||
// })
|
||||
// ->when($sub, function ($query, $sub) {
|
||||
// return $query->where('sub_items', 'like', '%"'.$sub.'"%');
|
||||
// })
|
||||
// ->when($request->item, function ($query) use ($request) {
|
||||
// if ($request->item > 0) {
|
||||
// return $query->where('item', $request->item);
|
||||
// }
|
||||
// return $query;
|
||||
// })
|
||||
// ->when(!is_null($request->status), function ($query) use ($request) {
|
||||
// return $query->where('status', $request->status);
|
||||
// })
|
||||
// ->leftJoin('users', 'users.id', '=', 'road_items_projects.user_id')
|
||||
// ->whereBetween('road_items_projects.activity_date', [
|
||||
// $date_from,
|
||||
// $date_to,
|
||||
// ])
|
||||
// ->select('road_items_projects.id as i', 'start_lat as l', 'start_lng as g', 'status')
|
||||
// ->get();
|
||||
// // dd($datass);
|
||||
|
||||
$datass = DB::table('road_items_projects')
|
||||
->where('is_new', 1)
|
||||
->when($province, function ($query, $province) {
|
||||
return $query->where('road_items_projects.province_id', $province);
|
||||
})
|
||||
->when($city, function ($query, $city) {
|
||||
return $query->where('road_items_projects.city_id', $city);
|
||||
})
|
||||
->when($sub, function ($query, $sub) {
|
||||
return $query->where('sub_items', 'like', '%"'.$sub.'"%');
|
||||
})
|
||||
->when($request->item, function ($query) use ($request) {
|
||||
if ($request->item > 0) {
|
||||
return $query->where('item', $request->item);
|
||||
}
|
||||
return $query;
|
||||
})
|
||||
->when(!is_null($request->status), function ($query) use ($request) {
|
||||
return $query->where('status', $request->status);
|
||||
})
|
||||
->leftJoin('users', 'users.id', '=', 'road_items_projects.user_id')
|
||||
->whereBetween('road_items_projects.activity_date', [
|
||||
$date_from,
|
||||
$date_to,
|
||||
])
|
||||
->select('road_items_projects.id as i', 'start_lat as l', 'start_lng as g', 'status')
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
'count' => count($datass),
|
||||
'message' => '',
|
||||
'data' => $datass
|
||||
], 200);
|
||||
}
|
||||
// return response()->json([
|
||||
// 'status' => 'succeed',
|
||||
// 'count' => count($datass),
|
||||
// 'message' => '',
|
||||
// 'data' => $datass
|
||||
// ], 200);
|
||||
// }
|
||||
// sharareh end
|
||||
|
||||
|
||||
public function table3InRoadItemProject(Request $request)
|
||||
|
||||
@@ -219,14 +219,14 @@ class UserActivityController extends Controller
|
||||
GROUP BY user_id
|
||||
ORDER BY majmoe desc;";
|
||||
|
||||
foreach (DB::select(DB::raw($user_activity_quantity_sql)) as $key => $value) {
|
||||
foreach (DB::select($user_activity_quantity_sql) as $key => $value) {
|
||||
$user_activity_quantity_temp[$value->user_id] = [
|
||||
"majmoe" => $value->quantity ?? 0,
|
||||
"name" => $value->user_first_name ? $value->user_first_name." ".$value->user_last_name." (".$value->username.")" : $value->user_name." (".$value->username.")",
|
||||
];
|
||||
}
|
||||
|
||||
foreach (DB::select(DB::raw($user_activity_time_sql)) as $key => $value) {
|
||||
foreach (DB::select($user_activity_time_sql) as $key => $value) {
|
||||
$user_activity_time_temp[$value->user_id] = [
|
||||
"majmoe" => $value->majmoe ?? 0,
|
||||
"name" => $value->user_first_name ? $value->user_first_name." ".$value->user_last_name." (".$value->username.")" : $value->user_name." (".$value->username.")",
|
||||
@@ -245,7 +245,7 @@ class UserActivityController extends Controller
|
||||
LIMIT 5
|
||||
";
|
||||
|
||||
$activity_list = DB::select(DB::raw($user_activity_top_5_temp_sql));
|
||||
$activity_list = DB::select($user_activity_top_5_temp_sql);
|
||||
$sum = 0;
|
||||
foreach ($activity_list as $index => $item) {
|
||||
$sum += (int) $item->quantity;
|
||||
@@ -263,17 +263,17 @@ class UserActivityController extends Controller
|
||||
'fromDate' => $request->fromDate ? $request->fromDate : null,
|
||||
'toDate' => $request->toDate ? $request->toDate : null,
|
||||
'user_activity_time' => $ids_list ? $user_activity_time_temp : null,
|
||||
'hourly_activity_chart' => $ids_list ? DB::select(DB::raw($hourly_activity_chart_sql)): null,
|
||||
'quantitative_activity_chart' => $ids_list ? DB::select(DB::raw($quantitative_activity_chart_sql)): null,
|
||||
'total_activity_quantity' => $ids_list ? DB::select(DB::raw($total_activity_quantity_sql))[0]->total_activity_quantity : null,
|
||||
'total_activity_time' => $ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : null,
|
||||
'top_10_activity_list' => $ids_list ? DB::select(DB::raw($top_10_activity_list_sql)) : null,
|
||||
'hourly_activity_chart' => $ids_list ? DB::select($hourly_activity_chart_sql): null,
|
||||
'quantitative_activity_chart' => $ids_list ? DB::select($quantitative_activity_chart_sql): null,
|
||||
'total_activity_quantity' => $ids_list ? DB::select($total_activity_quantity_sql)[0]->total_activity_quantity : null,
|
||||
'total_activity_time' => $ids_list ? DB::select($total_activity_time_sql)[0]->activity : null,
|
||||
'top_10_activity_list' => $ids_list ? DB::select($top_10_activity_list_sql) : null,
|
||||
'user_activity_quantity' => $ids_list ? $user_activity_quantity_temp : null,
|
||||
'group_name' => $role->name_fa,
|
||||
'average' => round(($ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : 0) / count($users), 2) ,
|
||||
'average' => round(($ids_list ? DB::select($total_activity_time_sql)[0]->activity : 0) / count($users), 2) ,
|
||||
'user_activity_top_5_temp' => $user_activity_top_5_temp,
|
||||
'total_user_count' => count($users),
|
||||
'active_user_count' => $ids_list ? DB::select(DB::raw($active_user_count_sql))[0]->active_user_count : null,
|
||||
'active_user_count' => $ids_list ? DB::select($active_user_count_sql)[0]->active_user_count : null,
|
||||
'group_id' => $role->id
|
||||
];
|
||||
|
||||
@@ -382,7 +382,7 @@ class UserActivityController extends Controller
|
||||
) user_activity_by_hour_and_
|
||||
GROUP BY user_id) AS calculated_table;";
|
||||
|
||||
$activity = DB::select(DB::raw($temp_sql))[0]->activity;
|
||||
$activity = DB::select($temp_sql)[0]->activity;
|
||||
$users_activity[] = [
|
||||
'activity_time' => $ids_list ? $activity : null,
|
||||
'average' => round(($ids_list ? $activity : 0) / count($users), 2) ,
|
||||
@@ -424,8 +424,8 @@ class UserActivityController extends Controller
|
||||
GROUP BY user_id) AS calculated_table;";
|
||||
|
||||
$users_activity[] = [
|
||||
'activity_time' => $country_group_ids_list ? DB::select(DB::raw($country_temp_sql))[0]->activity : null,
|
||||
'average' => round(($country_group_ids_list ? DB::select(DB::raw($country_temp_sql))[0]->activity : 0) / $country_group_user_quantity, 2) ,
|
||||
'activity_time' => $country_group_ids_list ? DB::select($country_temp_sql)[0]->activity : null,
|
||||
'average' => round(($country_group_ids_list ? DB::select($country_temp_sql)[0]->activity : 0) / $country_group_user_quantity, 2) ,
|
||||
'group_name' => 'کشوری',
|
||||
'user_count' => $country_group_user_quantity,
|
||||
'is_static' => 1,
|
||||
@@ -464,8 +464,8 @@ class UserActivityController extends Controller
|
||||
GROUP BY user_id) AS calculated_table;";
|
||||
|
||||
$users_activity[] = [
|
||||
'activity_time' => $organization_group_ids_list ? DB::select(DB::raw($organization_temp_sql))[0]->activity : null,
|
||||
'average' => round(($organization_group_ids_list ? DB::select(DB::raw($organization_temp_sql))[0]->activity : 0) / $organization_group_user_quantity, 2) ,
|
||||
'activity_time' => $organization_group_ids_list ? DB::select($organization_temp_sql)[0]->activity : null,
|
||||
'average' => round(($organization_group_ids_list ? DB::select($organization_temp_sql)[0]->activity : 0) / $organization_group_user_quantity, 2) ,
|
||||
'group_name' => 'سازمانی',
|
||||
'user_count' => $organization_group_user_quantity,
|
||||
'is_static' => 2,
|
||||
@@ -696,8 +696,8 @@ class UserActivityController extends Controller
|
||||
dd;";
|
||||
|
||||
$data['labels'][] = $role->name_fa;
|
||||
$data['hourly_activity_chart'][] = isset(DB::select(DB::raw($hourly_activity_chart_sql))[0]->majmoe) ? DB::select(DB::raw($hourly_activity_chart_sql))[0]->majmoe: 0;
|
||||
$data['quantitative_activity_chart'][] = isset(DB::select(DB::raw($quantitative_activity_chart_sql))[0]->quantity) ? DB::select(DB::raw($quantitative_activity_chart_sql))[0]->quantity: 0;
|
||||
$data['hourly_activity_chart'][] = isset(DB::select($hourly_activity_chart_sql)[0]->majmoe) ? DB::select($hourly_activity_chart_sql)[0]->majmoe: 0;
|
||||
$data['quantitative_activity_chart'][] = isset(DB::select($quantitative_activity_chart_sql)[0]->quantity) ? DB::select($quantitative_activity_chart_sql)[0]->quantity: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ class UserActivityController extends Controller
|
||||
WHERE created_at between '{$request->fromDate}' and '{$request->toDate}' and user_id IN(".$total_ids_list.")
|
||||
";
|
||||
|
||||
$data['total_activity_quantity'] = $total_ids_list ? DB::select(DB::raw($total_activity_quantity_sql))[0]->total_activity_quantity : null;
|
||||
$data['total_activity_quantity'] = $total_ids_list ? DB::select($total_activity_quantity_sql)[0]->total_activity_quantity : null;
|
||||
|
||||
$data['total_user_count'] = count(explode(',', $total_ids_list));
|
||||
|
||||
@@ -721,7 +721,7 @@ class UserActivityController extends Controller
|
||||
GROUP BY user_id
|
||||
) grpuped_by_user_id";
|
||||
|
||||
$data['active_user_count'] = $total_ids_list ? DB::select(DB::raw($active_user_count_sql))[0]->active_user_count : null;
|
||||
$data['active_user_count'] = $total_ids_list ? DB::select($active_user_count_sql)[0]->active_user_count : null;
|
||||
|
||||
$total_activity_time_sql = "
|
||||
SELECT sum(majmoe) AS activity FROM (SELECT *,
|
||||
@@ -739,9 +739,9 @@ class UserActivityController extends Controller
|
||||
) user_activity_by_hour_and_
|
||||
GROUP BY user_id) AS calculated_table;";
|
||||
|
||||
$data['total_activity_time'] = $total_ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : null;
|
||||
$data['total_activity_time'] = $total_ids_list ? DB::select($total_activity_time_sql)[0]->activity : null;
|
||||
|
||||
$data['average'] = round(($total_ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : 0) / count(explode(',', $total_ids_list)), 2);
|
||||
$data['average'] = round(($total_ids_list ? DB::select($total_activity_time_sql)[0]->activity : 0) / count(explode(',', $total_ids_list)), 2);
|
||||
|
||||
$top_10_activity_list_sql = "
|
||||
SELECT *,
|
||||
@@ -758,7 +758,7 @@ class UserActivityController extends Controller
|
||||
ORDER BY quantity desc
|
||||
LIMIT 10";
|
||||
|
||||
$data['top_10_activity_list'] = $total_ids_list ? DB::select(DB::raw($top_10_activity_list_sql)) : null;
|
||||
$data['top_10_activity_list'] = $total_ids_list ? DB::select($top_10_activity_list_sql) : null;
|
||||
|
||||
|
||||
$data['fromDate'] = $request->fromDate ? $request->fromDate : null;
|
||||
|
||||
@@ -187,14 +187,14 @@ class UserController extends Controller
|
||||
GROUP BY user_id
|
||||
ORDER BY majmoe desc;";
|
||||
|
||||
foreach (DB::select(DB::raw($user_activity_quantity_sql)) as $key => $value) {
|
||||
foreach (DB::select($user_activity_quantity_sql) as $key => $value) {
|
||||
$user_activity_quantity_temp[$value->user_id] = [
|
||||
"majmoe" => $value->quantity ?? 0,
|
||||
"name" => $value->user_first_name ? $value->user_first_name." ".$value->user_last_name." (".$value->username.")" : $value->user_name." (".$value->username.")",
|
||||
];
|
||||
}
|
||||
|
||||
foreach (DB::select(DB::raw($user_activity_time_sql)) as $key => $value) {
|
||||
foreach (DB::select($user_activity_time_sql) as $key => $value) {
|
||||
$user_activity_time_temp[$value->user_id] = [
|
||||
"majmoe" => $value->majmoe ?? 0,
|
||||
"name" => $value->user_first_name ? $value->user_first_name." ".$value->user_last_name." (".$value->username.")" : $value->user_name." (".$value->username.")",
|
||||
@@ -213,7 +213,7 @@ class UserController extends Controller
|
||||
LIMIT 5
|
||||
";
|
||||
|
||||
$activity_list = DB::select(DB::raw($user_activity_top_5_temp_sql));
|
||||
$activity_list = DB::select($user_activity_top_5_temp_sql);
|
||||
$sum = 0;
|
||||
foreach ($activity_list as $index => $item) {
|
||||
$sum += (int) $item->quantity;
|
||||
@@ -231,17 +231,17 @@ class UserController extends Controller
|
||||
'fromDate' => $request->fromDate ? $request->fromDate : null,
|
||||
'toDate' => $request->toDate ? $request->toDate : null,
|
||||
'user_activity_time' => $ids_list ? $user_activity_time_temp : null,
|
||||
'hourly_activity_chart' => $ids_list ? DB::select(DB::raw($hourly_activity_chart_sql)) : null,
|
||||
'quantitative_activity_chart' => $ids_list ? DB::select(DB::raw($quantitative_activity_chart_sql)) : null,
|
||||
'total_activity_quantity' => $ids_list ? DB::select(DB::raw($total_activity_quantity_sql))[0]->total_activity_quantity : null,
|
||||
'total_activity_time' => $ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : null,
|
||||
'top_10_activity_list' => $ids_list ? DB::select(DB::raw($top_10_activity_list_sql)) : null,
|
||||
'hourly_activity_chart' => $ids_list ? DB::select($hourly_activity_chart_sql) : null,
|
||||
'quantitative_activity_chart' => $ids_list ? DB::select($quantitative_activity_chart_sql) : null,
|
||||
'total_activity_quantity' => $ids_list ? DB::select($total_activity_quantity_sql)[0]->total_activity_quantity : null,
|
||||
'total_activity_time' => $ids_list ? DB::select($total_activity_time_sql)[0]->activity : null,
|
||||
'top_10_activity_list' => $ids_list ? DB::select($top_10_activity_list_sql) : null,
|
||||
'user_activity_quantity' => $ids_list ? $user_activity_quantity_temp : null,
|
||||
'group_name' => $user->first_name." ".$user->last_name,
|
||||
'average' => round(($ids_list ? DB::select(DB::raw($total_activity_time_sql))[0]->activity : 0) / 1, 2) ,
|
||||
'average' => round(($ids_list ? DB::select($total_activity_time_sql)[0]->activity : 0) / 1, 2) ,
|
||||
'user_activity_top_5_temp' => $user_activity_top_5_temp,
|
||||
'total_user_count' => 1,
|
||||
'active_user_count' => $ids_list ? DB::select(DB::raw($active_user_count_sql))[0]->active_user_count : null,
|
||||
'active_user_count' => $ids_list ? DB::select($active_user_count_sql)[0]->active_user_count : null,
|
||||
'group_id' => $user->id
|
||||
];
|
||||
|
||||
@@ -1550,7 +1550,7 @@ class UserController extends Controller
|
||||
->leftJoin('users', 'users.id', '=', 'road_items_projects.user_id')
|
||||
->leftJoin('cities', 'cities.id', '=', 'users.city_id')
|
||||
->where('city_id', '>', 0)
|
||||
->select(DB::raw('count(*) as count, item, city_id, name_fa'))
|
||||
->select('count(*) as count, item, city_id, name_fa')
|
||||
->groupBy('city_id', 'item')
|
||||
->get();
|
||||
// $items_array = $itemss->toArray();
|
||||
@@ -1906,9 +1906,9 @@ class UserController extends Controller
|
||||
WHERE created_at between '{$request->fromDate}' and '{$request->toDate}' and user_id IN(".$user->id.")
|
||||
ORDER BY cnt desc";
|
||||
|
||||
$number_of_active_days = (DB::select(DB::raw($number_of_active_days))[0]->cnt ? DB::select(DB::raw($number_of_active_days))[0]->cnt : -1);
|
||||
$activity_time = DB::select(DB::raw($temp_sql_for_activity_time))[0]->activity;
|
||||
$number_of_activities = DB::select(DB::raw($number_of_activities))[0]->cnt;
|
||||
$number_of_active_days = (DB::select($number_of_active_days)[0]->cnt ? DB::select($number_of_active_days)[0]->cnt : -1);
|
||||
$activity_time = DB::select($temp_sql_for_activity_time)[0]->activity;
|
||||
$number_of_activities = DB::select($number_of_activities)[0]->cnt;
|
||||
$data = [
|
||||
'number_of_active_days' => $number_of_active_days,
|
||||
|
||||
@@ -1917,7 +1917,7 @@ class UserController extends Controller
|
||||
'number_of_activities' => $number_of_activities ,
|
||||
'average_activity_number' => round(($user->id ? $number_of_activities : 0) / $number_of_active_days, 2) ,
|
||||
|
||||
'activity_list' => $user->id ? DB::select(DB::raw($temp_sql_for_activity_list)) : null,
|
||||
'activity_list' => $user->id ? DB::select($temp_sql_for_activity_list) : null,
|
||||
'last_login' => $user->last_login,
|
||||
];
|
||||
return $data;
|
||||
|
||||
@@ -14,7 +14,7 @@ use App\Models\RoadItemsProject;
|
||||
use App\Models\EdarateShahri;
|
||||
use App\Models\ObservedItem;
|
||||
use App\Models\InfoItem;
|
||||
|
||||
use App\Services\NominatimService;
|
||||
use App\Exports\V2\RoadItems\OperatorCartableExport;
|
||||
use App\Exports\V2\RoadItems\SupervisorCartableExport;
|
||||
|
||||
@@ -205,7 +205,7 @@ class RoadItemsProjectController extends Controller
|
||||
return view('version2.dashboard_pages.road_items.operation_cartable');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
if (!Auth::user()->can('create-road-item')) {
|
||||
return response()->json([
|
||||
@@ -290,8 +290,8 @@ class RoadItemsProjectController extends Controller
|
||||
'city_id' => Auth::user()->city_id,
|
||||
'city_fa' => Auth::user()->city_fa,
|
||||
'user_name' => Auth::user()->name,
|
||||
'start_way_id' => get_way_id_from_nominatim($start_coordinates[0], $start_coordinates[1]),
|
||||
'end_way_id' => $end_coordinates ? get_way_id_from_nominatim($end_coordinates[0], $end_coordinates[1]) : null,
|
||||
'start_way_id' => $nominatimService->get_way_id_from_nominatim(),
|
||||
'end_way_id' => $end_coordinates ? $nominatimService->get_way_id_from_nominatim() : null,
|
||||
'unit_fa' => $info_item->sub_item_unit,
|
||||
'created_at_fa' => verta(\Carbon\Carbon::now())->format('Y-m-d H:i:s'),
|
||||
'info_id' => $info_item->id,
|
||||
|
||||
@@ -44,12 +44,17 @@ class RoadItemsReportController extends Controller
|
||||
$date_to = Date('Y-m-d');
|
||||
$date_to = $date_to . ' 23:59:59';
|
||||
}
|
||||
|
||||
$item = $request->item;
|
||||
$all = array();
|
||||
$all = DB::select(DB::raw(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s,province_id AS p FROM road_items_projects WHERE item = '.$item.' AND activity_date_time BETWEEN "'.$from_date.'" AND "'.$date_to.'" and status = 1 GROUP BY p, sub_item'));
|
||||
$country =DB::select(DB::raw(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s, -1 AS p FROM road_items_projects WHERE item = '.$item.' AND activity_date_time BETWEEN "'.$from_date.'" AND "'.$date_to.'" and status = 1 GROUP BY sub_item'));
|
||||
$all = DB::select(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s,province_id AS p FROM road_items_projects WHERE item = ' . $item . ' AND activity_date_time BETWEEN "' . $from_date . '" AND "' . $date_to . '" and status = 1 GROUP BY p, sub_item'
|
||||
);
|
||||
|
||||
$country = DB::select(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s, -1 AS p FROM road_items_projects WHERE item = ' . $item . ' AND activity_date_time BETWEEN "' . $from_date . '" AND "' . $date_to . '" and status = 1 GROUP BY sub_item'
|
||||
);
|
||||
|
||||
$items_fa = InfoItem::where('item', $item)->get();
|
||||
foreach ($all as $value) {
|
||||
foreach ($items_fa as $val) {
|
||||
@@ -58,13 +63,16 @@ class RoadItemsReportController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
return response()->json([
|
||||
return response()->json(
|
||||
[
|
||||
'status' => 'succeed',
|
||||
'message' => '',
|
||||
'data' => $all,
|
||||
'country' => $country,
|
||||
'items_fa' => $items_fa
|
||||
], 200);
|
||||
],
|
||||
200
|
||||
);
|
||||
}
|
||||
public function get_items_city(Request $request)
|
||||
{
|
||||
@@ -81,8 +89,11 @@ class RoadItemsReportController extends Controller
|
||||
$item = $request->item;
|
||||
$province = $request->province_id;
|
||||
$all = array();
|
||||
$all = DB::select(DB::raw(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s,province_id AS p, edarat_id AS ci FROM road_items_projects WHERE item = '.$item.' AND province_id = '.$province.' AND activity_date_time BETWEEN "'.$from_date.'" AND "'.$date_to.'" and status = 1 GROUP BY ci, sub_item'));
|
||||
$all = DB::select(
|
||||
DB::raw(
|
||||
'SELECT sub_item AS t,COUNT(*) AS c,CAST(SUM(CASE WHEN sub_item_data>0 THEN sub_item_data ELSE ABS(sub_item_data) END) AS UNSIGNED) AS s,province_id AS p, edarat_id AS ci FROM road_items_projects WHERE item = ' . $item . ' AND province_id = ' . $province . ' AND activity_date_time BETWEEN "' . $from_date . '" AND "' . $date_to . '" and status = 1 GROUP BY ci, sub_item'
|
||||
)
|
||||
);
|
||||
$items_fa = InfoItem::where('item', $item)->get();
|
||||
foreach ($all as $value) {
|
||||
foreach ($items_fa as $val) {
|
||||
@@ -144,7 +155,8 @@ class RoadItemsReportController extends Controller
|
||||
SELECT COUNT(*) AS s,-1 AS p,77 AS i FROM road_patrols
|
||||
WHERE road_patrols.province_id = " . $province_id . " and road_patrols.start_time BETWEEN '" . $from_date . " 00:00:00' and '" . $date_to . " 23:59:59'";
|
||||
}
|
||||
$data = DB::select(DB::raw($sql));
|
||||
|
||||
$data = DB::select($sql);
|
||||
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
@@ -173,11 +185,62 @@ class RoadItemsReportController extends Controller
|
||||
road_patrols.start_time between '" . $from_date . " 00:00:00' and '" . $date_to . " 23:59:59'
|
||||
and province_id= '" . $p . "' GROUP BY c";
|
||||
|
||||
$data = DB::select(DB::raw($sql));
|
||||
$data = DB::select($sql);
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
'message' => '',
|
||||
'data' => $data,
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function map(Request $request)
|
||||
{
|
||||
$province = $request->province_id;
|
||||
$city = $request->city_id;
|
||||
$sub = $request->sub_id;
|
||||
|
||||
if ($request->date_from && $request->date_to) {
|
||||
$date_from = $request->date_from.' 00:00:00';
|
||||
$date_to = $request->date_to.' 23:59:59';
|
||||
} else {
|
||||
$date_from = Date('Y-m-d');
|
||||
$date_to = new \DateTime('tomorrow');
|
||||
$date_to = $date_to->format('Y-m-d');
|
||||
}
|
||||
$datass = DB::table('road_items_projects')
|
||||
->where('is_new', 1)
|
||||
->when($province, function ($query, $province) {
|
||||
return $query->where('road_items_projects.province_id', $province);
|
||||
})
|
||||
->when($city, function ($query, $city) {
|
||||
return $query->where('road_items_projects.city_id', $city);
|
||||
})
|
||||
->when($sub, function ($query, $sub) {
|
||||
return $query->where('sub_items', 'like', '%"'.$sub.'"%');
|
||||
})
|
||||
->when($request->item, function ($query) use ($request) {
|
||||
if ($request->item > 0) {
|
||||
return $query->where('item', $request->item);
|
||||
}
|
||||
return $query;
|
||||
})
|
||||
->when(!is_null($request->status), function ($query) use ($request) {
|
||||
return $query->where('status', $request->status);
|
||||
})
|
||||
->leftJoin('users', 'users.id', '=', 'road_items_projects.user_id')
|
||||
->whereBetween('road_items_projects.activity_date', [
|
||||
$date_from,
|
||||
$date_to,
|
||||
])
|
||||
->select('road_items_projects.id as i', 'start_lat as l', 'start_lng as g', 'status')
|
||||
->get();
|
||||
// dd($datass);
|
||||
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
'count' => count($datass),
|
||||
'message' => '',
|
||||
'data' => $datass
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ use App\Exports\V2\RoadObservation\OperatorCartableExport;
|
||||
use App\Exports\V2\RoadObservation\SupervisorCartableExport;
|
||||
use App\Exports\V2\RoadObservation\PendingComplaintsExport;
|
||||
use App\Exports\V2\RoadObservation\ReportComplaintsExport;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class RoadObservationController extends Controller
|
||||
{
|
||||
@@ -210,6 +211,7 @@ class RoadObservationController extends Controller
|
||||
public function operatorCartableReport(Request $request)
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات واکنش سریع ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
// dd($request->id, $request->status, $request->fromDate, $request->toDate, $name);
|
||||
return Excel::download(new OperatorCartableExport($request->id, $request->status, $request->fromDate, $request->toDate), $name);
|
||||
}
|
||||
/**
|
||||
@@ -434,7 +436,9 @@ class RoadObservationController extends Controller
|
||||
$files_path = [];
|
||||
$file_index = 0;
|
||||
$file_time = time();
|
||||
$uuid = \Uuid::generate();
|
||||
// $uuid = \Uuid::generate();
|
||||
$uuid = (string) Str::uuid();
|
||||
|
||||
if ($request->file('image-before-1')) {
|
||||
$roadObserved->files()->where('path', 'like', '%_image-before-1_%')->delete();
|
||||
|
||||
|
||||
@@ -50,48 +50,6 @@ class RoadObservationReportController extends Controller
|
||||
|
||||
$data = processDataTable($request, '', $fields, $query);
|
||||
|
||||
// $data = RoadObserved::leftjoin('edarate_shahri', 'road_observeds.edarate_shahri_id', 'edarate_shahri.id')->select('road_observeds.id', 'province_fa', 'city_fa', 'FeatureTypeTitle', 'road_observeds.created_at', 'Title', 'Description', 'MobileForSendEventSms', 'lat', 'lng', 'rms_description', 'road_observeds.updated_at', 'rms_status', 'rms_last_activity_fa', 'rms_description', 'AutoId', 'edarate_shahri.name_fa')
|
||||
// ->whereIn('fk_FeatureType', ['1', '2', '3', '4', '5', '6'])
|
||||
// ->where('rms_status', "<>", 1)
|
||||
// ->get();
|
||||
|
||||
// $all = DB::select(DB::raw(
|
||||
// 'SELECT
|
||||
// "کشوری" as province_fa,
|
||||
// -1 as province_id,
|
||||
// COUNT(*) tedade,
|
||||
// SUM(tedad_mavarede_moshede_shode) as tedad_mavarede_moshede_shode,
|
||||
// SUM(tedad_mavarede_peygiri_shode) as tedad_mavarede_peygiri_shode,
|
||||
// SUM(tedad_faliyat_sabt_shode) as tedad_faliyat_sabt_shode,
|
||||
// ROUND(SUM(distance)) as masafat_tey_shode
|
||||
// FROM (SELECT
|
||||
// province_id,
|
||||
// province_fa,
|
||||
// distance,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oi WHERE rp.`id`= oi.road_patrol_id) AS tedad_mavarede_moshede_shode,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NOT NULL) AS tedad_mavarede_peygiri_shode,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NULL) AS tedad_faliyat_sabt_shode
|
||||
// FROM `road_patrols` rp where rp.start_time BETWEEN "'.$from_date.'" AND "'.$date_to.'") temp
|
||||
// union
|
||||
// SELECT
|
||||
// province_fa,
|
||||
// province_id,
|
||||
// COUNT(*) tedade,
|
||||
// SUM(tedad_mavarede_moshede_shode) as tedad_mavarede_moshede_shode,
|
||||
// SUM(tedad_mavarede_peygiri_shode) as tedad_mavarede_peygiri_shode,
|
||||
// SUM(tedad_faliyat_sabt_shode) as tedad_faliyat_sabt_shode,
|
||||
// ROUND(SUM(distance)) as masafat_tey_shode
|
||||
// FROM (SELECT
|
||||
// province_id,
|
||||
// province_fa,
|
||||
// distance,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oi WHERE rp.`id`= oi.road_patrol_id) AS tedad_mavarede_moshede_shode,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NOT NULL) AS tedad_mavarede_peygiri_shode,
|
||||
// (SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NULL) AS tedad_faliyat_sabt_shode
|
||||
// FROM `road_patrols` rp where rp.start_time BETWEEN "'.$from_date.'" AND "'.$date_to.'") temp
|
||||
// GROUP BY province_id
|
||||
// '
|
||||
// ));
|
||||
return response()->json(
|
||||
$data,
|
||||
$data['status'],
|
||||
|
||||
@@ -13,12 +13,12 @@ use App\Facades\Sms\Sms;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use App\Facades\Otp\Otp;
|
||||
use Carbon\Carbon;
|
||||
|
||||
use App\Models\RoadObserved;
|
||||
use App\Models\RoadPatrol;
|
||||
use App\Models\RoadItemsProject;
|
||||
use App\Models\EdarateShahri;
|
||||
use App\Models\InfoItem;
|
||||
|
||||
use App\Services\NominatimService;
|
||||
use App\Exports\V2\RoadPatrol\OperatorCartableExport;
|
||||
use App\Exports\V2\RoadPatrol\SupervisorCartableExport;
|
||||
|
||||
@@ -206,7 +206,7 @@ class RoadPatrolProjectController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
if (!auth()->user()->hasPermissionTo('add-road-patrol')) {
|
||||
return response()->json([
|
||||
@@ -264,7 +264,7 @@ class RoadPatrolProjectController extends Controller
|
||||
$edare_name = auth()->user()->edarate_shahri_id ? auth()->user()->edarate_shahri_name : auth()->user()->edarate_ostani_name;
|
||||
|
||||
try {
|
||||
$road_patrol = \DB::transaction(function () use ($request, $start_coordinates, $end_coordinates, $edare_id, $edare_name) {
|
||||
$road_patrol = \DB::transaction(function () use ($request, $start_coordinates, $end_coordinates, $edare_id, $edare_name, $nominatimService) {
|
||||
if (!$request->observed_items && !$request->description) {
|
||||
throw ValidationException::withMessages([
|
||||
"description" => __('validation.required', ['attribute' => 'description']),
|
||||
@@ -287,8 +287,8 @@ class RoadPatrolProjectController extends Controller
|
||||
'city_fa' => auth()->user()->city_fa,
|
||||
'edare_id' => $edare_id,
|
||||
'edare_name' => $edare_name,
|
||||
'start_way_id' => get_way_id_from_nominatim($start_coordinates[0], $start_coordinates[1]),
|
||||
'end_way_id' => get_way_id_from_nominatim($end_coordinates[0], $end_coordinates[1]),
|
||||
'start_way_id' => $nominatimService->get_way_id_from_nominatim($start_coordinates[0], $start_coordinates[1]),
|
||||
'end_way_id' => $nominatimService->get_way_id_from_nominatim($end_coordinates[0], $end_coordinates[1]),
|
||||
'status' => 0,
|
||||
'status_fa' => 'در حال بررسی',
|
||||
'distance' => $request->distance,
|
||||
@@ -397,8 +397,8 @@ class RoadPatrolProjectController extends Controller
|
||||
'city_id' => auth()->user()->city_id,
|
||||
'city_fa' => auth()->user()->city_fa,
|
||||
'user_name' => auth()->user()->name,
|
||||
'start_way_id' => get_way_id_from_nominatim($item_start_coordinates[0], $item_start_coordinates[1]),
|
||||
'end_way_id' => $item_end_coordinates ? get_way_id_from_nominatim($item_end_coordinates[0], $item_end_coordinates[1]) : null,
|
||||
'start_way_id' => $nominatimService->get_way_id_from_nominatim($item_start_coordinates[0], $item_start_coordinates[1]),
|
||||
'end_way_id' => $item_end_coordinates ? $nominatimService->get_way_id_from_nominatim($item_end_coordinates[0], $item_end_coordinates[1]) : null,
|
||||
'unit_fa' => $info_item->sub_item_unit,
|
||||
'created_at_fa' => verta(Carbon::now())->format('Y-m-d H:i:s'),
|
||||
'info_id' => $info_item->id,
|
||||
@@ -501,6 +501,49 @@ class RoadPatrolProjectController extends Controller
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function map(Request $request)
|
||||
{
|
||||
$province = $request->province_id;
|
||||
$edare_shahri = $request->edare_shahri_id;
|
||||
$status = $request->status;
|
||||
$rms_status = $request->rms_status;
|
||||
|
||||
if ($request->date_from && $request->date_to) {
|
||||
$date_from = $request->date_from.' 00:00:00';
|
||||
$date_to = $request->date_to.' 23:59:59';
|
||||
} else {
|
||||
$date_from = Date('Y-m-d');
|
||||
$date_to = new \DateTime('tomorrow');
|
||||
$date_to = $date_to->format('Y-m-d');
|
||||
}
|
||||
|
||||
$projects = RoadObserved::select('id', 'lng', 'lat','status')
|
||||
->whereBetween('created_at', [$date_from, $date_to])
|
||||
->when($province, function ($query) use ($province) {
|
||||
return $query->where('province_id', $province);
|
||||
})
|
||||
->when($rms_status, function ($query) use ($rms_status) {
|
||||
if ($rms_status == 2) {
|
||||
return $query->where('rms_status', '<>',0);
|
||||
} else {
|
||||
return $query->where('rms_status', 0);
|
||||
}
|
||||
})
|
||||
->when($edare_shahri, function ($query) use ($edare_shahri) {
|
||||
return $query->where('edarate_shahri_id', $edare_shahri);
|
||||
})
|
||||
->when($status, function ($query) use ($status) {
|
||||
return $query->where('status', $status);
|
||||
})
|
||||
// ->toSql();
|
||||
->get();
|
||||
return response()->json([
|
||||
'status' => 'succeed',
|
||||
'message' => '',
|
||||
'data' => $projects
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function detail(RoadPatrol $road_patrol)
|
||||
{
|
||||
return response()->json($road_patrol, 200);
|
||||
|
||||
@@ -17,6 +17,7 @@ use App\Models\EdarateShahri;
|
||||
use App\Models\Contractor;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use App\Services\NominatimService;
|
||||
use App\Models\InfoItem;
|
||||
|
||||
class SafetyAndPrivacyController extends Controller
|
||||
@@ -84,7 +85,7 @@ class SafetyAndPrivacyController extends Controller
|
||||
return view('version2.dashboard_pages.safety_and_privacy.operation_create');
|
||||
}
|
||||
|
||||
public function operatorFirstStepStore(Request $request)
|
||||
public function operatorFirstStepStore(Request $request, NominatimService $nominatimService)
|
||||
{
|
||||
if (! auth()->user()->hasAnyPermission(['add-safety-and-privacy'])) {
|
||||
abort(403);
|
||||
@@ -118,7 +119,7 @@ class SafetyAndPrivacyController extends Controller
|
||||
$item = InfoItem::where('id', $request->info_id)->where('item', 17)->firstOrFail();
|
||||
|
||||
try {
|
||||
$safety_and_privacy = \DB::transaction(function () use ($request, $coordinates, $item) {
|
||||
$safety_and_privacy = \DB::transaction(function () use ($request, $coordinates, $item, $nominatimService) {
|
||||
$safety_and_privacy = SafetyAndPrivacy::create([
|
||||
'lat' => $coordinates[0],
|
||||
'lon' => $coordinates[1],
|
||||
@@ -133,7 +134,7 @@ class SafetyAndPrivacyController extends Controller
|
||||
'activity_date_time' => $request->activity_date." ".$request->activity_time,
|
||||
'edare_shahri_id' => auth()->user()->edarate_shahri_id,
|
||||
'edare_shahri_name' => auth()->user()->edarate_shahri_name,
|
||||
'way_id' => get_way_id_from_nominatim($coordinates[0], $coordinates[1]),
|
||||
'way_id' => $nominatimService->get_way_id_from_nominatim(),
|
||||
]);
|
||||
|
||||
if ($request->has('recognize_picture')) {
|
||||
|
||||
62
app/Providers/TelescopeServiceProvider.php
Normal file
62
app/Providers/TelescopeServiceProvider.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Laravel\Telescope\IncomingEntry;
|
||||
use Laravel\Telescope\Telescope;
|
||||
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
||||
|
||||
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
// Telescope::night();
|
||||
|
||||
$this->hideSensitiveRequestDetails();
|
||||
|
||||
$isLocal = $this->app->environment('local');
|
||||
|
||||
Telescope::filter(function (IncomingEntry $entry) use ($isLocal) {
|
||||
return $isLocal ||
|
||||
$entry->isReportableException() ||
|
||||
$entry->isFailedRequest() ||
|
||||
$entry->isFailedJob() ||
|
||||
$entry->isScheduledTask() ||
|
||||
$entry->hasMonitoredTag();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent sensitive request details from being logged by Telescope.
|
||||
*/
|
||||
protected function hideSensitiveRequestDetails(): void
|
||||
{
|
||||
if ($this->app->environment('local')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Telescope::hideRequestParameters(['_token']);
|
||||
|
||||
Telescope::hideRequestHeaders([
|
||||
'cookie',
|
||||
'x-csrf-token',
|
||||
'x-xsrf-token',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Telescope gate.
|
||||
*
|
||||
* This gate determines who can access Telescope in non-local environments.
|
||||
*/
|
||||
protected function gate(): void
|
||||
{
|
||||
Gate::define('viewTelescope', function ($user) {
|
||||
return $user->username == 'witel';
|
||||
});
|
||||
}
|
||||
}
|
||||
11
app/Services/NominatimService.php
Normal file
11
app/Services/NominatimService.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class NominatimService
|
||||
{
|
||||
public function get_way_id_from_nominatim(): string
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ trait ReceiptReportAble
|
||||
{
|
||||
public static function cityReceiptData($from_date, $date_to, $province_id): array
|
||||
{
|
||||
return DB::select(DB::raw(
|
||||
return DB::select(
|
||||
'SELECT
|
||||
city_fa,
|
||||
city_id,
|
||||
@@ -25,13 +25,13 @@ trait ReceiptReportAble
|
||||
where created_at BETWEEN "'.$from_date.'" AND "'.$date_to.'" AND province_id ='.$province_id.'
|
||||
GROUP BY city_id
|
||||
'
|
||||
));
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public static function provinceReceiptData($from_date, $date_to) : array {
|
||||
|
||||
return DB::select(DB::raw(
|
||||
return DB::select(
|
||||
'SELECT
|
||||
"کشوری" as province_fa,
|
||||
-1 as province_id,
|
||||
@@ -67,7 +67,7 @@ trait ReceiptReportAble
|
||||
where created_at BETWEEN "'.$from_date.'" AND "'.$date_to.'"
|
||||
GROUP BY province_id
|
||||
'
|
||||
));
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ trait ReportAble
|
||||
{
|
||||
public static function edarehPatrolData($from_date, $date_to, $province_id): array
|
||||
{
|
||||
return DB::select(DB::raw(
|
||||
return DB::select(
|
||||
'SELECT
|
||||
province_fa,
|
||||
province_id,
|
||||
@@ -34,13 +34,12 @@ trait ReportAble
|
||||
FROM `road_patrols` rp where rp.province_id = "'.$province_id.'" AND rp.start_time BETWEEN "'.$from_date.'" AND "'.$date_to.'") temp
|
||||
GROUP BY edare_id
|
||||
'
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
public static function provincePatrolData($from_date, $date_to) : array {
|
||||
|
||||
return DB::select(DB::raw(
|
||||
'SELECT
|
||||
return DB::select('SELECT
|
||||
"کشوری" as province_fa,
|
||||
-1 as province_id,
|
||||
COUNT(*) tedade,
|
||||
@@ -81,9 +80,8 @@ trait ReportAble
|
||||
(SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NOT NULL) AS tedad_mavarede_peygiri_shode,
|
||||
(SELECT COUNT(*) FROM `observed_items` oii WHERE rp.`id`= oii.road_patrol_id AND oii.road_item_id IS NOT NULL AND priority IS NULL) AS tedad_faliyat_sabt_shode
|
||||
FROM `road_patrols` rp where rp.start_time BETWEEN "'.$from_date.'" AND "'.$date_to.'") temp
|
||||
GROUP BY province_id
|
||||
'
|
||||
));
|
||||
GROUP BY province_id'
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ trait SafetyAndPrivacyReportAble
|
||||
$all[$value->id]["id"] = $value->id;
|
||||
}
|
||||
|
||||
$temp = DB::select(DB::raw("SELECT COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where created_at BETWEEN '".$from_date."' and '".$date_to."' GROUP BY info_id,step"));
|
||||
$temp = DB::select("SELECT COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where created_at BETWEEN '".$from_date."' and '".$date_to."' GROUP BY info_id,step");
|
||||
|
||||
$sum = 0;
|
||||
foreach ($temp as $key => $value) {
|
||||
@@ -62,7 +62,7 @@ trait SafetyAndPrivacyReportAble
|
||||
$all[0]["sum"] = $sum;
|
||||
}
|
||||
|
||||
$temp = DB::select(DB::raw("SELECT province_id, COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where created_at BETWEEN '".$from_date."' and '".$date_to."' GROUP BY info_id,step,province_id order by province_id"));
|
||||
$temp = DB::select("SELECT province_id, COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where created_at BETWEEN '".$from_date."' and '".$date_to."' GROUP BY info_id,step,province_id order by province_id");
|
||||
$province_id_flag = "";
|
||||
$sum = 0;
|
||||
|
||||
@@ -116,7 +116,7 @@ trait SafetyAndPrivacyReportAble
|
||||
}
|
||||
|
||||
|
||||
$temp = DB::select(DB::raw('SELECT edare_shahri_id, COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where province_id ='.$province_id.' and created_at BETWEEN "'.$from_date.'" and "'.$date_to.'" GROUP BY info_id,step,edare_shahri_id order by edare_shahri_id'));
|
||||
$temp = DB::select('SELECT edare_shahri_id, COUNT(*) as qty,info_id, step,step_fa, info_fa FROM safety_and_privacy where province_id ='.$province_id.' and created_at BETWEEN "'.$from_date.'" and "'.$date_to.'" GROUP BY info_id,step,edare_shahri_id order by edare_shahri_id');
|
||||
$edare_shahri_id_flag = "";
|
||||
$sum = 0;
|
||||
|
||||
|
||||
22
bootstrap/cache/packages.php
vendored
22
bootstrap/cache/packages.php
vendored
@@ -1,4 +1,26 @@
|
||||
<?php return array (
|
||||
'barryvdh/laravel-debugbar' =>
|
||||
array (
|
||||
'providers' =>
|
||||
array (
|
||||
0 => 'Barryvdh\\Debugbar\\ServiceProvider',
|
||||
),
|
||||
'aliases' =>
|
||||
array (
|
||||
'Debugbar' => 'Barryvdh\\Debugbar\\Facades\\Debugbar',
|
||||
),
|
||||
),
|
||||
'hekmatinasser/verta' =>
|
||||
array (
|
||||
'providers' =>
|
||||
array (
|
||||
0 => 'Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider',
|
||||
),
|
||||
'aliases' =>
|
||||
array (
|
||||
'Verta' => 'Hekmatinasser\\Verta\\Verta',
|
||||
),
|
||||
),
|
||||
'laravel/sail' =>
|
||||
array (
|
||||
'providers' =>
|
||||
|
||||
68
bootstrap/cache/services.php
vendored
68
bootstrap/cache/services.php
vendored
@@ -23,22 +23,26 @@
|
||||
19 => 'Illuminate\\Translation\\TranslationServiceProvider',
|
||||
20 => 'Illuminate\\Validation\\ValidationServiceProvider',
|
||||
21 => 'Illuminate\\View\\ViewServiceProvider',
|
||||
22 => 'Laravel\\Sail\\SailServiceProvider',
|
||||
23 => 'Laravel\\Sanctum\\SanctumServiceProvider',
|
||||
24 => 'Laravel\\Telescope\\TelescopeServiceProvider',
|
||||
25 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
||||
26 => 'Laravel\\Ui\\UiServiceProvider',
|
||||
27 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
||||
28 => 'Carbon\\Laravel\\ServiceProvider',
|
||||
29 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||
30 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||
31 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||
32 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
33 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
34 => 'App\\Providers\\AppServiceProvider',
|
||||
35 => 'App\\Providers\\AuthServiceProvider',
|
||||
36 => 'App\\Providers\\EventServiceProvider',
|
||||
37 => 'App\\Providers\\RouteServiceProvider',
|
||||
22 => 'Barryvdh\\Debugbar\\ServiceProvider',
|
||||
23 => 'Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider',
|
||||
24 => 'Laravel\\Sail\\SailServiceProvider',
|
||||
25 => 'Laravel\\Sanctum\\SanctumServiceProvider',
|
||||
26 => 'Laravel\\Telescope\\TelescopeServiceProvider',
|
||||
27 => 'Laravel\\Tinker\\TinkerServiceProvider',
|
||||
28 => 'Laravel\\Ui\\UiServiceProvider',
|
||||
29 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
||||
30 => 'Carbon\\Laravel\\ServiceProvider',
|
||||
31 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||
32 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||
33 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||
34 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
35 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
36 => 'App\\Providers\\AppServiceProvider',
|
||||
37 => 'App\\Providers\\AuthServiceProvider',
|
||||
38 => 'App\\Providers\\EventServiceProvider',
|
||||
39 => 'App\\Providers\\RouteServiceProvider',
|
||||
40 => 'App\\Providers\\TelescopeServiceProvider',
|
||||
41 => 'Barryvdh\\Debugbar\\ServiceProvider',
|
||||
),
|
||||
'eager' =>
|
||||
array (
|
||||
@@ -52,20 +56,24 @@
|
||||
7 => 'Illuminate\\Pagination\\PaginationServiceProvider',
|
||||
8 => 'Illuminate\\Session\\SessionServiceProvider',
|
||||
9 => 'Illuminate\\View\\ViewServiceProvider',
|
||||
10 => 'Laravel\\Sanctum\\SanctumServiceProvider',
|
||||
11 => 'Laravel\\Telescope\\TelescopeServiceProvider',
|
||||
12 => 'Laravel\\Ui\\UiServiceProvider',
|
||||
13 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
||||
14 => 'Carbon\\Laravel\\ServiceProvider',
|
||||
15 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||
16 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||
17 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||
18 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
19 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
20 => 'App\\Providers\\AppServiceProvider',
|
||||
21 => 'App\\Providers\\AuthServiceProvider',
|
||||
22 => 'App\\Providers\\EventServiceProvider',
|
||||
23 => 'App\\Providers\\RouteServiceProvider',
|
||||
10 => 'Barryvdh\\Debugbar\\ServiceProvider',
|
||||
11 => 'Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider',
|
||||
12 => 'Laravel\\Sanctum\\SanctumServiceProvider',
|
||||
13 => 'Laravel\\Telescope\\TelescopeServiceProvider',
|
||||
14 => 'Laravel\\Ui\\UiServiceProvider',
|
||||
15 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
|
||||
16 => 'Carbon\\Laravel\\ServiceProvider',
|
||||
17 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
|
||||
18 => 'Termwind\\Laravel\\TermwindServiceProvider',
|
||||
19 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider',
|
||||
20 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
21 => 'Spatie\\Permission\\PermissionServiceProvider',
|
||||
22 => 'App\\Providers\\AppServiceProvider',
|
||||
23 => 'App\\Providers\\AuthServiceProvider',
|
||||
24 => 'App\\Providers\\EventServiceProvider',
|
||||
25 => 'App\\Providers\\RouteServiceProvider',
|
||||
26 => 'App\\Providers\\TelescopeServiceProvider',
|
||||
27 => 'Barryvdh\\Debugbar\\ServiceProvider',
|
||||
),
|
||||
'deferred' =>
|
||||
array (
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
"ext-zip": "*",
|
||||
"doctrine/dbal": "^3.7",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"hekmatinasser/verta": "^8.3",
|
||||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.2",
|
||||
"laravel/telescope": "^4.15",
|
||||
"laravel/telescope": "^4.17",
|
||||
"laravel/tinker": "^2.8",
|
||||
"laravel/ui": "^4.4",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
@@ -19,6 +20,7 @@
|
||||
"spatie/laravel-permission": "^5.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.9",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/pint": "^1.0",
|
||||
"laravel/sail": "^1.18",
|
||||
@@ -32,7 +34,12 @@
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"app/Helpers/Compress.php",
|
||||
"app/Helpers/EnToFa.php",
|
||||
"app/Helpers/General.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
||||
347
composer.lock
generated
347
composer.lock
generated
@@ -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": "74ce5a6aff0090dad7cc0596dc5a6bad",
|
||||
"content-hash": "687a4c2a80c569c39332ff856097dafd",
|
||||
"packages": [
|
||||
{
|
||||
"name": "beberlei/assert",
|
||||
@@ -1598,6 +1598,189 @@
|
||||
],
|
||||
"time": "2023-12-03T19:50:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hekmatinasser/jalali",
|
||||
"version": "v8.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/hekmatinasser/jalali.git",
|
||||
"reference": "745cdf40eac790b046b93d3836a29d68f15220f7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hekmatinasser/jalali/zipball/745cdf40eac790b046b93d3836a29d68f15220f7",
|
||||
"reference": "745cdf40eac790b046b93d3836a29d68f15220f7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hekmatinasser/notowo": "^1.0",
|
||||
"php": "^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^4.18|^5.20|^6.24|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Hekmatinasser\\Jalali\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nasser Hekmati",
|
||||
"email": "hekmati.nasser@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "This Package helps developers to work with Jalali Datetime class for PHP",
|
||||
"keywords": [
|
||||
"Jalali",
|
||||
"date",
|
||||
"datetime",
|
||||
"php",
|
||||
"shamsi"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/hekmatinasser/jalali/issues",
|
||||
"source": "https://github.com/hekmatinasser/jalali/tree/v8.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/hekmatinasser",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-04T07:11:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hekmatinasser/notowo",
|
||||
"version": "v1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/hekmatinasser/notowo.git",
|
||||
"reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hekmatinasser/notowo/zipball/c51ad5dcedac966dd93ce558ac7e6a84e0020d6d",
|
||||
"reference": "c51ad5dcedac966dd93ce558ac7e6a84e0020d6d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Hekmatinasser\\Notowo\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nasser Hekmati",
|
||||
"email": "hekmati.nasser@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "This Package helps developers change number to word for all language on Laravel freamwork PHP",
|
||||
"keywords": [
|
||||
"Notowo",
|
||||
"laravel",
|
||||
"n2w",
|
||||
"number",
|
||||
"word"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/hekmatinasser/notowo/issues",
|
||||
"source": "https://github.com/hekmatinasser/notowo/tree/v1.0.1"
|
||||
},
|
||||
"time": "2017-09-22T13:41:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hekmatinasser/verta",
|
||||
"version": "v8.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/hekmatinasser/verta.git",
|
||||
"reference": "5ef147733289845d14786e1418c0c0ab5f85b7fc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hekmatinasser/verta/zipball/5ef147733289845d14786e1418c0c0ab5f85b7fc",
|
||||
"reference": "5ef147733289845d14786e1418c0c0ab5f85b7fc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hekmatinasser/jalali": "^8.2",
|
||||
"illuminate/support": "^8.0|^9.0|^10.0",
|
||||
"illuminate/validation": "^8.0|^9.0|^10.0",
|
||||
"php": "^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^6.23|^7.0|^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Verta": "Hekmatinasser\\Verta\\Verta"
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Hekmatinasser\\Verta\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nasser Hekmati",
|
||||
"email": "hekmati.nasser@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "This Package helps developers to work with Jalali Datetime class for Laravel Framework PHP",
|
||||
"keywords": [
|
||||
"Jalali",
|
||||
"Verta",
|
||||
"date",
|
||||
"datetime",
|
||||
"laravel",
|
||||
"shamsi"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/hekmatinasser/verta/issues",
|
||||
"source": "https://github.com/hekmatinasser/verta/tree/v8.3.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/hekmatinasser",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-15T11:52:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v10.43.0",
|
||||
@@ -1988,16 +2171,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/telescope",
|
||||
"version": "v4.17.5",
|
||||
"version": "v4.17.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/telescope.git",
|
||||
"reference": "2c5295261d1459e4f9b157c407a663a6685f3ddf"
|
||||
"reference": "2d453dc629b27e8cf39fb1217aba062f8c54e690"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/telescope/zipball/2c5295261d1459e4f9b157c407a663a6685f3ddf",
|
||||
"reference": "2c5295261d1459e4f9b157c407a663a6685f3ddf",
|
||||
"url": "https://api.github.com/repos/laravel/telescope/zipball/2d453dc629b27e8cf39fb1217aba062f8c54e690",
|
||||
"reference": "2d453dc629b27e8cf39fb1217aba062f8c54e690",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2053,9 +2236,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/telescope/issues",
|
||||
"source": "https://github.com/laravel/telescope/tree/v4.17.5"
|
||||
"source": "https://github.com/laravel/telescope/tree/v4.17.6"
|
||||
},
|
||||
"time": "2024-01-30T15:41:45+00:00"
|
||||
"time": "2024-02-08T15:04:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/tinker",
|
||||
@@ -6968,6 +7151,90 @@
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "barryvdh/laravel-debugbar",
|
||||
"version": "v3.9.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-debugbar.git",
|
||||
"reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/bfd0131c146973cab164e50f5cdd8a67cc60cab1",
|
||||
"reference": "bfd0131c146973cab164e50f5cdd8a67cc60cab1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/routing": "^9|^10",
|
||||
"illuminate/session": "^9|^10",
|
||||
"illuminate/support": "^9|^10",
|
||||
"maximebf/debugbar": "^1.18.2",
|
||||
"php": "^8.0",
|
||||
"symfony/finder": "^6"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.3.3",
|
||||
"orchestra/testbench-dusk": "^5|^6|^7|^8",
|
||||
"phpunit/phpunit": "^8.5.30|^9.0",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.8-dev"
|
||||
},
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Barryvdh\\Debugbar\\ServiceProvider"
|
||||
],
|
||||
"aliases": {
|
||||
"Debugbar": "Barryvdh\\Debugbar\\Facades\\Debugbar"
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Barryvdh\\Debugbar\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Barry vd. Heuvel",
|
||||
"email": "barryvdh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP Debugbar integration for Laravel",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"debugbar",
|
||||
"laravel",
|
||||
"profiler",
|
||||
"webprofiler"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.9.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://fruitcake.nl",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/barryvdh",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-25T18:43:57+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fakerphp/faker",
|
||||
"version": "v1.23.1",
|
||||
@@ -7284,6 +7551,72 @@
|
||||
},
|
||||
"time": "2024-01-30T03:03:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "maximebf/debugbar",
|
||||
"version": "v1.19.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/maximebf/php-debugbar.git",
|
||||
"reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/03dd40a1826f4d585ef93ef83afa2a9874a00523",
|
||||
"reference": "03dd40a1826f4d585ef93ef83afa2a9874a00523",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1|^8",
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/var-dumper": "^4|^5|^6"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=7.5.20 <10.0",
|
||||
"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"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.18-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/maximebf/php-debugbar",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"debugbar"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/maximebf/php-debugbar/issues",
|
||||
"source": "https://github.com/maximebf/php-debugbar/tree/v1.19.1"
|
||||
},
|
||||
"time": "2023-10-12T08:10:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mockery/mockery",
|
||||
"version": "1.6.7",
|
||||
|
||||
@@ -178,6 +178,9 @@ return [
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\TelescopeServiceProvider::class,
|
||||
|
||||
Barryvdh\Debugbar\ServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
|
||||
281
config/debugbar.php
Normal file
281
config/debugbar.php
Normal file
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Debugbar Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Debugbar is enabled by default, when debug is set to true in app.php.
|
||||
| You can override the value by setting enable to true or false instead of null.
|
||||
|
|
||||
| You can provide an array of URI's that must be ignored (eg. 'api/*')
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => env('DEBUGBAR_ENABLED', null),
|
||||
'except' => [
|
||||
'telescope*',
|
||||
'horizon*',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Storage settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| DebugBar stores data for session/ajax requests.
|
||||
| You can disable this, so the debugbar stores data in headers/session,
|
||||
| but this can cause problems with large data collectors.
|
||||
| By default, file storage (in the storage folder) is used. Redis and PDO
|
||||
| can also be used. For PDO, run the package migrations first.
|
||||
|
|
||||
| Warning: Enabling storage.open will allow everyone to access previous
|
||||
| request, do not enable open storage in publicly available environments!
|
||||
| Specify a callback if you want to limit based on IP or authentication.
|
||||
*/
|
||||
'storage' => [
|
||||
'enabled' => true,
|
||||
'open' => env('DEBUGBAR_OPEN_STORAGE', false), // bool/callback.
|
||||
'driver' => 'file', // redis, file, pdo, socket, custom
|
||||
'path' => storage_path('debugbar'), // For file driver
|
||||
'connection' => null, // Leave null for default connection (Redis/PDO)
|
||||
'provider' => '', // Instance of StorageInterface for custom driver
|
||||
'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver
|
||||
'port' => 2304, // Port to use with the "socket" driver
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Editor
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Choose your preferred editor to use when clicking file name.
|
||||
|
|
||||
| Supported: "phpstorm", "vscode", "vscode-insiders", "vscode-remote",
|
||||
| "vscode-insiders-remote", "vscodium", "textmate", "emacs",
|
||||
| "sublime", "atom", "nova", "macvim", "idea", "netbeans",
|
||||
| "xdebug", "espresso"
|
||||
|
|
||||
*/
|
||||
|
||||
'editor' => env('DEBUGBAR_EDITOR', 'phpstorm'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Path Mapping
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using a remote dev server, like Laravel Homestead, Docker, or
|
||||
| even a remote VPS, it will be necessary to specify your path mapping.
|
||||
|
|
||||
| Leaving one, or both of these, empty or null will not trigger the remote
|
||||
| URL changes and Debugbar will treat your editor links as local files.
|
||||
|
|
||||
| "remote_sites_path" is an absolute base path for your sites or projects
|
||||
| in Homestead, Vagrant, Docker, or another remote development server.
|
||||
|
|
||||
| Example value: "/home/vagrant/Code"
|
||||
|
|
||||
| "local_sites_path" is an absolute base path for your sites or projects
|
||||
| on your local computer where your IDE or code editor is running on.
|
||||
|
|
||||
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
|
||||
|
|
||||
*/
|
||||
|
||||
'remote_sites_path' => env('DEBUGBAR_REMOTE_SITES_PATH', ''),
|
||||
'local_sites_path' => env('DEBUGBAR_LOCAL_SITES_PATH', ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Vendors
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Vendor files are included by default, but can be set to false.
|
||||
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
|
||||
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
|
||||
| and for js: jquery and highlight.js
|
||||
| So if you want syntax highlighting, set it to true.
|
||||
| jQuery is set to not conflict with existing jQuery scripts.
|
||||
|
|
||||
*/
|
||||
|
||||
'include_vendors' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Capture Ajax Requests
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
|
||||
| you can use this option to disable sending the data through the headers.
|
||||
|
|
||||
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
|
||||
|
|
||||
| Note for your request to be identified as ajax requests they must either send the header
|
||||
| X-Requested-With with the value XMLHttpRequest (most JS libraries send this), or have application/json as a Accept header.
|
||||
*/
|
||||
|
||||
'capture_ajax' => true,
|
||||
'add_ajax_timing' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Custom Error Handler for Deprecated warnings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When enabled, the Debugbar shows deprecated warnings for Symfony components
|
||||
| in the Messages tab.
|
||||
|
|
||||
*/
|
||||
'error_handler' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Clockwork integration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The Debugbar can emulate the Clockwork headers, so you can use the Chrome
|
||||
| Extension, without the server-side code. It uses Debugbar collectors instead.
|
||||
|
|
||||
*/
|
||||
'clockwork' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DataCollectors
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable/disable DataCollectors
|
||||
|
|
||||
*/
|
||||
|
||||
'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' => false, // 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
|
||||
'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
|
||||
'cache' => false, // Display cache events
|
||||
'models' => true, // Display models
|
||||
'livewire' => true, // Display Livewire (when available)
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extra options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure some DataCollectors
|
||||
|
|
||||
*/
|
||||
|
||||
'options' => [
|
||||
'auth' => [
|
||||
'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.
|
||||
'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults)
|
||||
'timeline' => false, // Add the queries to the timeline
|
||||
'duration_background' => true, // Show shaded background on each query relative to how long it took to execute.
|
||||
'explain' => [ // Show EXPLAIN output on queries
|
||||
'enabled' => false,
|
||||
'types' => ['SELECT'], // Deprecated setting, is always only SELECT
|
||||
],
|
||||
'hints' => false, // Show hints for common mistakes
|
||||
'show_copy' => false, // Show copy button next to the query,
|
||||
'slow_threshold' => false, // Only track queries that last longer than this time in ms
|
||||
],
|
||||
'mail' => [
|
||||
'full_log' => false,
|
||||
],
|
||||
'views' => [
|
||||
'timeline' => false, // Add the views to the timeline (Experimental)
|
||||
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
||||
'exclude_paths' => [], // Add the paths which you don't want to appear in the views
|
||||
],
|
||||
'route' => [
|
||||
'label' => true, // show complete route on bar
|
||||
],
|
||||
'logs' => [
|
||||
'file' => null,
|
||||
],
|
||||
'cache' => [
|
||||
'values' => true, // collect cache values
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Inject Debugbar in Response
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Usually, the debugbar is added just before </body>, by listening to the
|
||||
| Response after the App is done. If you disable this, you have to add them
|
||||
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
|
||||
|
|
||||
*/
|
||||
|
||||
'inject' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DebugBar route prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Sometimes you want to set route prefix to be used by DebugBar to load
|
||||
| its resources from. Usually the need comes from misconfigured web server or
|
||||
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
|
||||
|
|
||||
*/
|
||||
'route_prefix' => '_debugbar',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DebugBar route domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default DebugBar route served from the same domain that request served.
|
||||
| To override default domain, specify it as a non-empty value.
|
||||
*/
|
||||
'route_domain' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DebugBar theme
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Switches between light and dark theme. If set to auto it will respect system preferences
|
||||
| Possible values: auto, light, dark
|
||||
*/
|
||||
'theme' => env('DEBUGBAR_THEME', 'auto'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Backtrace stack limit
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, the DebugBar limits the number of frames returned by the 'debug_backtrace()' function.
|
||||
| If you need larger stacktraces, you can increase this number. Setting it to 0 will result in no limit.
|
||||
*/
|
||||
'debug_backtrace_limit' => 50,
|
||||
];
|
||||
189
config/telescope.php
Normal file
189
config/telescope.php
Normal file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Telescope\Http\Middleware\Authorize;
|
||||
use Laravel\Telescope\Watchers;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the subdomain where Telescope will be accessible from. If the
|
||||
| setting is null, Telescope will reside under the same domain as the
|
||||
| application. Otherwise, this value will be used as the subdomain.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('TELESCOPE_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the URI path where Telescope will be accessible from. Feel free
|
||||
| to change this path to anything you like. Note that the URI will not
|
||||
| affect the paths of its internal API that aren't exposed to users.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => env('TELESCOPE_PATH', 'telescope'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Storage Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This configuration options determines the storage driver that will
|
||||
| be used to store Telescope's data. In addition, you may set any
|
||||
| custom options as needed by the particular driver you choose.
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('TELESCOPE_DRIVER', 'database'),
|
||||
|
||||
'storage' => [
|
||||
'database' => [
|
||||
'connection' => env('DB_CONNECTION', 'mysql'),
|
||||
'chunk' => 1000,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Master Switch
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option may be used to disable all Telescope watchers regardless
|
||||
| of their individual configuration, which simply provides a single
|
||||
| and convenient way to enable or disable Telescope data storage.
|
||||
|
|
||||
*/
|
||||
|
||||
'enabled' => env('TELESCOPE_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Route Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These middleware will be assigned to every Telescope route, giving you
|
||||
| the chance to add your own middleware to this list or change any of
|
||||
| the existing middleware. Or, you can simply stick with this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'web',
|
||||
Authorize::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Allowed / Ignored Paths & Commands
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the URI paths and Artisan commands that will
|
||||
| not be watched by Telescope. In addition to this list, some Laravel
|
||||
| commands, like migrations and queue commands, are always ignored.
|
||||
|
|
||||
*/
|
||||
|
||||
'only_paths' => [
|
||||
// 'api/*'
|
||||
],
|
||||
|
||||
'ignore_paths' => [
|
||||
'livewire*',
|
||||
'nova-api*',
|
||||
'pulse*',
|
||||
],
|
||||
|
||||
'ignore_commands' => [
|
||||
//
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Telescope Watchers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following array lists the "watchers" that will be registered with
|
||||
| Telescope. The watchers gather the application's profile data when
|
||||
| a request or task is executed. Feel free to customize this list.
|
||||
|
|
||||
*/
|
||||
|
||||
'watchers' => [
|
||||
Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true),
|
||||
|
||||
Watchers\CacheWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_CACHE_WATCHER', true),
|
||||
'hidden' => [],
|
||||
],
|
||||
|
||||
Watchers\ClientRequestWatcher::class => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true),
|
||||
|
||||
Watchers\CommandWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_COMMAND_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\DumpWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_DUMP_WATCHER', true),
|
||||
'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false),
|
||||
],
|
||||
|
||||
Watchers\EventWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_EVENT_WATCHER', true),
|
||||
'ignore' => [],
|
||||
],
|
||||
|
||||
Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true),
|
||||
|
||||
Watchers\GateWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_GATE_WATCHER', true),
|
||||
'ignore_abilities' => [],
|
||||
'ignore_packages' => true,
|
||||
'ignore_paths' => [],
|
||||
],
|
||||
|
||||
Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true),
|
||||
|
||||
Watchers\LogWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_LOG_WATCHER', true),
|
||||
'level' => 'error',
|
||||
],
|
||||
|
||||
Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true),
|
||||
|
||||
Watchers\ModelWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_MODEL_WATCHER', true),
|
||||
'events' => ['eloquent.*'],
|
||||
'hydrations' => true,
|
||||
],
|
||||
|
||||
Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true),
|
||||
|
||||
Watchers\QueryWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
|
||||
'ignore_packages' => true,
|
||||
'ignore_paths' => [],
|
||||
'slow' => 100,
|
||||
],
|
||||
|
||||
Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true),
|
||||
|
||||
Watchers\RequestWatcher::class => [
|
||||
'enabled' => env('TELESCOPE_REQUEST_WATCHER', true),
|
||||
'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64),
|
||||
'ignore_http_methods' => [],
|
||||
'ignore_status_codes' => [200],
|
||||
],
|
||||
|
||||
Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true),
|
||||
Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true),
|
||||
],
|
||||
];
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use App\Models\User;
|
||||
use Faker\Generator as Faker;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model Factories
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This directory should contain each of the model factory definitions for
|
||||
| your application. Factories provide a convenient way to generate new
|
||||
| model instances for testing / seeding your application's database.
|
||||
|
|
||||
*/
|
||||
|
||||
$factory->define(User::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->name,
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'email_verified_at' => now(),
|
||||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user