commit f8a19c4ac6306efe25e465df1cf4fd0c65d62efd Author: Ibnu hamdani Date: Mon Jul 4 14:02:23 2022 +0700 fisrt commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2ecf9ea --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0090957 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +/vendor +/.idea +Homestead.json +Homestead.yaml +.env +.env.production +.phpunit.result.cache +api-testing.http +bootstrap/backup +.config-prod.json \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..4be9f04 --- /dev/null +++ b/.htaccess @@ -0,0 +1,21 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Handle Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/.styleci.yml b/.styleci.yml new file mode 100644 index 0000000..fcd4cf0 --- /dev/null +++ b/.styleci.yml @@ -0,0 +1,6 @@ +php: + preset: laravel + disabled: + - unused_use +js: true +css: true diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a57708 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# How To Run This Project +Need PHP >= 7.3 +1. Clone this project to your htdocs +2. After clone, run command + ```sh + $ composer install + ``` +3. Then rename .env.example to .env +4. After rename run command + ```sh + $ php artisan key:generate + ``` + and + ```sh + $ php artisan jwt:secret + ``` +6. URL to access the API is + ```sh + `localhost/simpro-lumen/api/${api-url}` + ``` +# Usefull Command +- Create model + ```sh + $ php artisan make:model ModelName + ``` +- Create Controller + ```sh + $ php artisan make:controller ControllerName + ``` +# List Documentation Url +- Query builder + ```sh + https://laravel.com/docs/8.x/queries + ``` +# Lumen PHP Framework + +[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework) +[![Total Downloads](https://img.shields.io/packagist/dt/laravel/framework)](https://packagist.org/packages/laravel/lumen-framework) +[![Latest Stable Version](https://img.shields.io/packagist/v/laravel/framework)](https://packagist.org/packages/laravel/lumen-framework) +[![License](https://img.shields.io/packagist/l/laravel/framework)](https://packagist.org/packages/laravel/lumen-framework) + +Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching. + +## Official Documentation + +Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs). + +## Contributing + +Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). + +## Security Vulnerabilities + +If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. + +## License + +The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Console/Commands/.gitkeep b/app/Console/Commands/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php new file mode 100644 index 0000000..9bafa55 --- /dev/null +++ b/app/Console/Kernel.php @@ -0,0 +1,29 @@ +validate($request, [ + 'user_id' => 'required', + 'description' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = Absent::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Absent successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Absent failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = Absent::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Absent not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Absent successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Absent failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Absent::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Absent not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Absent successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Absent failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Absent::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data Absent, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in golang API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_absensi'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Absent::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Absent, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php new file mode 100644 index 0000000..31fadcf --- /dev/null +++ b/app/Http/Controllers/ActivityController.php @@ -0,0 +1,1443 @@ +count(); + + $dataGantt = []; + if($cekData > 0){ + $dataGantt = $this->getDataActivity($id); + }else{ + $this->templateToActivity($id, $proyek_id); + $dataGantt = $this->getDataActivity($id); + } + + return response()->json(['status'=>'success','data'=>$dataGantt,'code'=>200], 200); + } + + private function getDataActivity($id) + { + $checkHeader = Activity::where('version_gantt_id', $id)->where('type_activity', 'header')->count(); + $finalData = []; + if($checkHeader > 0){ + $dataHeader = Activity::where('version_gantt_id', $id)->where('type_activity', 'header')->first(); + $startDate = date_create($dataHeader->start_date); + $endDate = date_create($dataHeader->end_date); + $dataHeader->start_date = date_format($startDate,"Y-m-d H:i:s"); + $dataHeader->end_date = date_format($endDate,"Y-m-d H:i:s"); + $dataHeader->type = "project"; + $dataHeader->text = $dataHeader->name; + $finalData[] = $dataHeader; + $data = Activity::where('version_gantt_id', $id)->where('parent_id', $dataHeader->id)->orderBy('id', 'asc')->get(); + }else{ + $data = Activity::where('version_gantt_id', $id)->whereNull('parent_id')->orderBy('id', 'asc')->get(); + } + + foreach($data as $objRow){ + $objRow->text = $objRow->name; + if($objRow->parent_id){ + $objRow->parent = $objRow->parent_id; + } + $startDate = date_create($objRow->start_date); + $endDate = date_create($objRow->end_date); + // $objRow->jobs_done = $this->sumVolumeActuall($objRow->id); + $objRow->jobs_done = $this->sumVolumeActualMaterial($objRow->id); + $objRow->assign_hr = $this->getUserActivity($objRow->id); + $objRow->assign_tools = $this->getToolsActivity($objRow->id); + $objRow->assign_material = $this->getMaterialActivity($objRow->id); + $objRow->start_date = date_format($startDate,"Y-m-d H:i:s"); + $objRow->end_date = date_format($endDate,"Y-m-d H:i:s"); + $objRow->planned_start = isset($objRow->planned_start) ? date_format(date_create($objRow->planned_start),"Y-m-d H:i:s") : NULL; + $objRow->planned_end = isset($objRow->planned_end) ? date_format(date_create($objRow->planned_end),"Y-m-d H:i:s") : NULL; + $objRow->progress = (int)$objRow->persentase_progress/100; + $dataChildren = $this->getChildren($id, $objRow->id); + if($objRow->type_activity=="milestone"){ + $objRow->type = $objRow->type_activity; + }else if(empty($dataChildren)){ + $objRow->type = "task"; + }else{ + $objRow->type = "project"; + } + $finalData[] = $objRow; + $finalData = array_merge($finalData, $dataChildren); + } + + $dataLink = Link::where('version_gantt_id', $id)->get(); + $finalLink = []; + foreach($dataLink as $objRow) + { + $dataRow = array( + 'id'=>$objRow->id, + 'source'=>$objRow->s_activity_id, + 'target'=>$objRow->t_activity_id, + 'type'=>$objRow->type_link, + 'code'=>$objRow->code_link + ); + + if($objRow->lag) + { + $dataRow['lag'] = $objRow->lag; + } + + $finalLink[] = $dataRow; + + } + + $resultData = array( + "data"=>$finalData, + "links"=>$finalLink + ); + + return $resultData; + } + + private function getChildren($gantt_id, $parent_id) + { + $finalData = []; + $data = Activity::where('version_gantt_id', $gantt_id)->where('parent_id', $parent_id)->orderBy('id', 'asc')->get(); + foreach($data as $objRow){ + $objRow->parent = $parent_id; + $objRow->text = $objRow->name; + // $objRow->jobs_done = $this->sumVolumeActuall($objRow->id); + $objRow->jobs_done = $this->sumVolumeActualMaterial($objRow->id); + $objRow->assign_hr = $this->getUserActivity($objRow->id); + $objRow->assign_tools = $this->getToolsActivity($objRow->id); + $objRow->assign_material = $this->getMaterialActivity($objRow->id); + $objRow->progress = (int)$objRow->persentase_progress/100; + $startDate = date_create($objRow->start_date); + $endDate = date_create($objRow->end_date); + $objRow->start_date = date_format($startDate,"Y-m-d H:i:s"); + $objRow->end_date = date_format($endDate,"Y-m-d H:i:s"); + $objRow->planned_start = isset($objRow->planned_start) ? date_format(date_create($objRow->planned_start),"Y-m-d H:i:s") : NULL; + $objRow->planned_end = isset($objRow->planned_end) ? date_format(date_create($objRow->planned_end),"Y-m-d H:i:s") : NULL; + $dataChildren = $this->getChildren($gantt_id, $objRow->id); + if($objRow->type_activity=="milestone"){ + $objRow->type = $objRow->type_activity; + }elseif(empty($dataChildren)){ + $objRow->type = "task"; + }else{ + $objRow->type = "project"; + } + $finalData[] = $objRow; + $finalData = array_merge($finalData, $dataChildren); + } + return $finalData; + } + + private function sumVolumeActuall($id) + { + $sumVa = ReportActivity::where("activity_id", $id)->sum("job_count_report"); + return $sumVa; + } + + private function sumVolumeActualMaterial($id) + { + $dataPlan = AssignMaterial::where('activity_id', $id)->get(); + $tmpPercentage1 = []; + // for the case of each material assign + if(!$dataPlan->isEmpty()){ + foreach ($dataPlan as $value) { + // $price = $value->material_id; + $qty_plan = $value->qty_planning; + $status_activity = $value->status_activity; + // get volume actual + $getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty"); + $percentage1 = ($getDataVolActual * 100) / $qty_plan; + if($status_activity == 'done'){ + $tmpPercentage1[] = 100; + } + else{ + $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + } + } + + $totalPercentage = array_sum($tmpPercentage1) > 0 ? array_sum($tmpPercentage1) / count($tmpPercentage1) : 0; + }else{ + + // if(!$dataPlan->isEmpty()){ + // foreach ($dataPlan as $value) { + // $price = $value->material_id; + // $qty_plan = $value->qty_planning; + // $status_activity = $value->status_activity; + // // get volume actual + // $getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty"); + // $percentage1 = ($getDataVolActual * 100) / $qty_plan; + + // if($status_activity == 'done'){ + // $tmpPercentage1[] = 100; + // } + // // else if($status_activity == 'on-progress'){ + // // $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + // // } + // else{ + // $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + // } + // } + // $totalPercentage = array_sum($tmpPercentage1) / count($tmpPercentage1); + // }else{ + $totalPercentage = 0; + } + return $totalPercentage; + } + + private function getUserActivity($id) + { + $data = UserToActivity::select("u.name as name")->join("m_users as u", "u.id", "=", "assign_hr_to_activity.user_id")->where('assign_hr_to_activity.activity_id', $id)->get(); + $nameCollection = []; + foreach($data as $value){ + $nameCollection[] = $value->name; + } + return $nameCollection; + } + + private function getMaterialActivity($id) + { + // $data = AssignMaterial::select("m.name as name")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id)->get(); + $data = AssignMaterial::select("m.description as name")->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id)->get(); + $nameCollection = []; + foreach($data as $value){ + $nameCollection[] = $value->name; + } + return $nameCollection; + } + + private function getToolsActivity($id) + { + $data = AssignTools::select("m.name as name")->join("m_tools_resource as m", "m.id", "=", "assign_tools_to_activity.tools_id")->where('assign_tools_to_activity.activity_id', $id)->get(); + $nameCollection = []; + foreach($data as $value){ + $nameCollection[] = $value->name; + } + return $nameCollection; + } + + private function templateToActivity($id, $proyek_id) + { + $resultProject = Project::find($proyek_id); + $newRencanaBiaya = str_replace(".","", $resultProject->rencana_biaya); + $dataHeader = array( + 'version_gantt_id'=>$id, + 'proyek_id'=>$proyek_id, + 'name'=> $resultProject->nama, + 'kode_sortname'=>$resultProject->kode_sortname, + 'start_date'=> $resultProject->mulai_proyek, + 'end_date'=> $resultProject->akhir_proyek, + 'rencana_biaya'=> $newRencanaBiaya, + 'type_activity'=> 'header', + 'created_by'=>$this->currentName + ); + $newHeader = Activity::create($dataHeader); + + $resultTypeProject = TemplateGantt::where('proyek_type_id',$resultProject->type_proyek_id)->whereNull('parent_id')->orderByRaw('id ASC')->get(); + + $typeProjectId = $resultProject->type_proyek_id; + + foreach($resultTypeProject as $objRow){ + $newActivity = array( + 'version_gantt_id'=>$id, + 'parent_id'=>$newHeader->id, + 'proyek_id'=>$proyek_id, + 'name'=> $objRow->name_activity, + 'start_date'=>date("Y-m-d H:i:s"), + 'end_date'=>date("Y-m-d H:i:s"), + 'created_by'=>$this->currentName + ); + $checkChild = TemplateGantt::where("parent_id", $objRow->id)->count(); + if($checkChild > 0){ + $newActivity['type_activity'] = "project"; + }else{ + $newActivity['type_activity'] = "task"; + } + $resultNew = Activity::create($newActivity); + $this->getChildrenTemplate($id, $objRow->id, $typeProjectId, $proyek_id, $resultNew->id, $resultProject->mulai_proyek); + } + } + + private function getChildrenTemplate($id, $parent_id, $type_proyek_id, $proyek_id, $parent_new, $firstDay) + { + $data = TemplateGantt::where('proyek_type_id', $type_proyek_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); + foreach($data as $objRow){ + $newActivity = array( + 'version_gantt_id'=>$id, + 'parent_id'=>$parent_new, + 'proyek_id'=>$proyek_id, + 'name'=> $objRow->name_activity, + 'start_date'=>$firstDay, + 'end_date'=>$firstDay, + 'created_by'=>$this->currentName + ); + $checkChild = TemplateGantt::where("parent_id", $objRow->id)->count(); + if($checkChild > 0){ + $newActivity['type_activity'] = "project"; + }else{ + $newActivity['type_activity'] = "task"; + } + $resultNew = Activity::create($newActivity); + $this->getChildrenTemplate($id, $objRow->id, $type_proyek_id, $proyek_id, $resultNew->id, $firstDay); + } + } + + public function add(Request $request) + { + $this->validate($request, [ + 'version_gantt_id'=>'required' + ]); + + $data = $request->all(); + $data['name'] = $request->text; + $data['persentase_progress'] = $request->progress; + $data['created_by'] = $this->currentName; + $data['type_activity'] = "task"; + + $parent = isset($data['parent_id']) ? $data['parent_id'] : null; + if($parent && $parent > 0){ + $this->updateTypeProject($parent); + $comment = CommentActivity::where('activity_id', $parent)->delete(); + $hr = UserToActivity::where('activity_id', $parent)->delete(); + } + + $result = Activity::create($data); + + if($result){ + return response()->json(['status'=>'success','action'=>'inserted', 'tid'=>$result->id,'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','action'=>'error','code'=>400], 400); + } + } + + private function updateTypeProject($id) + { + Activity::find($id)->update(["type_activity"=>"project"]); + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Activity::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data activity, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'id is required!','code'=>400], 400); + } + + $data = Activity::find($id); + $oldRencanaBiaya = (int)$data->rencana_biaya; + $newRencanaBiaya = (int)$request->rencana_biaya; + if($oldRencanaBiaya==$newRencanaBiaya){ + $updateBobot = false; + }else{ + $updateBobot = true; + } + $parent = $data->parent_id; + $dataUpdate = $request->all(); + $dataUpdate['name'] = $request->text; + $dataUpdate['persentase_progress'] = $request->progress*100; + $dataUpdate['updated_by'] = $this->currentName; + if($data->type_activity!='header'){ + $dataUpdate['type_activity'] = $request->type; + } + if($data){ + $upactual = false; + $result = $data->update($dataUpdate); + if($result){ + if($parent && (int)$parent > 0){ + $this->updateCostPlanning($parent); + $this->updatePersentaseProgress($parent); + $this->updateCostActual($parent); + } + + $this->calculateAllBobot($data->proyek_id, $data->version_gantt_id); + + return response()->json(['status'=>'success','update_bobot'=>$updateBobot,'data'=>$dataUpdate, 'action'=>'updated','message'=>'data activity successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'data activity failed updated!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'data activity not found!','code'=>400], 400); + die(); + } + } + + public function updateRegular(Request $request, $id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Activity::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data activity not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data activity successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data activity failed updated!','code'=>400], 400); + } + } + + private function calculateAllBobot($proyek, $gantt) + { + $checkHeader = Activity::where('version_gantt_id', $gantt)->where("proyek_id", $proyek)->where('type_activity', 'header')->count(); + if($checkHeader > 0){ + $dataHeader = Activity::where('version_gantt_id', $gantt)->where("proyek_id", $proyek)->where('type_activity', 'header')->first(); + $totalCost = Activity::select(DB::raw('sum(cast(rencana_biaya as double precision))'))->where("proyek_id", $proyek)->where("version_gantt_id", $gantt)->where("parent_id", $dataHeader->id)->first(); + }else{ + $totalCost = Activity::select(DB::raw('sum(cast(rencana_biaya as double precision))'))->where("proyek_id", $proyek)->where("version_gantt_id", $gantt)->whereNull("parent_id")->first(); + } + $totalCost = $totalCost->sum; + // var_dump($totalCost); + if($totalCost > 0){ + $activitys = Activity::where("proyek_id", $proyek)->where("version_gantt_id", $gantt)->get(); + foreach ($activitys as $activity) { + $bobot = ((int)$activity->rencana_biaya/$totalCost)*100; + $willUpdated = Activity::find($activity->id); + $dataUpdate = array( + "bobot_planning"=>$bobot, + "updated_by"=>$this->currentName + ); + $willUpdated->update($dataUpdate); + } + } + return true; + } + + public function delete($id) + { + $data = Activity::find($id); + + if($data){ + $parent = $data->parent_id; + if($parent && (int)$parent > 0){ + $this->checkForUpdateParent($parent); + $this->updateCostPlanning($parent); + $this->updatePersentaseProgress($parent); + $this->updateCostActual($parent); + } + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'data activity not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success', "action"=>"deleted",'message'=>'data activity successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'data activity failed deleted!','code'=>400], 400); + } + } + + private function checkForUpdateParent($id) + { + $count = Activity::where("parent_id", $id)->count(); + if(!$count || $count==0){ + Activity::find($id)->update(["type_activity"=>"task"]); + } + } + + public function getUpdate($id) + { + $data = Activity::find($id); + if($data){ + $data->progress = (int)$data->persentase_progress/100; + // $data->jobs_done = $this->sumVolumeActuall($data->id); + $data->jobs_done = $this->sumVolumeActualMaterial($data->id); + $data->assign_hr = $this->getUserActivity($data->id); + $data->assign_tools = $this->getToolsActivity($data->id); + $data->assign_material = $this->getMaterialActivity($data->id); + return response()->json(['status'=>'success', "data"=> $data,'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'data activity not found!','code'=>400], 400); + } + } + + private function updateCostPlanning($id) + { + $sumBiaya = Activity::select(DB::raw('sum(cast(rencana_biaya as double precision))'))->where("parent_id", $id)->first(); + $dataActivity = Activity::find($id); + $dataUpdate = array( + "rencana_biaya" => $sumBiaya->sum, + "updated_by" => $this->currentName + ); + $dataActivity->update($dataUpdate); + if($dataActivity){ + $parent = $dataActivity->parent_id; + if($parent && (int)$parent > 0){ + $this->updateCostPlanning($parent); + } + } + } + + private function calculateProgress($id) + { + $sumBobot = Activity::where("parent_id", $id)->sum("bobot_planning"); + $dataActivity = Activity::find($id); + // 30 - 20 + $restBobot = $dataActivity->bobot_planning - $sumBobot; + return $restBobot; + // if($dataActivity){ + // $parent = $dataActivity->parent_id; + // if($parent && (int)$parent > 0){ + // $this->updateBobotProgress($parent); + // } + // } + } + + private function updatePersentaseProgress($id) + { + $sumProgress = Activity::where("parent_id", $id)->sum("persentase_progress"); + $totalChild = Activity::where("parent_id", $id)->count(); + // $sumProgress = $sumProgress/$totalChild; + $dataActivity = Activity::find($id); + $calculateProgressActual = $sumProgress/$totalChild; + $dataUpdate = array( + "persentase_progress" => $calculateProgressActual, + "updated_by" => $this->currentName + ); + $dataActivity->update($dataUpdate); + if($dataActivity){ + $parent = $dataActivity->parent_id; + if($parent && (int)$parent > 0){ + $this->updatePersentaseProgress($parent); + } + } + } + + private function updateCostActual($id) + { + $biayaActual = Activity::where("parent_id", $id)->sum("biaya_actual"); + $dataActivity = Activity::find($id); + + $dataUpdate = array( + "biaya_actual" => $biayaActual, + "updated_by" => $this->currentName + ); + // Activity::where("id", $id)->update($dataUpdate); + $dataActivity->update($dataUpdate); + if($dataActivity){ + $parent = $dataActivity->parent_id; + if($parent && (int)$parent > 0){ + $this->updateCostActual($parent); + } + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + // not used move to Controller.php + public function calculateAllCost($activity_id, $proyek_id) + { + $humanCostPlanning = $this->calculateHuman($activity_id, $proyek_id); + $materialCostPlanning = 0; + $toolsCostPlanning = 0; + + $allCost = $humanCostPlanning + $materialCostPlanning + $toolsCostPlanning; + return $allCost; + } + + private function calculateHuman($activity_id, $proyek_id) + { + $dataHuman = UserToActivity::select("ahp.standart_rate as standart_rate","ahp.max_used as max_used", "ahp.cost_per_used as cost_per_used", "ahp.uom_standart_rate as uom_standart_rate")->leftJoin("assign_hr_to_proyek as ahp", "assign_hr_to_activity.user_id", "=", "ahp.user_id") + ->where("assign_hr_to_activity.activity_id", $activity_id)->where("assign_hr_to_activity.proyek_id", $proyek_id) + ->where("ahp.proyek_id", $proyek_id) + ->get(); + + $totalCost = 0; + foreach ($dataHuman as $human) { + $uom = $human->uom_standart_rate; + $totalCost += $this->calculateHumanCost($human, $activity_id); + // if(strtolower($uom)=="day"){ + // $totalCost += $this->calculateHumanDay($human, $activity_id); + // }else{ + // $totalCost += $this->calculateHumanHours($human, $activity_id, $proyek_id); + // } + } + + return $totalCost; + } + + private function calculateHumanCost($human, $activity_id) + { + $activity = Activity::find($activity_id); + $duration = $activity->duration; + // $costPerUsed = $human->cost_per_used; + $standarRate = $human->standart_rate; + $maxUsed = $human->max_used/100; + $totalCost = ($standarRate*$duration)*$maxUsed; + return $totalCost; + } + + private function calculateHumanDay($human, $activity_id) + { + $activity = Activity::find($activity_id); + $duration = $activity->duration; + // $costPerUsed = $human->cost_per_used; + $standarRate = $human->standart_rate; + $maxUsed = $human->max_used/100; + $totalCost = ($standarRate*$duration)*$maxUsed; + return $totalCost; + } + + private function calculateHumanHours($human, $activity_id, $proyek_id) + { + $hours = OfficeHours::where("proyek_id", $proyek_id)->first(); + $activity = Activity::find($activity_id); + $ganttId = $activity->version_gantt_id; + $verGantt = VersionGantt::find($ganttId); + $holiday = Holiday::where("version_gantt_id", $ganttId)->where("proyek_id", $proyek_id)->pluck("date"); + $dateHoliday = $holiday->all(); + $configOff = $verGantt->config_dayoff; + if($configOff && $configOff!= ""){ + $dayOff = explode(",", $verGantt->config_dayoff); + $dayOff = array_map( + function($value) { return (int)$value; }, + $dayOff + ); + }else{ + $dayOff = []; + } + $begin = new \DateTime($activity->start_date); + $end = new \DateTime($activity->end_date); + $end = $end->modify( '+1 day' ); + $interval = \DateInterval::createFromDateString('1 day'); + $period = new \DatePeriod($begin, $interval, $end); + $totalCost = 0; + foreach ($period as $dt) { + $weekDay = $dt->format("w"); + $currentDay = $dt->format("Y-m-d"); + if(!in_array($weekDay, $dayOff) && !in_array($currentDay, $dateHoliday)) + { + $totalHours = $this->getHourInDay($hours, $weekDay); + $standarRate = $human->standart_rate; + $maxUsed = $human->max_used/100; + $totalCost += ($standarRate*$totalHours)*$maxUsed; + // $costPerUsed = $human->cost_per_used; + } + } + return $totalCost; + } + + private function getHourInDay($hours, $day) + { + $totalHours = 0; + switch ($day) { + case 1: + $totalHours = ceil(abs(((strtotime($hours->monday_end)-strtotime($hours->monday_start))/60)/60)); + break; + case 2: + $totalHours = ceil(abs(((strtotime($hours->tuesday_end)-strtotime($hours->tuesday_start))/60)/60)); + break; + case 3: + $totalHours = ceil(abs(((strtotime($hours->wednesday_end)-strtotime($hours->wednesday_start))/60)/60)); + break; + case 4: + $totalHours = ceil(abs(((strtotime($hours->thursday_end)-strtotime($hours->thursday_start))/60)/60)); + break; + case 5: + $totalHours = ceil(abs(((strtotime($hours->friday_end)-strtotime($hours->friday_start))/60)/60)); + break; + case 6: + $totalHours = ceil(abs(((strtotime($hours->saturday_end)-strtotime($hours->saturday_start))/60)/60)); + break; + default: + $totalHours = ceil(abs(((strtotime($hours->sunday_end)-strtotime($hours->sunday_start))/60)/60)); + break; + } + return $totalHours; + } + + private function calculateMaterial($activity_id, $proyek_id) + { + $totalCost = AssignMaterial::selectRaw("ISNULL(qty_planning,0)*ISNULL(budget,0) as totalCost")->where("proyek_id", $proyek_id)->where("activity_id", $activity_id)->sum("totalCost"); + return $totalCost; + } + + private function calculateTools($activity_id, $proyek_id) + { + + } + + public function getPercentagePerDay(Request $request) + { + $dataPayload = $request->all(); + $allGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $allGantt[] = $this->getMaxVersionGantt($val); + } + + $dataFinal=[]; + foreach ($allGantt as $val) { + $dataProject = Project::find($val['proyek_id']); + $holidays = Holiday::where("version_gantt_id", $val['last_gantt_id'])->where("proyek_id", $val['proyek_id'])->get(); + $dateHoliday = []; //$holiday->all(); + foreach ($holidays as $holiday) { + $startH = new \DateTime($holiday->date); + $endH = clone $startH; + $endH->modify('+'.$holiday->duration.' day'); + // $end = $startH->modify( '+1 day' ); + $intervalH = \DateInterval::createFromDateString('1 day'); + $periodH = new \DatePeriod($startH, $intervalH, $endH); + foreach ($periodH as $dt) { + $dateHoliday[] = $dt->format("Y-m-d"); + } + } + $verGantt = VersionGantt::find($val['last_gantt_id']); + $configOff = $verGantt->config_dayoff; + if($configOff && $configOff!= ""){ + $dayOff = explode(",", $verGantt->config_dayoff); + $dayOff = array_map( + function($value) { return (int)$value; }, + $dayOff + ); + }else{ + $dayOff = []; + } + // $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get(); + $checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count(); + if($checkHeader > 0){ + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + $minDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + }else{ + $minDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + } + + $begin = new \DateTime($minDate); + $end = new \DateTime($maxDate); + $end = $end->modify( '+1 day' ); + $interval = \DateInterval::createFromDateString('1 day'); + $period = new \DatePeriod($begin, $interval, $end); + $checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count(); + if($checkHeader > 0){ + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as integer))'))->where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + }else{ + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as integer))'))->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + } + + $totalRencanaBudget = $totalRencanaBudget->sum; + // $dataPercentage = []; + $currentPercentage = 0; + $dataDate = []; + $dataPercen = []; + foreach ($period as $dt) { + $weekDay = $dt->format("w"); + $currentDate = $dt->format("Y-m-d"); + if(!in_array($weekDay, $dayOff) && !in_array($currentDate, $dateHoliday)) + { + $totalPercentage = 0; + $checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count(); + if($checkHeader > 0){ + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date)")->where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get(); + }else{ + $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date)")->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get(); + } + + foreach ($dataActivity as $activity) { + $duration = $activity->duration; + if($totalRencanaBudget > 0 && $duration > 0){ + $totalPercentage = $totalPercentage + ((($activity->rencana_biaya/$totalRencanaBudget)*100)/$duration); + } + // $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100; + } + $currentPercentage = $currentPercentage + $totalPercentage; + // $dataPercentage[] = array( + // "date" => $currentDate, + // "percentage"=> $currentPercentage + // ); + $dataDate[] = $currentDate; + $dataPercen[] = $currentPercentage; + }else{ + // $dataPercentage[] = array( + // "date" => $currentDate, + // "percentage"=> "dateOff" + // ); + $dataDate[] = $currentDate; + $dataPercen[] = "dateOff"; + } + } + $dataPercentage = array( + "date"=>$dataDate, + "percentage"=>$dataPercen + ); + $dataFinal[] = array( + "proyek_name"=> $dataProject->nama, + "data"=>$dataPercentage + ); + } + + if($dataFinal){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list percentage day, please try again later!','code'=>400], 400); + } + } + + + public function getCalculateCurvaS(Request $request) // for adw (plan & actual == date) + { + $dataPayload = $request->all(); + $allGantt = []; + if(isset($dataPayload['gannt_id'])){ + $allGantt = $dataPayload['gannt_id']; + }else{ + foreach ($dataPayload['project_id'] as $val) { + $allGantt[] = $this->getMaxVersionGantt($val); + } + } + $dataFinal=[]; + foreach ($allGantt as $keyGantt) { + $dataProject = Project::find($keyGantt['proyek_id']); + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first(); + + // $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + if($dataHeader){ + $totalRencanaBudget = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya"); + // $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first(); + }else{ + $totalRencanaBudget = Activity::whereNull('parent_id')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya"); + + // $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->whereNull('parent_id')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first(); + } + + $minDate = DB::table('assign_material_to_activity as ama') + ->where("ama.proyek_id", $keyGantt['proyek_id']) + ->join('m_activity as a', 'a.id', '=', 'ama.activity_id') + ->where('a.version_gantt_id', '=', $keyGantt['last_gantt_id']) + ->min("plan_date"); + + $maxDate = DB::table('assign_material_to_activity as ama') + ->where("ama.proyek_id", $keyGantt['proyek_id']) + ->join('m_activity as a', 'a.id', '=', 'ama.activity_id') + ->where('a.version_gantt_id', '=', $keyGantt['last_gantt_id']) + ->max("plan_date"); + + $begin = new \DateTime($minDate); + $end = new \DateTime($maxDate); + $end2 = new \DateTime($maxDate); + // $end2 = $end2->modify( '-1 day' ); + $interval = \DateInterval::createFromDateString('1 day'); + $period = new \DatePeriod($begin, $interval, $end); + // week 1 == monday + $arr_ActualM = []; + $tempDate = []; + $tempPercentage = []; + $tempTtlPercentPlan=0; + $tempTtlPercentActual=0; + // $date_week = + // $lastKey = array_key_last($period); + + $currentACWP = 0; + $budgetControlACWP = 0; + $currentProgressActivity = 0; + $currentBCWP = 0; + $budgetControlBCWP = 0; + + foreach ($period as $dt) { + $dataPlanM = DB::table('assign_material_to_activity as ama') + ->select('ama.activity_id', 'ama.qty_planning', 'ama.plan_date', 'ama.start_activity', 'a.bobot_planning', 'a.biaya_actual', 'a.duration', 'a.persentase_progress') + ->join('m_activity as a', 'a.id', '=', 'ama.activity_id') + ->where('ama.proyek_id', '=', $keyGantt['proyek_id']) + ->where('a.version_gantt_id', '=', $keyGantt['last_gantt_id']) + ->whereDate('ama.plan_date', $dt->format("Y-m-d")) + ->get(); + $dataActualM = DB::table('report_activity_material as ram') + ->select('ram.activity_id', 'ram.qty', 'ram.report_date', 'a.bobot_planning', 'a.biaya_actual', 'a.duration', 'a.persentase_progress') + ->join('m_activity as a', 'a.id', '=', 'ram.activity_id') + ->where('a.version_gantt_id', '=', $keyGantt['last_gantt_id']) + ->where('a.proyek_id', '=', $keyGantt['proyek_id']) + ->whereDate('ram.report_date', $dt->format("Y-m-d")) + ->get(); + $dataTempPlan = []; + $x = 0; + $sumPercentagePlan=0; + $totalACWP = isset($totalACWP) ? $totalACWP : 0; + $totalBCWP = isset($totalBCWP) ? $totalBCWP : 0; + + foreach ($dataPlanM as $keyPlanM) { + $sumVolPlan = DB::table('assign_material_to_activity') + ->select('activity_id', DB::raw('SUM(qty_planning) as ttl_qty_plan')) + ->where('activity_id', '=', $keyPlanM->activity_id) + ->groupBy('activity_id') + ->first(); + $dataTempPlan [$x]['activity_id'] = $keyPlanM->activity_id; + $dataTempPlan [$x]['qty_plan'] = $keyPlanM->qty_planning; + $dataTempPlan [$x]['plan_date'] = $keyPlanM->plan_date; + $dataTempPlan [$x]['start_activity'] = $keyPlanM->start_activity; + $dataTempPlan [$x]['bobot_planning'] = $keyPlanM->bobot_planning; + $dataTempPlan [$x]['ttl_plan'] = $sumVolPlan->ttl_qty_plan; + $dataTempPlan [$x]['biaya_actual'] = $keyPlanM->biaya_actual; + $dataTempPlan [$x]['duration'] = $keyPlanM->duration; + $dataTempPlan [$x]['persentase_progress'] = $keyPlanM->persentase_progress; + $dataTempPlan [$x]['percentage'] = ($keyPlanM->qty_planning/$sumVolPlan->ttl_qty_plan)*$keyPlanM->bobot_planning; + $sumPercentagePlan+=($keyPlanM->qty_planning/$sumVolPlan->ttl_qty_plan)*$keyPlanM->bobot_planning; + $totalBCWP += (((($keyPlanM->persentase_progress*$keyPlanM->bobot_planning)/100)/$keyPlanM->duration)* $totalRencanaBudget)/100; + $dataTempPlan [$x]['totalBCWP'] = $totalBCWP; + $x++; + } + + $w = 0; + $dataTempReport = []; + $sumPercentageActual=0; + foreach ($dataActualM as $keyActualM) { + $sumVolActual = DB::table('assign_material_to_activity') + ->select('activity_id', DB::raw('SUM(qty_planning) as ttl_qty_plan')) + ->where('activity_id', '=', $keyActualM->activity_id) + ->groupBy('activity_id') + ->first(); + $dataTempReport [$w]['activity_id'] = $keyActualM->activity_id; + $dataTempReport [$w]['qty'] = $keyActualM->qty; + $dataTempReport [$w]['report_date'] = $keyActualM->report_date; + $dataTempReport [$w]['bobot_planning'] = $keyActualM->bobot_planning; + $dataTempReport [$w]['ttl_plan'] = $sumVolActual->ttl_qty_plan; + $dataTempReport [$w]['biaya_actual'] = $keyActualM->biaya_actual; + $dataTempReport [$w]['duration'] = $keyActualM->duration; + $dataTempReport [$w]['persentase_progress'] = $keyActualM->persentase_progress; + $dataTempReport [$w]['percentage'] = ($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + $totalACWP += $keyActualM->biaya_actual/$keyActualM->duration; + $dataTempReport [$w]['totalacwp'] = $totalACWP; + $w++; + } + + $arr_ActualM[] = array( + 'date'=>$dt->format("Y-m-d"), + 'percentPlan'=>$sumPercentagePlan, + 'percentActual'=>$sumPercentageActual, + 'plan'=>$dataTempPlan, + 'actual'=>$dataTempReport, + ); + // week, every monday (code 1) + if(isset($dataPayload['period']) && $dataPayload['period'] == 'week'){ + if($dt->format("w")==1){ + if($totalACWP > 0 ){ + $budgetControlACWP = $currentACWP + $totalACWP; + } + if($totalBCWP > 0 ){ + $budgetControlBCWP = $currentBCWP + $totalBCWP; + } + + $tempTtlPercentPlan+= $sumPercentagePlan; + $tempTtlPercentActual+= $sumPercentageActual; + $currentACWP += $totalACWP; + $currentBCWP += $totalBCWP; + + $tempPercentage[] = array(round($tempTtlPercentPlan,2), round($tempTtlPercentActual,2)); + // $tempDate[] = array($dt->format("Y-m-d"), round($currentACWP,2), round($currentBCWP,2)); + $tempDate[] = array($dt->format("Y-m-d"), 0, 0); + // $tempTtlPercentPlan = 0; + // $tempTtlPercentActual = 0; + }else if($dt->format("Y-m-d") == $end2->format("Y-m-d")) { + $tempTtlPercentPlan+= $sumPercentagePlan; + $tempTtlPercentActual+= $sumPercentageActual; + $currentACWP += $totalACWP; + $currentBCWP += $totalBCWP; + + $tempPercentage[] = array(round($tempTtlPercentPlan,2), round($tempTtlPercentActual,2)); + // $tempDate[] = array($dt->format("Y-m-d"), round($currentACWP,2), round($currentBCWP,2)); + $tempDate[] = array($dt->format("Y-m-d"), 0, 0); + $tempTtlPercentPlan = 0; + $tempTtlPercentActual = 0; + } + // else everyday + }else{ + $tempPercentage[] = array(round($sumPercentagePlan,2), round($sumPercentageActual,2)); + $tempDate[] = array($dt->format("Y-m-d"), 0, 0); + // $tempDate[] = array($dt->format("w"), 0, 0); + } + } + + if(round($totalACWP,0) > $totalRencanaBudget){ + $estimatedCost = round($totalACWP,0)+0; + }else{ + $estimatedCost = ($totalRencanaBudget+0); + } + $costDeviation = $totalRencanaBudget - $estimatedCost; + + $dataResponse = array( + "date" =>$tempDate, + "percentage" =>$tempPercentage, + "data_details" =>$arr_ActualM, + "budget_control" =>array("current_budget"=> $totalRencanaBudget, + "acwp" => round($totalACWP,0), + "bcwp" => round($totalBCWP,0), + "rem_to_complete" => ($totalRencanaBudget - round($totalACWP,0)), + "add_cost_to_complete" => 0, + "estimated_at_completion" => $estimatedCost, + "cost_deviation" => $costDeviation, + "potential" => $costDeviation > 0 ? "SAVING" : $costDeviation == 0 ? "ON BUDGET" : "OVERRUN" + ) + // "budget_control" =>array("current_budget"=> $totalRencanaBudget, + // "acwp" => round($budgetControlACWP,0), + // "bcwp" => round($budgetControlBCWP,0), + // "rem_to_complete" => ($totalRencanaBudget - round($budgetControlACWP,0)), + // "add_cost_to_complete" => 0, + // "estimated_at_completion" => $estimatedCost, + // "cost_deviation" => $costDeviation, + // "potential" => $costDeviation > 0 ? "SAVING" : $costDeviation == 0 ? "ON BUDGET" : "OVERRUN" + // ) + ); + + $dataFinal[] = array( + "proyek_name"=> $dataProject->nama, + "data"=>$dataResponse, + "allGant"=>$allGantt + ); + } + + return response()->json(['status'=>'success','code'=>200, 'data' => $dataFinal], 200); + + } + + public function getCalculateCurvaSBackup(Request $request) + { + $dataPayload = $request->all(); + $allGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $allGantt[] = $this->getMaxVersionGantt($val); + } + + $dataFinal=[]; + foreach ($allGantt as $val) { + $dataProject = Project::find($val['proyek_id']); + $holidays = Holiday::where("version_gantt_id", $val['last_gantt_id'])->where("proyek_id", $val['proyek_id'])->get(); + $dateHoliday = []; //$holiday->all(); + foreach ($holidays as $holiday) { + $startH = new \DateTime($holiday->date); + $endH = clone $startH; + $endH->modify('+'.$holiday->duration.' day'); + // $end = $startH->modify( '+1 day' ); + $intervalH = \DateInterval::createFromDateString('1 day'); + $periodH = new \DatePeriod($startH, $intervalH, $endH); + foreach ($periodH as $dt) { + $dateHoliday[] = $dt->format("Y-m-d"); + } + } + $verGantt = VersionGantt::find($val['last_gantt_id']); + $configOff = $verGantt->config_dayoff; + if($configOff && $configOff!= ""){ + $dayOff = explode(",", $verGantt->config_dayoff); + $dayOff = array_map( + function($value) { return (int)$value; }, + $dayOff + ); + }else{ + $dayOff = []; + } + // $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get(); + $checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count(); + if($checkHeader > 0){ + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + $minDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + }else{ + $minDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + } + + $begin = new \DateTime($minDate); + $end = new \DateTime($maxDate); + $end2 = new \DateTime($maxDate); + $end2 = $end2->modify( '-1 day' ); + $interval = \DateInterval::createFromDateString('1 day'); + $period = new \DatePeriod($begin, $interval, $end); + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + if($dataHeader){ + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + }else{ + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + } + + + $totalRencanaBudget = $totalRencanaBudget->sum; + // $dataPercentage = []; + $currentPercentage = 0; + $currentACWP = 0; + $budgetControlACWP = 0; + $currentProgressActivity = 0; + $currentBCWP = 0; + $budgetControlBCWP = 0; + $dataDate = []; + $dataPercen = []; + $testdata = []; + $countWeek = 0; + foreach ($period as $dt) { + $weekDay = $dt->format("w"); + $currentDate = $dt->format("Y-m-d"); + // $testdata1 = []; + $testdata[] = array('weekday' => $weekDay, 'date' =>$currentDate, 'dayof' => $dayOff); + + $totalPercentage = isset($totalPercentage) ? $totalPercentage : 0; + $totalACWP = isset($totalACWP) ? $totalACWP : 0; + $totalProgressActivity = isset($totalProgressActivity) ? $totalProgressActivity : 0; + $totalBCWP = isset($totalBCWP) ? $totalBCWP : 0; + + if(!in_array($weekDay, $dayOff) && !in_array($currentDate, $dateHoliday)) + { + $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date) - INTERVAL '1 DAY'")->where('type_activity', 'task')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get(); + foreach ($dataActivity as $activity) { + + $duration = $activity->duration; + if($totalRencanaBudget > 0 && $duration > 0){ + $totalPercentage += $activity->bobot_planning/$duration; + if($activity->biaya_actual > 0 && $activity->persentase_progress){ + $totalACWP += $activity->biaya_actual/$duration; + $totalProgressActivity += (($activity->persentase_progress*$activity->bobot_planning)/100)/$duration; + $totalBCWP += (((($activity->persentase_progress*$activity->bobot_planning)/100)/$duration)* $totalRencanaBudget)/100; + } + } + // $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100; + } + // $dateMax = date_format(date_create($maxDate), "Y-m-d") + // $dateMax->modify("-1 day"); + + + } + + if($currentDate == $end2->format('Y-m-d')){ + $currentPercentage = round(($currentPercentage + $totalPercentage), 0); + if($totalACWP > 0 ){ + $budgetControlACWP = $currentACWP + $totalACWP; + } + if($totalBCWP > 0 ){ + $budgetControlBCWP = $currentBCWP + $totalBCWP; + } + $currentACWP = $totalACWP == 0 ? null : $currentACWP + $totalACWP; + $currentProgressActivity = $totalProgressActivity == 0 ? null : round(($currentProgressActivity + $totalProgressActivity),0); + + $currentBCWP = $totalBCWP == 0 ? null :$currentBCWP + $totalBCWP; + $currentPercentage = $currentPercentage > 100 ? 100 : $currentPercentage; + $currentProgressActivity = $currentProgressActivity > 100 ? 100 : $currentProgressActivity; + + + $dataDate[] = array($currentDate, round($currentBCWP,0), round($currentACWP,0)); + $dataPercen[] = array($currentPercentage, $currentProgressActivity); + + $totalPercentage = 0; + $totalACWP = 0; + $totalProgressActivity = 0; + $totalBCWP = 0; + }else if($weekDay == "0"){ + $currentPercentage = round(($currentPercentage + $totalPercentage), 0); + if($totalACWP > 0 ){ + $budgetControlACWP = $currentACWP + $totalACWP; + } + if($totalBCWP > 0 ){ + $budgetControlBCWP = $currentBCWP + $totalBCWP; + } + $currentACWP = $totalACWP == 0 ? null : $currentACWP + $totalACWP; + $currentProgressActivity = $totalProgressActivity == 0 ? null : round(($currentProgressActivity + $totalProgressActivity),0); + + $currentBCWP = $totalBCWP == 0 ? null :$currentBCWP + $totalBCWP; + $currentPercentage = $currentPercentage > 100 ? 100 : $currentPercentage; + $currentProgressActivity = $currentProgressActivity > 100 ? 100 : $currentProgressActivity; + + + $dataDate[] = array($currentDate, round($currentBCWP,0), round($currentACWP,0)); + $dataPercen[] = array($currentPercentage, $currentProgressActivity); + + $totalPercentage = 0; + $totalACWP = 0; + $totalProgressActivity = 0; + $totalBCWP = 0; + } + // else{ + // $dataDate[] = $currentDate; + // // $dataPercen[] = null; + // $dataPercen[] = array($currentPercentage,$currentProgressActivity); + // } + } + if(round($budgetControlACWP,0) > $totalRencanaBudget){ + $estimatedCost = round($budgetControlACWP,0)+0; + }else{ + $estimatedCost = ($totalRencanaBudget+0); + } + $costDeviation = $totalRencanaBudget - $estimatedCost; + + $dataResponse = array( + "date" =>$dataDate, + "percentage" =>$dataPercen, + "budget_control" =>array("current_budget"=> $totalRencanaBudget, + "acwp" => round($budgetControlACWP,0), + "bcwp" => round($budgetControlBCWP,0), + "rem_to_complete" => ($totalRencanaBudget - round($budgetControlACWP,0)), + "add_cost_to_complete" => 0, + "estimated_at_completion" => $estimatedCost, + "cost_deviation" => $costDeviation, + "potential" => $costDeviation > 0 ? "SAVING" : $costDeviation == 0 ? "ON BUDGET" : "OVERRUN" + ) + ); + $dataFinal[] = array( + "proyek_name"=> $dataProject->nama, + "data"=>$dataResponse + ); + } + + if($dataFinal){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'test' => array('current'=>$currentDate,'max' =>$end2->format('Y-m-d')), 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list percentage day, please try again later!','code'=>400], 400); + } + } + + public function getCalculateCurvaSDays(Request $request) + { + $dataPayload = $request->all(); + $allGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $allGantt[] = $this->getMaxVersionGantt($val); + } + + $dataFinal=[]; + foreach ($allGantt as $val) { + $dataProject = Project::find($val['proyek_id']); + $holidays = Holiday::where("version_gantt_id", $val['last_gantt_id'])->where("proyek_id", $val['proyek_id'])->get(); + $dateHoliday = []; //$holiday->all(); + foreach ($holidays as $holiday) { + $startH = new \DateTime($holiday->date); + $endH = clone $startH; + $endH->modify('+'.$holiday->duration.' day'); + // $end = $startH->modify( '+1 day' ); + $intervalH = \DateInterval::createFromDateString('1 day'); + $periodH = new \DatePeriod($startH, $intervalH, $endH); + foreach ($periodH as $dt) { + $dateHoliday[] = $dt->format("Y-m-d"); + } + } + $verGantt = VersionGantt::find($val['last_gantt_id']); + $configOff = $verGantt->config_dayoff; + if($configOff && $configOff!= ""){ + $dayOff = explode(",", $verGantt->config_dayoff); + $dayOff = array_map( + function($value) { return (int)$value; }, + $dayOff + ); + }else{ + $dayOff = []; + } + // $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get(); + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + if($dataHeader){ + $minDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + }else{ + $minDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date"); + $maxDate = Activity::whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->max("end_date"); + } + + $begin = new \DateTime($minDate); + $end = new \DateTime($maxDate); + // $end = $end->modify( '+1 day' ); + $interval = \DateInterval::createFromDateString('1 day'); + $period = new \DatePeriod($begin, $interval, $end); + $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + if($dataHeader){ + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as integer))'))->where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + }else{ + $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as integer))'))->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first(); + } + + $totalRencanaBudget = $totalRencanaBudget->sum; + // $dataPercentage = []; + $currentPercentage = 0; + $currentACWP = 0; + $currentProgressActivity = 0; + $currentBCWP = 0; + $dataDate = []; + $dataPercen = []; + $testdata = []; + foreach ($period as $dt) { + $weekDay = $dt->format("w"); + $currentDate = $dt->format("Y-m-d"); + // $testdata1 = []; + $testdata[] = array('weekday' => $weekDay, 'date' =>$currentDate); + if(!in_array($weekDay, $dayOff) && !in_array($currentDate, $dateHoliday)) + { + $totalPercentage = 0; + $totalACWP = 0; + $totalProgressActivity = 0; + $totalBCWP = 0; + // $dataActivitycount = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date)")->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count('duration'); + // $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date) - INTERVAL '1 DAY'")->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get(); + $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date) - INTERVAL '1 DAY'")->where('type_activity', 'task')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get(); + // $testdata[] = array('data'=>$dataActivity, 'date' => $currentDate); + foreach ($dataActivity as $activity) { + + $duration = $activity->duration; + if($totalRencanaBudget > 0 && $duration > 0){ + $totalPercentage += $activity->bobot_planning/$duration; + if($activity->biaya_actual > 0 && $activity->persentase_progress){ + $totalACWP += $activity->biaya_actual/$duration; + $totalProgressActivity += (($activity->persentase_progress*$activity->bobot_planning)/100)/$duration; + $totalBCWP += (((($activity->persentase_progress*$activity->bobot_planning)/100)/$duration)* $totalRencanaBudget)/100; + } + } + // $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100; + } + + $currentPercentage = round(($currentPercentage + $totalPercentage), 0); + $currentACWP = $totalACWP == 0 ? null : $currentACWP + $totalACWP; + // $currentACWP = $currentACWP + $totalACWP; + $currentProgressActivity = $totalProgressActivity == 0 ? null : round(($currentProgressActivity + $totalProgressActivity),0); + // $currentProgressActivity = $currentProgressActivity + $totalProgressActivity; + $currentBCWP = $totalBCWP == 0 ? null :$currentBCWP + $totalBCWP; + // $currentBCWP = $currentBCWP + $totalBCWP; + $currentPercentage = $currentPercentage > 100 ? 100 : $currentPercentage; + $currentProgressActivity = $currentProgressActivity > 100 ? 100 : $currentProgressActivity; + + + $dataDate[] = array($currentDate, $currentBCWP, $currentACWP); + $dataPercen[] = array($currentPercentage, $currentProgressActivity); + }else{ + $dataDate[] = $currentDate; + // $dataPercen[] = null; + $dataPercen[] = array($currentPercentage,$currentProgressActivity); + } + } + $dataPercentage = array( + "date"=>$dataDate, + "percentage"=>$dataPercen + ); + $dataFinal[] = array( + "proyek_name"=> $dataProject->nama, + "data"=>$dataPercentage + ); + } + + if($dataFinal){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'testdata' => $testdata, '$period' => $period, 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list percentage day, please try again later!','code'=>400], 400); + } + } + + private function getMaxVersionGantt($id){ + $maxGanttId = VersionGantt::where("proyek_id", $id)->max("id"); + $data = array( + "last_gantt_id" => $maxGanttId, + "proyek_id" => $id + ); + return $data; + } + + public function setBaseline($gantt_id) + { + // UPDATE m_activity SET planned_start='start_date', planned_end='end_date' WHERE version_gantt_id=$gantt_id + $activities = Activity::where("version_gantt_id", $gantt_id)->get(); + + foreach ($activities as $activity) { + $planned_start = $activity->start_date; + $planned_end = $activity->end_date; + $willUpdated = Activity::find($activity->id); + $dataUpdate = array( + "planned_start"=>$planned_start, + "planned_end"=>$planned_end + ); + $willUpdated->update($dataUpdate); + } + + return response()->json(['status'=>'success','message'=>'Set baseline success!','code'=>200], 200); + // return response()->json(['status'=>'failed','message'=>'Failed to set baseline!','code'=>400], 400); + } + + public function synchronizeReport($gantt_id) + { + // Update start_date and end_date if there report_activity. + // first, get all activity id based on gantt_id + // then, loop and check table report_activity, + // if found (that must me more 1 or more than 1 report at 1 activity) so get the first and last report date + // and set to m_activity->start_data and m_activity->end_date + $activities = Activity::where("version_gantt_id", $gantt_id)->get(); + $reports = []; + + foreach($activities as $activity) { + $activity_id = $activity->id; + $countReports = ReportActivity::where('activity_id', $activity_id)->count(); + if ($countReports === 1) { + $dataReports = ReportActivity::where('activity_id', $activity_id)->orderBy('report_date')->get(); + foreach($dataReports as $dr) { + $reports[] = array( + 'activity_id'=>$activity_id, + 'min_date'=>$dr->report_date, + 'max_date'=>date_modify(date_create($dr->report_date), "1 days") + ); + } + } + elseif ($countReports > 1) { + $firstReport = ReportActivity::where('activity_id', $activity_id)->orderBy('report_date')->first(); + $lastReport = ReportActivity::where('activity_id', $activity_id)->orderByDesc('report_date')->first(); + $reports[] = array( + 'activity_id'=>$activity_id, + 'min_date'=>$firstReport->report_date, + 'max_date'=>date_modify(date_create($lastReport->report_date), "1 days") + ); + + } + } + + // loop reports[] then update to m_activity + for ($i=0; $i < count($reports); $i++) { + $activity = Activity::find($reports[$i]['activity_id']); + $activity->start_date = $reports[$i]['min_date']; + $activity->end_date = $reports[$i]['max_date']; + $activity->save(); + } + + return response()->json(['status'=>'success','message'=>'Synchronize to report success!','code'=>200], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/ActivityDokumenController.php b/app/Http/Controllers/ActivityDokumenController.php new file mode 100644 index 0000000..79f8833 --- /dev/null +++ b/app/Http/Controllers/ActivityDokumenController.php @@ -0,0 +1,106 @@ + 0){ + $dataDokumen = ActivityDokumen::where("activity_id", $id)->get(); + + return response()->json(['status'=>'success','data'=>$dataDokumen,'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'activity id is required!','code'=>400], 400); + } + } + + public function delete($id) + { + if($id && $id!="" && (int)$id > 0){ + $dokumen = ActivityDokumen::find($id); + if($dokumen){ + if(file_exists($this->pathActivityDocument.$dokumen->file)){ + unlink($this->pathActivityDocument.$dokumen->file); + } + $dokumen->delete(); + return response()->json(['status'=>'success','message'=>'Dokumen deleted successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); + } + } + + public function uploadProjectDokumen(Request $request) + { + if($request->hasFile('dokumen')){ + $activity_id = $request->activity_id; + $dokumen = $request->file('dokumen'); + $extension = $dokumen->extension(); + $name = $dokumen->getClientOriginalName(); + + $result = $dokumen->move($this->pathActivityDocument, $name); + if($result){ + $data = [ + 'activity_id' => (int)$activity_id, + 'file' => $name, + 'description' => $request->description + ]; + + $result = ActivityDokumen::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'file upload is successfully!','code'=>200], 200); + }else{ + unlink($this->pathActivityDocument.$name); + return response()->json(['status'=>'failed','message'=>'file upload is failed!','code'=>400], 400); + } + + }else{ + return response()->json(['status'=>'failed','message'=>'file upload is failed!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'file is required!','code'=>400], 400); + } + } + + public function searchDocProject(Request $request){ + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_document_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function downloadDokumen($id) + { + if($id && $id!="" && (int)$id > 0){ + $dokumen = ActivityDokumen::find($id); + if($dokumen){ + if(file_exists($this->pathActivityDocument.$dokumen->file)){ + $pathToFile = $this->pathActivityDocument.$dokumen->file; + return response()->download($pathToFile); + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/AssignMaterialController.php b/app/Http/Controllers/AssignMaterialController.php new file mode 100644 index 0000000..404b653 --- /dev/null +++ b/app/Http/Controllers/AssignMaterialController.php @@ -0,0 +1,325 @@ +validate($request, [ + 'activity_id' => 'required', + 'material_id' => 'required', + 'qty_planning' => 'required', + 'budget' => 'required' + ]); + + $checkStock = MaterialResource::where("id", $request->material_id)->first(); + $currentStock = $checkStock->qty; + if((int)$currentStock < (int)$request->qty_planning){ + return response()->json(['status'=>'failed','message'=>'Not enough stock in warehouse!','code'=>400]); + die(); + } + + // $checkData = AssignMaterial::where("activity_id", $request->activity_id)->where("material_id", $request->material_id) + // ->count(); + + // if($checkData > 0){ + // $update = $this->updateFromAdd($request->all()); + // if($update){ + // return response()->json(['status'=>'success','message'=>'Assign material success!','code'=>200]); + // }else{ + // return response()->json(['status'=>'failed','message'=>'Assign material failed','code'=>400]); + // } + // die(); + // } + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = AssignMaterial::create($data); + if($result){ + $checkStock = MaterialResource::find($request->material_id); + $newStock = (int)$checkStock->qty - (int)$request->qty_planning; + $dataUpdate = array( + "qty"=>$newStock, + "updated_by"=>$this->currentName + ); + $checkStock->update($dataUpdate); + + return response()->json(['status'=>'success','message'=>'Assign material successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign material failed created','code'=>400]); + } + } + + public function add(Request $request){ + //validasi + $this->validate($request, [ + 'activity_id' => 'required', + 'material_id' => 'required', + 'qty_planning' => 'required' + // 'budget' => 'required' + ]); + + $checkStock = RequestMaterial::where("id", $request->material_id)->first(); + $currentStock = $checkStock->qty; + $price = $checkStock->price; + if((int)$currentStock < (int)$request->qty_planning){ + return response()->json(['status'=>'failed','message'=>'Not enough stock !','code'=>400]); + die(); + } + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + $data['budget'] = $price; + + $result = AssignMaterial::create($data); + if($result){ + // comment untill fix flow + // $checkStock = MaterialResource::find($request->material_id); + // $newStock = (int)$checkStock->qty - (int)$request->qty_planning; + // $dataUpdate = array( + // "qty"=>$newStock, + // "updated_by"=>$this->currentName + // ); + // $checkStock->update($dataUpdate); + + // update cost planning + $updateActivity = Activity::find($request->activity_id); + if($updateActivity){ + $costPlanOld = $updateActivity==null? 0 : (int)$updateActivity->rencana_biaya; + $costPlanNew = $costPlanOld + ($price*$request->qty_planning); + $updateActivity->rencana_biaya = $costPlanNew; + $updateActivity->save(); + // $updateActivity->update(array("rencana_biaya"=>$costPlanNew)); + return response()->json(['status'=>'success','message'=>'Assign material successfull created, and update cost plan success '.$costPlanNew,'code'=>200]); + }else{ + return response()->json(['status'=>'success','message'=>'Assign material successfull created','code'=>200]); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Assign material failed created','code'=>400]); + } + } + + private function updateFromAdd($data){ + $assignMaterial = AssignMaterial::where("activity_id", $data->activity_id)->where("material_id", $data->material_id)->first(); + + $newQty = (int)$assignMaterial->qty_planning + (int)$data->qty_planning; + + $newBudget = $assignMaterial->budget > $data->budget ? $assignMaterial->budget : $data->budget; + + $dataUpdate = array( + "qty_planning"=>$newQty, + "budget"=>$newBudget, + "updated_by"=>$this->currentName + ); + + $dataWillUpdate = AssignMaterial::where("activity_id", $data->activity_id)->where("material_id", $data->material_id); + + return $dataWillUpdate->update($dataUpdate); + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = AssignMaterial::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Assign material not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Assign material successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign material failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = AssignMaterial::find($id); + + if($data){ + $id = $data->material_id; + $stock = $data->qty_planning; + $materialResource = MaterialResource::find($id); + if($materialResource){ + $oldStock = $materialResource->qty; + $newStock = $oldStock + $stock; + $dataUpdate = array( + "qty"=>$newStock, + "updated_by"=>$this->currentName + ); + $materialResource->update($dataUpdate); + } + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Assign material not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Assign material successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign material failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = AssignMaterial::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data Assign material, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in golang API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'assign_material_to_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = AssignMaterial::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Assign material, please try again later!','code'=>400], 400); + } + } + + public function datatables(Request $request){ + $id_activity = $request->query('idact'); + // $data = AssignMaterial::select("assign_material_to_activity.*","m.name as material_name", "m.uom as uom")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get(); + $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom")->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + } + + public function datatablesForReportActivity(Request $request){ + $id_activity = $request->query('idact'); + // $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom") + // ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + // // ->groupBy("assign_material_to_activity.activity_id") + // ->where("assign_material_to_activity.activity_id", $id_activity)->get(); + $data = AssignMaterial::select(AssignMaterial::raw('SUM(qty_planning) as qty_planning'), "m.description as material_name", "assign_material_to_activity.activity_id as activity_id") + ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + ->groupBy("m.description") + ->groupBy("assign_material_to_activity.activity_id") + ->where("assign_material_to_activity.activity_id", $id_activity)->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('qty_sum', function($row){ + $val_qty_act = AssignMaterial::select(ReportActivityMaterial::raw('SUM(ram.qty) as qty_sum'),"m.description as material_name1") + ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + ->join("report_activity_material as ram", "ram.assign_material_id", "=", "assign_material_to_activity.id") + ->groupBy("m.description") + ->where("m.description", strval($row->material_name)) + ->where("ram.activity_id", $row->activity_id)->first(); + return $val_qty_act ? $val_qty_act->qty_sum : '-'; + }) + ->addColumn('status_activity', function($row){ + $val_status = AssignMaterial::select("status_activity") + ->join('m_req_material as m', 'm.id', '=', 'assign_material_to_activity.material_id') + ->where('m.description', '=', $row->material_name) + ->where("assign_material_to_activity.activity_id", $row->activity_id)->first(); + return $val_status ? $val_status->status_activity : null; + }) + ->addColumn('start_activity', function($row){ + $val_start = AssignMaterial::select("start_activity") + ->join('m_req_material as m', 'm.id', '=', 'assign_material_to_activity.material_id') + ->where('m.description', '=', $row->material_name) + ->where("assign_material_to_activity.activity_id", $row->activity_id)->first(); + return $val_start ? $val_start->start_activity : null; + }) + ->addColumn('finish_activity', function($row){ + $val_finish = AssignMaterial::select("finish_activity") + ->join('m_req_material as m', 'm.id', '=', 'assign_material_to_activity.material_id') + ->where('m.description', '=', $row->material_name) + ->where("assign_material_to_activity.activity_id", $row->activity_id)->first(); + return $val_finish ? $val_finish->finish_activity : null; + }) + ->addColumn('uom', function($row){ + $val_uom = RequestMaterial::select("uom") + ->where('description', '=', $row->material_name)->first(); + return $val_uom ? $val_uom->uom : null; + }) + ->addColumn('action', function($row){ + $actionBtn = ''; + $actionBtn .= ''; + // $actionBtn .= ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + } + + public function ForReportActivityByMaterial(Request $request){ + $id_activity = $request->idact; + $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom") + ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + ->where('assign_material_to_activity.activity_id', $id_activity)->get(); + foreach ($data as $key) { + // for ($i=0; $i < count($data); $i++) { + # code... + + $val_qty_sum = ReportActivityMaterial::where('assign_material_id', '=', $key->id)->sum("qty"); + // $data[] = ['qty' =>$val_qty_sum ? $val_qty_sum : 0]; + // array_push($data[$i], ['qty' =>$val_qty_sum ? $val_qty_sum : 0]); + } + // $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom") + // ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + // ->where('assign_material_to_activity.activity_id', $id_activity, function ($query) { + // $query->sum('qty') + // ->from('report_activity_material') + // ->where('report_activity_material.assign_material_id', 'assign_material_to_activity.id'); + // })->get(); + $countData = $data->count(); + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Assign material, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/AssignToolsController.php b/app/Http/Controllers/AssignToolsController.php new file mode 100644 index 0000000..acf07ab --- /dev/null +++ b/app/Http/Controllers/AssignToolsController.php @@ -0,0 +1,179 @@ +validate($request, [ + 'activity_id' => 'required', + 'tools_id' => 'required', + 'qty_planning' => 'required', + ]); + + $checkStock = ToolsResource::where("id", $request->tools_id)->first(); + $currentStock = $checkStock->qty; + if((int)$currentStock < (int)$request->qty_planning){ + return response()->json(['status'=>'failed','message'=>'Not enough stock in warehouse!','code'=>400]); + die(); + } + // $checkData = AssignTools::where("activity_id", $request->activity_id)->where("tools_id", $request->tools_id) + // ->count(); + + // if($checkData > 0){ + // $update = $this->updateFromAdd($request->all()); + // if($update){ + // return response()->json(['status'=>'success','message'=>'Assign tools success!','code'=>200]); + // }else{ + // return response()->json(['status'=>'failed','message'=>'Assign tools failed','code'=>400]); + // } + // die(); + // } + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = AssignTools::create($data); + if($result){ + $checkStock = ToolsResource::find($request->tools_id); + $newStock = (int)$checkStock->qty - (int)$request->qty_planning; + $dataUpdate = array( + "qty"=>$newStock, + "updated_by"=>$this->currentName + ); + $checkStock->update($dataUpdate); + return response()->json(['status'=>'success','message'=>'Assign tools success!','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign tools failed','code'=>400]); + } + } + + private function updateFromAdd($data){ + $assignTools = AssignTools::where("activity_id", $data->activity_id)->where("tools_id", $data->tools_id)->first(); + + $newQty = (int)$assignTools->qty_planning + (int)$data->qty_planning; + $dataUpdate = array( + "qty_planning"=>$newQty, + "updated_by"=>$this->currentName + ); + + $dataWillUpdate = AssignMaterial::where("activity_id", $data->activity_id)->where("tools_id", $data->tools_id); + + return $dataWillUpdate->update($dataUpdate); + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = AssignTools::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Assign tools not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Assign tools successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign tools failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = AssignTools::find($id); + + if($data){ + $id = $data->tools_id; + $stock = $data->qty_planning; + $toolsResource = ToolsResource::find($id); + if($toolsResource){ + $oldStock = $toolsResource->qty; + $newStock = $oldStock + $stock; + $dataUpdate = array( + "qty"=>$newStock, + "updated_by"=>$this->currentName + ); + $toolsResource->update($dataUpdate); + } + + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Assign tools not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Assign tools successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Assign tools failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = AssignTools::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data Assign tools, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in golang API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'assign_tools_to_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = AssignTools::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Assign tools, please try again later!','code'=>400], 400); + } + } + + public function datatables(Request $request){ + $id_activity = $request->query('idact'); + $data = AssignTools::select("assign_tools_to_activity.*","m.name as tools_name","m.uom as uom")->join("m_tools_resource as m", "m.id", "=", "assign_tools_to_activity.tools_id")->where('assign_tools_to_activity.activity_id', $id_activity)->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + } +} diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php new file mode 100644 index 0000000..62953d6 --- /dev/null +++ b/app/Http/Controllers/AuthController.php @@ -0,0 +1,94 @@ +middleware('auth:api', ['except' => ['login']]); + } + + public function login(Request $request) + { + $username = $request->username; + $password = $request->password; + $is_mobile = $request->is_mobile; + + if(empty($username) || empty($password)){ + return response()->json(['status'=>'error','message'=>'You must fill all the fields'], 400); + } + + $credentials = array( + "username"=> $username, + "password"=> md5($password) + ); + + $user = User::where('username', $username)->where('password', md5($password)) + ->first(); + + if($is_mobile){ + $fcm_token = $request->fcm_token; + + if(!$fcm_token || $fcm_token==""){ + return response()->json(['status'=>'error','message'=>'FCM Token is required'], 400); + die(); + } + + $dataUpdateFcm = array( + "fcm_token"=>$fcm_token + ); + + $hr = User::find($user->id); + + if($hr){ + $result = $hr->update($dataUpdateFcm); + } + } + + $dataRole = Role::find($user->role_id); + + if($dataRole){ + $user->role = $dataRole; + } + + // if($user->role_id!=1){ + // $dataProject = UserProject::where('user_id', $user->id)->first(); + // if($dataProject){ + // $user->project = $dataProject; + // } + // } + + if (! $token =Auth::login($user)) { + return response()->json(['error' => 'Unauthorized'], 401); + } + + return $this->respondWithToken($token, $user); + } + + protected function respondWithToken($token, $user) + { + return response()->json([ + 'code' => 200, + 'data' => array( + 'data_user' => $user, + 'access_token' => $token, + 'token_type' => 'bearer', + 'expires_in' => auth()->factory()->getTTL() * 60 + ), + ]); + } +} diff --git a/app/Http/Controllers/BroadcastController.php b/app/Http/Controllers/BroadcastController.php new file mode 100644 index 0000000..eddd34f --- /dev/null +++ b/app/Http/Controllers/BroadcastController.php @@ -0,0 +1,10 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = ChecklistK3::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Master checklist K3 successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Master checklist K3 failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = ChecklistK3::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Master checklist K3 not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Master checklist K3 successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master checklist K3 failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ChecklistK3::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Master checklist K3 not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Master checklist K3 successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master checklist K3 failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_checklist_k3'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ChecklistK3::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/CommentActivityController.php b/app/Http/Controllers/CommentActivityController.php new file mode 100644 index 0000000..ec166e3 --- /dev/null +++ b/app/Http/Controllers/CommentActivityController.php @@ -0,0 +1,111 @@ +validate($request, [ + 'activity_id' => 'required', + 'comment' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = CommentActivity::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Comment Activity Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Comment Activity Project failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = CommentActivity::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data Comment Activity Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Comment Activity Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Comment Activity Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = CommentActivity::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Comment Activity Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Comment Activity Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Comment Activity Project failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = CommentActivity::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_comment_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = CommentActivity::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list version gantt, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ConfigAlertController.php b/app/Http/Controllers/ConfigAlertController.php new file mode 100644 index 0000000..613bc66 --- /dev/null +++ b/app/Http/Controllers/ConfigAlertController.php @@ -0,0 +1,116 @@ +validate($request, [ + 'name' => 'required', + 'keterangan' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ConfigAlert::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data config alert successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data config alert failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ConfigAlert::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data config alert, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ConfigAlert::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data config alert successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ConfigAlert::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data config alert successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'config_alert'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ConfigAlert::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list config alert, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ConfigAlertUserController.php b/app/Http/Controllers/ConfigAlertUserController.php new file mode 100644 index 0000000..856b7f1 --- /dev/null +++ b/app/Http/Controllers/ConfigAlertUserController.php @@ -0,0 +1,100 @@ +validate($request, [ + 'user_id' => 'required', + 'config_alert_id' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ConfigAlertUser::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data config alert user successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data config alert user failed!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ConfigAlertUser::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert user not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data config alert user successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert user failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ConfigAlertUser::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert user not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data config alert user successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data config alert user failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'config_alert_to_user'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function getConfigUser($id) + { + $getData = ConfigAlertUser::where('user_id', $id)->get(); + + if($getData){ + return response()->json(['status'=>'success','code'=>200,'data'=>$getData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'config alert for this user not found!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ControlMonitoringController.php b/app/Http/Controllers/ControlMonitoringController.php new file mode 100644 index 0000000..19a7866 --- /dev/null +++ b/app/Http/Controllers/ControlMonitoringController.php @@ -0,0 +1,63 @@ +all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_proyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // get another child data + if($request->has("child_data")){ + $newDataGet = []; + $child_data = $request->child_data; + $date_start = $child_data['start_date']; + $date_end = $child_data['date_end']; + foreach ($dataGet as $value) { + $ganttId = $this->getMaxVersionGantt($value->id); + $allActivityIds = Activity::where("version_gantt_id", $ganttId)->where("proyek_id", $value->id)->pluck("id"); + $value->volume_planning = Activity::where("version_gantt_id", $ganttId)->where("proyek_id", $value->id)->sum("jumlah_pekerjaan"); + $value->biaya_actual = Activity::where("version_gantt_id", $ganttId)->where("proyek_id", $value->id)->sum("biaya_actual"); + $value->volume_actual = ReportActivity::where("activity_id", $allActivityIds->all())->sum("job_count_report"); + $listAct = []; + $activityIds = ReportActivity::select("ma.id as id")->join("m_activity as ma", "ma.id", "=", "report_activity.activity_id")->where("ma.version_gantt_id", $ganttId)->where("ma.proyek_id", $value->id)->whereBetween("report_activity.report_date", [$date_start, $date_end])->groupBy("ma.id")->get()->pluck('id'); + $dataActivity = Activity::select("m_activity.*", "ms.name as uom")->leftJoin("m_satuan as ms", "ms.id","=","m_activity.satuan_id")->whereIn("m_activity.id", $activityIds->all())->get(); + foreach($dataActivity as $act){ + $act->list_report = ReportActivity::select("report_activity.*", "mu.name as user_name", "mi.image as image_url")->leftJoin("m_users as mu", "mu.id", "=", "report_activity.user_id")->leftJoin("m_image as mi", function($join){ + $join->on("mi.ref_id", "=", "report_activity.id")->where("mi.category", "report_activity"); + })->where("report_activity.activity_id", $act->id)->whereBetween("report_activity.report_date", [$date_start, $date_end])->get(); + // $act->list_report = ReportActivity::select("report_activity.*", "mu.name as user_name")->leftJoin("m_users as mu", "mu.id", "=", "report_activity.user_id")->where("report_activity.activity_id", $act->id)->whereBetween("report_activity.report_date", [$date_start, $date_end])->get(); + $listAct[] = $act; + } + $value->report_data = $listAct; + $newDataGet[] = $value; + } + $dataGet = $newDataGet; + } + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + private function getMaxVersionGantt($id){ + return Activity::where("proyek_id", $id)->max("version_gantt_id"); + } +} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..e8bb4ba --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,289 @@ +functionName($param)' or '$this->variableName' +class Controller extends BaseController +{ + // here is the global variabel + protected $pathImage = "assets/image/"; + protected $pathDocument = "assets/file/project/"; + protected $pathActivityDocument = "assets/file/activity/"; + protected $listJoinAll = ['first', 'second', 'third', 'fourth', 'fifth', + 'sixth', 'seventh', 'eighth', 'ninth', 'tenth']; + protected $currentDate; + protected $currentName; + protected $currentId; + + public function __construct() + { + // datetime now + $this->currentDate = date("Y-m-d H:i:s"); + // current user auth + $this->currentName = auth()->user() ? auth()->user()->name : "system"; + $this->currentId = auth()->user() ? auth()->user()->id : 0; + + // configure assets + $this->pathImage = config('assets.image'); + $this->pathDocument = config('assets.project'); + $this->pathActivityDocument = config('assets.activity'); + } + + // every single param in this function is required + protected function setUpPayload($condition, $tableSelf) + { + $alias = "selfTable"; + $builder = DB::table($tableSelf." AS ".$alias); + $builder = $builder->select($alias.".*"); + if($condition){ + if(isset($condition['joins'])){ + $selectColumn = []; + $no = 0; + foreach($condition['joins'] as $join){ + $tableJoin = isset($join['name1']) ? $join['name1'] : $alias; + $tableName = $join['name']; + $columnJoin = $join['column_join']; // foreign key table sini + $columnSelf = isset($join['column_self']) ? $join['column_self'] : "id"; // primary key table lawan + $columnResult = $join['column_results']; + + foreach($columnResult as $sColumn){ + $builder = $builder->addSelect($tableName.".".$sColumn." as join_".$this->listJoinAll[$no]."_".$sColumn); + } + // need to make dinamic join option + $builder = $builder->leftJoin($tableName, $tableJoin.".".$columnJoin, '=', $tableName.'.'.$columnSelf); + $no++; + } + } + + if(isset($condition['columns'])){ + $listWhere = $condition['columns']; + + $builder = $builder->where(function ($query) use($listWhere, $alias){ + foreach($listWhere as $where){ + $value = $where['value']; + if($value && $value!="" && $value!=" "){ + $column = $where['name']; + $operator = strtolower($where['logic_operator']); // like, =, <>, range + //$whereCondition = $where['operator']; // AND , OR + $value2 = isset($where['value1']) ? $where['value1'] : ""; + $tableColumn = isset($where['table_name']) ? $where['table_name'] : $alias; + $query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2); + } + } + }); + } + + if(isset($condition['group_column'])){ + $builder = $this->groupWhere($builder, $condition['group_column'], $alias); + } + + $data['count'] = clone $builder; + + if(isset($condition['paging'])){ + $builder = $builder->offset($condition['paging']['start'])->limit($condition['paging']['length']); + } + + if(isset($condition['orders'])){ + $orders = $condition['orders']; + $sortBy = $orders['ascending'] ? "ASC" : "DESC"; + $columnOrder = $orders['columns']; + foreach($columnOrder as $column){ + $builder = $builder->orderBy($alias.".".$column, $sortBy); + } + } + } + $data['builder'] = $builder; + return $data; + } + + private function groupWhere($oldBuilder, $groupWhere, $alias) + { + $builder = $oldBuilder; + $listGroupWhere = $groupWhere; + $operator = $listGroupWhere['operator']; + $operatorGroup = $listGroupWhere['group_operator']; + $listWhere = $listGroupWhere['where']; + if(strtolower($operator)=="and"){ + $builder = $builder->where(function($query) use($operatorGroup, $listWhere, $alias){ + $no = 1; + foreach ($listWhere as $where) { + $value = $where['value']; + $column = $where['name']; + $operator = strtolower($where['logic_operator']); + $value2 = isset($where['value1']) ? $where['value1'] : ""; + $tableColumn = isset($where['table_name']) ? $where['table_name'] : $alias; + if($value && $value!="" && $value!=" "){ + if($operatorGroup=="and"){ + $query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2); + }else{ + if($no==1){ + $query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2); + }else{ + $query = $this->orWhereCondition($query, $operator, $tableColumn, $column, $value, $value2); + } + } + } + $no = $no+1; + } + }); + }else if(strtolower($operator)=="or"){ + $builder = $builder->orWhere(function($query) use($operatorGroup, $listWhere, $alias){ + $no = 1; + foreach ($listWhere as $where) { + $value = $where['value']; + $column = $where['name']; + $operator = strtolower($where['logic_operator']); + $value2 = isset($where['value1']) ? $where['value1'] : ""; + $tableColumn = isset($where['table_name']) ? $where['table_name'] : $alias; + if($value && $value!="" && $value!=" "){ + if($operatorGroup=="and"){ + $query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2); + }else{ + if($no==1){ + $query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2); + }else{ + $query = $this->orWhereCondition($query, $operator, $tableColumn, $column, $value, $value2); + } + } + } + $no++; + } + }); + } + return $builder; + } + + private function whereCondition($oldQuery, $operator, $tableColumn, $column, $value, $value2) + { + $query = $oldQuery; + if($operator=="range"){ + $query = $query->whereBetween($tableColumn.".".$column, [$value, $value2]); + }else if($operator=="like"){ + $query = $query->where($tableColumn.".".$column, 'like', '%'.$value.'%'); + }else if($operator=="ilike"){ + $query = $query->where($tableColumn.".".$column, '~*', $value); + }else if($operator=="="){ + $query = $query->where($tableColumn.".".$column, $value); + }else if($operator=="in"){ + $query = $query->whereIn($tableColumn.".".$column, $value); + }else if($operator=="notin"){ + $query = $query->whereNotIn($tableColumn.".".$column, $value); + }else{ + $query = $query->where($tableColumn.".".$column, $operator, $value); + } + return $query; + } + + private function whereConditionSingleTable($oldQuery, $operator, $column, $value, $value2){ + $query = $oldQuery; + if($operator=="range"){ + $query = $query->whereBetween($column, [$value, $value2]); + }else if($operator=="like"){ + $query = $query->where($column, 'like', '%'.$value.'%'); + }else if($operator=="ilike"){ + $query = $query->where($column, '~*', $value); + }else if($operator=="="){ + $query = $query->where($column, $value); + }else if($operator=="in"){ + $query = $query->whereIn($column, $value); + }else if($operator=="notin"){ + $query = $query->whereNotIn($column, $value); + }else{ + $query = $query->where($column, $operator, $value); + } + return $query; + } + + private function orWhereCondition($oldQuery, $operator, $tableColumn, $column, $value, $value2) + { + $query = $oldQuery; + if($operator=="range"){ + $query = $query->orWhereBetween($tableColumn.".".$column, [$value, $value2]); + }else if($operator=="like"){ + $query = $query->orWhere($tableColumn.".".$column, 'like', '%'.$value.'%'); + }else if($operator=="ilike"){ + $query = $query->where($tableColumn.".".$column, '~*', $value); + }else if($operator=="="){ + $query = $query->orWhere($tableColumn.".".$column, $value); + }else if($operator=="in"){ + $query = $query->orWhereIn($tableColumn.".".$column, $value); + }else if($operator=="notin"){ + $query = $query->orWhereNotIn($tableColumn.".".$column, $value); + }else{ + $query = $query->orWhere($tableColumn.".".$column, $operator, $value); + } + return $query; + } + + // need call when update userToActivity / materialToActivity / toolsToActivity + protected function calculateAllCost($activity, $proyek_id){ + $humanCostPlanning = $this->calculateAllHumanCost($activity_id, $proyek_id); + $materialCostPlanning = $this->calculateMaterialCost($activity_id, $proyek_id); + $toolsCostPlanning = 0; + + $allCost = $humanCostPlanning + $materialCostPlanning + $toolsCostPlanning; + return $allCost; + } + + private function calculateAllHumanCost($activity_id, $proyek_id) + { + $dataHuman = UserToActivity::select("ahp.standart_rate as standart_rate","ahp.max_used as max_used", "ahp.cost_per_used as cost_per_used", "ahp.uom_standart_rate as uom_standart_rate")->leftJoin("assign_hr_to_proyek as ahp", "assign_hr_to_activity.user_id", "=", "ahp.user_id") + ->where("assign_hr_to_activity.activity_id", $activity_id)->where("assign_hr_to_activity.proyek_id", $proyek_id) + ->where("ahp.proyek_id", $proyek_id) + ->get(); + + $totalCost = 0; + foreach ($dataHuman as $human) { + $uom = $human->uom_standart_rate; + $totalCost += $this->calculateHumanCost($human, $activity_id); + } + + return $totalCost; + } + + private function calculateHumanCost($human, $activity_id) + { + $activity = Activity::find($activity_id); + $duration = $activity->duration; + // $costPerUsed = $human->cost_per_used; + $standarRate = $human->standart_rate; + $maxUsed = $human->max_used/100; + $totalCost = ($standarRate*$duration)*$maxUsed; + return $totalCost; + } + + private function calculateMaterialCost($activity_id, $proyek_id) + { + $totalCost = AssignMaterial::selectRaw("ISNULL(qty_planning,0)*ISNULL(budget,0) as totalCost")->where("proyek_id", $proyek_id)->where("activity_id", $activity_id)->sum("totalCost"); + return $totalCost; + } + + private function calculateToolsCost($activity_id, $proyek_id) + { + + } + + protected function updatedCostPlanning($id) + { + $sumBiaya = Activity::select(DB::raw('sum(cast(rencana_biaya as double precision))'))->where("parent_id", $id)->first(); + $dataActivity = Activity::find($id); + $dataUpdate = array( + "rencana_biaya" => $sumBiaya->sum, + "updated_by" => $this->currentName + ); + $dataActivity->update($dataUpdate); + if($dataActivity){ + $parent = $dataActivity->parent_id; + if($parent && (int)$parent > 0){ + $this->updateCostPlanning($parent); + } + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php new file mode 100644 index 0000000..a07d319 --- /dev/null +++ b/app/Http/Controllers/CurrencyController.php @@ -0,0 +1,172 @@ + "AED", "symbol" => "\u062f.\u0625;", "name" => "UAE dirham"), + // array("cc" => "AFN", "symbol" => "Afs", "name" => "Afghan afghani"), + // array("cc" => "ALL", "symbol" => "L", "name" => "Albanian lek"), + // array("cc" => "AMD", "symbol" => "AMD", "name" => "Armenian dram"), + // array("cc" => "ANG", "symbol" => "NA\u0192", "name" => "Netherlands Antillean gulden"), + // array("cc" => "AOA", "symbol" => "Kz", "name" => "Angolan kwanza"), + // array("cc" => "ARS", "symbol" => "$", "name" => "Argentine peso"), + // array("cc" => "AUD", "symbol" => "$", "name" => "Australian dollar"), + // array("cc" => "AWG", "symbol" => "\u0192", "name" => "Aruban florin"), + // array("cc" => "AZN", "symbol" => "AZN", "name" => "Azerbaijani manat"), + // array("cc" => "BAM", "symbol" => "KM", "name" => "Bosnia and Herzegovina konvertibilna marka"), + // array("cc" => "BBD", "symbol" => "Bds$", "name" => "Barbadian dollar"), + // array("cc" => "BDT", "symbol" => "\u09f3", "name" => "Bangladeshi taka"), + // array("cc" => "BGN", "symbol" => "BGN", "name" => "Bulgarian lev"), + // array("cc" => "BHD", "symbol" => ".\u062f.\u0628", "name" => "Bahraini dinar"), + // array("cc" => "BIF", "symbol" => "FBu", "name" => "Burundi franc"), + // array("cc" => "BMD", "symbol" => "BD$", "name" => "Bermudian dollar"), + // array("cc" => "BND", "symbol" => "B$", "name" => "Brunei dollar"), + // array("cc" => "BOB", "symbol" => "Bs.", "name" => "Bolivian boliviano"), + // array("cc" => "BRL", "symbol" => "R$", "name" => "Brazilian real"), + // array("cc" => "BSD", "symbol" => "B$", "name" => "Bahamian dollar"), + // array("cc" => "BTN", "symbol" => "Nu.", "name" => "Bhutanese ngultrum"), + // array("cc" => "BWP", "symbol" => "P", "name" => "Botswana pula"), + // array("cc" => "BYR", "symbol" => "Br", "name" => "Belarusian ruble"), + // array("cc" => "BZD", "symbol" => "BZ$", "name" => "Belize dollar"), + // array("cc" => "CAD", "symbol" => "$", "name" => "Canadian dollar"), + // array("cc" => "CDF", "symbol" => "F", "name" => "Congolese franc"), + // array("cc" => "CHF", "symbol" => "Fr.", "name" => "Swiss franc"), + // array("cc" => "CLP", "symbol" => "$", "name" => "Chilean peso"), + // array("cc" => "CNY", "symbol" => "\u00a5", "name" => "Chinese/Yuan renminbi"), + // array("cc" => "COP", "symbol" => "Col$", "name" => "Colombian peso"), + // array("cc" => "CRC", "symbol" => "\u20a1", "name" => "Costa Rican colon"), + // array("cc" => "CUC", "symbol" => "$", "name" => "Cuban peso"), + // array("cc" => "CVE", "symbol" => "Esc", "name" => "Cape Verdean escudo"), + // array("cc" => "CZK", "symbol" => "K\u010d", "name" => "Czech koruna"), + // array("cc" => "DJF", "symbol" => "Fdj", "name" => "Djiboutian franc"), + // array("cc" => "DKK", "symbol" => "Kr", "name" => "Danish krone"), + // array("cc" => "DOP", "symbol" => "RD$", "name" => "Dominican peso"), + // array("cc" => "DZD", "symbol" => "\u062f.\u062c", "name" => "Algerian dinar"), + // array("cc" => "EEK", "symbol" => "KR", "name" => "Estonian kroon"), + // array("cc" => "EGP", "symbol" => "\u00a3", "name" => "Egyptian pound"), + // array("cc" => "ERN", "symbol" => "Nfa", "name" => "Eritrean nakfa"), + // array("cc" => "ETB", "symbol" => "Br", "name" => "Ethiopian birr"), + // array("cc" => "EUR", "symbol" => "\u20ac", "name" => "European Euro"), + // array("cc" => "FJD", "symbol" => "FJ$", "name" => "Fijian dollar"), + // array("cc" => "FKP", "symbol" => "\u00a3", "name" => "Falkland Islands pound"), + // array("cc" => "GBP", "symbol" => "\u00a3", "name" => "British pound"), + // array("cc" => "GEL", "symbol" => "GEL", "name" => "Georgian lari"), + // array("cc" => "GHS", "symbol" => "GH\u20b5", "name" => "Ghanaian cedi"), + // array("cc" => "GIP", "symbol" => "\u00a3", "name" => "Gibraltar pound"), + // array("cc" => "GMD", "symbol" => "D", "name" => "Gambian dalasi"), + // array("cc" => "GNF", "symbol" => "FG", "name" => "Guinean franc"), + // array("cc" => "GQE", "symbol" => "CFA", "name" => "Central African CFA franc"), + // array("cc" => "GTQ", "symbol" => "Q", "name" => "Guatemalan quetzal"), + // array("cc" => "GYD", "symbol" => "GY$", "name" => "Guyanese dollar"), + // array("cc" => "HKD", "symbol" => "HK$", "name" => "Hong Kong dollar"), + // array("cc" => "HNL", "symbol" => "L", "name" => "Honduran lempira"), + // array("cc" => "HRK", "symbol" => "kn", "name" => "Croatian kuna"), + // array("cc" => "HTG", "symbol" => "G", "name" => "Haitian gourde"), + // array("cc" => "HUF", "symbol" => "Ft", "name" => "Hungarian forint"), + array("cc" => "IDR", "symbol" => "Rp", "name" => "Indonesian rupiah"), + // array("cc" => "ILS", "symbol" => "\u20aa", "name" => "Israeli new sheqel"), + // array("cc" => "INR", "symbol" => "\u20B9", "name" => "Indian rupee"), + // array("cc" => "IQD", "symbol" => "\u062f.\u0639", "name" => "Iraqi dinar"), + // array("cc" => "IRR", "symbol" => "IRR", "name" => "Iranian rial"), + // array("cc" => "ISK", "symbol" => "kr", "name" => "Icelandic kr\u00f3na"), + // array("cc" => "JMD", "symbol" => "J$", "name" => "Jamaican dollar"), + // array("cc" => "JOD", "symbol" => "JOD", "name" => "Jordanian dinar"), + // array("cc" => "JPY", "symbol" => "\u00a5", "name" => "Japanese yen"), + // array("cc" => "KES", "symbol" => "KSh", "name" => "Kenyan shilling"), + // array("cc" => "KGS", "symbol" => "\u0441\u043e\u043c", "name" => "Kyrgyzstani som"), + // array("cc" => "KHR", "symbol" => "\u17db", "name" => "Cambodian riel"), + // array("cc" => "KMF", "symbol" => "KMF", "name" => "Comorian franc"), + // array("cc" => "KPW", "symbol" => "W", "name" => "North Korean won"), + // array("cc" => "KRW", "symbol" => "W", "name" => "South Korean won"), + // array("cc" => "KWD", "symbol" => "KWD", "name" => "Kuwaiti dinar"), + // array("cc" => "KYD", "symbol" => "KY$", "name" => "Cayman Islands dollar"), + // array("cc" => "KZT", "symbol" => "T", "name" => "Kazakhstani tenge"), + // array("cc" => "LAK", "symbol" => "KN", "name" => "Lao kip"), + // array("cc" => "LBP", "symbol" => "\u00a3", "name" => "Lebanese lira"), + // array("cc" => "LKR", "symbol" => "Rs", "name" => "Sri Lankan rupee"), + // array("cc" => "LRD", "symbol" => "L$", "name" => "Liberian dollar"), + // array("cc" => "LSL", "symbol" => "M", "name" => "Lesotho loti"), + // array("cc" => "LTL", "symbol" => "Lt", "name" => "Lithuanian litas"), + // array("cc" => "LVL", "symbol" => "Ls", "name" => "Latvian lats"), + // array("cc" => "LYD", "symbol" => "LD", "name" => "Libyan dinar"), + // array("cc" => "MAD", "symbol" => "MAD", "name" => "Moroccan dirham"), + // array("cc" => "MDL", "symbol" => "MDL", "name" => "Moldovan leu"), + // array("cc" => "MGA", "symbol" => "FMG", "name" => "Malagasy ariary"), + // array("cc" => "MKD", "symbol" => "MKD", "name" => "Macedonian denar"), + // array("cc" => "MMK", "symbol" => "K", "name" => "Myanma kyat"), + // array("cc" => "MNT", "symbol" => "\u20ae", "name" => "Mongolian tugrik"), + // array("cc" => "MOP", "symbol" => "P", "name" => "Macanese pataca"), + // array("cc" => "MRO", "symbol" => "UM", "name" => "Mauritanian ouguiya"), + // array("cc" => "MUR", "symbol" => "Rs", "name" => "Mauritian rupee"), + // array("cc" => "MVR", "symbol" => "Rf", "name" => "Maldivian rufiyaa"), + // array("cc" => "MWK", "symbol" => "MK", "name" => "Malawian kwacha"), + // array("cc" => "MXN", "symbol" => "$", "name" => "Mexican peso"), + // array("cc" => "MYR", "symbol" => "RM", "name" => "Malaysian ringgit"), + // array("cc" => "MZM", "symbol" => "MTn", "name" => "Mozambican metical"), + // array("cc" => "NAD", "symbol" => "N$", "name" => "Namibian dollar"), + // array("cc" => "NGN", "symbol" => "\u20a6", "name" => "Nigerian naira"), + // array("cc" => "NIO", "symbol" => "C$", "name" => "Nicaraguan c\u00f3rdoba"), + // array("cc" => "NOK", "symbol" => "kr", "name" => "Norwegian krone"), + // array("cc" => "NPR", "symbol" => "NRs", "name" => "Nepalese rupee"), + // array("cc" => "NZD", "symbol" => "NZ$", "name" => "New Zealand dollar"), + // array("cc" => "OMR", "symbol" => "OMR", "name" => "Omani rial"), + // array("cc" => "PAB", "symbol" => "B./", "name" => "Panamanian balboa"), + // array("cc" => "PEN", "symbol" => "S/.", "name" => "Peruvian nuevo sol"), + // array("cc" => "PGK", "symbol" => "K", "name" => "Papua New Guinean kina"), + // array("cc" => "PHP", "symbol" => "\u20b1", "name" => "Philippine peso"), + // array("cc" => "PKR", "symbol" => "Rs.", "name" => "Pakistani rupee"), + // array("cc" => "PLN", "symbol" => "z\u0142", "name" => "Polish zloty"), + // array("cc" => "PYG", "symbol" => "\u20b2", "name" => "Paraguayan guarani"), + // array("cc" => "QAR", "symbol" => "QR", "name" => "Qatari riyal"), + // array("cc" => "RON", "symbol" => "L", "name" => "Romanian leu"), + // array("cc" => "RSD", "symbol" => "din.", "name" => "Serbian dinar"), + // array("cc" => "RUB", "symbol" => "R", "name" => "Russian ruble"), + // array("cc" => "SAR", "symbol" => "SR", "name" => "Saudi riyal"), + // array("cc" => "SBD", "symbol" => "SI$", "name" => "Solomon Islands dollar"), + // array("cc" => "SCR", "symbol" => "SR", "name" => "Seychellois rupee"), + // array("cc" => "SDG", "symbol" => "SDG", "name" => "Sudanese pound"), + // array("cc" => "SEK", "symbol" => "kr", "name" => "Swedish krona"), + // array("cc" => "SGD", "symbol" => "S$", "name" => "Singapore dollar"), + // array("cc" => "SHP", "symbol" => "\u00a3", "name" => "Saint Helena pound"), + // array("cc" => "SLL", "symbol" => "Le", "name" => "Sierra Leonean leone"), + // array("cc" => "SOS", "symbol" => "Sh.", "name" => "Somali shilling"), + // array("cc" => "SRD", "symbol" => "$", "name" => "Surinamese dollar"), + // array("cc" => "SYP", "symbol" => "LS", "name" => "Syrian pound"), + // array("cc" => "SZL", "symbol" => "E", "name" => "Swazi lilangeni"), + // array("cc" => "THB", "symbol" => "\u0e3f", "name" => "Thai baht"), + // array("cc" => "TJS", "symbol" => "TJS", "name" => "Tajikistani somoni"), + // array("cc" => "TMT", "symbol" => "m", "name" => "Turkmen manat"), + // array("cc" => "TND", "symbol" => "DT", "name" => "Tunisian dinar"), + // array("cc" => "TRY", "symbol" => "TRY", "name" => "Turkish new lira"), + // array("cc" => "TTD", "symbol" => "TT$", "name" => "Trinidad and Tobago dollar"), + // array("cc" => "TWD", "symbol" => "NT$", "name" => "New Taiwan dollar"), + // array("cc" => "TZS", "symbol" => "TZS", "name" => "Tanzanian shilling"), + // array("cc" => "UAH", "symbol" => "UAH", "name" => "Ukrainian hryvnia"), + // array("cc" => "UGX", "symbol" => "USh", "name" => "Ugandan shilling"), + array("cc" => "USD", "symbol" => "US$", "name" => "United States dollar"), + // array("cc" => "UYU", "symbol" => '$U', "name" => "Uruguayan peso"), + // array("cc" => "UZS", "symbol" => "UZS", "name" => "Uzbekistani som"), + // array("cc" => "VEB", "symbol" => "Bs", "name" => "Venezuelan bolivar"), + // array("cc" => "VND", "symbol" => "\u20ab", "name" => "Vietnamese dong"), + // array("cc" => "VUV", "symbol" => "VT", "name" => "Vanuatu vatu"), + // array("cc" => "WST", "symbol" => "WS$", "name" => "Samoan tala"), + // array("cc" => "XAF", "symbol" => "CFA", "name" => "Central African CFA franc"), + // array("cc" => "XCD", "symbol" => "EC$", "name" => "East Caribbean dollar"), + // array("cc" => "XDR", "symbol" => "SDR", "name" => "Special Drawing Rights"), + // array("cc" => "XOF", "symbol" => "CFA", "name" => "West African CFA franc"), + // array("cc" => "XPF", "symbol" => "F", "name" => "CFP franc"), + // array("cc" => "YER", "symbol" => "YER", "name" => "Yemeni rial"), + // array("cc" => "ZAR", "symbol" => "R", "name" => "South African rand"), + // array("cc" => "ZMK", "symbol" => "ZK", "name" => "Zambian kwacha"), + // array("cc" => "ZWR", "symbol" => "Z$", "name" => "Zimbabwean dollar") + ); + + return response()->json(['status'=>'success','code'=>200,'data'=>$CURRENCY_DATA, 'totalRecord'=>count($CURRENCY_DATA)], 200); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php new file mode 100644 index 0000000..494df97 --- /dev/null +++ b/app/Http/Controllers/DashboardController.php @@ -0,0 +1,297 @@ +all(); + $dataMaxVersionGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $dataMaxVersionGantt[] = $this->getMaxVersionGantt($val); + } + + $dataFinal=[]; + foreach ($dataMaxVersionGantt as $val) { + $data = Activity::select('m_activity.id', 'm_activity.proyek_id', 'm_activity.name', 'm_activity.kode_sortname', 'm_activity.rencana_biaya', 'm_activity.biaya_actual', 'mp.nama as proyek_name')->join("m_proyek as mp", "m_activity.proyek_id", "=", "mp.id")->where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->orderBy('id', 'asc')->get(); + $dataFinal[] = array("proyek_id" => $val['proyek_id'], "proyek_name" => isset($data) && count($data) > 0 ? $data[0]['proyek_name'] : "-", "version_gantt_id" => $val['last_version_gantt'], "data" => $data); + } + + if($dataPayload){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list role, please try again later!','code'=>400], 400); + } + } + + public function getMaxVersionGantt($id){ + $data = Activity::select(Activity::raw('MAX(version_gantt_id) as last_version_gantt'))->where("proyek_id", $id)->first(); + return array("last_version_gantt"=>$data->last_version_gantt, "proyek_id" => $id, "proyek_name" => $data->proyek_name); + } + + public function percentagePlanningActual(Request $request) + { + $dataPayload = $request->all(); + $dataMaxVersionGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $dataMaxVersionGantt[] = $this->getMaxVersionGantt($val); + } + // SELECT * FROM public.m_activity where proyek_id = 11 and version_gantt_id=12 and parent_id IS NULL; + $dataFinal=[]; + foreach ($dataMaxVersionGantt as $val) { + $data = Activity::select('m_activity.id', 'm_activity.proyek_id', 'm_activity.name', 'm_activity.kode_sortname', 'm_activity.persentase_progress', 'm_activity.persentase_bobot', 'm_activity.bobot_planning', 'mp.nama as proyek_name')->join("m_proyek as mp", "m_activity.proyek_id", "=", "mp.id")->where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->orderBy('id', 'asc')->get(); + // loop + // hitung persentase_progress = persentase_progress*bobot_planning/100 + $dataFinal[] = array("proyek_id" => $val['proyek_id'], "proyek_name" => isset($data) && count($data) > 0 ? $data[0]['proyek_name'] : "-", "version_gantt_id" => $val['last_version_gantt'], "data" => $data); + + } + + if($dataPayload){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list role, please try again later!','code'=>400], 400); + } + } + + public function list() + { + $data = Role::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list role, please try again later!','code'=>400], 400); + } + } + + // // cari titik last waypoint dari user di masing-masing project terpilih dari front end + // public function searchUserPresencePoints(Request $request) { + // $dataPayload = $request->all(); + // $reqActivityId = []; + // foreach ($dataPayload['project_id'] as $val) { + // $reqActivityId[] = $this->getActivityByProjectId($val); + // } + + // // var_dump(count($reqActivityId)); + // $activity_id = []; + // $getPoints = false; + + // if (count($reqActivityId) > 0) { + // for ($i=0; $i < count($reqActivityId); $i++) { + // if (count($reqActivityId[$i]) > 0) { + // foreach($reqActivityId[$i] as $reqAct) { + // array_push($activity_id, $reqAct->id); + // } + // } + // } + // } + + // if (count($activity_id) > 0) { + // // $getPoints = ReportActivity::select('report_activity.*', 'm_activity.name as activity_name', 'm_proyek.nama as proyek_name') + // // ->leftJoin('m_activity', 'm_activity.id', '=', 'report_activity.activity_id') + // // ->leftJoin('m_proyek', 'm_proyek.id', '=', 'm_activity.proyek_id') + // // ->whereIn('report_activity.activity_id', $activity_id)->get(); + // // $getPoints = + // } + + // if($getPoints){ + // return response()->json(['status'=>'success','code'=>200,'data'=>$getPoints, 'totalRecord'=>count($getPoints)], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'failed get list points, please try again later!','code'=>400], 400); + // } + // } + + public function getActivityByProjectId($projectId) { + $output = []; + $data = Activity::select('id')->where('proyek_id', $projectId)->get(); + if (count($data) > 0) { + foreach ($data as $actData) { + $output[] = $actData->id; + } + } + return $output; + } + + /* for statusProyek, I want something output like this + const statusProyek = [ + { + "id": "1", + "proyek_name": "Pembuatan Aplikasi Survey Covid Varian Baru", // ambil dari m_proyek + "total_task": 80, // ambil dari m_activity -> SUM(jumlah_pekerjaan) where proyek_id berdasarkan proyek_id terpilih + "task_on_progress": 60, // ambil dari report_activity -> SUM(job_count_report) where activity_id berdasarkan activity_id terpilih + "day_left": 7, // ambil dari m_proyek, cari sisa hari (end_date - hari ini) + "percentage": 75 // (task_on_progress / total_task * 100) + }, + { + "id": "2", + "proyek_name": "Pembangunan Jembatan Layang", + "total_task": 70, // SELECT SUM(jumlah_pekerjaan) FROM public.m_activity WHERE proyek_id IN (11); + "task_on_progress": 70, // SELECT SUM(job_count_report) FROM public.report_activity WHERE activity_id IN (349, 355); + "day_left": 0, + "percentage": 100 + }, + ... + ] + */ + public function statusProyek(Request $request) { + $dataPayload = $request->all(); + $reqProject = []; + $dataFinal = []; + + if (!isset($dataPayload['project_id'])) { + return response()->json(['status'=>'failed','message'=>'Undefined project_id','code'=>400], 400); + } + + foreach ($dataPayload['project_id'] as $val) { + $prj["project_id"] = $val; + $prj["activity_id"] = $this->getActivityByProjectId($val); + + $reqProject[] = $prj; + } + + if (count($reqProject) > 0) { + $row = []; + + for ($i=0; $i < count($reqProject); $i++) { + $dataMaxVersionGantt = Activity::select(Activity::raw('MAX(version_gantt_id) as last_version_gantt'))->where("proyek_id", $reqProject[$i]['project_id'])->first(); + $last_version_gantt = $dataMaxVersionGantt->last_version_gantt; + $queryProject = Project::select('id', 'nama', 'mulai_proyek', 'akhir_proyek')->where('id',$reqProject[$i]['project_id'])->first(); + $sum_jumlah_pekerjaan = Activity::where('proyek_id', $reqProject[$i]['project_id'])->where('version_gantt_id', $last_version_gantt)->sum("jumlah_pekerjaan"); + $count_activity = Activity::where('proyek_id', $reqProject[$i]['project_id'])->where('version_gantt_id', $last_version_gantt)->count("id"); + $count_activity_done = Activity::where('proyek_id', $reqProject[$i]['project_id'])->where('persentase_progress', '100')->where('version_gantt_id', $last_version_gantt)->count("id"); + $progress_percentage = Activity::where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->sum("persentase_progress"); + $count_progress_percentage = Activity::where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->count("persentase_progress"); + + // progress_actual = bobot_planning * persentase_progress + $progress_actual = Activity::select('id', 'bobot_planning', 'persentase_progress')->where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->get(); + $current_progress = 0; + foreach($progress_actual as $objRow) { + // $total_current = ($objRow->bobot_planning * $objRow->persentase_progress) / 100; + $current_progress += ($objRow->bobot_planning * $objRow->persentase_progress) / 100; + } + + // yang sudah difilter dengan max_version_gantt + if (count($reqProject[$i]['activity_id']) > 0) { + for ($j=0; $j < count($reqProject[$i]['activity_id']); $j++) { + $sum_job_count_report = ReportActivity::whereIn('activity_id', $reqProject[$i]['activity_id'])->sum("job_count_report"); + } + } + + if (!isset($queryProject->id)) { + return response()->json(['status'=>'failed','message'=>'Project with id='.$reqProject[$i]['project_id'].' is not found!','code'=>400], 400); + } + + // sisa hari + $now = time(); + $akhir_proyek = strtotime($queryProject->akhir_proyek); + $datediff = $akhir_proyek - $now; + + $mulai_proyek = strtotime($queryProject->mulai_proyek); + $total_kontrak = $akhir_proyek - $mulai_proyek; + + $row["id"] = $queryProject->id; + $row["proyek_name"] = $queryProject->nama; + $row["mulai_proyek"] = $queryProject->mulai_proyek; + $row["akhir_proyek"] = $queryProject->akhir_proyek; + $row["total_kontrak"] = round($total_kontrak / (60 * 60 * 24)); + $row["total_task"] = $sum_jumlah_pekerjaan; + $row["task_on_progress"] = $sum_job_count_report; + $row["count_activity"] = $count_activity; + $row["count_activity_done"] = $count_activity_done; + $row["day_left"] = round($datediff / (60 * 60 * 24)); + $row["percentage"] = round($current_progress,3); + $row["count_progress_percentage"] = $count_progress_percentage; + + $dataFinal[] = $row; + } + } + + if($dataFinal){ + return response()->json(['status'=>'success','code'=>200,'data'=>$dataFinal, 'totalRecord'=>count($dataFinal)], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get status proyek, please try again later!','code'=>400], 400); + } + + } + + public function curvaS(Request $request) + { + $dataPayload = $request->all(); + $dataMaxVersionGantt = []; + foreach ($dataPayload['project_id'] as $val) { + $dataMaxVersionGantt[] = $this->getMaxVersionGantt($val); + } + // SELECT * FROM public.m_activity where proyek_id = 11 and version_gantt_id=12 and parent_id IS NULL; + $dataFinal=[]; + foreach ($dataMaxVersionGantt as $val) { + $data = Activity::select('m_activity.id', 'm_activity.proyek_id', 'm_activity.name', 'm_activity.kode_sortname', 'm_activity.persentase_progress', 'm_activity.persentase_bobot', 'm_activity.bobot_planning', 'm_activity.biaya_actual', 'mp.nama as proyek_name')->join("m_proyek as mp", "m_activity.proyek_id", "=", "mp.id")->where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->orderBy('id', 'asc')->get(); + $totalCostPlanning = Activity::where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->sum('rencana_biaya'); + // loop + $dataBobotPlan =[]; + for ($i=0; $i < count($data); $i++) { + // if($i) + $tmpp = 0; + $tmpa = 0; + $tmpbc = 0; + $tmpac = 0; + for ($x=$i; $x >= 0 ; $x--) { + $tmpp += $data[$x]['bobot_planning']; + $tmpa += ($data[$x]['persentase_progress'] * $data[$x]['bobot_planning'])/100; + $tmpbc += ((($data[$x]['persentase_progress'] * $data[$x]['bobot_planning'])/100)*$totalCostPlanning)/100; + $tmpac += $data[$x]['biaya_actual']; + } + + // $dataBobotPlan[] = $tmp; + $data[$i]['cal_bobot_p'] = round($tmpp,2); + if($i > 0 ){ + if($data[$i-1]['cal_bobot_a'] != null){ + if($data[$i-1]['cal_bobot_a'] == round($tmpa,2)){ + $data[$i]['cal_bobot_a'] = null; + }else{ + $data[$i]['cal_bobot_a'] = round($tmpa,2); + } + }else{ + $data[$i]['cal_bobot_a'] = null; + } + }else{ + $data[$i]['cal_bobot_a'] = round($tmpa,2); + } + $data[$i]['cal_budget_cost'] = round($tmpbc,2); + + // $data[$i]['cal_actual_cost']=round($tmpac,2); + if($i > 0 ){ + if($data[$i-1]['cal_actual_cost'] != null){ + if($data[$i-1]['cal_actual_cost'] == round($tmpac,2)){ + $data[$i]['cal_actual_cost'] = null; + }else{ + $data[$i]['cal_actual_cost'] = round($tmpac,2); + } + }else{ + $data[$i]['cal_actual_cost'] = null; + } + }else{ + $data[$i]['cal_actual_cost'] = round($tmpac,2); + } + } + // hitung persentase_progress = persentase_progress*bobot_planning/100 + + $dataFinal[] = array("proyek_id" => $val['proyek_id'], "proyek_name" => isset($data) && count($data) > 0 ? $data[0]['proyek_name'] : "-", "version_gantt_id" => $val['last_version_gantt'], "data" => $data); + + } + + if($dataPayload){ + return response()->json(['status'=>'success','code'=>200, 'data'=>$dataFinal, 'totalRecord'=>1], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list role, please try again later!','code'=>400], 400); + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/DivisiController.php b/app/Http/Controllers/DivisiController.php new file mode 100644 index 0000000..6687c8d --- /dev/null +++ b/app/Http/Controllers/DivisiController.php @@ -0,0 +1,96 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = Divisi::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Master divisi successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Master divisi failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = Divisi::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Master divisi not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Master divisi successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master divisi failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Divisi::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Master divisi not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Master divisi successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master divisi failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_divisi'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Divisi::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ExampleController.php b/app/Http/Controllers/ExampleController.php new file mode 100644 index 0000000..2923bc6 --- /dev/null +++ b/app/Http/Controllers/ExampleController.php @@ -0,0 +1,18 @@ +validate($request, [ + 'name_folder' => 'required', + 'proyek_id' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = FolderDocumentProyek::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Folder Document Proyek successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Folder Document Proyek failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = FolderDocumentProyek::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Folder Document Proyek not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Folder Document Proyek successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Folder Document Proyek failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = FolderDocumentProyek::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Folder Document Proyek not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Folder Document Proyek successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Folder Document Proyek failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_FolderDocumentProyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = FolderDocumentProyek::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } + public function getTree($id) + { + $data = FolderDocumentProyek::where('proyek_id', $id)->whereNull('parent_id')->orderByRaw('id ASC')->get(); + $dataFile = DokumenProject::where('type_dokumen', 'project-document-out-folder')->where('ref_id', $id)->orderByRaw('id ASC')->get(); + // var_dump($dataFile); + $finalData = []; + foreach($data as $objRow){ + $objRow->children = $this->getChildren($id, $objRow->id); + $objRow->key = rand(1, 1000); + $objRow->isDir = true; + $finalData[] = $objRow; + } + + foreach($dataFile as $objRowFile) { + $objRowFile->key = rand(1, 1000); + $objRowFile->isDir = false; + $objRowFile->proyek_id = $id; + $finalData[] = $objRowFile; + } + + return response()->json(['status'=>'success','data'=>$finalData,'code'=>200], 200); + } + + private function getChildren($proyek_id, $parent_id) + { + $finalData = []; + $data = FolderDocumentProyek::where('proyek_id', $proyek_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); + $dataFile = DokumenProject::where('type_dokumen', 'project-document-in-folder')->where('ref_id', $parent_id)->orderByRaw('id ASC')->get(); + foreach($data as $objRow){ + $objRow->key = rand(1, 1000); + $objRow->children = $this->getChildren($proyek_id, $objRow->id); + $objRow->isDir = true; + $finalData[] = $objRow; + } + + foreach($dataFile as $objRowFile) { + $objRowFile->key = rand(1, 1000); + $objRowFile->isDir = false; + $objRowFile->proyek_id = $proyek_id; + $finalData[] = $objRowFile; + } + + return $finalData; + } +} diff --git a/app/Http/Controllers/HolidayController.php b/app/Http/Controllers/HolidayController.php new file mode 100644 index 0000000..9056c11 --- /dev/null +++ b/app/Http/Controllers/HolidayController.php @@ -0,0 +1,148 @@ +validate($request, [ + 'proyek_id' => 'required', + 'version_gantt_id' => 'required', + 'date' => 'required' + ]); + + $data = $request->all(); + $duration = $request->duration; + if(!$duration){ + $data['duration'] = 1; + } + $data['created_by'] = $this->currentName; + + $result = Holiday::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add holiday successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add holiday failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Holiday::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data holiday, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Holiday::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data holiday not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data holiday successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data holiday failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Holiday::find($id); + + if($data){ + $deletedData = $data; + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data holiday not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success', 'data'=>$deletedData,'message'=>'data holiday successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data holiday failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_holidays'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Holiday::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list holiday, please try again later!','code'=>400], 400); + } + } + + public function datatables(Request $request){ + $proyek_id = $request->query('proyek_id'); + $gantt_id = $request->query('gantt_id'); + + $data = Holiday::where('proyek_id', $proyek_id)->where('version_gantt_id', $gantt_id)->get(); + + return Datatables::of($data) + ->editColumn('date', function($row) { + $date = date_create($row->date); + $dateFormat = date_format($date,"d-m-Y"); + return $dateFormat; + }) + ->editColumn('duration', function($row) { + $day = (int)$row->duration > 1 ? "days" : "day"; + return $row->duration." ".$day; + }) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + + ->rawColumns(['action'])->make(true); + } +} diff --git a/app/Http/Controllers/HumanResourceController.php b/app/Http/Controllers/HumanResourceController.php new file mode 100644 index 0000000..9068444 --- /dev/null +++ b/app/Http/Controllers/HumanResourceController.php @@ -0,0 +1,183 @@ +validate($request, [ + 'role_id' => 'required', + // 'username' => 'required', + // 'password' => 'required', + 'name' => 'required', + // 'phone_number' => 'required', + // 'email' => 'required', + // 'address' => 'required', + 'ktp_number' => 'required', + 'employee_type' => 'required' + ]); + + $data = $request->all(); + + if(isset($request->password) && $request->password!=""){ + $data['password'] = md5($request->password); + } + + $result = HumanResource::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'Human Resource Pool successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Human Resource Pool failed created','code'=>400]); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = HumanResource::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data human resource, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $humanresource = HumanResource::find($id); + + $data = $request->all(); + + if(isset($request->password) && $request->password!="" ){ + $data['password'] = md5($request->password); + } + + if($humanresource){ + $result = $humanresource->update($data); + }else{ + return response()->json(['status'=>'failed','message'=>'data Human Resource Pool not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Human Resource Pool successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Human Resource Pool failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = HumanResource::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Human Resource Pool not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Human Resource Pool successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Human Resource Pool failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_users'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = HumanResource::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list human resource, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request){ + + $search = $request->query('search'); + + $idActivity = (int)$request->query('idact'); + $idProyek = (int)$request->query('idProyek'); + + $forbidden = []; + + if($idActivity && $idActivity > 0){ + $dataF = UserToActivity::select("user_id")->where("activity_id", $idActivity)->get(); + foreach($dataF as $val){ + $forbidden[] = $val->user_id; + } + } + + if($search && !empty($search)){ + $data = UserToProyek::select("m_users.id as id", "m_users.name as name", "assign_hr_to_proyek.project_role as proyek_role")->join('m_users', 'm_users.id', '=', 'assign_hr_to_proyek.user_id') + ->where("assign_hr_to_proyek.proyek_id", $idProyek)->where("m_users.name", 'like', '%'.$search.'%')->whereNotIn("m_users.id", $forbidden)->get(); + }else{ + $data = UserToProyek::select("m_users.id as id", "m_users.name as name", "assign_hr_to_proyek.project_role as proyek_role")->where("assign_hr_to_proyek.proyek_id", $idProyek)->join('m_users', 'm_users.id', '=', 'assign_hr_to_proyek.user_id')->whereNotIn("m_users.id", $forbidden)->get(); + } + + return response()->json($data); + } + + public function checkOldPassword(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $data = $request->all(); + + if(isset($request->old_password) && $request->old_password!="" ){ + $result = HumanResource::find($id); + $data['old_password'] = md5($request->old_password); + if($data['old_password'] !== $result->password) { + return response()->json(['status'=>'failed','message'=>"old password seems doesn't match in records. please try again.",'code'=>400], 400); + } + elseif($data['old_password'] === $result->password) { + return response()->json(['status'=>'success','message'=>"old password match",'data'=>$result,'code'=>200], 200); + } + } + else { + return response()->json(['status'=>'failed','message'=>'old_password is required!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ImageController.php b/app/Http/Controllers/ImageController.php new file mode 100644 index 0000000..82650d2 --- /dev/null +++ b/app/Http/Controllers/ImageController.php @@ -0,0 +1,128 @@ +hasFile('files')){ + + $this->validate($request, [ + 'ref_id' => 'required', + 'category' => 'required' + ]); + + $ref_id = $request->ref_id; + $dokumen = $request->file('files'); + $extension = $dokumen->extension(); + $name = $ref_id.date("YmdHis").".".$extension; + + $resultMove = $dokumen->move($this->pathImage, $name); + + if($resultMove){ + $data = [ + 'ref_id' => (int)$ref_id, + 'image' => $name, + 'category' => $request->category + ]; + + $result = Image::create($data); + + if($result){ + return response()->json(['status'=>'success', "name_image"=>$name,'message'=>'image upload is successfully!','code'=>200], 200); + }else{ + unlink($this->pathImage.$name); + return response()->json(['status'=>'failed','message'=>'image upload is failed!','code'=>400], 400); + } + + }else{ + return response()->json(['status'=>'failed','message'=>'image upload is failed!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'image is required!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Image::find($id); + + if($data){ + unlink($this->pathImage.$data->image); + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data image not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data image successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data image failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_image'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function deleteByRef($id, $category) + { + $data = Image::where("ref_id", $id)->where("category", $category)->first(); + + if($data){ + unlink($this->pathImage.$data->image); + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data image not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data image successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data image failed deleted!','code'=>400], 400); + } + } + + public function getByRefId($id, $category) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + if(!$category || $category==""){ + return response()->json(['status'=>'failed','message'=>'category is required!','code'=>400], 400); + die(); + } + + $result = Image::where("ref_id", $id)->where("category", $category)->first(); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data image, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/LinkController.php b/app/Http/Controllers/LinkController.php new file mode 100644 index 0000000..2d95e86 --- /dev/null +++ b/app/Http/Controllers/LinkController.php @@ -0,0 +1,116 @@ +validate($request, [ + 'source' => 'required', + 'target' => 'required', + 'type' => 'required', + 'version_gantt_id' => 'required' + ]); + + $code = $this->getCodeByType($request->type); + + $data = array( + 's_activity_id'=> $request->source, + 't_activity_id'=> $request->target, + 'type_link'=> $request->type, + 'code_link'=> $code, + 'version_gantt_id'=>$request->version_gantt_id + ); + + $data['created_by'] = $this->currentName; + + $result = Link::create($data); + + if($result){ + return response()->json(['status'=>'success', 'tid'=>$result->id, 'action'=>'inserted','message'=>'add data project successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'add data project failed!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'id is required!','code'=>400], 400); + } + + $data = Link::find($id); + + $code = $this->getCodeByType($request->type); + + $dataUpdate = array( + 's_activity_id'=> $request->source, + 't_activity_id'=> $request->target, + 'type_link'=> $request->type, + 'code_link'=> $code, + 'lag'=> $request->lag, + 'updated_by'=> $this->currentName + ); + + if($data){ + $result = $data->update($dataUpdate); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'activity link not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success', 'action'=>'updated','message'=>'activity link successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'activity link failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'id is required!','code'=>400], 400); + die(); + } + + $data = Link::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'activity link not found!','code'=>400], 400); + die(); + } + + + if($delete){ + $deletAll = Link::where("parent_id", $id); + $deletAll->delete(); + return response()->json(['status'=>'success', 'action'=>'deleted','message'=>'activity link successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed', 'action'=>'error','message'=>'activity link failed deleted!','code'=>400], 400); + } + } + + private function getCodeByType($code){ + switch ($code) { + case 1: + return "SS"; + break; + case 2: + return "FF"; + break; + case 3: + return "SF"; + break; + default: + return "FS"; + break; + } + } +} diff --git a/app/Http/Controllers/MaterialProjectController.php b/app/Http/Controllers/MaterialProjectController.php new file mode 100644 index 0000000..21a360e --- /dev/null +++ b/app/Http/Controllers/MaterialProjectController.php @@ -0,0 +1,54 @@ +project_id; + $subproyekId = $request->subproyek_id; + $listMaterialId = $request->material_id; + + if(!$projectId && !$subproyekId){ + return response()->json(['status'=>'failed','message'=>'Required proyek_id or subproyek id','code'=>400]); + } + + if(is_array($listMaterialId) && count($listMaterialId) > 0){ + $result = 0; + MaterialProject::where('proyek_id', $projectId)->delete(); + MaterialProject::where('proyek_id', $subproyekId)->delete(); + foreach($listMaterialId as $material_id){ + $data = [ + 'material_resource_id'=>(int)$material_id + ]; + + if($projectId && $projectId!="" && (int)$projectId > 0){ + $data['proyek_id'] = $projectId; + }else if($subproyekId && $subproyekId!="" && (int)$subproyekId > 0){ + $data['subproyek_id'] = $subproyekId; + } + + $insert = MaterialProject::create($data); + if($insert){ + $result++; + }else{ + $result--; + } + } + if($result > 0){ + return response()->json(['status'=>'success','message'=>'Material Project successfull updated','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Material Project failed updated','code'=>400]); + } + }else{ + MaterialProject::where('proyek_id', $projectId)->delete(); + MaterialProject::where('proyek_id', $subproyekId)->delete(); + return response()->json(['status'=>'success','message'=>'Material Project Successfull updated','code'=>200]); + } + + } +} diff --git a/app/Http/Controllers/MaterialResourceController.php b/app/Http/Controllers/MaterialResourceController.php new file mode 100644 index 0000000..5acdab2 --- /dev/null +++ b/app/Http/Controllers/MaterialResourceController.php @@ -0,0 +1,136 @@ +validate($request, [ + 'name' => 'required', + 'uom' => 'required', + 'unit_price' => 'required', + 'description' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = MaterialResource::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data material resource successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data material resource failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = MaterialResource::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data material resource, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = MaterialResource::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data material resource not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data material resource successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data material resource failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = MaterialResource::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data material resource not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data material resource successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data material resource failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_material_resource'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = MaterialResource::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list material resource, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request){ + + $search = $request->query('search'); + $projectId = $request->idProyek; + + if($search && !empty($search)){ + // $data = MaterialResource::where("name", 'ilike', '%'.$search.'%')->get(); + $data = RequestMaterial::where("description", 'ilike', '%'.$search.'%')->get(); + }else{ + // $data = MaterialResource::all(); + $data = RequestMaterial::Where("proyek_id", $projectId)->get(); + } + + return response()->json($data); + } +} diff --git a/app/Http/Controllers/MenuController.php b/app/Http/Controllers/MenuController.php new file mode 100644 index 0000000..a367332 --- /dev/null +++ b/app/Http/Controllers/MenuController.php @@ -0,0 +1,159 @@ +validate($request, [ + 'icon' => 'required', + 'name' => 'required', + 'url' => 'required', + 'sequence' => 'required', + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = Menu::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data menu successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data menu failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Menu::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data menu, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Menu::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data menu successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Menu::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data menu successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_menu'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function listMenu($id) + { + $dataParent = RoleMenu::select("m_menu.*") + ->join('m_menu', 'm_menu.id', '=', 't_roles_menu.menu_id') + ->join('m_roles', 'm_roles.id', '=', 't_roles_menu.role_id') + ->whereNull('m_menu.parent_id') + ->where('m_roles.id', $id) + ->orderBy('m_menu.sequence', 'ASC') + ->get(); + + $finalData = []; + foreach($dataParent as $data){ + $data->children = $this->getChildrenMenu($data->id, $id); + $finalData[] = $data; + } + + return response()->json(['status'=>'success','code'=>200,'data'=>$finalData], 200); + } + + protected function getChildrenMenu($id, $role_id) + { + $dataChildren = RoleMenu::select("m_menu.*") + ->join('m_menu', 'm_menu.id', '=', 't_roles_menu.menu_id') + ->join('m_roles', 'm_roles.id', '=', 't_roles_menu.role_id') + ->where('m_roles.id', $role_id) + ->where('m_menu.parent_id', $id) + ->orderBy('m_menu.sequence', 'ASC') + ->get(); + $children = []; + if($dataChildren){ + foreach($dataChildren as $data) + { + $data->children = $this->getChildrenMenu($data->id, $role_id); + $children[] = $data; + } + } + return $children; + } + + public function list() + { + $data = Menu::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list menu, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/OfficeHoursController.php b/app/Http/Controllers/OfficeHoursController.php new file mode 100644 index 0000000..f959244 --- /dev/null +++ b/app/Http/Controllers/OfficeHoursController.php @@ -0,0 +1,116 @@ +validate($request, [ + 'proyek_id' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = OfficeHours::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data office hours successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data office hours failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = OfficeHours::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data office hours, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = OfficeHours::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data office hours not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data office hours successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data office hours failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = OfficeHours::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data office hours not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data office hours successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data office hours failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_office_hours'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = OfficeHours::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list office hours, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/PanicButtonController.php b/app/Http/Controllers/PanicButtonController.php new file mode 100644 index 0000000..8bd6c50 --- /dev/null +++ b/app/Http/Controllers/PanicButtonController.php @@ -0,0 +1,118 @@ +validate($request, [ + 'user_id' => 'required', + 'lat' => 'required', + 'lon' => 'required' + ]); + + $data = $request->all(); + + $status_response = $request->status_response ? $request->status_response : "active"; + + $data['status_response'] = $status_response; + + $data['created_by'] = $this->currentName; + + $result = PanicButton::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'Panic button successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Panic button failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = PanicButton::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Panic button not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Panic button successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Panic button failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = PanicButton::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Panic button not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Panic button successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Panic button failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = PanicButton::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data Panic button, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in golang API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_panic_button'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = PanicButton::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Panic button, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/PresenceController.php b/app/Http/Controllers/PresenceController.php new file mode 100644 index 0000000..a0e2387 --- /dev/null +++ b/app/Http/Controllers/PresenceController.php @@ -0,0 +1,351 @@ +validate($request, [ + 'user_id' => 'required' + ]); + + //var_dump($request); + + if($request->type=="out"){ + + $clock_out_loc = "-"; + // if (isset($request->clock_out_lat) && isset($request->clock_out_lng)) { + // $response = Http::get(config('api.nominatim') . "/reverse?lat=".$request->clock_out_lat."&lon=".$request->clock_out_lng."&format=json"); + // $clock_out_loc = $response->json()["display_name"]; + // } + $dataUpdate = array( + "clock_out"=>$request->clock_time, + "clock_out_lat" => $request->clock_out_lat, + "clock_out_lng" => $request->clock_out_lng, + "updated_by"=>$this->currentName, + "clock_out_loc" => $clock_out_loc + ); + + $resultUpdate = $this->updateFormAdd($dataUpdate, $request->user_id); + if($resultUpdate && $resultUpdate > 0){ + return response()->json(['status'=>'success', 'id'=>$resultUpdate,'message'=>'clock out success!','code'=>200], 200); + } + // enable multiple clock out at same day, so I commented this + // else if($resultUpdate=="has presence"){ + // return response()->json(['status'=>'failed','message'=>'clock in failed, user has made presence today!','code'=>400], 400); + // } + else{ + return response()->json(['status'=>'failed','message'=>'clock out failed please try again!','code'=>400], 400); + } + die(); + } + + $date = date_create($request->clock_time); + $onlyDate = date_format($date,"Y-m-d"); + + // enable multiple clock in at same day, so I commented this + // $cek = Presence::where('user_id',$request->user_id)->where("date_presence", $onlyDate)->count(); + // if($cek > 0){ + // return response()->json(['status'=>'failed','message'=>'clock in failed, user has made presence today!','code'=>400], 400); + // die(); + // } + + $clock_in_loc = "-"; + // if (isset($request->clock_in_lat) && isset($request->clock_in_lng)) { + // $response = Http::get(config('api.nominatim') . "/reverse?lat=".$request->clock_in_lat."&lon=".$request->clock_in_lng."&format=json"); + // $clock_in_loc = $response->json()["display_name"]; + // } + + $dataAdd = array( + 'user_id'=> $request->user_id, + 'clock_in'=> $request->clock_time, + 'date_presence'=> $onlyDate, + 'created_by' =>$this->currentName, + 'clock_in_lat' => $request->clock_in_lat, + 'clock_in_lng' => $request->clock_in_lng, + 'clock_in_loc' => $clock_in_loc + ); + + $result = Presence::create($dataAdd); + + if($result){ + return response()->json(['status'=>'success', 'id'=>$result->id,'message'=>'clock in successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'clock in failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Presence::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project, please try again later!','code'=>400], 400); + } + } + + // public function clockinout($id) { + // $client = new Client(); + // $res = $client->request('GET', config('api.golang') . "/clockinout/{$id}"); + // if ($res->getStatusCode() != 200) { + // return response()->json(['status'=>'failed','message'=>'failed get data clockinout, please try again later!','code'=>400], 400); + // } + + // $result= $res->getBody(); + // return response($result, 200) + // ->header("content-type", $res->getHeaderLine('content-type')); + // } + + public function clockinout($id) { + $dateTimeNow = Carbon::now()->addHour(7); + // ambil data t_clockinout where user_id + $dataPresence = Presence::where('user_id', $id)->orderBy('id', 'DESC')->first(); + // ambil data working hour shift + // $dataShift = DB::table('t_users_monthly_shift')->where('user_id', $id)->orderBy('id', 'DESC')->first(); + // if($dataShift){ + // // cek ke jsonb + // }else{ + // $dataWorkingHour = DB::table('m_shift')->where('is_non_shift', 't')->first(); + // } + + // $dataWorkingHour->start_time; + // $dataWorkingHour->end_time; + // $dataWorkingHour->flex_time_minute; + + // if(Carbon::now()->format('H') == ){ + // $in_working_time = + // } + + if($dataPresence){ + + // "id": 131, + // "at": "2022-04-13T02:31:44.913587582+07:00", + // "user_id": 330, + // "clock_in": null, + // "clock_out": null, + // "last_clock_in": "2022-04-11T07:44:05+07:00", + // "last_clock_out": "2022-04-11T16:05:01+07:00", + // "start_at": "2022-04-12T04:59:59+07:00", + // "end_at": "2022-04-14T00:59:01+07:00", + // "in_working_time": true + $dateNow = date("Y-m-d"); + $dateA = strtotime($dataPresence->clock_in); + $dayClockin = date("Y-m-d", $dateA); + if($dayClockin == $dateNow){ + $clock_in = $dataPresence->clock_in; + $clock_out = $dataPresence->clock_out; + }else{ + $clock_in = null; + $clock_out = null; + } + // new \DateTime($minDate) + $res_data = array( + "id" => $dataPresence->id, + // "at"=> Carbon::now()->timezone('Asia/Jakarta'), + "at" => $dateTimeNow, + "user_id"=> $id, + "clock_in"=> $clock_in, + "clock_out"=> $clock_out, + "last_clock_in"=> $dataPresence->clock_in, + "last_clock_out"=> $dataPresence->clock_out, + // "start_at"=> "2022-04-12T04=>59=>59+07=>00", + // "end_at"=> "2022-04-14T00=>59=>01+07=>00", + "in_working_time"=> true + ); + return response()->json(['status'=>'success','data'=>$res_data,'code'=>200], 200); + } + $res_data = array( + "id" => null, + "at" => $dateTimeNow, + "user_id"=> $id, + "clock_in"=> null, + "clock_out"=> null, + "last_clock_in"=> null, + "last_clock_out"=> null, + // "start_at"=> "2022-04-12T04=>59=>59+07=>00", + // "end_at"=> "2022-04-14T00=>59=>01+07=>00", + "in_working_time"=> true + ); + return response()->json(['status'=>'success','data'=>$res_data,'code'=>200], 200); + } + + private function updateFormAdd($data, $id){ + + $date = date_create($data['clock_out']); + + $onlyDate = date_format($date,"Y-m-d"); + + // enable multiple clock out at same day, so I commented this + // $cek = Presence::where('user_id', $id)->where("date_presence", $onlyDate)->whereNotNull('clock_out')->count(); + // if($cek > 0){ + // return "has presence"; + // die(); + // } + + $dataPresence = Presence::where('user_id',$id) + ->where("clock_in", "<=", $data["clock_out"]) + ->orderByDesc("id") + ->first(); + + if($dataPresence){ + $queryUpdate = $dataPresence->update($data); + if($queryUpdate){ + $getDataUpdate = Presence::where('user_id', $id)->where("date_presence", $onlyDate)->first(); + return $getDataUpdate->id; + }else{ + return false; + } + }else{ + return false; + } + die(); + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Presence::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data presence not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data presence successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data presence failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Presence::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data presence not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data presence successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data presence failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_clock_in_out'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + $finalData = []; + // foreach ($dataGet as $objRow) { + // // each clock_in_lat, clock_in_lng request to Address API and push clock_in_location to $dataGet + // // format clock_in_loc (full address / display_name) for now + // $clock_in_lat = $objRow->clock_in_lat; + // $clock_in_lng = $objRow->clock_in_lng; + // $objRow->clock_in_loc = ""; + // if (isset($clock_in_lat) && isset($clock_in_lng)) { + // $response = Http::get(self::NOMINATIM_ADDR . "/reverse?lat=".$clock_in_lat."&lon=".$clock_in_lng."&format=json"); + // $objRow->clock_in_loc = $response->json()["display_name"]; + // } + + // // each clock_out_lat, clock_out_lng request to Address API and push clock_out_location to $dataGet + // // format clock_out_loc (full adrress / display_name) for now + // $clock_out_lat = $objRow->clock_out_lat; + // $clock_out_lng = $objRow->clock_out_lng; + // $objRow->clock_out_loc = ""; + // if (isset($clock_out_lat) && isset($clock_out_lng)) { + // $response = Http::get(self::NOMINATIM_ADDR . "/reverse?lat=".$clock_out_lat."&lon=".$clock_out_lng."&format=json"); + // $objRow->clock_out_loc = $response->json()["display_name"]; + // } + + // $finalData[] = $objRow; + // } + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Presence::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list presence, please try again later!','code'=>400], 400); + } + } + + public function bulkUpdateLocation() + { + $data = Presence::all(); + $finalData = []; + foreach($data as $objRow) { + $presence = Presence::find($objRow->id); + + // each clock_in_lat, clock_in_lng request to Address API and push clock_in_location to $dataGet + // format clock_in_loc (full address / display_name) for now + $clock_in_lat = $objRow->clock_in_lat; + $clock_in_lng = $objRow->clock_in_lng; + $objRow->clock_in_loc = ""; + if (isset($clock_in_lat) && isset($clock_in_lng)) { + $response = Http::get(config('api.nominatim') . "/reverse?lat=".$clock_in_lat."&lon=".$clock_in_lng."&format=json"); + $objRow->clock_in_loc = $response->json()["display_name"]; + } + + // each clock_out_lat, clock_out_lng request to Address API and push clock_out_location to $dataGet + // format clock_out_loc (full adrress / display_name) for now + $clock_out_lat = $objRow->clock_out_lat; + $clock_out_lng = $objRow->clock_out_lng; + $objRow->clock_out_loc = ""; + if (isset($clock_out_lat) && isset($clock_out_lng)) { + $response = Http::get(config('api.nominatim') . "/reverse?lat=".$clock_out_lat."&lon=".$clock_out_lng."&format=json"); + $objRow->clock_out_loc = $response->json()["display_name"]; + } + + // $finalData[] = $objRow; + + $presence->clock_in_loc = $objRow->clock_in_loc; + $presence->clock_out_loc = $objRow->clock_out_loc; + $presence->save(); + } + } +} diff --git a/app/Http/Controllers/ProjectApprovalController.php b/app/Http/Controllers/ProjectApprovalController.php new file mode 100644 index 0000000..f313c57 --- /dev/null +++ b/app/Http/Controllers/ProjectApprovalController.php @@ -0,0 +1,140 @@ +validate($request, [ + 'proyek_id' => 'required', + 'tittle' => 'required', + 'name' => 'required', + 'date_approval' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectApproval::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project approval successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project approval failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectApproval::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project approval, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectApproval::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project approval not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project approval successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project approval failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectApproval::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project approval not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project approval successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project approval failed deleted!','code'=>400], 400); + } + } + + public function deleteByProyek($id) + { + $data = ProjectApproval::where('proyek_id', $id)->delete(); + + if($data){ + return response()->json(['status'=>'success','message'=>'data project approval successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project approval failed deleted, because data not found!','code'=>200], 200); + } + } + + public function customWhere($where, $val) + { + $data = ProjectApproval::where($where, $val)->orderBy('id', 'asc')->get(); + + if($data){ + return response()->json(['status'=>'success','data'=> $data,'code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project approval not found!','code'=>400], 40); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'project_approval'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectApproval::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project approval, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ProjectCharterController.php b/app/Http/Controllers/ProjectCharterController.php new file mode 100644 index 0000000..2f92087 --- /dev/null +++ b/app/Http/Controllers/ProjectCharterController.php @@ -0,0 +1,119 @@ +validate($request, [ + // 'nama' => 'required', + // 'keterangan' => 'required', + // 'mulai_proyek' => 'required', + // 'akhir_proyek' => 'required' + // ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectCharter::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project charter successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project charter failed!','code'=>400], 400); + } + } + + // public function edit($id){ + // if(!$id || (int) $id < 0 || $id==""){ + // return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + // die(); + // } + + // $result = Project::find($id); + + // if($result){ + // return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'failed get data project, please try again later!','code'=>400], 400); + // } + // } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectCharter::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project failed updated!','code'=>400], 400); + } + } + + // public function delete($id) + // { + // $data = Project::find($id); + + // if($data){ + // $delete = $data->delete(); + // }else{ + // return response()->json(['status'=>'failed','message'=>'data project not found!','code'=>400], 400); + // die(); + // } + + + // if($delete){ + // return response()->json(['status'=>'success','message'=>'data project successfully deleted!','code'=>200], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'data project failed deleted!','code'=>400], 400); + // } + // } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'project_charter'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + // public function list() + // { + // $data = Project::all(); + // $countData = $data->count(); + + // if($data){ + // return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'failed get list project, please try again later!','code'=>400], 400); + // } + // } +} diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php new file mode 100644 index 0000000..88df320 --- /dev/null +++ b/app/Http/Controllers/ProjectController.php @@ -0,0 +1,252 @@ +validate($request, [ + 'nama' => 'required', + // 'keterangan' => 'required', + 'mulai_proyek' => 'required', + 'akhir_proyek' => 'required', + 'rencana_biaya' => 'required', + 'type_proyek_id' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = Project::create($data); + + if($result){ + $this->createOfficeHours($result->id); + $dataResultInsert = Project::where('nama', $data['nama'])->where('mulai_proyek', $data['mulai_proyek'])->first(); + return response()->json(['status'=>'success','message'=>'add data project successfully!', 'data_result' =>$dataResultInsert, 'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Project::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Project::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project failed updated!','code'=>400], 400); + } + } + + private function createOfficeHours($proyek_id) + { + $dataCreate = array( + "proyek_id"=>$proyek_id, + "monday_start"=> "08:00:00", + "monday_end"=> "16:00:00", + "tuesday_start"=> "08:00:00", + "tuesday_end"=> "16:00:00", + "wednesday_start"=> "08:00:00", + "wednesday_end"=> "16:00:00", + "thursday_start"=> "08:00:00", + "thursday_end"=> "16:00:00", + "friday_start"=> "08:00:00", + "friday_end"=> "16:00:00", + "saturday_start"=> "08:00:00", + "saturday_end"=> "16:00:00", + "sunday_start"=> "08:00:00", + "sunday_end"=> "16:00:00", + "created_by"=> $this->currentName + ); + + OfficeHours::create($dataCreate); + + return true; + } + + public function delete($id) + { + $data = Project::find($id); + + if($data){ + $this->deleteRelative($id); + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project failed deleted!','code'=>400], 400); + } + } + + private function deleteRelative($project_id) + { + UserToProyek::where('proyek_id', $project_id)->delete(); + UserToActivity::where('proyek_id', $project_id)->delete(); + AssignMaterial::where('proyek_id', $project_id)->delete(); + ProjectCharter::where('proyek_id', $project_id)->delete(); + ProjectApproval::where('proyek_id', $project_id)->delete(); + ProjectMileStone::where('proyek_id', $project_id)->delete(); + ProjectParticipants::where('proyek_id', $project_id)->delete(); + $this->deleteVersionGantt($project_id); + $this->deleteDokumenProject($project_id); + } + + private function deleteVersionGantt($project_id) + { + $dataVg = VersionGantt::where("proyek_id", $project_id)->pluck("id"); + $vhIds = $dataVg->all(); + $activity = Activity::whereIn("version_gantt_id", $vhIds)->pluck('id'); + $activityIds = $activity->all(); + $dataRa = ReportActivity::whereIn("activity_id", $activityIds)->get(); + foreach ($dataRa as $ra) { + $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); + foreach ($images as $image) { + if(file_exists($this->pathImage.$image->image)){ + unlink($this->pathImage.$image->image); + } + } + Image::where("ref_id", $ra->id)->where("category", "report_activity")->delete(); + } + $dataAd = ActivityDokumen::whereIn("activity_id", $activityIds)->get(); + foreach ($dataAd as $ad) { + if(file_exists($this->pathActivityDocument.$ad->file)){ + unlink($this->pathActivityDocument.$ad->file); + } + } + ActivityDokumen::whereIn("activity_id", $activityIds)->delete(); + CommentActivity::whereIn("activity_id", $activityIds)->delete(); + Holiday::where("proyek_id", $project_id)->delete(); + VersionGantt::where("proyek_id", $project_id)->delete(); + Link::whereIn("version_gantt_id", $vhIds)->delete(); + ShowHideColumn::whereIn("version_gantt_id", $vhIds)->delete(); + Activity::whereIn("version_gantt_id", $vhIds)->delete(); + ReportActivity::whereIn("activity_id", $activityIds)->delete(); + } + + private function deleteDokumenProject($project_id) + { + $dataDokumen = DokumenProject::where("type_dokumen", "project-document-out-folder")->where('ref_id', $project_id)->get(); + + foreach ($dataDokumen as $dokumen) { + if(file_exists($this->pathDocument.$dokumen->file)){ + unlink($this->pathDocument.$dokumen->file); + } + } + DokumenProject::where("type_dokumen", "project-document-out-folder")->where('ref_id', $project_id)->delete(); + + $dataFolder = FolderDocumentProyek::where('proyek_id', $project_id)->pluck("id"); + $ref_ids = $dataFolder->all(); + $dataDokumen = DokumenProject::where("type_dokumen", "project-document-in-folder")->whereIn('ref_id', $ref_ids)->get(); + foreach ($dataDokumen as $dokumen) { + if(file_exists($this->pathDocument.$dokumen->file)){ + unlink($this->pathDocument.$dokumen->file); + } + } + + DokumenProject::where("type_dokumen", "project-document-in-folder")->whereIn('ref_id', $ref_ids)->delete(); + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_proyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Project::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project, please try again later!','code'=>400], 400); + } + } + + public function getListProjectTask($id){ + $data = UserToActivity::select("assign_hr_to_activity.user_id as user_id","m_proyek.*")->where("assign_hr_to_activity.user_id", $id)->join('m_proyek', 'assign_hr_to_activity.proyek_id', '=', 'm_proyek.id') + ->groupBy("m_proyek.proyek_id")->get(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ProjectDokumenController.php b/app/Http/Controllers/ProjectDokumenController.php new file mode 100644 index 0000000..15ba4d1 --- /dev/null +++ b/app/Http/Controllers/ProjectDokumenController.php @@ -0,0 +1,108 @@ + 0){ + $dataDokumen = DokumenProject::where("ref_id", $id)->get(); + + return response()->json(['status'=>'success','data'=>$dataDokumen,'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'project id is required!','code'=>400], 400); + } + } + + public function delete($id) + { + if($id && $id!="" && (int)$id > 0){ + $dokumen = DokumenProject::find($id); + if($dokumen){ + if(file_exists($this->pathDocument.$dokumen->file)){ + unlink($this->pathDocument.$dokumen->file); + } + $dokumen->delete(); + return response()->json(['status'=>'success','message'=>'Dokumen deleted successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); + } + } + + public function uploadProjectDokumen(Request $request) + { + if($request->hasFile('dokumen')){ + // $project_id = $request->project_id; + $dokumen = $request->file('dokumen'); + $ref_id = $request->ref_id; + $extension = $dokumen->extension(); + $name = $dokumen->getClientOriginalName(); + + $result = $dokumen->move($this->pathDocument, $name); + if($result){ + $data = [ + // 'ref_id' => (int)$project_id, + 'ref_id' => (int)$ref_id, + 'file' => $name, + 'type_dokumen' => isset($request->type_dokumen) ? $request->type_dokumen : 'project-document' // project-document-in-folder / project-document-out-folder + ]; + + $result = DokumenProject::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'file upload is successfully!','code'=>200], 200); + }else{ + unlink($this->pathDocument.$name); + return response()->json(['status'=>'failed','message'=>'file upload is failed!','code'=>400], 400); + } + + }else{ + return response()->json(['status'=>'failed','message'=>'file upload is failed!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'file is required!','code'=>400], 400); + } + } + + public function searchDocProject(Request $request){ + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'document_project'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function downloadDokumen($id) + { + if($id && $id!="" && (int)$id > 0){ + $dokumen = DokumenProject::find($id); + if($dokumen){ + if(file_exists($this->pathDocument.$dokumen->file)){ + $pathToFile = $this->pathDocument.$dokumen->file; + return response()->download($pathToFile); + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Dokumen not found!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'Id is required!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ProjectMileStoneController.php b/app/Http/Controllers/ProjectMileStoneController.php new file mode 100644 index 0000000..8a8d02c --- /dev/null +++ b/app/Http/Controllers/ProjectMileStoneController.php @@ -0,0 +1,166 @@ +validate($request, [ + 'proyek_id' => 'required', + 'status' => 'required', + 'due_date' => 'required', + 'deadline' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectMileStone::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project milestone successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project milestone failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectMileStone::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project milestone, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectMileStone::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project milestone not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project milestone successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project milestone failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectMileStone::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project milestone not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project milestone successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project milestone failed deleted!','code'=>400], 400); + } + } + + public function deleteByProyek($id) + { + $data = ProjectMileStone::where('proyek_id', $id)->delete(); + + if($data){ + return response()->json(['status'=>'success','message'=>'data project milestone successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project milestone failed deleted, because data not found!','code'=>200], 200); + } + } + + public function customWhere($where, $val) + { + $data = ProjectMileStone::where($where, $val)->orderBy('id', 'asc')->get(); + + if($data){ + return response()->json(['status'=>'success','data'=> $data,'code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project milestone not found!','code'=>400], 40); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'project_milestone'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectMileStone::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project milestone, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request) + { + $search = $request->query('search'); + $idProject = (int)$request->query('idProject'); + $ganttId = (int)$request->query('idGantt'); + + $forbidden = []; + + if($idProject && $idProject > 0 && $ganttId && $ganttId > 0){ + $dataF = Activity::select("name")->where("type_activity", "milestone")->where("version_gantt_id", $ganttId)->where("proyek_id", $idProject)->get(); + foreach($dataF as $val){ + $forbidden[] = $val->name; + } + } + + if($search && !empty($search)){ + $data = ProjectMileStone::where("proyek_id", $idProject)->where("status", 'like', '%'.$search.'%')->whereNotIn("status", $forbidden)->get(); + }else{ + $data = ProjectMileStone::where("proyek_id", $idProject)->whereNotIn("status", $forbidden)->get(); + } + + return response()->json($data); + } +} diff --git a/app/Http/Controllers/ProjectParticipantsController.php b/app/Http/Controllers/ProjectParticipantsController.php new file mode 100644 index 0000000..095bcd1 --- /dev/null +++ b/app/Http/Controllers/ProjectParticipantsController.php @@ -0,0 +1,139 @@ +validate($request, [ + 'proyek_id' => 'required', + 'tittle' => 'required', + 'name' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectParticipants::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project participants successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project participants failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectParticipants::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project participants, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectParticipants::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project participants not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project participants successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project participants failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectParticipants::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project participants not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project participants successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project participants failed deleted!','code'=>400], 400); + } + } + + public function deleteByProyek($id) + { + $data = ProjectParticipants::where('proyek_id', $id)->delete(); + + if($data){ + return response()->json(['status'=>'success','message'=>'data project participants successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project participants failed deleted, because data not found!','code'=>200], 200); + } + } + + public function customWhere($where, $val) + { + $data = ProjectParticipants::where($where, $val)->orderBy('id', 'asc')->get(); + + if($data){ + return response()->json(['status'=>'success','data'=> $data,'code'=>200], 200); + }else{ + return response()->json(['status'=>'success','message'=>'data project participants not found!','code'=>400], 40); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'project_participants'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectParticipants::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project participants, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ProjectRoleController.php b/app/Http/Controllers/ProjectRoleController.php new file mode 100644 index 0000000..ffa6f39 --- /dev/null +++ b/app/Http/Controllers/ProjectRoleController.php @@ -0,0 +1,128 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectRole::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project role successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project role failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectRole::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project role, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectRole::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data project role not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project role successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project role failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectRole::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project role not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project role successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project role failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_role_proyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectRole::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project role, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request){ + $search = $request->query('search'); + if($search && !empty($search)){ + $data = ProjectRole::where("name", 'like', '%'.$search.'%')->get(); + }else{ + $data = ProjectRole::all(); + } + + return response()->json($data); + } +} diff --git a/app/Http/Controllers/ProjectToChecklistK3Controller.php b/app/Http/Controllers/ProjectToChecklistK3Controller.php new file mode 100644 index 0000000..7e324f0 --- /dev/null +++ b/app/Http/Controllers/ProjectToChecklistK3Controller.php @@ -0,0 +1,149 @@ +validate($request, [ + 'proyek_id' => 'required', + 'checklist_k3_id' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = ProjectToChecklistK3::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed created','code'=>400]); + } + } + + public function addMultiple(Request $request){ + $checklist_k3_ids = $request->checklist_k3_id; + + $data = ProjectToChecklistK3::where("proyek_id", $request->proyek_id); + + if($data){ + $data->delete(); + } + + if(is_array($checklist_k3_ids) && count($checklist_k3_ids) > 0){ + $countRes = 0; + foreach($checklist_k3_ids as $item){ + + $dataInsert = array( + "checklist_k3_id" => $item, + "proyek_id" => $request->proyek_id, + "created_by" => $this->currentName + ); + + $result = ProjectToChecklistK3::create($dataInsert); + + if($result){ + $countRes++; + }else{ + $countRes--; + } + } + if($countRes > 0){ + return response()->json(['status'=>'success' ,'message'=>'Project to Checklist K3 successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'success' ,'message'=>'Project to Checklist K3 failed created','code'=>400]); + } + }else{ + return response()->json(['status'=>'success' ,'message'=>'Project to Checklist K3 successfull created','code'=>200]); + } + + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = ProjectToChecklistK3::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data user to version gantt Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectToChecklistK3::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data user to version gantt Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectToChecklistK3::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'proyek_to_checklist_k3'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectToChecklistK3::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project to checklist K3, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ProjectTypeController.php b/app/Http/Controllers/ProjectTypeController.php new file mode 100644 index 0000000..0ce8cf3 --- /dev/null +++ b/app/Http/Controllers/ProjectTypeController.php @@ -0,0 +1,117 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ProjectType::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data project type successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data project type failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ProjectType::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data project type, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ProjectType::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data role not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data project type successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project type failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ProjectType::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data project type not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data project type successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data project type failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_type_proyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ProjectType::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list project type, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/RateSallaryController.php b/app/Http/Controllers/RateSallaryController.php new file mode 100644 index 0000000..ac1d8bd --- /dev/null +++ b/app/Http/Controllers/RateSallaryController.php @@ -0,0 +1,117 @@ +validate($request, [ + 'project_role_id' => 'required', + 'cost' => 'required', + 'type_rate' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = RateSallary::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data rate sallary successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data rate sallary failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = RateSallary::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data rate sallary, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = RateSallary::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data rate sallary not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data rate sallary successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data rate sallary failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = RateSallary::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data rate sallary not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data rate sallary successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data rate sallary failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'rate_cost_hr'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = RateSallary::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list rate sallary, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ReportActivityController.php b/app/Http/Controllers/ReportActivityController.php new file mode 100644 index 0000000..9b5365a --- /dev/null +++ b/app/Http/Controllers/ReportActivityController.php @@ -0,0 +1,279 @@ +has('gantt')){ + $this->validate($request, [ + 'activity_id' => 'required', + 'user_id' => 'required', + 'report_date' => 'required', + 'job_count_report' => 'required' + ]); + }else{ + $this->validate($request, [ + 'activity_id' => 'required', + 'user_id' => 'required', + 'report_date' => 'required', + 'job_count_report' => 'required', + 'lat' => 'required', + 'lon' => 'required', + ]); + } + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ReportActivity::create($data); + + if($result){ + $this->countForProgress($request->activity_id); + if($request->hasFile("files")){ + $this->uploadImage($request->file('files'), $result->id); + } + return response()->json(['status'=>'success','message'=>'add report activity, update progress activity successfully!','code'=>200,'last_inserted_id'=>$result->id], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add report activity failed!','code'=>400], 400); + } + } + + private function uploadImage($files, $ref_id) + { + $dokumen = $files; + $extension = $dokumen->extension(); + $name = $ref_id.date("YmdHis").".".$extension; + $resultMove = $dokumen->move($this->pathImage, $name); + if($resultMove){ + $data = [ + 'ref_id' => (int)$ref_id, + 'image' => $name, + 'category' => "report_activity" + ]; + + $result = Image::create($data); + + if($result){ + return true; + } + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ReportActivity::select("report_activity.*", "u.name as user_name")->where("report_activity.id", $id)->join("m_users as u", "u.id", "=", "report_activity.user_id")->first(); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data report activity, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ReportActivity::find($id); + + if($data){ + $dataUpdate = $request->all(); + $result = $data->update($dataUpdate); + if($result){ + if($request->hasFile("files")){ + $this->updateImage($request->file('files'), $id); + } + $this->countForProgress($data->activity_id); + return response()->json(['status'=>'success','message'=>'data report activity successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report activity failed updated!','code'=>400], 400); + } + }else{ + return response()->json(['status'=>'failed','message'=>'data report activity not found!','code'=>400], 400); + die(); + } + } + + public function updateImage($files, $ref_id) + { + $image = Image::where("ref_id", $ref_id)->where("category", "report_activity")->first(); + if($image){ + if(file_exists($this->pathImage.$image->image)){ + unlink($this->pathImage.$image->image); + } + $image->delete(); + } + $dokumen = $files; + $extension = $dokumen->extension(); + $name = $ref_id.date("YmdHis").".".$extension; + $resultMove = $dokumen->move($this->pathImage, $name); + if($resultMove){ + $data = [ + 'ref_id' => (int)$ref_id, + 'image' => $name, + 'category' => "report_activity" + ]; + + $result = Image::create($data); + + if($result){ + return true; + } + } + } + + public function delete($id) + { + $data = ReportActivity::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data report activity not found!','code'=>400], 400); + die(); + } + + + if($delete){ + $image = Image::where("ref_id", $id)->where("category", "report_activity")->first(); + if($image){ + if(file_exists($this->pathImage.$image->image)){ + unlink($this->pathImage.$image->image); + } + $image->delete(); + } + return response()->json(['status'=>'success','message'=>'data report activity successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report activity failed deleted!','code'=>400], 400); + } + } + + private function countForProgress($id) + { + + $totalJobs = ReportActivity::where('activity_id', $id)->sum("job_count_report"); + $dataActivity = Activity::find($id); + $jobsActivity = (int)$dataActivity->jumlah_pekerjaan; + + if ($jobsActivity < 1) { + return false; + } + + if ($totalJobs < 1) { + return false; + } + + $persentaseActual = ($totalJobs/$jobsActivity)*100; + $dataUpdate = array( + "persentase_progress" => $persentaseActual, + "updated_by" => $this->currentName + ); + return $dataActivity->update($dataUpdate); + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'report_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ReportActivity::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list report activity, please try again later!','code'=>400], 400); + } + } + + public function searchPoint(Request $request) { + $dataPayload = $request->all(); + $reqActivityId = []; + foreach ($dataPayload['project_id'] as $val) { + $reqActivityId[] = $this->getActivityByProjectId($val); + } + + // var_dump(count($reqActivityId)); + $activity_id = []; + $getPoints = false; + + if (count($reqActivityId) > 0) { + for ($i=0; $i < count($reqActivityId); $i++) { + if (count($reqActivityId[$i]) > 0) { + foreach($reqActivityId[$i] as $reqAct) { + array_push($activity_id, $reqAct->id); + } + } + } + } + + if (count($activity_id) > 0) { + $getPoints = ReportActivity::select('report_activity.*', 'm_activity.name as activity_name', 'm_activity.jumlah_pekerjaan', 'm_proyek.nama as proyek_name') + ->leftJoin('m_activity', 'm_activity.id', '=', 'report_activity.activity_id') + ->leftJoin('m_proyek', 'm_proyek.id', '=', 'm_activity.proyek_id') + ->whereIn('report_activity.activity_id', $activity_id)->get(); + } + + if($getPoints){ + return response()->json(['status'=>'success','code'=>200,'data'=>$getPoints, 'totalRecord'=>count($getPoints)], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list points, please try again later!','code'=>400], 400); + } + } + + public function getActivityByProjectId($projectId) { + $data = Activity::select('id')->where('proyek_id', $projectId)->get(); + return $data; + } + + public function datatables(Request $request){ + $id_activity = $request->query('idact'); + $data = ReportActivity::select("report_activity.*", "u.name as user_name") + ->join("m_users as u", "u.id", "=", "report_activity.user_id") + ->where('report_activity.activity_id', $id_activity) + ->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + $actionBtn .= ' '; + return $actionBtn; + }) + ->editColumn('report_date', function($row) { + $date = date_create($row->report_date); + return date_format($date,"d-m-Y H:i:s"); + }) + ->rawColumns(['action'])->make(true); + } +} diff --git a/app/Http/Controllers/ReportActivityMaterialController.php b/app/Http/Controllers/ReportActivityMaterialController.php new file mode 100644 index 0000000..5c6fa71 --- /dev/null +++ b/app/Http/Controllers/ReportActivityMaterialController.php @@ -0,0 +1,269 @@ +validate($request, [ + 'activity_id' => 'required', + // 'assign_material_id' => 'required', + 'qty' => 'required' + // 'budget' => 'required' + ]); + + $valAssignMaterialId = AssignMaterial::where('activity_id', $request->activity_id)->first(); + + $data = $request->all(); + $data['created_by'] = $this->currentName; + $data['assign_material_id'] = $valAssignMaterialId->id; + + $checkPrice = AssignMaterial::where("id", $valAssignMaterialId->id)->first(); + $price = $checkPrice->budget; + + $updateActivity = Activity::find($request->activity_id); + if($updateActivity){ + $costActualOld = $updateActivity->biaya_actual == null ? 0 : (int)$updateActivity->biaya_actual; + $costActualNew = $costActualOld + ($price*$request->qty); + $updateActivity->biaya_actual = $costActualNew; + $updateActivity->save(); + // return response()->json(['status'=>'success','message'=>'Assign material successfull created, and update cost plan success '.$costPlanNew,'code'=>200]); + $result = ReportActivityMaterial::create($data); + if($result){ + $this->countForProgress($request->activity_id); + return response()->json(['status'=>'success','message'=>'Input progress report activity created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Input progress report activity failed created','code'=>400]); + } + }else{ + return response()->json(['status'=>'success','message'=>'Update cost actual failed','code'=>400]); + } + } + + public function updateStatusStartFinish(Request $request){ + // $updateData = AssignMaterial::find($request->assign_material_id); + // if($updateData){ + // $updateData->start_activity = $request->start_activity; + // $updateData->finish_activity = $request->finish_activity; + // $updateData->status_activity = $request->status_activity; + // $updateData->save(); + // if($request->status_activity == 'done'){ + // $dataUpdate = array( + // "persentase_progress" => 100, + // "updated_by" => $this->currentName + // ); + // Activity::where('id', $updateData->activity_id)->update($dataUpdate); + // } + + // return response()->json(['status'=>'success','message'=>'Update data status successfully ', 'code'=>200]); + // } + $payloadUpdate = array( + 'start_activity' => $request->start_activity, + 'finish_activity' => $request->finish_activity, + 'status_activity' => $request->status_activity + ); + $updateData = AssignMaterial::where('activity_id',$request->activity_id) + ->update($payloadUpdate); + if($updateData){ + // $updateData->start_activity = $request->start_activity; + // $updateData->finish_activity = $request->finish_activity; + // $updateData->status_activity = $request->status_activity; + // $updateData->save(); + if($request->status_activity == 'done'){ + $dataUpdate = array( + "persentase_progress" => 100, + "updated_by" => $this->currentName + ); + Activity::where('id', $request->activity_id)->update($dataUpdate); + } + + return response()->json(['status'=>'success','message'=>'Update data status successfully ', 'code'=>200]); + } + else{ + return response()->json(['status'=>'failed','message'=>'Update data status failed', 'code'=>400]); + } + } + + public function delete($id) + { + $data = ReportActivityMaterial::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data menu successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data menu failed deleted!','code'=>400], 400); + } + } + + private function countForProgress($id) + { + + // $totalJobs = ReportActivityMaterial::where('activity_id', $id)->sum("qty"); + $dataActivity = Activity::find($id); + $dataPlan = AssignMaterial::where('activity_id', $id)->get(); + $tmpPercentage1 = []; + if(!$dataPlan->isEmpty()){ + + foreach ($dataPlan as $value) { + # code... + $price = $value->material_id; + $qty_plan = $value->qty_planning; + $status_activity = $value->status_activity; + + // get volume actual + $getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty"); + $percentage1 = ($getDataVolActual * 100) / $qty_plan; + + if($status_activity == 'done'){ + $tmpPercentage1[] = $percentage1 > 100 ? 100 : $percentage1; + }else if($status_activity == 'on-progress'){ + $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + }else{ + $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + } + } + $totalPercentage = array_sum($tmpPercentage1) / count($tmpPercentage1); + }else{ + $totalPercentage = 0; + } + + // if ($jobsActivity < 1) { + // return false; + // } + + // if ($totalJobs < 1) { + // return false; + // } + + // $persentaseActual = ($totalJobs/$jobsActivity)*100; + + $dataUpdate = array( + "persentase_progress" => $totalPercentage, + "updated_by" => $this->currentName + ); + return $dataActivity->update($dataUpdate); + } + + public function countForProgressTest() + { + $dataPlan = AssignMaterial::where('activity_id', 807)->get(); + // $jobsActivity = (int)$dataActivity->qty_planning; + $tmpPercentage1 = []; + + if(!$dataPlan->isEmpty()){ + foreach ($dataPlan as $value) { + # code... + // price per material + $price = $value->material_id; + $qty_plan = $value->qty_planning; + $status_activity = $value->status_activity; + + // get volume actual + $getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty"); + $percentage1 = ($getDataVolActual * 100) / $qty_plan; + // if($qty_plan == null){ + // $tmpPercentage1[] = 0 + // }else{ + $percentage1 = ($getDataVolActual * 100) / $qty_plan; + if($status_activity == 'done'){ + $tmpPercentage1[] = $percentage1 > 100 ? 100 : $percentage1; + }else if($status_activity == 'on-progress'){ + $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + }else{ + $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1; + } + // } + + + } + $totalPercentage = array_sum($tmpPercentage1) / count($tmpPercentage1); + }else{ + $totalPercentage = 0; + } + + return response()->json(['status'=>'success','code'=>200,'data'=>$dataPlan, 'tmpPercentage1'=> $tmpPercentage1, 'totalPercentage'=> $totalPercentage], 200); + } + + public function search(Request $request) + { + // payload same like in golang API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'report_activity_material'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ReportActivityMaterial::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get Repport Activity material, please try again later!','code'=>400], 400); + } + } + + public function datatables(Request $request){ + $id_activity = $request->query('idAct'); + $id_assign_material_id= $request->query('idAmi'); + $type = $request->query('type'); + if($type == 'plan'){ + $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom") + ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") + ->where('assign_material_to_activity.activity_id', $id_activity) + ->orderBy('assign_material_to_activity.id', 'asc') + ->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + }else{ + // $data = AssignMaterial::select("assign_material_to_activity.*","m.name as material_name", "m.uom as uom")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get(); + $data = ReportActivityMaterial::select("report_activity_material.*", "u.name as human_resource") + // ->join("assign_material_to_activity as am_ta", "am_ta.id","=", "report_activity_material.assign_material_id") + // ->join("m_req_material as m", "m.id", "=", "am_ta.material_id") + ->join("m_users as u", "u.id", "=", "report_activity_material.user_id") + // ->where('report_activity_material.assign_material_id', $id_assign_material_id) + ->where('report_activity_material.activity_id', $id_activity) + ->orderBy('report_activity_material.report_date', 'asc') + ->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + } + } +} diff --git a/app/Http/Controllers/ReportK3Controller.php b/app/Http/Controllers/ReportK3Controller.php new file mode 100644 index 0000000..80b3be6 --- /dev/null +++ b/app/Http/Controllers/ReportK3Controller.php @@ -0,0 +1,165 @@ +validate($request, [ + 'user_id' => 'required', + 'report_date' => 'required', + 'proyek_id' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ReportK3::create($data); + + if($result){ + if($request->has("detail")){ + $this->addDetailK3($request->detail, $result->id); + } + return response()->json(['status'=>'success', 'report_id'=>$result->id,'message'=>'add report k3 successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data report k3 failed!','code'=>400], 400); + } + } + + private function addDetailK3($dataDetail, $report_id){ + foreach ($dataDetail as $value) { + $dataNew = array( + "report_k3_id"=>$report_id, + "checklist_k3_id"=>$value['checklist_id'], + "name_checklist_k3"=>$value['checklist_name'], + "created_by"=>$this->currentName + ); + + ReportK3Detail::create($dataNew); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ReportK3::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data report k3, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ReportK3::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data report k3 successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ReportK3::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data report k3 successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_report_k3'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // get another child data + if($request->has("child_data")){ + $newDataGet = []; + $dataChild = $request->child_data; + if(isset($dataChild['table_name']) && isset($dataChild['column_name']) && isset($dataChild['column_table'])){ + $columnForeign = $dataChild['column_name']; + $columnSelf = $dataChild['column_table']; + foreach ($dataGet as $value) { + $resultData = DB::table($dataChild['table_name'])->where($columnSelf,$value->{$columnForeign})->get(); + $value->childData = $resultData; + // only for report k3 + $value->k3_checked = $resultData->pluck("name_checklist_k3")->all(); + $dataImage = Image::where("category", "report_k3")->where("ref_id", $value->id)->first(); + if($dataImage){ + $value->image = $dataImage->image; + }else{ + $value->image = null; + } + $idsChecklist = $resultData->pluck("checklist_k3_id")->all(); + $CheklistK3Ids = ProjectToChecklistK3::whereNotIn("checklist_k3_id", $idsChecklist)->where("proyek_id", $value->proyek_id)->pluck("checklist_k3_id"); + $value->k3_not_checked = ChecklistK3::whereIn("id", $CheklistK3Ids)->pluck("name")->all(); + // === // + $newDataGet[] = $value; + } + $dataGet = $newDataGet; + } + } + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ReportK3::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list report k3, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ReportK3DetailController.php b/app/Http/Controllers/ReportK3DetailController.php new file mode 100644 index 0000000..e95d03b --- /dev/null +++ b/app/Http/Controllers/ReportK3DetailController.php @@ -0,0 +1,118 @@ +validate($request, [ + 'report_k3_id' => 'required', + 'checklist_k3_id' => 'required', + 'name_checklist_k3' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ReportK3Detail::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add report k3 detail successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add report k3 detail failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ReportK3Detail::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data report k3 detail, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ReportK3Detail::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 detail not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data report k3 detail successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 detail failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ReportK3Detail::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 detail not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data report k3 detail successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data report k3 detail failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_report_k3_detail'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ReportK3Detail::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list report k3 detail, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/RequestMaterialController.php b/app/Http/Controllers/RequestMaterialController.php new file mode 100644 index 0000000..1a06fe6 --- /dev/null +++ b/app/Http/Controllers/RequestMaterialController.php @@ -0,0 +1,206 @@ +validate($request, [ + 'proyek_id' => 'required', + 'description' => 'required', + 'required_date' => 'required', + 'qty' => 'required', + 'uom' => 'required', + 'fom_date' => 'required', + ]); + + $data = $request->all(); + + $data['status'] = "fom"; + $data['created_by'] = $this->currentName; + + $result = RequestMaterial::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'request material successfully!', 'data'=>$result, 'code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'request material failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = RequestMaterial::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data request material, please try again later!','code'=>400], 400); + } + } + + // public function update(Request $request, $id){ + + // if(!$id || (int) $id < 0 || $id==""){ + // return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + // } + + // $data = RequestMaterial::find($id); + + // if($data){ + // $result = $data->update($request->all()); + // }else{ + // return response()->json(['status'=>'failed','message'=>'data request material not found!','code'=>400], 400); + // die(); + // } + + + // if($result){ + // return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'request material failed updated!','code'=>400], 400); + // } + // } + + public function delete($id) + { + $data = RequestMaterial::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data request material not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'request material successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'request material failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_req_material'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = RequestMaterial::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list request material, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + $dataForm = $request->all(); + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + $data = RequestMaterial::find($id); + if($data){ + if(!isset($dataForm['status'])){ + // return response()->json(['status'=>'failed','message'=>'status is required!','code'=>400], 400); + $resultUpdate = $data->update($request->all()); + if($resultUpdate){ + return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'request material failed updated!','code'=>400], 400); + } + die(); + } + if($dataForm['status']=="receipt to warehouse"){ + // $result = $data->update($request->all()); + // if($result){ + $dataM = MaterialResource::where('name', 'ilike', $data->description)->first(); + if($dataM){ + $result = $data->update($request->all()); + $payloadMQty = $dataM->qty + $data->qty_received; + $resultUpdateM = MaterialResource::where('id', $dataM->id)->update(['qty' => $payloadMQty]); + return response()->json(['status'=>'success', 'code'=>200], 200); + }else{ + $result = $data->update($request->all()); + $dataPayloadM = array( + "name" => $dataForm['description'], + "uom" => $dataForm['uom'], + "unit_price" => 0, + "description" => $dataForm['description'], + "qty" => $data->qty_received, + "status" => "Barang tersedia", + "created_by" => $this->currentName + ); + $result = MaterialResource::create($dataPayloadM); + if($result){ + return response()->json(['status'=>'success','message'=>'add data material resource successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data material resource failed!','code'=>400], 400); + } + } + + // }else{ + // return response()->json(['status'=>'failed','message'=>'update status receipt to warehouse request material resource failed!','code'=>400], 400); + // } + }else if($dataForm['status']=="receipt to site"){ + $result = $data->update($request->all()); + // if($result){ + $dataM = MaterialResource::where('name', 'ilike', $data->description)->first(); + if($dataM){ + $result = $data->update($request->all()); + $payloadMQty = $dataM->qty - $data->qty_received; + + if($payloadMQty < 0){ + return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed, because material is not exist in warehouse!','code'=>400], 400); + die(); + } + $resultUpdateM = MaterialResource::where('id', $dataM->id)->update(['qty' => $payloadMQty]); + return response()->json(['status'=>'success', 'message'=>'request material status receipt to site successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed, because material is not exist in warehouse!','code'=>400], 400); + } + // }else{ + // return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed!','code'=>400], 400); + // } + }else{ + $resultUpdate = $data->update($request->all()); + if($resultUpdate){ + return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'request material failed updated!','code'=>400], 400); + } + } + }else{ + return response()->json(['status'=>'failed','message'=>'data request material not found!','code'=>400], 400); + die(); + } + } +} diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php new file mode 100644 index 0000000..1c535be --- /dev/null +++ b/app/Http/Controllers/RoleController.php @@ -0,0 +1,116 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = Role::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data role successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data role failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Role::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data role, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Role::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data role not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data role successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data role failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Role::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data role not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data role successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data role failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_roles'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Role::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list role, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/RoleMenuController.php b/app/Http/Controllers/RoleMenuController.php new file mode 100644 index 0000000..1d7c302 --- /dev/null +++ b/app/Http/Controllers/RoleMenuController.php @@ -0,0 +1,109 @@ +validate($request, [ + 'role_id' => 'required', + 'menu_id' => 'required', + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = RoleMenu::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data role menu successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data role menu failed!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = RoleMenu::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data role menu successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = RoleMenu::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data role menu successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu failed deleted!','code'=>400], 400); + } + } + + public function deleteByRole($id) + { + $data = RoleMenu::where("role_id", $id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data role menu successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data role menu failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_roles_menu'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } +} diff --git a/app/Http/Controllers/SatuanController.php b/app/Http/Controllers/SatuanController.php new file mode 100644 index 0000000..c5bc253 --- /dev/null +++ b/app/Http/Controllers/SatuanController.php @@ -0,0 +1,117 @@ +validate($request, [ + 'name' => 'required', + 'description' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = Satuan::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add satuan successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data satuan failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Satuan::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data satuan, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Satuan::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data satuan not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data satuan successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data satuan failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Satuan::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data satuan not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data satuan successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data satuan failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_satuan'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Satuan::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list satuan, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ShiftController.php b/app/Http/Controllers/ShiftController.php new file mode 100644 index 0000000..eb61ea8 --- /dev/null +++ b/app/Http/Controllers/ShiftController.php @@ -0,0 +1,98 @@ +validate($request, [ + 'label' => 'required', + 'flex_time_minute' => 'required', + 'start_time' => 'required', + 'end_time' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = Shift::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Master shift successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Master shift failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = Shift::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data Master shift not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Master shift successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master shift failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Shift::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Master shift not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Master shift successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Master shift failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_shift'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Shift::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ShowHideColumnController.php b/app/Http/Controllers/ShowHideColumnController.php new file mode 100644 index 0000000..5492ab7 --- /dev/null +++ b/app/Http/Controllers/ShowHideColumnController.php @@ -0,0 +1,121 @@ +currentId; + if($user_id > 0){ + $cekData = UserToVersionGantt::where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->count(); + if($cekData <=0){ + $data = array( + "status"=>"not have access" + ); + }else{ + $cekAvailable = ShowHideColumn::where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->count(); + if($cekAvailable > 0){ + $data = ShowHideColumn::where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->get(); + }else{ + $data = array( + "status"=>"not yet have" + ); + } + } + return response()->json(['status'=>'success','code'=>200,'data'=>$data], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list user to version gantt, please try again later!','code'=>400], 400); + } + } + + public function add(Request $request) + { + $this->validate($request, [ + 'version_gantt_id' => 'required', + 'columns'=> 'required' + ]); + + $columns = $request->columns; + + $success = 0; + + foreach ($columns as $column) { + $dataAdd = array( + 'version_gantt_id'=>$request->version_gantt_id, + 'user_id'=>$this->currentId, + 'column_name'=>$column, + 'show'=>true, + 'created_by'=>$this->currentName + ); + + $result = ShowHideColumn::create($dataAdd); + + if($result){ + $success++; + }else{ + $success--; + } + } + + if($success > 0){ + return response()->json(['status'=>'success','message'=>'add show hide column successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add show hide column failed!','code'=>400], 400); + } + } + + public function update(Request $request, $gantt_id) + { + $this->validate($request, [ + 'columns'=> 'required' + ]); + + if(!$gantt_id || (int) $gantt_id < 0 || $gantt_id==""){ + return response()->json(['status'=>'failed','message'=>'gantt id is required!','code'=>400], 400); + } + + $user_id = $this->currentId; + + $columns = $request->columns; + + $success = 0; + foreach ($columns as $column => $show) { + $check = ShowHideColumn::where("column_name", $column)->where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->count(); + if($check > 0){ + $dataUpdate = array( + "show"=>$show + ); + + $result = ShowHideColumn::where("column_name", $column)->where("version_gantt_id", $gantt_id)->where("user_id", $user_id) + ->update($dataUpdate); + }else{ + $dataNew = array( + 'version_gantt_id'=>$gantt_id, + 'user_id'=>$user_id, + 'column_name'=>$column, + 'show'=>$show, + 'created_by'=>$this->currentName + ); + + $result = ShowHideColumn::create($dataNew); + } + + if($result){ + $success++; + }else{ + $success--; + } + } + + if($success > 0){ + return response()->json(['status'=>'success','message'=>'data show hide column successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data show hide column failed updated!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/TBroadcastController.php b/app/Http/Controllers/TBroadcastController.php new file mode 100644 index 0000000..c56e522 --- /dev/null +++ b/app/Http/Controllers/TBroadcastController.php @@ -0,0 +1,10 @@ +validate($request, [ + 'proyek_type_id' => 'required', + 'name_activity' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = TemplateGantt::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'Template Gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Template Gantt Project failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = TemplateGantt::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data Template Gantt Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'Template Gantt Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Template Gantt Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = TemplateGantt::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Template Gantt Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Template Gantt Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Template Gantt Project failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = TemplateGantt::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_template_gantt'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = TemplateGantt::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list version gantt, please try again later!','code'=>400], 400); + } + } + + public function getTreeByTypeProject($id) + { + $data = TemplateGantt::where('proyek_type_id', $id)->whereNull('parent_id')->orderByRaw('id ASC')->get(); + $finalData = []; + foreach($data as $objRow){ + $objRow->children = $this->getChildren($id, $objRow->id); + $objRow->key = rand(1, 1000); + $finalData[] = $objRow; + } + + return response()->json(['status'=>'success','data'=>$finalData,'code'=>200], 200); + } + + private function getChildren($type_project, $parent_id) + { + $finalData = []; + $data = TemplateGantt::where('proyek_type_id', $type_project)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get(); + foreach($data as $objRow){ + $objRow->key = rand(1, 1000); + $objRow->children = $this->getChildren($type_project, $objRow->id); + $finalData[] = $objRow; + } + return $finalData; + } +} diff --git a/app/Http/Controllers/ToolsProjectController.php b/app/Http/Controllers/ToolsProjectController.php new file mode 100644 index 0000000..e1a69cd --- /dev/null +++ b/app/Http/Controllers/ToolsProjectController.php @@ -0,0 +1,53 @@ +project_id; + $subproyekId = $request->subproyek_id; + $listToolsId = $request->tools_id; + + if(!$projectId && !$subproyekId){ + return response()->json(['status'=>'failed','message'=>'Required proyek_id or subproyek id','code'=>400]); + } + + if(is_array ($listToolsId) && count($listToolsId) > 0){ + $result = 0; + ToolsProject::where('proyek_id', $projectId)->delete(); + ToolsProject::where('proyek_id', $subproyekId)->delete(); + foreach($listToolsId as $tool_id){ + $data = [ + 'tools_id'=>(int)$tool_id + ]; + + if($projectId && $projectId!="" && (int)$projectId > 0){ + $data['proyek_id'] = $projectId; + }else if($subproyekId && $subproyekId!="" && (int)$subproyekId > 0){ + $data['subproyek_id'] = $subproyekId; + } + + $insert = ToolsProject::create($data); + if($insert){ + $result++; + }else{ + $result--; + } + } + if($result > 0){ + return response()->json(['status'=>'success','message'=>'Tools Project successfull updated','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Tools Project failed updated','code'=>400]); + } + }else{ + ToolsProject::where('proyek_id', $projectId)->delete(); + ToolsProject::where('proyek_id', $subproyekId)->delete(); + return response()->json(['status'=>'success','message'=>'Tools Project Successfull updated','code'=>200]); + } + } +} diff --git a/app/Http/Controllers/ToolsRequestController.php b/app/Http/Controllers/ToolsRequestController.php new file mode 100644 index 0000000..be6dc0a --- /dev/null +++ b/app/Http/Controllers/ToolsRequestController.php @@ -0,0 +1,171 @@ +validate($request, [ + 'asset_type' => 'required', + 'asset_name' => 'required', + 'required_date' => 'required', + 'qty' => 'required', + 'uom' => 'required', + 'description' => 'required' + ]); + $data = $request->all(); + $data['status'] = "fot"; + $data['created_by'] = $this->currentName; + + $result = ToolsRequest::create($data); + // return response()->json($author, 201); + if($result){ + return response()->json(['status'=>'success','message'=>'Tools Request Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'Tools Request Project failed created','code'=>400]); + } + } + + // public function update(Request $request, $id){ + + // if(!$id || (int) $id < 0 || $id==""){ + // return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + // } + // $data = ToolsRequest::find($id); + // if($data){ + // $result = $data->update($request->all()); + // }else{ + // return response()->json(['status'=>'failed','message'=>'data Tools Request Project not found!','code'=>400], 400); + // die(); + // } + + // if($result){ + // return response()->json(['status'=>'success','message'=>'Tools Request Project successfully updated!','code'=>200], 200); + // }else{ + // return response()->json(['status'=>'failed','message'=>'Tools Request Project failed updated!','code'=>400], 400); + // } + // } + + public function update(Request $request, $id) + { + $dataForm = $request->all(); + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + if(!isset($dataForm['status'])){ + return response()->json(['status'=>'failed','message'=>'status is required!','code'=>400], 400); + die(); + } + $data = ToolsRequest::find($id); + if($data){ + if($dataForm['status']=="receipt to warehouse"){ + + $dataT = ToolsResource::where('name', $data->asset_name)->first(); + if($dataT){ + $result = $data->update($request->all()); + $payloadMQty = $dataT->qty + $data->qty_received; + $resultUpdateM = ToolsResource::where('id', $dataT->id)->update(['qty' => $payloadMQty]); + return response()->json(['status'=>'success', 'message'=>'request material successfully updated!','code'=>200], 200); + }else{ + $result = $data->update($request->all()); + $dataPayloadM = array( + "name" => $dataForm['asset_name'], + "uom" => $dataForm['uom'], + "unit_price" => 0, + "description" => $dataForm['description'], + "qty" => $data->qty_received, + "asset_type" => $dataForm['asset_type'], + "created_by" => $this->currentName + ); + $result = ToolsResource::create($dataPayloadM); + if($result){ + return response()->json(['status'=>'success','message'=>'add data material resource successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data material resource failed!','code'=>400], 400); + } + } + }else if($dataForm['status']=="receipt to site"){ + + $dataT = ToolsResource::where('name', $data->asset_name)->first(); + if($dataT){ + $result = $data->update($request->all()); + $payloadMQty = $dataT->qty - $data->qty_received; + if($payloadMQty < 0){ + return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed, because material is not exist in warehouse!','code'=>400], 400); + die(); + } + $resultUpdateM = ToolsResource::where('id', $dataT->id)->update(['qty' => $payloadMQty]); + return response()->json(['status'=>'success', 'message'=>'request material status receipt to site successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed, because tools is not exist in warehouse!','code'=>400], 400); + } + }else{ + $resultUpdate = $data->update($request->all()); + if($resultUpdate){ + return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'request material failed updated!','code'=>400], 400); + } + } + }else{ + return response()->json(['status'=>'failed','message'=>'data request material not found!','code'=>400], 400); + die(); + } + } + + public function delete($id) + { + $data = ToolsRequest::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data Tools Request Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Tools Request Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Tools Request Project failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_req_tools'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ToolsRequest::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/ToolsResourceController.php b/app/Http/Controllers/ToolsResourceController.php new file mode 100644 index 0000000..3f09b04 --- /dev/null +++ b/app/Http/Controllers/ToolsResourceController.php @@ -0,0 +1,132 @@ +validate($request, [ + 'name' => 'required', + 'qty'=> 'required', + 'uom'=> 'required', + 'asset_type'=> 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = ToolsResource::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add data tools resource successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add data tools resource failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = ToolsResource::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = ToolsResource::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data tools resource not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data tools resource successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data tools resource failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = ToolsResource::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data tools resource not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data tools resource successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data tools resource failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_tools_resource'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = ToolsResource::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list material resource, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request){ + + $search = $request->query('search'); + + if($search && !empty($search)){ + $data = ToolsResource::where("name", 'like', '%'.$search.'%')->get(); + }else{ + $data = ToolsResource::all(); + } + + return response()->json($data); + } +} diff --git a/app/Http/Controllers/UserMonthlyShiftController.php b/app/Http/Controllers/UserMonthlyShiftController.php new file mode 100644 index 0000000..d1e5fbf --- /dev/null +++ b/app/Http/Controllers/UserMonthlyShiftController.php @@ -0,0 +1,137 @@ +validate($request, [ + 'user_id' => 'required', + 'schedules' => 'required', + 'start_time' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = UserMonthlyShift::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'monthly shift schedule successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'monthly shift schedule failed created','code'=>400]); + } + } + + public function import(Request $request) + { + $client = new Client(); + $res = $client->request('POST', config('api.golang') . "/monthly-shift-schedules/import", + ['json' => $request->all()] + ); + if ($res->getStatusCode() != 200) { + return response()->json(['status'=>'failed','message'=>'failed to import schedules, please try again later!','code'=>400], 400); + } + + $result= $res->getBody(); + return response($result, 200) + ->header("content-type", $res->getHeaderLine('content-type')); + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = UserMonthlyShift::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data monthly shift schedule not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'monthly shift schedule successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'monthly shift schedule failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = UserMonthlyShift::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data monthly shift schedule not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'Shift schedule successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Shift schedule failed deleted!','code'=>400], 400); + } + } + public function deleteYYYYMM($yyyymm) + { + $delete = UserMonthlyShift::deleteYYYYMM($yyyymm); + if($delete){ + return response()->json(['status'=>'success','message'=>'Shift schedule successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'Shift schedule failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_shift'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + // List this month's shift schedule + public function list() + { + return $this->listYYYYMM(date('Ym')); + } + + public function listYYYYMM($yyyymm) + { + // Kadang start_time bisa jadi tanggal awal-bulan - 1 hari + /* + $data = UserMonthlyShift::where("to_char(start_at+INTERVAL '1 day', 'YYYYMM')", $yyyymm) + ->all(); + */ + $data = UserMonthlyShift::monthlyWithUserInfo($yyyymm); + $countData = $data->count(); + if($data){ + return response()->json([ + 'status'=>'success', + 'code'=>200, + 'data'=>$data, + 'yyyymm' => $yyyymm, + 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/UserProyekController.php b/app/Http/Controllers/UserProyekController.php new file mode 100644 index 0000000..970cf31 --- /dev/null +++ b/app/Http/Controllers/UserProyekController.php @@ -0,0 +1,53 @@ +project_id; + $subproyekId = $request->subproyek_id; + $listUser = $request->user_id; + + if(!$projectId && !$subproyekId){ + return response()->json(['status'=>'failed','message'=>'Required proyek_id or subproyek id','code'=>400],400); + } + + if(is_array($listUser) && count($listUser) > 0){ + $result = 0; + UserProject::where('proyek_id', $projectId)->delete(); + UserProject::where('proyek_id', $subproyekId)->delete(); + foreach($listUser as $id){ + $data = [ + 'user_id'=>(int)$id + ]; + + if($projectId && $projectId!="" && (int)$projectId > 0){ + $data['proyek_id'] = $projectId; + }else if($subproyekId && $subproyekId!="" && (int)$subproyekId > 0){ + $data['subproyek_id'] = $subproyekId; + } + + $insert = UserProject::create($data); + if($insert){ + $result++; + }else{ + $result--; + } + } + if($result > 0){ + return response()->json(['status'=>'success','message'=>'User Project successfull updated','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'User Project failed updated','code'=>400], 400); + } + }else{ + UserProject::where('proyek_id', $projectId)->delete(); + UserProject::where('proyek_id', $subproyekId)->delete(); + return response()->json(['status'=>'success','message'=>'User Project Successfull updated','code'=>200], 200); + } + } +} diff --git a/app/Http/Controllers/UserToActivityController.php b/app/Http/Controllers/UserToActivityController.php new file mode 100644 index 0000000..fc108ed --- /dev/null +++ b/app/Http/Controllers/UserToActivityController.php @@ -0,0 +1,222 @@ +validate($request, [ + 'activity_id' => 'required', + 'user_id' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = UserToActivity::create($data); + if($result){ + $updateActivity = Activity::find($request->activity_id); + $getWorkingHours = UserToProyek::where('user_id', $request->user_id)->first(); + if($updateActivity && $getWorkingHours){ + $costPlanOld = $updateActivity==null? 0 : (int)$updateActivity->rencana_biaya; + if($getWorkingHours->uom_standart_rate == "Day"){ + $costUser = $getWorkingHours->standart_rate * $updateActivity->duration; + }else if($getWorkingHours->uom_standart_rate == "Hour"){ + $costUser = ($getWorkingHours->standart_rate * 8) * $updateActivity->duration; // assumption standart working is 8 hours + } + $costPlanNew = $costPlanOld + $costUser; + $updateActivity->rencana_biaya = $costPlanNew; + $updateActivity->save(); + // UserToProyek::where('user_id', $request->user_id)->update(['rencana_biaya' => $costPlanNew]); + return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfull created, and cost plant successfull update '.$costPlanNew,'code'=>200]); + }else{ + return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfull created','code'=>200]); + } + }else{ + return response()->json(['status'=>'failed','message'=>'user to activity gantt Project failed created','code'=>400]); + } + } + + public function addMultiple(Request $request){ + $users_id = $request->user_id; + + $data = UserToActivity::where("activity_id", $request->activity_id); + + if($data){ + $data->delete(); + } + + if(is_array($users_id) && count($users_id) > 0){ + $countRes = 0; + foreach($users_id as $item){ + + $dataInsert = array( + "user_id" => $item, + "activity_id" => $request->activity_id, + "role_proyek_id" => $request->role_proyek_id, + "proyek_id" => $request->proyek_id, + "created_by" => $this->currentName + ); + + $result = UserToActivity::create($dataInsert); + + if($result){ + $countRes++; + }else{ + $countRes--; + } + } + + if($countRes > 0){ + $allCost = $this->calculateAllCost($request->activity_id, $request->proyek_id); + $dataUpdateCost = array( + "rencana_biaya"=>$allCost, + "updated_by"=> $this->currentName + ); + $actUpdate = Activity::find($request->activity_id); + if($actUpdate){ + $actUpdate->update($dataUpdateCost); + if($actUpdate->parent_id){ + $this->updatedCostPlanning($actUpdate->parent_id); + } + } + + return response()->json(['status'=>'success' ,'message'=>'user to activity gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'success' ,'message'=>'user to activity gantt Project failed created','code'=>400]); + } + }else{ + return response()->json(['status'=>'success' ,'message'=>'user to activity gantt Project successfull created','code'=>200]); + } + + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = UserToActivity::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data user to activity gantt Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to activity gantt Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = UserToActivity::find($id); + if($data){ + $userId = $data->user_id; + $activityId = $data->activity_id; + $delete = $data->delete(); + if($delete){ + $this->deleteRelative($activityId, $userId); + } + }else{ + return response()->json(['status'=>'failed','message'=>'data user to activity gantt Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to activity gantt Project failed deleted!','code'=>400], 400); + } + } + + private function deleteRelative($id, $userId) + { + $dataRa = ReportActivity::where("activity_id", $id)->where("user_id", $userId)->get(); + foreach ($dataRa as $ra) { + $image = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); + foreach ($image as $value) { + if(file_exists($this->pathImage.$value->image)){ + unlink($this->pathImage.$value->image); + } + } + + Image::where("ref_id", $ra->id)->where("category", "report_activity")->delete(); + } + ReportActivity::where("activity_id", $id)->where("user_id", $userId)->delete(); + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = UserToActivity::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'assign_hr_to_activity'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = UserToActivity::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list user to activity gantt, please try again later!','code'=>400], 400); + } + } + + public function datatables(Request $request){ + $id_activity = $request->query('idact'); + $data = UserToActivity::select("assign_hr_to_activity.id as id", "u.name as user_name", "mrp.name as role_name") + ->join("m_role_proyek as mrp", "mrp.id", "=", "assign_hr_to_activity.role_proyek_id") + ->join("m_users as u", "u.id", "=", "assign_hr_to_activity.user_id") + ->where('assign_hr_to_activity.activity_id', $id_activity) + ->get(); + return Datatables::of($data) + ->addIndexColumn() + ->addColumn('action', function($row){ + $actionBtn = ''; + return $actionBtn; + }) + ->rawColumns(['action'])->make(true); + } +} diff --git a/app/Http/Controllers/UserToProyekController.php b/app/Http/Controllers/UserToProyekController.php new file mode 100644 index 0000000..681b2f2 --- /dev/null +++ b/app/Http/Controllers/UserToProyekController.php @@ -0,0 +1,176 @@ +validate($request, [ + 'user_id' => 'required', + 'proyek_id' => 'required' + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = UserToProyek::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'assign hr to proyek successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'assign hr to proyek failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = UserToProyek::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data assign hr to proyek, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = UserToProyek::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data assign hr to proyek not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data assign hr to proyek successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data assign hr to proyek failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = UserToProyek::find($id); + if($data){ + $userId = $data->user_id; + $proyekId = $data->proyek_id; + $delete = $data->delete(); + if($delete){ + $this->deleteRelative($proyekId, $userId); + } + }else{ + return response()->json(['status'=>'failed','message'=>'data assign hr to proyek not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data assign hr to proyek successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data assign hr to proyek failed deleted!','code'=>400], 400); + } + } + + private function deleteRelative($proyekId, $userId) + { + $uta = UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->get(); + foreach ($uta as $value) { + $dataRa = ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->get(); + foreach ($dataRa as $ra) { + $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); + foreach ($images as $image) { + if(file_exists($this->pathImage.$image->image)){ + unlink($this->pathImage.$image->image); + } + } + Image::where("ref_id", $ra->id)->where("category", "report_activity")->delete(); + } + ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->delete(); + } + UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->delete(); + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'assign_hr_to_proyek'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = UserToProyek::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list assign hr to proyek, please try again later!','code'=>400], 400); + } + } + + public function select(Request $request){ + + $search = $request->query('search'); + + $idProyek = (int)$request->query('idProyek'); + $idActivity = (int)$request->query('idact'); + + $include = []; + + if($idActivity && $idActivity > 0){ + $dataF = UserToActivity::select("user_id")->where("activity_id", $idActivity)->get(); + foreach($dataF as $val){ + $include[] = $val->user_id; + } + } + + if($search && !empty($search)){ + $data = UserToProyek::select("m_users.id as id", "m_users.name as name")->join('m_users', 'm_users.id', '=', 'assign_hr_to_proyek.user_id') + ->where("assign_hr_to_proyek.proyek_id", $idProyek)->where("m_users.name", 'like', '%'.$search.'%')->whereIn("m_users.id", $include)->get(); + }else{ + $data = UserToProyek::select("m_users.id as id", "m_users.name as name")->where("assign_hr_to_proyek.proyek_id", $idProyek)->join('m_users', 'm_users.id', '=', 'assign_hr_to_proyek.user_id')->whereIn("m_users.id", $include)->get(); + } + + if($data instanceof \Illuminate\Database\Eloquent\Collection){ + $pm = array( + "id"=>$this->currentId, + "name"=> "Project Manager" + ); + $data->push($pm); + } + + return response()->json($data); + } +} diff --git a/app/Http/Controllers/UserToShiftController.php b/app/Http/Controllers/UserToShiftController.php new file mode 100644 index 0000000..fd010cf --- /dev/null +++ b/app/Http/Controllers/UserToShiftController.php @@ -0,0 +1,97 @@ +validate($request, [ + 'user_id' => 'required', + 'from_date' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = UserShift::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'User shift assignment successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'User shift assignment failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = UserShift::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'Data User Shift not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'User Shift successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'User Shift failed updated!','code'=>400], 400); + } + } + + + public function delete($id) + { + $data = UserShift::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data User shift assignment not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'User shift assignment successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'User shift assignment failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 't_users_shift'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = UserShift::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list tools request, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/UserToVersionGanttController.php b/app/Http/Controllers/UserToVersionGanttController.php new file mode 100644 index 0000000..b1884e5 --- /dev/null +++ b/app/Http/Controllers/UserToVersionGanttController.php @@ -0,0 +1,167 @@ +validate($request, [ + 'user_id' => 'required', + 'version_gantt_id' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = UserToVersionGantt::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed created','code'=>400]); + } + } + + public function addMultiple(Request $request){ + $users_id = $request->user_id; + + $data = UserToVersionGantt::where("version_gantt_id", $request->version_gantt_id); + + if($data){ + $data->delete(); + } + + if(is_array($users_id) && count($users_id) > 0){ + $countRes = 0; + foreach($users_id as $item){ + + $dataInsert = array( + "user_id" => $item, + "version_gantt_id" => $request->version_gantt_id, + "created_by" => $this->currentName + ); + + $result = UserToVersionGantt::create($dataInsert); + + if($result){ + $countRes++; + }else{ + $countRes--; + } + } + if($countRes > 0){ + return response()->json(['status'=>'success' ,'message'=>'user to version gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'success' ,'message'=>'user to version gantt Project failed created','code'=>400]); + } + }else{ + return response()->json(['status'=>'success' ,'message'=>'user to version gantt Project successfull created','code'=>200]); + } + + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = UserToVersionGantt::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data user to version gantt Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = UserToVersionGantt::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data user to version gantt Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'user to version gantt Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'user to version gantt Project failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = UserToVersionGantt::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data tools resource, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'user_to_version_gantt'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = UserToVersionGantt::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list user to version gantt, please try again later!','code'=>400], 400); + } + } + + public function getByUserGantt($gantt_id) + { + $user_id = $this->currentId; + if($user_id > 0){ + $cekData = UserToVersionGantt::where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->count(); + if($cekData <=0){ + $data = array( + "status"=>"not have" + ); + }else{ + $data = UserToVersionGantt::where("version_gantt_id", $gantt_id)->where("user_id", $user_id)->first(); + } + return response()->json(['status'=>'success','code'=>200,'data'=>$data], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list user to version gantt, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/VersionGanttController.php b/app/Http/Controllers/VersionGanttController.php new file mode 100644 index 0000000..b20ba1f --- /dev/null +++ b/app/Http/Controllers/VersionGanttController.php @@ -0,0 +1,112 @@ +validate($request, [ + 'name_version' => 'required', + 'description' => 'required', + 'proyek_id' => 'required' + ]); + $data = $request->all(); + $data['created_by'] = $this->currentName; + + $result = VersionGantt::create($data); + if($result){ + return response()->json(['status'=>'success','message'=>'version gantt Project successfull created','code'=>200]); + }else{ + return response()->json(['status'=>'failed','message'=>'version gantt Project failed created','code'=>400]); + } + } + + public function update(Request $request, $id){ + + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + $data = VersionGantt::find($id); + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400); + die(); + } + + if($result){ + return response()->json(['status'=>'success','message'=>'version gantt Project successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'version gantt Project failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = VersionGantt::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data version gantt Project not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'version gantt Project successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'version gantt Project failed deleted!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = VersionGantt::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data version gantt, please try again later!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_version_gantt'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = VersionGantt::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list version gantt, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Controllers/WaypointController.php b/app/Http/Controllers/WaypointController.php new file mode 100644 index 0000000..101b5be --- /dev/null +++ b/app/Http/Controllers/WaypointController.php @@ -0,0 +1,118 @@ +validate($request, [ + 'user_id' => 'required', + 'lat' => 'required', + 'lon' => 'required', + ]); + + $data = $request->all(); + + $data['created_by'] = $this->currentName; + + $result = Waypoint::create($data); + + if($result){ + return response()->json(['status'=>'success','message'=>'add waypoint successfully!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'add waypoint failed!','code'=>400], 400); + } + } + + public function edit($id){ + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + die(); + } + + $result = Waypoint::find($id); + + if($result){ + return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get data waypoint, please try again later!','code'=>400], 400); + } + } + + public function update(Request $request, $id) + { + if(!$id || (int) $id < 0 || $id==""){ + return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400); + } + + $data = Waypoint::find($id); + + if($data){ + $result = $data->update($request->all()); + }else{ + return response()->json(['status'=>'failed','message'=>'data waypoint not found!','code'=>400], 400); + die(); + } + + + if($result){ + return response()->json(['status'=>'success','message'=>'data waypoint successfully updated!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data waypoint failed updated!','code'=>400], 400); + } + } + + public function delete($id) + { + $data = Waypoint::find($id); + + if($data){ + $delete = $data->delete(); + }else{ + return response()->json(['status'=>'failed','message'=>'data waypoint not found!','code'=>400], 400); + die(); + } + + + if($delete){ + return response()->json(['status'=>'success','message'=>'data waypoint successfully deleted!','code'=>200], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'data waypoint failed deleted!','code'=>400], 400); + } + } + + public function search(Request $request) + { + // payload same like in goland API oke + $payload = $request->all(); + // second parameter is table name + $dataBuilder = $this->setUpPayload($payload, 'm_waypoint'); + // builder for get data + $builder = $dataBuilder['builder']; + // builder for count data + $countBuilder = $dataBuilder['count']; + // execute builder + $dataGet = $builder->get(); + // execute count builder + $totalRecord = $countBuilder->count(); + // dd($totalRecord); + // send response about the result + return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); + } + + public function list() + { + $data = Waypoint::all(); + $countData = $data->count(); + + if($data){ + return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200); + }else{ + return response()->json(['status'=>'failed','message'=>'failed get list waypoint, please try again later!','code'=>400], 400); + } + } +} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php new file mode 100644 index 0000000..166aba3 --- /dev/null +++ b/app/Http/Middleware/Authenticate.php @@ -0,0 +1,44 @@ +auth = $auth; + } + + /** + * Handle an incoming request. + * + * @param \Illuminate\Http\Request $request + * @param \Closure $next + * @param string|null $guard + * @return mixed + */ + public function handle($request, Closure $next, $guard = null) + { + if ($this->auth->guard($guard)->guest()) { + return response('Unauthorized Request\n', 401); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/CorsMiddleware.php b/app/Http/Middleware/CorsMiddleware.php new file mode 100644 index 0000000..99d148a --- /dev/null +++ b/app/Http/Middleware/CorsMiddleware.php @@ -0,0 +1,39 @@ + '*', + 'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS, PUT, DELETE', + 'Access-Control-Allow-Credentials' => 'true', + 'Access-Control-Max-Age' => '86400', + 'Access-Control-Allow-Headers' => 'Content-Type, Accept, Authorization, X-Requested-With, Application' + ]; + + if ($request->isMethod('OPTIONS')) + { + return response()->json('{"method":"OPTIONS"}', 200, $headers); + } + + $response = $next($request); + foreach($headers as $key => $value) + { + $response->headers->set($key, $value); + } + + return $response; + } +} diff --git a/app/Http/Middleware/ExampleMiddleware.php b/app/Http/Middleware/ExampleMiddleware.php new file mode 100644 index 0000000..7e9b7a8 --- /dev/null +++ b/app/Http/Middleware/ExampleMiddleware.php @@ -0,0 +1,20 @@ +make($value) === $hashedValue; + } + + /** + * Check if the given hash has been hashed using the given options. + * + * @param string $hashedValue + * @param array $options + * @return bool + */ + public function needsRehash($hashedValue, array $options = array()) { + return false; + } + +} + diff --git a/app/Listeners/ExampleListener.php b/app/Listeners/ExampleListener.php new file mode 100644 index 0000000..c06f3eb --- /dev/null +++ b/app/Listeners/ExampleListener.php @@ -0,0 +1,31 @@ +getKey(); + } + + /** + * Return a key value array, containing any custom claims to be added to the JWT. + * + * @return array + */ + public function getJWTCustomClaims() + { + return []; + } + + /// --- belum terpakai, sementara pakai API golang --- + + /** + * Get working hours for given timestamp + * + * @return array of carbon or NULL in case HOLIDAY + */ + + public function getWorkingTime(Carbon $ts, $f = "08:00", $t = "17:00", $tz = self::DEFAULT_TZ) + { + $workingTime = array( + "from"=> Carbon::createFromTimeString($f, $tz), + "to"=> Carbon::createFromTimeString($t, $tz) + ); + + // get Shift assignment + $userShift = UserShift::where('user_id', ) + ->orderByDesc('from_date') + ->first(); + + // HAS SHIFT + $shift = null; + if ($userShift !== null) + { + // get date + //$ts = Carbon::parse($strTs); + $shiftId = null; + switch ($ts->shortEnglishDayOfWeek) + { + case "Mon": + $shiftId = $userShift->mon_shift_id; + break; + case "Tue": + $shiftId = $userShift->tue_shift_id; + break; + case "Wed": + $shiftId = $userShift->wed_shift_id; + break; + case "Thu": + $shiftId = $userShift->thu_shift_id; + break; + case "Fri": + $shiftId = $userShift->fri_shift_id; + break; + case "Sat": + $shiftId = $userShift->sat_shift_id; + break; + case "Sun": + $shiftId = $userShift->sun_shift_id; + break; + } + + // Holiday + if ($shiftId === null) { + return null; + } + + $shift = Shift::where('id', $shiftId)->first(); + } else { + // get default shift time (NON-SHIFT) + $shift = Shift::where('is_non_shift', true) + ->orderByDesc('created_at') + ->first(); + } + + // TODO: calendar holiday + + // assign shift time + if ($shift !== null) + { + $from = Carbon::createFromTimeString($shift->start_time, $tz) + ->subMinutes($shift->flex_time_minute); + $to = Carbon::createFromTimeString($shift->end_time, $tz) + ->addMinutes($shift->flex_time_minute); + + /* + if ($to->lessThan($from)) + { + $to->addDay(); + } + */ + $workingTime['from'] = $from; + $workingTime['to'] = $to; + } + + // return working time + return $workingTime; + } + + /** + * Get presence status + */ + public function presenceStatus(Carbon $at = null, $tz = self::DEFAULT_TZ) + { + // response + // INSIDE, OUTSIDE, HOLIDAY + + $ts = $at; + if ($at !== null) + { + $ts = Carbon::now($tz); + } + $tsSec = $ts->secondsSinceMidnight(); + + $status = ""; + $wt = $this->getWorkingTime($ts, $tz); + if ($wt === null) + { + $status = self::HOLIDAY; + } else { + $from = $wt->from; + $to = $wt->to; + $tsFrom = $from->secondsSinceMidnight(); + $tsTo = $to->secondsSinceMidnight(); + + // working hours with different date + // e.g. 22:00 - 06:00 (nextday) + if ($from->greaterThan($to)) { + $tsMid = 24*60*60 - $tsFrom; + if ($tsSec >= $tsFrom || $tsSec < $tsTo) { + $status = self::INSIDE; + } else { + $status = self::OUTSIDE; + } + } else { + if ($tsSec < $tsFrom || $tsSec > $tsTo) { + $status = self::OUTSIDE; + } else { + $status = self::INSIDE; + } + } + } + + // Get clock-in/out + $clockIn = null; + $clockOut = null; + $inout = Presence::where('user_id', $this->id) + ->orderByDesc('clock_in') + ->first(); + if ($inout !== null) { + $clockIn = Carbon::parse($inout->clock_in, $tz); + $clockOut = Carbon::parse($inout->clock_out, $tz); + } + + return array( + "status"=>$status, + "ts" => $ts, + "clock_in" => $clockIn, + "clock_out" => $clockOut + ); + } +} diff --git a/app/Models/UserMonthlyShift.php b/app/Models/UserMonthlyShift.php new file mode 100644 index 0000000..d923d6b --- /dev/null +++ b/app/Models/UserMonthlyShift.php @@ -0,0 +1,86 @@ +user_name; + } + public function getUserKtpNumberAttribute() { + return $this->user_ktp_number; + } + private function assignUserInfo($users) + { + foreach ($users as $user) { + if ($user->id == $this->user_id) { + //Log::debug("User ID matched {$user->id}"); + $this->setUserInfo($user); + break; + } + } + } + private function setUserInfo($user) + { + $this->user_name = $user->name; + $this->user_ktp_number = $user->ktp_number; + } + + public static function deleteYYYYMM($yyyymm) + { + $rawWhere = DB::raw("to_char(start_at + (end_at - start_at) / 2, 'YYYYMM')"); + $res = UserMonthlyShift::where($rawWhere, $yyyymm)->delete(); + return $res; + } + + // get monthly schedules + public static function monthlyWithUserInfo($yyyymm) + { + // fetch schedule with user name and KTP no + + // get user_id that match the condition + $rawWhere = DB::raw("to_char(start_at+INTERVAL '1 day', 'YYYYMM')"); + $userIds = UserMonthlyShift::where($rawWhere, $yyyymm)->select('user_id'); + + // Fetch users from database + $users = User::whereIn('id', $userIds) + ->orderBy('id') + ->select('id', 'name', 'ktp_number') + ->get(); + //var_dump($users); + //Log::info($users); + + // Get all schedules + $schedules = UserMonthlyShift::where($rawWhere, $yyyymm)->get(); + if ($schedules) { + foreach($schedules as $schedule) + { + $schedule->assignUserInfo($users); + //Log::debug($schedule); + } + } + //Log::debug($schedules); + + return $schedules; + } +} diff --git a/app/Models/UserProject.php b/app/Models/UserProject.php new file mode 100644 index 0000000..74905b2 --- /dev/null +++ b/app/Models/UserProject.php @@ -0,0 +1,17 @@ +app['auth']->viaRequest('api', function ($request) { + if ($request->input('api_token')) { + return User::where('api_token', $request->input('api_token'))->first(); + } + }); + } +} diff --git a/app/Providers/CatchAllOptionsRequestsProvider.php b/app/Providers/CatchAllOptionsRequestsProvider.php new file mode 100644 index 0000000..134cac0 --- /dev/null +++ b/app/Providers/CatchAllOptionsRequestsProvider.php @@ -0,0 +1,33 @@ +isMethod('OPTIONS')) + { + app()->options($request->path(), function() { return response('', 200); }); + } + } +} diff --git a/app/Providers/CustomHashServiceProvider.php b/app/Providers/CustomHashServiceProvider.php new file mode 100644 index 0000000..4f581c7 --- /dev/null +++ b/app/Providers/CustomHashServiceProvider.php @@ -0,0 +1,15 @@ +app->singleton('hash', function () { + return new CustomHasher; + }); + } +} diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php new file mode 100644 index 0000000..881a64d --- /dev/null +++ b/app/Providers/EventServiceProvider.php @@ -0,0 +1,19 @@ + [ + \App\Listeners\ExampleListener::class, + ], + ]; +} diff --git a/artisan b/artisan new file mode 100644 index 0000000..35c9141 --- /dev/null +++ b/artisan @@ -0,0 +1,35 @@ +#!/usr/bin/env php +make( + 'Illuminate\Contracts\Console\Kernel' +); + +exit($kernel->handle(new ArgvInput, new ConsoleOutput)); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 0000000..20d526f --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,130 @@ +bootstrap(); + +date_default_timezone_set(env('APP_TIMEZONE', 'UTC')); + +/* +|-------------------------------------------------------------------------- +| Create The Application +|-------------------------------------------------------------------------- +| +| Here we will load the environment and create the application instance +| that serves as the central piece of this framework. We'll use this +| application as an "IoC" container and router for this framework. +| +*/ + +$app = new Laravel\Lumen\Application( + dirname(__DIR__) +); + +$app->withFacades(); + +$app->withEloquent(); + +/* +|-------------------------------------------------------------------------- +| Register Container Bindings +|-------------------------------------------------------------------------- +| +| Now we will register a few bindings in the service container. We will +| register the exception handler and the console kernel. You may add +| your own bindings here if you like or you can make another file. +| +*/ + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class +); + +$app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class +); + +/* +|-------------------------------------------------------------------------- +| Register Config Files +|-------------------------------------------------------------------------- +| +| Now we will register the "app" configuration file. If the file exists in +| your configuration directory it will be loaded; otherwise, we'll load +| the default version. You may register other files below as needed. +| +*/ + +$app->configure('auth'); +$app->configure('api'); +$app->configure('assets'); + + + + +/* +|-------------------------------------------------------------------------- +| Register Middleware +|-------------------------------------------------------------------------- +| +| Next, we will register the middleware with the application. These can +| be global middleware that run before and after each request into a +| route or middleware that'll be assigned to some specific routes. +| +*/ + +// $app->middleware([ +// App\Http\Middleware\ExampleMiddleware::class +// ]); + +$app->middleware([ + App\Http\Middleware\CorsMiddleware::class +]); + +$app->routeMiddleware([ + 'auth' => App\Http\Middleware\Authenticate::class, +]); + +/* +|-------------------------------------------------------------------------- +| Register Service Providers +|-------------------------------------------------------------------------- +| +| Here we will register all of the application's service providers which +| are used to bind services into the container. Service providers are +| totally optional, so you are not required to uncomment this line. +| +*/ + +$app->register(App\Providers\CatchAllOptionsRequestsProvider::class); + +// $app->register(App\Providers\AppServiceProvider::class); +$app->register(App\Providers\AuthServiceProvider::class); +// $app->register(App\Providers\EventServiceProvider::class); +$app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class); +$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class); +class_alias('Yajra\DataTables\DataTables', 'Datatables'); +$app->configure('datatables'); +$app->register('Yajra\DataTables\DataTablesServiceProvider'); +/* +|-------------------------------------------------------------------------- +| Load The Application Routes +|-------------------------------------------------------------------------- +| +| Next we will include the routes file so that they can all be added to +| the application. This will provide all of the URLs the application +| can respond to, as well as the controllers that may handle them. +| +*/ + +$app->router->group([ + 'namespace' => 'App\Http\Controllers', +], function ($router) { + require __DIR__.'/../routes/web.php'; +}); + +return $app; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..6602dc4 --- /dev/null +++ b/composer.json @@ -0,0 +1,44 @@ +{ + "name": "laravel/lumen", + "description": "The Laravel Lumen Framework.", + "keywords": ["framework", "laravel", "lumen"], + "license": "MIT", + "type": "project", + "require": { + "php": "^7.3|^8.0", + "flipbox/lumen-generator": "^8.2", + "laravel/lumen-framework": "^8.3.1", + "tymon/jwt-auth": "^1.0", + "guzzlehttp/guzzle": "~7.0", + "yajra/laravel-datatables-oracle": "~9.0" + }, + "require-dev": { + "fakerphp/faker": "^1.9.1", + "mockery/mockery": "^1.3.1", + "phpunit/phpunit": "^9.5.10" + }, + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" + } + }, + "autoload-dev": { + "classmap": [ + "tests/" + ] + }, + "config": { + "preferred-install": "dist", + "sort-packages": true, + "optimize-autoloader": true + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ] + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..be00311 --- /dev/null +++ b/composer.lock @@ -0,0 +1,7670 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "9ce8530ea07057f063ab833b1e977ffe", + "packages": [ + { + "name": "brick/math", + "version": "0.9.3", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", + "vimeo/psalm": "4.9.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.9.3" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/brick/math", + "type": "tidelift" + } + ], + "time": "2021-08-15T20:50:18+00:00" + }, + { + "name": "classpreloader/classpreloader", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/ClassPreloader/ClassPreloader.git", + "reference": "af9284543aedb45ed58359374918141c0ac7ae34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/af9284543aedb45ed58359374918141c0ac7ae34", + "reference": "af9284543aedb45ed58359374918141c0ac7ae34", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "nikic/php-parser": "^4.10.3", + "php": "^7.0.8 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "graham-campbell/analyzer": "^2.4.3 || ^3.0.4", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19" + }, + "type": "library", + "autoload": { + "psr-4": { + "ClassPreloader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk" + } + ], + "description": "Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case", + "keywords": [ + "autoload", + "class", + "preload", + "preloader" + ], + "support": { + "issues": "https://github.com/ClassPreloader/ClassPreloader/issues", + "source": "https://github.com/ClassPreloader/ClassPreloader/tree/4.2.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/classpreloader/classpreloader", + "type": "tidelift" + } + ], + "time": "2021-08-28T21:56:17+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:16:43+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-01-12T08:27:12+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "63f2a76a045bac6ec93cc2daf2b534b412aa0313" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/63f2a76a045bac6ec93cc2daf2b534b412aa0313", + "reference": "63f2a76a045bac6ec93cc2daf2b534b412aa0313", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-webmozart-assert": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2022-01-14T16:02:05+00:00" + }, + { + "name": "egulias/email-validator", + "version": "2.1.25", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^1.0.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" + }, + "require-dev": { + "dominicsayers/isemail": "^3.0.7", + "phpunit/phpunit": "^4.8.36|^7.5.15", + "satooshi/php-coveralls": "^1.0.1" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/2.1.25" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2020-12-29T14:50:06+00:00" + }, + { + "name": "flipbox/lumen-generator", + "version": "8.2.2", + "source": { + "type": "git", + "url": "https://github.com/flipboxstudio/lumen-generator.git", + "reference": "d9946a97e1ac5534ff1506184db674c1850c2ece" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/flipboxstudio/lumen-generator/zipball/d9946a97e1ac5534ff1506184db674c1850c2ece", + "reference": "d9946a97e1ac5534ff1506184db674c1850c2ece", + "shasum": "" + }, + "require": { + "classpreloader/classpreloader": "^3.0|^4.0", + "illuminate/console": "^5.5|^6.0|^7.0|^8.0|^8.17", + "illuminate/filesystem": "^5.5|^6.0|^7.0|^8.0|^8.17", + "illuminate/support": "^5.5|^6.0|^7.0|^8.0|^8.17", + "psy/psysh": "0.9.*|0.10.*", + "symfony/var-dumper": "^4.2|^4.3|^5.0|^5.1|^5.2" + }, + "suggest": { + "anik/form-request": "Required to use form request in Lumen." + }, + "type": "library", + "autoload": { + "psr-4": { + "Flipbox\\LumenGenerator\\": "src/LumenGenerator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Krisan Alfa Timur", + "email": "krisan47@gmail.com" + } + ], + "description": "A Lumen Generator You Are Missing", + "support": { + "issues": "https://github.com/flipboxstudio/lumen-generator/issues", + "source": "https://github.com/flipboxstudio/lumen-generator/tree/8.2.2" + }, + "time": "2021-10-18T12:30:09+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "0690bde05318336c7221785f2a932467f98b64ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", + "reference": "0690bde05318336c7221785f2a932467f98b64ca", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2021-11-21T21:41:47+00:00" + }, + { + "name": "illuminate/auth", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/auth.git", + "reference": "02b166738b6e7449e18fe595822abeac59b7e317" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/auth/zipball/02b166738b6e7449e18fe595822abeac59b7e317", + "reference": "02b166738b6e7449e18fe595822abeac59b7e317", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/http": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/queue": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "illuminate/console": "Required to use the auth:clear-resets command (^8.0).", + "illuminate/queue": "Required to fire login / logout events (^8.0).", + "illuminate/session": "Required to use the session based guard (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Auth\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Auth package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-02T21:22:29+00:00" + }, + { + "name": "illuminate/broadcasting", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/broadcasting.git", + "reference": "d7c0c81bcc679c294746b161f4b834997e904cf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/broadcasting/zipball/d7c0c81bcc679c294746b161f4b834997e904cf4", + "reference": "d7c0c81bcc679c294746b161f4b834997e904cf4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/bus": "^8.0", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/queue": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "psr/log": "^1.0|^2.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0|^7.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Broadcasting\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Broadcasting package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-06T14:28:26+00:00" + }, + { + "name": "illuminate/bus", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/bus.git", + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/bus/zipball/917798f4a21c5eed1f83f9b434ce94f9c4fa8432", + "reference": "917798f4a21c5eed1f83f9b434ce94f9c4fa8432", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Bus\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Bus package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-10T22:25:47+00:00" + }, + { + "name": "illuminate/cache", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/cache.git", + "reference": "0f307e63c11ba99122a3d864647125788aac6db8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/cache/zipball/0f307e63c11ba99122a3d864647125788aac6db8", + "reference": "0f307e63c11ba99122a3d864647125788aac6db8", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "provide": { + "psr/simple-cache-implementation": "1.0" + }, + "suggest": { + "ext-memcached": "Required to use the memcache cache driver.", + "illuminate/database": "Required to use the database cache driver (^8.0).", + "illuminate/filesystem": "Required to use the file cache driver (^8.0).", + "illuminate/redis": "Required to use the redis cache driver (^8.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Cache package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-04T16:05:53+00:00" + }, + { + "name": "illuminate/collections", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "cfa88a486e04c3531d997b5f6e0a95cc148a5cd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/cfa88a486e04c3531d997b5f6e0a95cc148a5cd5", + "reference": "cfa88a486e04c3531d997b5f6e0a95cc148a5cd5", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "symfony/var-dumper": "Required to use the dump method (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-07T15:10:06+00:00" + }, + { + "name": "illuminate/config", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/config.git", + "reference": "70973cbbe0cb524658b6eeaa2386dd5b71de4b02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/config/zipball/70973cbbe0cb524658b6eeaa2386dd5b71de4b02", + "reference": "70973cbbe0cb524658b6eeaa2386dd5b71de4b02", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Config package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-08-03T13:42:24+00:00" + }, + { + "name": "illuminate/console", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/console.git", + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/console/zipball/d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", + "reference": "d93e3aeff1b7a0f647a8b20eefa8547fdcd61dcf", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4", + "symfony/process": "^5.4" + }, + "suggest": { + "dragonmantank/cron-expression": "Required to use scheduler (^3.0.2).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.5.5|^7.0.1).", + "illuminate/bus": "Required to use the scheduled job dispatcher (^8.0).", + "illuminate/container": "Required to use the scheduler (^8.0).", + "illuminate/filesystem": "Required to use the generator command (^8.0).", + "illuminate/queue": "Required to use closures for scheduled jobs (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Console package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-07T19:50:44+00:00" + }, + { + "name": "illuminate/container", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "e18f8ce24a551e086621b00c7b75d6914d2011b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/e18f8ce24a551e086621b00c7b75d6914d2011b4", + "reference": "e18f8ce24a551e086621b00c7b75d6914d2011b4", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-05T15:38:15+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "9baa9f781071e67d7b171775bd3be7ead13ddd29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/9baa9f781071e67d7b171775bd3be7ead13ddd29", + "reference": "9baa9f781071e67d7b171775bd3be7ead13ddd29", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-14T14:40:44+00:00" + }, + { + "name": "illuminate/database", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/database.git", + "reference": "d2c12e7fcba9bcd6c04ba2e45b2286c4c2d7dd24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/database/zipball/d2c12e7fcba9bcd6c04ba2e45b2286c4c2d7dd24", + "reference": "d2c12e7fcba9bcd6c04ba2e45b2286c4c2d7dd24", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.4" + }, + "suggest": { + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "illuminate/console": "Required to use the database commands (^8.0).", + "illuminate/events": "Required to use the observers with Eloquent (^8.0).", + "illuminate/filesystem": "Required to use the migrations (^8.0).", + "illuminate/pagination": "Required to paginate the result set (^8.0).", + "symfony/finder": "Required to use Eloquent model factories (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Database\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Database package.", + "homepage": "https://laravel.com", + "keywords": [ + "database", + "laravel", + "orm", + "sql" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-11T15:40:11+00:00" + }, + { + "name": "illuminate/encryption", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/encryption.git", + "reference": "3ff5c78f402c81da4b2ad4bef8f747a13e6fb0ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/encryption/zipball/3ff5c78f402c81da4b2ad4bef8f747a13e6fb0ff", + "reference": "3ff5c78f402c81da4b2ad4bef8f747a13e6fb0ff", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Encryption\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Encryption package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-09-15T14:32:50+00:00" + }, + { + "name": "illuminate/events", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/events.git", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "shasum": "" + }, + "require": { + "illuminate/bus": "^8.0", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Events\\": "" + }, + "files": [ + "functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Events package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-09-15T14:32:50+00:00" + }, + { + "name": "illuminate/filesystem", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/filesystem.git", + "reference": "def8901b69cd04902de0c2752683bab5e4d121b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/def8901b69cd04902de0c2752683bab5e4d121b5", + "reference": "def8901b69cd04902de0c2752683bab5e4d121b5", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4" + }, + "suggest": { + "ext-ftp": "Required to use the Flysystem FTP driver.", + "illuminate/http": "Required for handling uploaded files (^7.0).", + "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", + "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", + "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", + "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Filesystem package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-05T14:40:14+00:00" + }, + { + "name": "illuminate/hashing", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/hashing.git", + "reference": "2617f4de8d0150a3f8641b086fafac8c1e0cdbf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/hashing/zipball/2617f4de8d0150a3f8641b086fafac8c1e0cdbf2", + "reference": "2617f4de8d0150a3f8641b086fafac8c1e0cdbf2", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Hashing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Hashing package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-10-22T13:20:42+00:00" + }, + { + "name": "illuminate/http", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/http.git", + "reference": "893bd4a1c2d29e063974fe97c6cd7ac65f683266" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/http/zipball/893bd4a1c2d29e063974fe97c6cd7ac65f683266", + "reference": "893bd4a1c2d29e063974fe97c6cd7ac65f683266", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/session": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4" + }, + "suggest": { + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "guzzlehttp/guzzle": "Required to use the HTTP Client (^6.5.5|^7.0.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Http\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Http package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-05T14:49:18+00:00" + }, + { + "name": "illuminate/log", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/log.git", + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/log/zipball/1dbdc6aca24d1d2b5903f865bb206039d4b800b2", + "reference": "1dbdc6aca24d1d2b5903f865bb206039d4b800b2", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "monolog/monolog": "^2.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Log package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-10T15:22:22+00:00" + }, + { + "name": "illuminate/macroable", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "aed81891a6e046fdee72edd497f822190f61c162" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-16T13:57:03+00:00" + }, + { + "name": "illuminate/pagination", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "a0a5784a052663fb044baed95f56801b57c2d002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/a0a5784a052663fb044baed95f56801b57c2d002", + "reference": "a0a5784a052663fb044baed95f56801b57c2d002", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-05T15:05:14+00:00" + }, + { + "name": "illuminate/pipeline", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pipeline.git", + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Pipeline\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pipeline package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-03-26T18:39:16+00:00" + }, + { + "name": "illuminate/queue", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/queue.git", + "reference": "7111e907b4febe419c512a27ca4ce0510638308d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/queue/zipball/7111e907b4febe419c512a27ca4ce0510638308d", + "reference": "7111e907b4febe419c512a27ca4ce0510638308d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/console": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/database": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/pipeline": "^8.0", + "illuminate/support": "^8.0", + "laravel/serializable-closure": "^1.0", + "opis/closure": "^3.6", + "php": "^7.3|^8.0", + "ramsey/uuid": "^4.2.2", + "symfony/process": "^5.4" + }, + "suggest": { + "aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.198.1).", + "ext-pcntl": "Required to use all features of the queue worker.", + "ext-posix": "Required to use all features of the queue worker.", + "illuminate/redis": "Required to use the Redis queue driver (^8.0).", + "pda/pheanstalk": "Required to use the Beanstalk queue driver (^4.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Queue\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Queue package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T14:13:40+00:00" + }, + { + "name": "illuminate/session", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/session.git", + "reference": "c5964a2348354f266fb18aac60eed0b81355c258" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/session/zipball/c5964a2348354f266fb18aac60eed0b81355c258", + "reference": "c5964a2348354f266fb18aac60eed0b81355c258", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4" + }, + "suggest": { + "illuminate/console": "Required to use the session:table command (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Session\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Session package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-30T14:13:40+00:00" + }, + { + "name": "illuminate/support", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "250fd3002747e7fe3a78d802b091c867e321087d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/250fd3002747e7fe3a78d802b091c867e321087d", + "reference": "250fd3002747e7fe3a78d802b091c867e321087d", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.4|^2.0", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "nesbot/carbon": "^2.53.1", + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.4.8" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-11T15:43:56+00:00" + }, + { + "name": "illuminate/testing", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/testing.git", + "reference": "feca7bc8f4de97434e3923ae7b09c5c047d46038" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/testing/zipball/feca7bc8f4de97434e3923ae7b09c5c047d46038", + "reference": "feca7bc8f4de97434e3923ae7b09c5c047d46038", + "shasum": "" + }, + "require": { + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "brianium/paratest": "Required to run tests in parallel (^6.0).", + "illuminate/console": "Required to assert console commands (^8.0).", + "illuminate/database": "Required to assert databases (^8.0).", + "illuminate/http": "Required to assert responses (^8.0).", + "mockery/mockery": "Required to use mocking (^1.4.4).", + "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Testing\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Testing package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-01T12:58:42+00:00" + }, + { + "name": "illuminate/translation", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/translation.git", + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/translation/zipball/c10a68f37f590dc8c1c1fe5b6ad3f09381282137", + "reference": "c10a68f37f590dc8c1c1fe5b6ad3f09381282137", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Translation package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-10-30T16:01:33+00:00" + }, + { + "name": "illuminate/validation", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/validation.git", + "reference": "3ac1eed5b4d5fe355a510893164ecc718febdd54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/validation/zipball/3ac1eed5b4d5fe355a510893164ecc718febdd54", + "reference": "3ac1eed5b4d5fe355a510893164ecc718febdd54", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10", + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "illuminate/translation": "^8.0", + "php": "^7.3|^8.0", + "symfony/http-foundation": "^5.4", + "symfony/mime": "^5.4" + }, + "suggest": { + "ext-bcmath": "Required to use the multiple_of validation rule.", + "illuminate/database": "Required to use the database presence verifier (^8.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Validation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Validation package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-12T13:56:08+00:00" + }, + { + "name": "illuminate/view", + "version": "v8.79.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/view.git", + "reference": "ec853721a70c11d51c6162a58410abb319a073b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/view/zipball/ec853721a70c11d51c6162a58410abb319a073b1", + "reference": "ec853721a70c11d51c6162a58410abb319a073b1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/events": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\View\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate View package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-12-16T19:23:48+00:00" + }, + { + "name": "laravel/lumen-framework", + "version": "v8.3.4", + "source": { + "type": "git", + "url": "https://github.com/laravel/lumen-framework.git", + "reference": "733d1199d3344be337743f11df31b4048ec7fd1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/lumen-framework/zipball/733d1199d3344be337743f11df31b4048ec7fd1c", + "reference": "733d1199d3344be337743f11df31b4048ec7fd1c", + "shasum": "" + }, + "require": { + "dragonmantank/cron-expression": "^3.0.2", + "illuminate/auth": "^8.65", + "illuminate/broadcasting": "^8.65", + "illuminate/bus": "^8.65", + "illuminate/cache": "^8.65", + "illuminate/collections": "^8.65", + "illuminate/config": "^8.65", + "illuminate/console": "^8.65", + "illuminate/container": "^8.65", + "illuminate/contracts": "^8.65", + "illuminate/database": "^8.65", + "illuminate/encryption": "^8.65", + "illuminate/events": "^8.65", + "illuminate/filesystem": "^8.65", + "illuminate/hashing": "^8.65", + "illuminate/http": "^8.65", + "illuminate/log": "^8.65", + "illuminate/macroable": "^8.65", + "illuminate/pagination": "^8.65", + "illuminate/pipeline": "^8.65", + "illuminate/queue": "^8.65", + "illuminate/support": "^8.65", + "illuminate/testing": "^8.65", + "illuminate/translation": "^8.65", + "illuminate/validation": "^8.65", + "illuminate/view": "^8.65", + "nikic/fast-route": "^1.3", + "php": "^7.3|^8.0", + "symfony/console": "^5.4", + "symfony/error-handler": "^5.4", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4", + "symfony/var-dumper": "^5.4", + "vlucas/phpdotenv": "^5.2" + }, + "require-dev": { + "mockery/mockery": "^1.4.4", + "phpunit/phpunit": "^8.5.19|^9.5.8" + }, + "suggest": { + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Lumen\\": "src/" + }, + "files": [ + "src/helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Lumen Framework.", + "homepage": "https://lumen.laravel.com", + "keywords": [ + "framework", + "laravel", + "lumen" + ], + "support": { + "issues": "https://github.com/laravel/lumen-framework/issues", + "source": "https://github.com/laravel/lumen-framework" + }, + "time": "2021-12-22T10:11:35+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "25de3be1bca1b17d52ff0dc02b646c667ac7266c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/25de3be1bca1b17d52ff0dc02b646c667ac7266c", + "reference": "25de3be1bca1b17d52ff0dc02b646c667ac7266c", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "pestphp/pest": "^1.18", + "phpstan/phpstan": "^0.12.98", + "symfony/var-dumper": "^5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2021-11-30T15:53:04+00:00" + }, + { + "name": "lcobucci/jwt", + "version": "3.3.3", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "c1123697f6a2ec29162b82f170dd4a491f524773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c1123697f6a2ec29162b82f170dd4a491f524773", + "reference": "c1123697f6a2ec29162b82f170dd4a491f524773", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-openssl": "*", + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "mikey179/vfsstream": "~1.5", + "phpmd/phpmd": "~2.2", + "phpunit/php-invoker": "~1.1", + "phpunit/phpunit": "^5.7 || ^7.3", + "squizlabs/php_codesniffer": "~2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Otávio Cobucci Oblonczyk", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "support": { + "issues": "https://github.com/lcobucci/jwt/issues", + "source": "https://github.com/lcobucci/jwt/tree/3.3.3" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2020-08-20T13:22:28+00:00" + }, + { + "name": "monolog/monolog", + "version": "2.3.5", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.91", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90@dev", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.3.5" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2021-10-01T21:08:31+00:00" + }, + { + "name": "namshi/jose", + "version": "7.2.3", + "source": { + "type": "git", + "url": "https://github.com/namshi/jose.git", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/namshi/jose/zipball/89a24d7eb3040e285dd5925fcad992378b82bcff", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": ">=5.5", + "symfony/polyfill-php56": "^1.0" + }, + "require-dev": { + "phpseclib/phpseclib": "^2.0", + "phpunit/phpunit": "^4.5|^5.0", + "satooshi/php-coveralls": "^1.0" + }, + "suggest": { + "ext-openssl": "Allows to use OpenSSL as crypto engine.", + "phpseclib/phpseclib": "Allows to use Phpseclib as crypto engine, use version ^2.0." + }, + "type": "library", + "autoload": { + "psr-4": { + "Namshi\\JOSE\\": "src/Namshi/JOSE/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Nadalin", + "email": "alessandro.nadalin@gmail.com" + }, + { + "name": "Alessandro Cinelli (cirpo)", + "email": "alessandro.cinelli@gmail.com" + } + ], + "description": "JSON Object Signing and Encryption library for PHP.", + "keywords": [ + "JSON Web Signature", + "JSON Web Token", + "JWS", + "json", + "jwt", + "token" + ], + "support": { + "issues": "https://github.com/namshi/jose/issues", + "source": "https://github.com/namshi/jose/tree/master" + }, + "time": "2016-12-05T07:27:31+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.55.2", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.54", + "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2021-12-03T14:59:52+00:00" + }, + { + "name": "nikic/fast-route", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", + "reference": "181d480e08d9476e61381e04a71b34dc0432e812", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "FastRoute\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov", + "email": "nikic@php.net" + } + ], + "description": "Fast request router for PHP", + "keywords": [ + "router", + "routing" + ], + "support": { + "issues": "https://github.com/nikic/FastRoute/issues", + "source": "https://github.com/nikic/FastRoute/tree/master" + }, + "time": "2018-02-13T20:26:39+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "opis/closure", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/opis/closure.git", + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6", + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0" + }, + "require-dev": { + "jeremeamia/superclosure": "^2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opis\\Closure\\": "src/" + }, + "files": [ + "functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", + "homepage": "https://opis.io/closure", + "keywords": [ + "anonymous functions", + "closure", + "function", + "serializable", + "serialization", + "serialize" + ], + "support": { + "issues": "https://github.com/opis/closure/issues", + "source": "https://github.com/opis/closure/tree/3.6.2" + }, + "time": "2021-04-09T13:42:10+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "reference": "eab7a0df01fe2344d172bff4cd6dbd3f8b84ad15", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.8.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2021-12-04T23:24:31+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.10.12", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "a0d9981aa07ecfcbea28e4bfa868031cca121e7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a0d9981aa07ecfcbea28e4bfa868031cca121e7d", + "reference": "a0d9981aa07ecfcbea28e4bfa868031cca121e7d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", + "php": "^8.0 || ^7.0 || ^5.5.9", + "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", + "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "3.17.*" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.10.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.10.12" + }, + "time": "2021-11-30T14:05:36+00:00" + }, + { + "name": "ramsey/collection", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "reference": "cccc74ee5e328031b15640b51056ee8d3bb66c0a", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8", + "symfony/polyfill-php81": "^1.23" + }, + "require-dev": { + "captainhook/captainhook": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "ergebnis/composer-normalize": "^2.6", + "fakerphp/faker": "^1.5", + "hamcrest/hamcrest-php": "^2", + "jangregor/phpstan-prophecy": "^0.8", + "mockery/mockery": "^1.3", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^0.12.32", + "phpstan/phpstan-mockery": "^0.12.5", + "phpstan/phpstan-phpunit": "^0.12.11", + "phpunit/phpunit": "^8.5 || ^9", + "psy/psysh": "^0.10.4", + "slevomat/coding-standard": "^6.3", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2021-10-10T03:01:02+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "shasum": "" + }, + "require": { + "brick/math": "^0.8 || ^0.9", + "ext-json": "*", + "php": "^7.2 || ^8.0", + "ramsey/collection": "^1.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "moontoast/math": "^1.1", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5 || ^9", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.x-dev" + }, + "captainhook": { + "force-install": true + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.2.3" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2021-09-25T23:10:38+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-20T16:11:12+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "e0c0dd0f9d4120a20158fc9aec2367d07d38bc56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/e0c0dd0f9d4120a20158fc9aec2367d07d38bc56", + "reference": "e0c0dd0f9d4120a20158fc9aec2367d07d38bc56", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/serializer": "^4.4|^5.0|^6.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-19T20:02:00+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-12T14:48:14+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e77046c252be48c48a40816187ed527703c8f76c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", + "reference": "e77046c252be48c48a40816187ed527703c8f76c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-15T11:06:13+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "ce952af52877eaf3eab5d0c08cc0ea865ed37313" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ce952af52877eaf3eab5d0c08cc0ea865ed37313", + "reference": "ce952af52877eaf3eab5d0c08cc0ea865ed37313", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-28T17:15:56+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "35b7e9868953e0d1df84320bb063543369e43ef5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/35b7e9868953e0d1df84320bb063543369e43ef5", + "reference": "35b7e9868953e0d1df84320bb063543369e43ef5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.3.7|^6.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/browser-kit": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", + "twig/twig": "<2.13" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2|^3", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2|^3", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-29T13:20:26+00:00" + }, + { + "name": "symfony/mime", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "1bfd938cf9562822c05c4d00e8f92134d3c8e42d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/1bfd938cf9562822c05c4d00e8f92134d3c8e42d", + "reference": "1bfd938cf9562822c05c4d00e8f92134d3c8e42d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<4.4" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.2|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-28T17:15:56+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T21:10:46+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44", + "reference": "749045c69efb97c70d25d7463abba812e91f3a44", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-14T14:02:44+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php56", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php56/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:11+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-27T21:01:00+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-16T21:52:00+00:00" + }, + { + "name": "symfony/translation", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "ff8bb2107b6a549dc3c5dd9c498dcc82c9c098ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/ff8bb2107b6a549dc3c5dd9c498dcc82c9c098ca", + "reference": "ff8bb2107b6a549dc3c5dd9c498dcc82c9c098ca", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-25T19:45:36+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-17T14:20:01+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "1b56c32c3679002b3a42384a580e16e2600f41c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1b56c32c3679002b3a42384a580e16e2600f41c1", + "reference": "1b56c32c3679002b3a42384a580e16e2600f41c1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/uid": "^5.1|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-29T10:10:35+00:00" + }, + { + "name": "tymon/jwt-auth", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/tymondesigns/jwt-auth.git", + "reference": "e588cb719539366c0e2f6017f975379cb73e9680" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/e588cb719539366c0e2f6017f975379cb73e9680", + "reference": "e588cb719539366c0e2f6017f975379cb73e9680", + "shasum": "" + }, + "require": { + "illuminate/auth": "^5.2|^6|^7|^8", + "illuminate/contracts": "^5.2|^6|^7|^8", + "illuminate/http": "^5.2|^6|^7|^8", + "illuminate/support": "^5.2|^6|^7|^8", + "lcobucci/jwt": "<3.4", + "namshi/jose": "^7.0", + "nesbot/carbon": "^1.0|^2.0", + "php": "^5.5.9|^7.0" + }, + "require-dev": { + "illuminate/console": "^5.2|^6|^7|^8", + "illuminate/database": "^5.2|^6|^7|^8", + "illuminate/routing": "^5.2|^6|^7|^8", + "mockery/mockery": ">=0.9.9", + "phpunit/phpunit": "~4.8|~6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.0-dev" + }, + "laravel": { + "aliases": { + "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", + "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" + }, + "providers": [ + "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Tymon\\JWTAuth\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sean Tymon", + "email": "tymon148@gmail.com", + "homepage": "https://tymon.xyz", + "role": "Developer" + } + ], + "description": "JSON Web Token Authentication for Laravel and Lumen", + "homepage": "https://github.com/tymondesigns/jwt-auth", + "keywords": [ + "Authentication", + "JSON Web Token", + "auth", + "jwt", + "laravel" + ], + "support": { + "issues": "https://github.com/tymondesigns/jwt-auth/issues", + "source": "https://github.com/tymondesigns/jwt-auth" + }, + "funding": [ + { + "url": "https://www.patreon.com/seantymon", + "type": "patreon" + } + ], + "time": "2020-11-27T12:32:42+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.4.1", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/264dce589e7ce37a7ba99cb901eed8249fbec92f", + "reference": "264dce589e7ce37a7ba99cb901eed8249fbec92f", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-filter": "*", + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2021-12-12T23:22:04+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "80953678b19901e5165c56752d087fc11526017c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", + "reference": "80953678b19901e5165c56752d087fc11526017c", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + }, + { + "name": "yajra/laravel-datatables-oracle", + "version": "v9.18.2", + "source": { + "type": "git", + "url": "https://github.com/yajra/laravel-datatables.git", + "reference": "f4eebc1dc2b067058dfb91e7c067de862353c40f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/f4eebc1dc2b067058dfb91e7c067de862353c40f", + "reference": "f4eebc1dc2b067058dfb91e7c067de862353c40f", + "shasum": "" + }, + "require": { + "illuminate/database": "5.8.*|^6|^7|^8", + "illuminate/filesystem": "5.8.*|^6|^7|^8", + "illuminate/http": "5.8.*|^6|^7|^8", + "illuminate/support": "5.8.*|^6|^7|^8", + "illuminate/view": "5.8.*|^6|^7|^8", + "php": "^7.1.3|^8" + }, + "require-dev": { + "orchestra/testbench": "^3.8" + }, + "suggest": { + "yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTables.", + "yajra/laravel-datatables-editor": "Plugin to use DataTables Editor (requires a license).", + "yajra/laravel-datatables-fractal": "Plugin for server-side response using Fractal.", + "yajra/laravel-datatables-html": "Plugin for server-side HTML builder of dataTables." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.0-dev" + }, + "laravel": { + "providers": [ + "Yajra\\DataTables\\DataTablesServiceProvider" + ], + "aliases": { + "DataTables": "Yajra\\DataTables\\Facades\\DataTables" + } + } + }, + "autoload": { + "psr-4": { + "Yajra\\DataTables\\": "src/" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Arjay Angeles", + "email": "aqangeles@gmail.com" + } + ], + "description": "jQuery DataTables API for Laravel 4|5|6|7", + "keywords": [ + "datatables", + "jquery", + "laravel" + ], + "support": { + "issues": "https://github.com/yajra/laravel-datatables/issues", + "source": "https://github.com/yajra/laravel-datatables/tree/v9.18.2" + }, + "funding": [ + { + "url": "https://www.paypal.me/yajra", + "type": "custom" + }, + { + "url": "https://www.patreon.com/yajra", + "type": "patreon" + } + ], + "time": "2021-10-27T12:38:21+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "fakerphp/faker", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "b85e9d44eae8c52cca7aa0939483611f7232b669" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/b85e9d44eae8c52cca7aa0939483611f7232b669", + "reference": "b85e9d44eae8c52cca7aa0939483611f7232b669", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-intl": "*", + "symfony/phpunit-bridge": "^4.4 || ^5.2" + }, + "suggest": { + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.17.0" + }, + "time": "2021-12-05T17:14:47+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "issues": "https://github.com/mockery/mockery/issues", + "source": "https://github.com/mockery/mockery/tree/1.4.4" + }, + "time": "2021-09-13T15:28:59+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + }, + "time": "2022-01-04T19:58:01+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2406855036db1102126125537adb1406f7242fdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-25T07:07:57+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^7.3|^8.0" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/config/api.php b/config/api.php new file mode 100644 index 0000000..6edc41c --- /dev/null +++ b/config/api.php @@ -0,0 +1,7 @@ + env('API_GOLANG', 'http://127.0.0.1:8090'), + 'paxel' => env('API_PAXEL', 'https://paxel.oslogdev.com/db/search'), + 'nominatim' => env('API_NOMINATIM', 'https://nominatim.oslogdev.com') + ]; +?> \ No newline at end of file diff --git a/config/assets.php b/config/assets.php new file mode 100644 index 0000000..7855730 --- /dev/null +++ b/config/assets.php @@ -0,0 +1,7 @@ + env('ASSETS_IMAGE', 'assets/image/'), + 'project' => env('ASSETS_PROJECT', 'assets/file/project/'), + 'activity' => env('ASSETS_ACTIVITY', 'assets/file/activity/') + ]; +?> \ No newline at end of file diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..43c69ca --- /dev/null +++ b/config/auth.php @@ -0,0 +1,22 @@ + [ + 'guard' => 'api', + 'passwords' => 'm_users', + ], + 'guards' => [ + 'api' => [ + 'driver' => 'jwt', + 'provider' => 'm_users', + ], + ], + 'providers'=> [ + 'm_users' => [ + 'driver'=>'eloquent', + 'model'=>\App\Models\User::class + ] + ] +]; + +?> \ No newline at end of file diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 0000000..1358673 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,29 @@ + $this->faker->name, + 'email' => $this->faker->unique()->safeEmail, + ]; + } +} diff --git a/database/migrations/.gitkeep b/database/migrations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php new file mode 100644 index 0000000..3fa57b4 --- /dev/null +++ b/database/seeders/DatabaseSeeder.php @@ -0,0 +1,18 @@ +call('UsersTableSeeder'); + } +} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..35ca14e --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,32 @@ +FROM php:7.4-fpm-alpine + +RUN apk add --update --no-cache +RUN apk add \ + libpq-dev \ + php7-tokenizer \ + php7-zip \ + php7-curl \ + php7-mbstring \ + php7-intl \ + php7-iconv +RUN docker-php-ext-install pgsql pdo_pgsql + +#RUN curl -sS https://getcomposer.org/installer | php -- \ +# --install-dir=/usr/bin --filename=composer + +ADD https://getcomposer.org/installer ./composer-setup.php +RUN php ./composer-setup.php --install-dir=/usr/local/bin --filename=composer +RUN rm ./composer-setup.php + + +RUN rm -rf /var/cache/apk/* + +COPY . /kit-api + +RUN cd "/kit-api" && cp .env.production .env && composer install + +WORKDIR /kit-api + +EXPOSE 80 + +CMD php -S 0.0.0.0:80 diff --git a/docker/Dockerfile-bullseye b/docker/Dockerfile-bullseye new file mode 100644 index 0000000..eb19399 --- /dev/null +++ b/docker/Dockerfile-bullseye @@ -0,0 +1,54 @@ +FROM php:7.4-fpm-bullseye + +ENV TZ="Asia/Jakarta" +RUN date + +RUN apt-get update +RUN apt-get -y upgrade +RUN apt-get -y install \ + apt-utils \ + ca-certificates \ + zip \ + unzip \ + libpq-dev \ + libonig-dev \ + libzip-dev \ + libicu-dev +RUN docker-php-ext-install \ + pgsql pdo_pgsql iconv intl mbstring zip + +RUN apt-get clean + +#RUN curl -sS https://getcomposer.org/installer | php -- \ +# --install-dir=/usr/bin --filename=composer + +ADD https://getcomposer.org/installer ./composer-setup.php +RUN php ./composer-setup.php --install-dir=/usr/local/bin --filename=composer +RUN rm ./composer-setup.php + +COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord +COPY . /kit-api + +RUN cd "/kit-api" && mv .env.production .env + +# Create assets directory inside volume +RUN mkdir -p /ospro/assets/image +RUN mkdir -p /ospro/assets/file/project +RUN mkdir -p /ospro/assets/file/activity + +# Install dependency +WORKDIR /kit-api +RUN composer update +RUN composer install + +# copy configuration +RUN cp ./docker/supervisord.conf /etc/ +RUN chmod +x ./docker/deps/shiftapp +RUN cp ./docker/deps/shiftapp /usr/local/bin/ + +EXPOSE 80 +EXPOSE 8090 + +# CMD php -S 0.0.0.0:80 +CMD ["/usr/local/bin/supervisord"] + diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..447618a --- /dev/null +++ b/docker/README.md @@ -0,0 +1,57 @@ +# Docker for Lumen API + +Langkah-langkah (versi tanpa script): + +1. Clone repository + +```bash +git clone https://git.oslog.id/juan/simpro-lumen.git +cd simpro-lumen +``` + +2. Create `.env.production` file. Edit bagian koneksi database + +``` +B_CONNECTION=pgsql +# Koneksi ke oslogdev +DB_HOST= +DB_PORT= +DB_DATABASE= +DB_USERNAME= +DB_PASSWORD= +``` + +3. Jalankan script untuk membuat docker container + +```bash +# Jika pertama kali dibuild +./kit-app-bullseye.sh build + +# Jika containernya sudah ada +./kit-app-bullseye.sh rebuild +``` + +4. Selesai + + +Script diatas sebenarnya menjalankan langkah-langkah berikut (biar tidak mengetik secara berulang). + +1. Build docker images + +```bash +docker build -t ospro/kit_api -f ./docker/Dockerfile . +``` + +2. Jalankan docker + +```bash +docker run -d -p 127.0.0.1:8333:80 --name ospro_kit_api-container ospro/kit_api +``` + +3. Jika ada update, rebuild + +```bash +docker stop ospro_kit_api-container +docker rm ospro_kit_api-container +``` +kemudian lakukan langkah `1` dan `2`. diff --git a/docker/deps/shiftapp b/docker/deps/shiftapp new file mode 100644 index 0000000..891fd76 Binary files /dev/null and b/docker/deps/shiftapp differ diff --git a/docker/supervisord.conf b/docker/supervisord.conf new file mode 100644 index 0000000..252277a --- /dev/null +++ b/docker/supervisord.conf @@ -0,0 +1,19 @@ +[inet_http_server] +port=127.0.0.1:9001 + +[supervisorctl] +serverurl=http://127.0.0.1:9001 + +[program:apiserver] +command=/usr/local/bin/php -S 0.0.0.0:80 +autostart=true +startretries=5 + +[program:shiftapp] +command=/usr/local/bin/shiftapp -conf=/kit-api/.config-prod.json +autostart=true +startretries=5 +stdout_logfile=/tmp/stdout.txt +stdout_logfile_maxbytes=10000000 +stderr_logfile=/tmp/stderr.txt +stderr_logfile_maxbytes=10000000 diff --git a/index.php b/index.php new file mode 100644 index 0000000..0c3f990 --- /dev/null +++ b/index.php @@ -0,0 +1,28 @@ +run(); diff --git a/kit-api.sh b/kit-api.sh new file mode 100644 index 0000000..c4b6468 --- /dev/null +++ b/kit-api.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# args +action=${1:build} + +# ensure newest +git pull + +if [ $1 = "rebuild" ]; then + echo 'Rebuild OSPRO KIT-API Container' + docker stop ospro_kit_api-container + docker rm ospro_kit_api-container +else + echo 'Build New OSPOR KIT-API Container' +fi + +docker build -t ospro/kit_api -f ./docker/Dockerfile . +docker run -d -p 127.0.0.1:8333:80 --name ospro_kit_api-container ospro/kit_api + + + diff --git a/kit-app-bullseye.sh b/kit-app-bullseye.sh new file mode 100644 index 0000000..e2f24ad --- /dev/null +++ b/kit-app-bullseye.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# args +action=${1:build} + +# ensure newest +git pull + +if [ $1 == "rebuild" ]; then + echo 'Rebuild OSPRO KIT-API Container' + docker stop ospro_kit_api-container + docker rm ospro_kit_api-container +else + echo 'Build New OSPOR KIT-API Container' +fi + +# check volume +docker volume inspect ospro +if [ $? != 0 ]; then + echo 'Create volume' + docker volume create ospro +fi + +docker build -t ospro/kit_api -f ./docker/Dockerfile-bullseye . +docker run -d -v ospro:/ospro \ + -p 127.0.0.1:8333:80 \ + -p 127.0.0.1:8090:8090 \ + --restart always \ + --name ospro_kit_api-container ospro/kit_api + + + diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..2c28110 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,17 @@ + + + + + ./tests + + + + + + + + diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/rest-client.http b/rest-client.http new file mode 100644 index 0000000..55d79ef --- /dev/null +++ b/rest-client.http @@ -0,0 +1,804 @@ +@token = eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Nwcm8tYXBpLm9zcHJvLmlkXC9hcGlcL2xvZ2luIiwiaWF0IjoxNjU2MDk3NDg4LCJleHAiOjE2NTYxODM4ODgsIm5iZiI6MTY1NjA5NzQ4OCwianRpIjoiSFRYVFZMUW1adndoZjllZCIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.EiTKPtPzjKtdGKgxZbzsNkK6fZ1LzcxskquBYVeAstk + + +# @hostname = https://kit-api.ospro.id/api +@hostname = https://ospro-api.ospro.id/api +# @hostname = https://api-iu.ospro.id/api + +###### login +POST {{hostname}}/login +# Authorization: Bearer xxx +# X-REQUEST-TYPE: GraphQL +content-type: application/json + +{ + "username": "admin", + "password": "admin123" +} + +###### Tools Req +### add +POST {{hostname}}/req-tools/add +Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Nwcm8tYXBpLm9zcHJvLmlkXC9hcGlcL2xvZ2luIiwiaWF0IjoxNjUyODYzNzM4LCJleHAiOjE2NTI5NTAxMzgsIm5iZiI6MTY1Mjg2MzczOCwianRpIjoia2ZwNnhwc0ZZZ0dFNEtGSSIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.f7a0M-GKYgacXtaEmZJUs2UOPFXaigEwGu8OfZ117kI + +content-type: application/json + +{ + "asset_type": "Alat Berat 1", + "asset_name": "Beco", + "required_date":"2021-12-16", + "qty": 10, + "uom": "Kg", + "description": "test Data", + "created_by":"admin", + "proyek_id":1 +} + +### update +PUT {{hostname}}/req-tools/update/3 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "qty": 332, +} + +### search +POST {{hostname}}/req-tools/search +Authorization: Bearer {{token}} +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"asset_type", + "logic_operator":"like", + "value":"", + "operator":"AND" + }, + { + "name":"status", + "logic_operator":"<>", + "value":"receipt to site", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + +### delete +DELETE {{hostname}}/req-tools/delete/13 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + + +###### Menu +### add +POST {{hostname}}/menu/add +Authorization: {{token}} +content-type: application/json + +{ + "alias_name": "Alat Berat 1", + "icon": "#", + "name":"2021-12-16", + "parent_id": 23, + "sequence": 100, + "url": "test Data" +} + +### update +PUT {{hostname}}/req-tools/update/3 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "qty": 332, +} + +### search +POST {{hostname}}/menu/search +Authorization: Bearer {{token}} +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"name", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[ + { + "name":"m_menu", + "column_join":"parent_id", + "column_results":["name"], + } + ], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + +### delete +DELETE {{hostname}}/req-tools/delete/13 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + + +###### Material Req +### add +POST {{hostname}}/request-material/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "description": "Lempengan Besi", + "required_date": "2022-05-04", + "qty": "1000", + "uom": "Lembar", + "fom_date": "2022-05-04", + "proyek_id": 29, + "price":10 + } + +### update +PUT {{hostname}}/request-material/update/20 +Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Nwcm8tYXBpLm9zcHJvLmlkXC9hcGlcL2xvZ2luIiwiaWF0IjoxNjQyMTE1NjQyLCJleHAiOjE2NDIyMDIwNDIsIm5iZiI6MTY0MjExNTY0MiwianRpIjoiVWt1UjRnZjVUMHQ5YXRQWSIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.ftCrSs5v7GxqxW64ZcfZn40Opxom5YoFcDMMF1TvWrk +Content-Type: application/x-www-form-urlencoded +Accept: application/json + +{ + "description": "Pebble", + "fom_date": "2022-01-12T09:59:26.190Z", + "id": 20, + "po_date": null, + "pr_date": null, + "qty": "10", + "qty_received": "100", + "received_date": null, + "required_date": "2022-01-12T09:59:07.739Z", + "status": "fom", + "uom": "kg" +} + + + +### search +POST {{hostname}}/request-material/search +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"description", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + +### delete +DELETE {{hostname}}/request-material/delete/2 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + + +###### Human Resource +### add +POST {{hostname}}/human-resource/add +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "role_id" : 1, + "username" : "ibnu", + "password" : "test", + "name" : "ibnu", + "phone_number" : "083823134569", + "email" : "ibnu@gmail.com", + "address" : "gria pesona madani", + "ktp_number" : "3212141105950004", + "employee_type" : "freelance" +} + +### update +PUT {{hostname}}/human-resource/update/8 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "address" : "gria pesona madani 1" +} + + +### delete +DELETE {{hostname}}/human-resource/delete/8 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +### search +POST {{hostname}}/human-resource/search +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"name", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + + +###### Material Resource +### add +POST {{hostname}}/material-resource/add +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "id": 3, + "name": "Batangan Besi", + "uom": "truck", + "unit_price": 500000, + "description": "Pasir", + "qty": 1000 +} + +### update +PUT {{hostname}}/material-resource/update/5 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "uom" : "Batang" +} + + +### delete +DELETE {{hostname}}/material-resource/delete/5 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +### search +POST {{hostname}}/material-resource/search +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"name", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + + +###### Tools Resource +### add +POST {{hostname}}/tools-resource/add +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "name": "Excavator Belco", + "description": "Excavator Belco", + "uom":"unit", + "qty": "100", + "asset_type": "Alat Berat" +} + +### update +PUT {{hostname}}/tools-resource/update/5 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "name" : "Excavator Kobelco" +} + + +### delete +DELETE {{hostname}}/tools-resource/delete/5 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +### search +POST {{hostname}}/tools-resource/search +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"name", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + + +###### Project + +### list +GET {{hostname}}/project/list +Authorization: Bearer {{token}} +content-type: application/json + + +### add +POST {{hostname}}/project/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "nama": "Excavator Belco", + "keterangan": "Excavator Belco", + "mulai_proyek":"2022/01/11", + "akhir_proyek": "2022/05/11" +} + +### update +PUT {{hostname}}/project/update/5 +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "name" : "Excavator Kobelco" +} + + +### delete +DELETE {{hostname}}/project/delete/19 +Authorization: Bearer {{token}} +content-type: application/json + +### search +POST {{hostname}}/tools-resource/search +Authorization: Bearer dFWBXe6qQQm_s4DyH68yVt:APA91bFTms-pjqm-9OkugufLF2yjtOTJZQBlVxY8FC5iYq3owmWzGZtlPSSHholMeUxeE0TRQ6pFfEKvy5xRHnufPu4dJNiY-2gRGHKch6o4iWU9gp3GDHQ7sm-ySsE9keCMKzmQ11aM +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"name", + "logic_operator":"like", + "value":"", + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "id" + ], + "ascending":false + } +} + + +###### Divisi + +### list +GET {{hostname}}/divisi/list +Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Nwcm8tYXBpLm9zcHJvLmlkXC9hcGlcL2xvZ2luIiwiaWF0IjoxNjQxNDYwNDcyLCJleHAiOjE2NDE0NjQwNzIsIm5iZiI6MTY0MTQ2MDQ3MiwianRpIjoiRjRxYmJ3U25YcEw0OXN0QyIsInN1YiI6MSwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.CLm_ZOEW5GCyGJuIcRNIRD8m1XxIeSCH60QK2HxF8d0 +content-type: application/json + + + +###### Activity +### get data by id version +GET {{hostname}}/activity/33/29/get +Authorization: Bearer {{token}} +content-type: application/json + +###### Rate Sallary + +### list +GET {{hostname}}/project-role/list +Authorization: Bearer {{token}} +content-type: application/json + + + +###### Rate Sallary + +### list +GET {{hostname}}/rate-sallary/list +Authorization: Bearer {{token}} +content-type: application/json + + +### add +POST {{hostname}}/rate-sallary/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_role_id" : 4, + "cost" : 2000, + "type_rate" : "UMR Jatim" +} + +### update +PUT {{hostname}}/rate-sallary/update/{id} +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_role_id" : 4, + "cost" : 2000, + "type_rate" : "UMR Jatim" +} + +### delete +POST {{hostname}}/rate-sallary/delete/{id} +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_role_id" : 4, + "cost" : 2000, + "type_rate" : "UMR Jatim" +} + + + +### search +POST {{hostname}}/dashboard/percentage-planning-actual +Authorization: Bearer {{token}} +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[ + { + "name":"proyek_id", + "logic_operator":"in", + "value":[7,6,4], + "operator":"AND" + }, + { + "name":"version_gantt_id", + "logic_operator":"=", + "value":3, + "operator":"AND" + } + ], + "joins":[], + "orders":{ + "columns":[ + "proyek_id" + ], + "ascending":true + } +} + + +### +POST {{hostname}}/dashboard/cost-planning-actual +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id" : [11] +} + + +### +POST {{hostname}}/dashboard/percentage-planning-actual +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id" : [11] +} + + +###### project participants +### add +POST {{hostname}}/project-participants/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "proyek_id" : 11, + "tittle" : "investor", + "name" : "ibnu" +} + + +# get('/project-participants/edit/{id}', 'ProjectParticipantsController@edit'); +### update +# PUT {{hostname}}//project-participants/update/11 + +# POST {{hostname}}/project-participants/search +# DELETE {{hostname}}/project-participants/delete/{id} +# GET {{hostname}}/project-participants/list + +### +GET {{hostname}}/project-participants/list +Authorization: Bearer {{token}} +content-type: application/json + + +### +GET {{hostname}}/project-participants/proyek_id/11 +Authorization: Bearer {{token}} +content-type: application/json + +### +DELETE {{hostname}}/project-participants/delete/1 +Authorization: Bearer {{token}} +content-type: application/json + +### +DELETE {{hostname}}/project-participants/delete-by-proyek/7 +Authorization: Bearer {{token}} +content-type: application/json + +###### project-approval +POST {{hostname}}/project-approval/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "proyek_id" : 7, + "tittle" : "investor", + "name" : "koko", + "date_approval" : "2022/01/21" +} + +### +get {{hostname}}/project-approval/edit/{id} + + +put {{hostname}}/project-approval/update/{id} +post {{hostname}}/project-approval/search +delete {{hostname}}/project-approval/delete/{id} +get {{hostname}}/project-approval/list + +###### project-milestone +post {{hostname}}/project-milestone/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "proyek_id" : 7, + "status" : "Build 2. Finish eksekusi", + "due_date" : "2022/01/21", + "deadline" : "2022/01/21" +} + +### +get {{hostname}}/project-milestone/edit/{id} +put {{hostname}}/project-milestone/update/{id} +post {{hostname}}/project-milestone/search +delete {{hostname}}/project-milestone/delete/{id} +get {{hostname}}/project-milestone/list +get {{hostname}}/project-milestone/select + + +### +GET {{hostname}}/template-gantt/get-tree/3 +Authorization: Bearer {{token}} +content-type: application/json + +### +POST {{hostname}}/folder-document-proyek/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "proyek_id": "12", + "name_folder": "test 1", + "parent_id" : 1 +} + + +### +GET {{hostname}}/folder-document-proyek/list +Authorization: Bearer {{token}} +content-type: application/json + + +### +GET {{hostname}}/folder-document-proyek/get-tree/12 +Authorization: Bearer {{token}} +content-type: application/json + + + +### +POST {{hostname}}/human-resource/select +Authorization: Bearer {{token}} +content-type: application/json + +{ + "idact" : "362", + "idProyek": "11" +} + + +### +POST https://ospro-api.ospro.id/api/dashboard/status-proyek +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id": [11] +} + + +### +POST {{hostname}}/activity/get-percentage +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id": [11] +} + + +### +POST {{hostname}}/activity/get-curva-s +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id": [29], + "period": "week" +} + + +### +POST {{hostname}}/dashboard/curva-s +Authorization: Bearer {{token}} +content-type: application/json + +{ + "project_id": [15] +} + + +### +POST {{hostname}}/presence/search +Authorization: Bearer {{token}} +content-type: application/json + +{ + "paging":{ + "start":0, + "length":10 + }, + "columns":[], + "joins": [ + { + "name": "m_users", + "column_join": "user_id", + "column_results": [ + "name", + "ktp_number" + ] + } + ], + "orders":{ + "columns":[ + "id" + ], + "ascending":true + } +} + + + +### +POST {{hostname}}/assign-material/ForReportActivityByMaterial +Authorization: Bearer {{token}} +content-type: application/json + +{ + "idact": 387 +} + + +###### +GET {{hostname}}/presence/clockinout/262 +Authorization: Bearer {{token}} +content-type: application/json + + +###### + +POST {{hostname}}/presence/add +Authorization: Bearer {{token}} +content-type: application/json + +{ + "clock_out_lat": -6.2622811, + "clock_out_lng": 106.7881746, + "clock_time": "2022-04-25T16:40:17+07:00", + "type": "out", + "user_id": 262 +} \ No newline at end of file diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..5e87638 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,488 @@ +get('/', function () use ($router) { + return $router->app->version(); +}); + +$router->group(['prefix'=>'api'], function () use ($router) { + // API route + // Login + $router->post('/login', 'AuthController@login'); + + // Role + $router->post('/role/search', 'RoleController@search'); + $router->post('/role/add', 'RoleController@add'); + $router->get('/role/edit/{id}', 'RoleController@edit'); + $router->put('/role/update/{id}', 'RoleController@update'); + $router->delete('/role/delete/{id}', 'RoleController@delete'); + $router->get('/role/list', 'RoleController@list'); + + + // menu + $router->post('/menu/add', 'MenuController@add'); + $router->get('/menu/edit/{id}', 'MenuController@edit'); + $router->put('/menu/update/{id}', 'MenuController@update'); + $router->delete('/menu/delete/{id}', 'MenuController@delete'); + $router->post('/menu/search', 'MenuController@search'); + $router->get('/menu/management/{id}', 'MenuController@listMenu'); + $router->get('/menu/list', 'MenuController@list'); + // role menu + $router->post('/role-menu/add', 'RoleMenuController@add'); + $router->put('/role-menu/update/{id}', 'RoleMenuController@update'); + $router->delete('/role-menu/delete/{id}', 'RoleMenuController@delete'); + $router->delete('/role-menu/delete-byrole/{id}', 'RoleMenuController@deleteByRole'); + $router->post('/role-menu/search', 'RoleMenuController@search'); + $router->get('/role-menu/get-role/{id}', 'RoleMenuController@listMenu'); + // download dokumen no need token + $router->get('/document-project/download/{id}', 'ProjectDokumenController@downloadDokumen'); + + $router->group(['middleware' => 'auth'], function () use ($router) { + // API route need token to akses + + // project dokumen + $router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen'); + $router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId'); + $router->delete('/document-project/delete/{id}', 'ProjectDokumenController@delete'); + $router->post('/document-project/search', 'ProjectDokumenController@searchDocProject'); + + + // activity dokumen + $router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen'); + $router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId'); + $router->delete('/document-activity/delete/{id}', 'ActivityDokumenController@delete'); + $router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject'); + $router->get('/document-activity/download/{id}', 'ActivityDokumenController@downloadDokumen'); + + // project + $router->post('/project/search', 'ProjectController@search'); + $router->post('/project/add', 'ProjectController@add'); + $router->put('/project/update/{id}', 'ProjectController@update'); + $router->get('/project/edit/{id}', 'ProjectController@edit'); + $router->delete('/project/delete/{id}', 'ProjectController@delete'); + $router->get('/project/list', 'ProjectController@list'); + $router->get('/project/list-user/{id}', 'ProjectController@getListProjectTask'); + // Project Charter + $router->post('/project-charter/search', 'ProjectCharterController@search'); + $router->post('/project-charter/add', 'ProjectCharterController@add'); + $router->put('/project-charter/update/{id}', 'ProjectCharterController@update'); + + // divisi + $router->post('/divisi/add', 'DivisiController@add'); + $router->get('/divisi/edit/{id}', 'DivisiController@edit'); + $router->put('/divisi/update/{id}', 'DivisiController@update'); + $router->post('/divisi/search', 'DivisiController@search'); + $router->delete('/divisi/delete/{id}', 'DivisiController@delete'); + $router->get('/divisi/list', 'DivisiController@list'); + + // config alert + $router->post('/config-alert/search', 'ConfigAlertController@search'); + $router->post('/config-alert/add', 'ConfigAlertController@add'); + $router->get('/config-alert/edit/{id}', 'ConfigAlertController@edit'); + $router->put('/config-alert/update/{id}', 'ConfigAlertController@update'); + $router->delete('/config-alert/delete/{id}', 'ConfigAlertController@delete'); + $router->get('/config-alert/list', 'ConfigAlertController@list'); + + // config alert user + $router->post('/config-alert-to-user/search', 'ConfigAlertUserController@search'); + $router->post('/config-alert-to-user/add', 'ConfigAlertUserController@add'); + $router->put('/config-alert-to-user/update/{id}', 'ConfigAlertUserController@update'); + $router->delete('/config-alert-to-user/delete/{id}', 'ConfigAlertUserController@delete'); + $router->get('/config-alert/get-user/{id}', 'ConfigAlertUserController@getConfigUser'); + + // Human Resource + $router->post('/human-resource/search', 'HumanResourceController@search'); + $router->post('/human-resource/add', 'HumanResourceController@add'); + $router->get('/human-resource/edit/{id}', 'HumanResourceController@edit'); + $router->put('/human-resource/update/{id}', 'HumanResourceController@update'); + $router->delete('/human-resource/delete/{id}', 'HumanResourceController@delete'); + $router->get('/human-resource/list', 'HumanResourceController@list'); + $router->get('/human-resource/select', 'HumanResourceController@select'); + $router->post('/human-resource/check-old-password/{id}', 'HumanResourceController@checkOldPassword'); + + // Project Role + $router->post('/project-role/search', 'ProjectRoleController@search'); + $router->post('/project-role/add', 'ProjectRoleController@add'); + $router->get('/project-role/edit/{id}', 'ProjectRoleController@edit'); + $router->put('/project-role/update/{id}', 'ProjectRoleController@update'); + $router->delete('/project-role/delete/{id}', 'ProjectRoleController@delete'); + $router->get('/project-role/list', 'ProjectRoleController@list'); + $router->get('/project-role/select', 'ProjectRoleController@select'); + + // Project Type + $router->post('/project-type/search', 'ProjectTypeController@search'); + $router->post('/project-type/add', 'ProjectTypeController@add'); + $router->get('/project-type/edit/{id}', 'ProjectTypeController@edit'); + $router->put('/project-type/update/{id}', 'ProjectTypeController@update'); + $router->delete('/project-type/delete/{id}', 'ProjectTypeController@delete'); + $router->get('/project-type/list', 'ProjectTypeController@list'); + + // user to project + $router->post('/user-to-project/assign', 'UserProyekController@assignUserProyek'); + + // Request Material + $router->post('/request-material/add', 'RequestMaterialController@add'); + $router->post('/request-material/search', 'RequestMaterialController@search'); + $router->get('/request-material/edit/{id}', 'RequestMaterialController@edit'); + $router->put('/request-material/update/{id}', 'RequestMaterialController@update'); + $router->delete('/request-material/delete/{id}', 'RequestMaterialController@delete'); + $router->get('/request-material/list', 'RequestMaterialController@list'); + + // update receipt to warehouse / site + $router->put('/request-material/update-warehouse-site/{id}', 'RequestMaterialController@updateWarehouseSite'); + + // Material to project + $router->post('/material-to-project/assign', 'MaterialProjectController@assignMaterial'); + + // material resource + $router->post('/material-resource/add', 'MaterialResourceController@add'); + $router->post('/material-resource/search', 'MaterialResourceController@search'); + $router->get('/material-resource/update/{id}', 'MaterialResourceController@edit'); + $router->put('/material-resource/update/{id}', 'MaterialResourceController@update'); + $router->delete('/material-resource/delete/{id}', 'MaterialResourceController@delete'); + $router->get('/material-resource/list', 'MaterialResourceController@list'); + $router->get('/material-resource/select', 'MaterialResourceController@select'); + + // Tools to project + $router->post('/tools-to-project/assign', 'ToolsProjectController@assignTools'); + $router->get('/tools-to-project/search', 'ToolsProjectController@searchTools'); + + // tools resource + $router->post('/tools-resource/add', 'ToolsResourceController@add'); + $router->post('/tools-resource/search', 'ToolsResourceController@search'); + $router->get('/tools-resource/edit/{id}', 'ToolsResourceController@edit'); + $router->put('/tools-resource/update/{id}', 'ToolsResourceController@update'); + $router->delete('/tools-resource/delete/{id}', 'ToolsResourceController@delete'); + $router->get('/tools-resource/list', 'ToolsResourceController@list'); + $router->get('/tools-resource/select', 'ToolsResourceController@select'); + + // Tools Request + $router->post('/req-tools/add', 'ToolsRequestController@add'); + $router->get('/req-tools/edit/{id}', 'ToolsRequestController@edit'); + $router->put('/req-tools/update/{id}', 'ToolsRequestController@update'); + $router->post('/req-tools/search', 'ToolsRequestController@search'); + $router->delete('/req-tools/delete/{id}', 'ToolsRequestController@delete'); + $router->get('/req-tools/list', 'ToolsRequestController@list'); + + // Version Gantt + $router->post('/version-gantt/add', 'VersionGanttController@add'); + $router->get('/version-gantt/edit/{id}', 'VersionGanttController@edit'); + $router->put('/version-gantt/update/{id}', 'VersionGanttController@update'); + $router->post('/version-gantt/search', 'VersionGanttController@search'); + $router->delete('/version-gantt/delete/{id}', 'VersionGanttController@delete'); + $router->get('/version-gantt/list', 'VersionGanttController@list'); + + // User Version Gantt + $router->post('/user-to-version-gantt/add', 'UserToVersionGanttController@add'); + $router->post('/user-to-version-gantt/add-multiple', 'UserToVersionGanttController@addMultiple'); + $router->get('/user-to-version-gantt/edit/{id}', 'UserToVersionGanttController@edit'); + $router->put('/user-to-version-gantt/update/{id}', 'UserToVersionGanttController@update'); + $router->post('/user-to-version-gantt/search', 'UserToVersionGanttController@search'); + $router->delete('/user-to-version-gantt/delete/{id}', 'UserToVersionGanttController@delete'); + $router->get('/user-to-version-gantt/list', 'UserToVersionGanttController@list'); + $router->get('/user-to-version-gantt/get-by-gantt/{gantt_id}', 'UserToVersionGanttController@getByUserGantt'); + + // User to activity + $router->post('/user-to-activity/add', 'UserToActivityController@add'); + $router->post('/user-to-activity/add-multiple', 'UserToActivityController@addMultiple'); + $router->get('/user-to-activity/edit/{id}', 'UserToActivityController@edit'); + $router->put('/user-to-activity/update/{id}', 'UserToActivityController@update'); + $router->post('/user-to-activity/search', 'UserToActivityController@search'); + $router->delete('/user-to-activity/delete/{id}', 'UserToActivityController@delete'); + $router->get('/user-to-activity/list', 'UserToActivityController@list'); + $router->get('/user-to-activity/datatables', 'UserToActivityController@datatables'); + + // activity + $router->get('/sumVolActualM/{id}', 'ActivityController@sumVolumeActualMaterial'); + $router->get('/activity/{id}/{proyek_id}/get', 'ActivityController@getByGanttId'); + $router->get('/activity/search', 'ActivityController@search'); + $router->post('/task', 'ActivityController@add'); + $router->get('/task/edit/{id}', 'ActivityController@edit'); + $router->put('/task/{id}', 'ActivityController@update'); + $router->put('/task/update-regular/{id}', 'ActivityController@updateRegular'); + $router->delete('/task/{id}', 'ActivityController@delete'); + $router->get('/task/get-update/{id}', 'ActivityController@getUpdate'); + $router->post('/activity/get-percentage', 'ActivityController@getPercentagePerDay'); + $router->get('/activity/set-baseline/{gantt_id}', 'ActivityController@setBaseline'); + $router->post('/activity/get-curva-s', 'ActivityController@getCalculateCurvaS'); + $router->get('/activity/synchronize-report/{gantt_id}', 'ActivityController@synchronizeReport'); + + // link + $router->post('/link', 'LinkController@add'); + $router->put('/link/{id}', 'LinkController@update'); + $router->delete('/link/{id}', 'LinkController@delete'); + + // template gantt + $router->post('/template-gantt/add', 'TemplateGanttController@add'); + $router->get('/template-gantt/edit/{id}', 'TemplateGanttController@edit'); + $router->put('/template-gantt/update/{id}', 'TemplateGanttController@update'); + $router->post('/template-gantt/search', 'TemplateGanttController@search'); + $router->delete('/template-gantt/delete/{id}', 'TemplateGanttController@delete'); + $router->get('/template-gantt/list', 'TemplateGanttController@list'); + $router->get('/template-gantt/get-tree/{id}', 'TemplateGanttController@getTreeByTypeProject'); + + // comment activity + $router->post('/comment-activity/add', 'CommentActivityController@add'); + $router->get('/comment-activity/edit/{id}', 'CommentActivityController@edit'); + $router->put('/comment-activity/update/{id}', 'CommentActivityController@update'); + $router->post('/comment-activity/search', 'CommentActivityController@search'); + $router->delete('/comment-activity/delete/{id}', 'CommentActivityController@delete'); + $router->get('/comment-activity/list', 'CommentActivityController@list'); + + // presence human resource + $router->post('/presence/add', 'PresenceController@add'); + $router->get('/presence/edit/{id}', 'PresenceController@edit'); + $router->put('/presence/update/{id}', 'PresenceController@update'); + $router->post('/presence/search', 'PresenceController@search'); + $router->delete('/presence/delete/{id}', 'PresenceController@delete'); + $router->get('/presence/list', 'PresenceController@list'); + $router->get('/presence/clockinout/{id}', 'PresenceController@clockinout'); + $router->get('/presence/bulk-update-location', 'PresenceController@bulkUpdateLocation'); + + // absent human resource + $router->post('/permit/add', 'AbsentController@add'); + $router->get('/permit/edit/{id}', 'AbsentController@edit'); + $router->put('/permit/update/{id}', 'AbsentController@update'); + $router->post('/permit/search', 'AbsentController@search'); + $router->delete('/permit/delete/{id}', 'AbsentController@delete'); + $router->get('/permit/list', 'AbsentController@list'); + + // assign tools + $router->post('/assign-tools/add', 'AssignToolsController@add'); + $router->get('/assign-tools/edit/{id}', 'AssignToolsController@edit'); + $router->put('/assign-tools/update/{id}', 'AssignToolsController@update'); + $router->post('/assign-tools/search', 'AssignToolsController@search'); + $router->delete('/assign-tools/delete/{id}', 'AssignToolsController@delete'); + $router->get('/assign-tools/list', 'AssignToolsController@list'); + $router->get('/assign-tools/datatables', 'AssignToolsController@datatables'); + + // assign material + $router->post('/assign-material/add', 'AssignMaterialController@add'); + $router->get('/assign-material/edit/{id}', 'AssignMaterialController@edit'); + $router->put('/assign-material/update/{id}', 'AssignMaterialController@update'); + $router->post('/assign-material/search', 'AssignMaterialController@search'); + $router->delete('/assign-material/delete/{id}', 'AssignMaterialController@delete'); + $router->get('/assign-material/list', 'AssignMaterialController@list'); + $router->get('/assign-material/datatables', 'AssignMaterialController@datatables'); + $router->get('/assign-material/datatablesForReportActivity', 'AssignMaterialController@datatablesForReportActivity'); + $router->post('/assign-material/ForReportActivityByMaterial', 'AssignMaterialController@ForReportActivityByMaterial'); + + // image + $router->post('/image/search', 'ImageController@search'); + $router->delete('/image/delete/{id}', 'ImageController@delete'); + $router->delete('/image/delete/{id}/{category}', 'ImageController@deleteByRef'); + $router->post('/image/upload', 'ImageController@uploadImage'); + $router->get('/image/{id}/{category}', 'ImageController@getByRefId'); + + // panic button + $router->post('/panic-button/add', 'PanicButtonController@add'); + $router->get('/panic-button/edit/{id}', 'PanicButtonController@edit'); + $router->put('/panic-button/update/{id}', 'PanicButtonController@update'); + $router->post('/panic-button/search', 'PanicButtonController@search'); + $router->delete('/panic-button/delete/{id}', 'PanicButtonController@delete'); + $router->get('/panic-button/list', 'PanicButtonController@list'); + + // rate-sallary + $router->post('/rate-sallary/add', 'RateSallaryController@add'); + $router->get('/rate-sallary/edit/{id}', 'RateSallaryController@edit'); + $router->put('/rate-sallary/update/{id}', 'RateSallaryController@update'); + $router->post('/rate-sallary/search', 'RateSallaryController@search'); + $router->delete('/rate-sallary/delete/{id}', 'RateSallaryController@delete'); + $router->get('/rate-sallary/list', 'RateSallaryController@list'); + + // project-participants + $router->post('/project-participants/add', 'ProjectParticipantsController@add'); + $router->get('/project-participants/edit/{id}', 'ProjectParticipantsController@edit'); + $router->put('/project-participants/update/{id}', 'ProjectParticipantsController@update'); + $router->post('/project-participants/search', 'ProjectParticipantsController@search'); + $router->delete('/project-participants/delete/{id}', 'ProjectParticipantsController@delete'); + $router->delete('/project-participants/delete-by-proyek/{id}', 'ProjectParticipantsController@deleteByProyek'); + $router->get('/project-participants/list', 'ProjectParticipantsController@list'); + $router->get('/project-participants/{where}/{val}', 'ProjectParticipantsController@customWhere'); + + // project-approval + $router->post('/project-approval/add', 'ProjectApprovalController@add'); + $router->get('/project-approval/edit/{id}', 'ProjectApprovalController@edit'); + $router->put('/project-approval/update/{id}', 'ProjectApprovalController@update'); + $router->post('/project-approval/search', 'ProjectApprovalController@search'); + $router->delete('/project-approval/delete/{id}', 'ProjectApprovalController@delete'); + $router->delete('/project-approval/delete-by-proyek/{id}', 'ProjectApprovalController@deleteByProyek'); + $router->get('/project-approval/list', 'ProjectApprovalController@list'); + $router->get('/project-approval/{where}/{val}', 'ProjectApprovalController@customWhere'); + + // project-milestone + $router->post('/project-milestone/add', 'ProjectMileStoneController@add'); + $router->get('/project-milestone/edit/{id}', 'ProjectMileStoneController@edit'); + $router->put('/project-milestone/update/{id}', 'ProjectMileStoneController@update'); + $router->post('/project-milestone/search', 'ProjectMileStoneController@search'); + $router->delete('/project-milestone/delete/{id}', 'ProjectMileStoneController@delete'); + $router->delete('/project-milestone/delete-by-proyek/{id}', 'ProjectMileStoneController@deleteByProyek'); + $router->get('/project-milestone/list', 'ProjectMileStoneController@list'); + $router->get('/project-milestone/select', 'ProjectMileStoneController@select'); + $router->get('/project-milestone/{where}/{val}', 'ProjectMileStoneController@customWhere'); + + // dashboard + $router->post('/dashboard/cost-planning-actual', 'DashboardController@costPlanningActual'); + $router->post('/dashboard/percentage-planning-actual', 'DashboardController@percentagePlanningActual'); + $router->post('/dashboard/search-user-presence', 'DashboardController@searchUserPresencePoints'); + $router->post('/dashboard/status-proyek', 'DashboardController@statusProyek'); + $router->post('/dashboard/curva-s', 'DashboardController@curvaS'); + + // report-activity + $router->post('/report-activity/add', 'ReportActivityController@add'); + $router->get('/report-activity/edit/{id}', 'ReportActivityController@edit'); + $router->put('/report-activity/update/{id}', 'ReportActivityController@update'); + $router->post('/report-activity/search', 'ReportActivityController@search'); + $router->delete('/report-activity/delete/{id}', 'ReportActivityController@delete'); + $router->get('/report-activity/list', 'ReportActivityController@list'); + $router->post('/report-activity/search-point', 'ReportActivityController@searchPoint'); + $router->get('/report-activity/datatables', 'ReportActivityController@datatables'); + + // report-activity-material + $router->post('/report-activity-material/add', 'ReportActivityMaterialController@add'); + // $router->get('/report-activity-material/edit/{id}', 'ReportActivityMaterialController@edit'); + // $router->put('/report-activity-material/update/{id}', 'ReportActivityMaterialController@update'); + $router->post('/report-activity-material/search', 'ReportActivityMaterialController@search'); + $router->delete('/report-activity-material/delete/{id}', 'ReportActivityMaterialController@delete'); + $router->get('/report-activity-material/list', 'ReportActivityMaterialController@list'); + // $router->post('/report-activity-material/search-point', 'ReportActivityMaterialController@searchPoint'); + $router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables'); + $router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish'); + $router->get('/report-activity-material/test', 'ReportActivityMaterialController@countForProgressTest'); + + + // waypoint + $router->post('/waypoint/add', 'WaypointController@add'); + $router->get('/waypoint/edit/{id}', 'WaypointController@edit'); + $router->put('/waypoint/update/{id}', 'WaypointController@update'); + $router->post('/waypoint/search', 'WaypointController@search'); + $router->delete('/waypoint/delete/{id}', 'WaypointController@delete'); + $router->get('/waypoint/list', 'WaypointController@list'); + + // holiday + $router->post('/holiday/add', 'HolidayController@add'); + $router->get('/holiday/edit/{id}', 'HolidayController@edit'); + $router->put('/holiday/update/{id}', 'HolidayController@update'); + $router->post('/holiday/search', 'HolidayController@search'); + $router->delete('/holiday/delete/{id}', 'HolidayController@delete'); + $router->get('/holiday/list', 'HolidayController@list'); + $router->get('/holiday/datatables', 'HolidayController@datatables'); + + // satuan + $router->post('/satuan/add', 'SatuanController@add'); + $router->get('/satuan/edit/{id}', 'SatuanController@edit'); + $router->put('/satuan/update/{id}', 'SatuanController@update'); + $router->post('/satuan/search', 'SatuanController@search'); + $router->delete('/satuan/delete/{id}', 'SatuanController@delete'); + $router->get('/satuan/list', 'SatuanController@list'); + + // checklist k3 + $router->post('/checklist-k3/add', 'ChecklistK3Controller@add'); + $router->get('/checklist-k3/edit/{id}', 'ChecklistK3Controller@edit'); + $router->put('/checklist-k3/update/{id}', 'ChecklistK3Controller@update'); + $router->post('/checklist-k3/search', 'ChecklistK3Controller@search'); + $router->delete('/checklist-k3/delete/{id}', 'ChecklistK3Controller@delete'); + $router->get('/checklist-k3/list', 'ChecklistK3Controller@list'); + + // report k3 + $router->post('/report-k3/add', 'ReportK3Controller@add'); + $router->get('/report-k3/edit/{id}', 'ReportK3Controller@edit'); + $router->put('/report-k3/update/{id}', 'ReportK3Controller@update'); + $router->post('/report-k3/search', 'ReportK3Controller@search'); + $router->delete('/report-k3/delete/{id}', 'ReportK3Controller@delete'); + $router->get('/report-k3/list', 'ReportK3Controller@list'); + + // report k3 detail + $router->post('/report-k3-detail/add', 'ReportK3DetailController@add'); + $router->get('/report-k3-detail/edit/{id}', 'ReportK3DetailController@edit'); + $router->put('/report-k3-detail/update/{id}', 'ReportK3DetailController@update'); + $router->post('/report-k3-detail/search', 'ReportK3DetailController@search'); + $router->delete('/report-k3-detail/delete/{id}', 'ReportK3DetailController@delete'); + $router->get('/report-k3-detail/list', 'ReportK3DetailController@list'); + + // user to proyek + $router->post('/user-to-proyek/add', 'UserToProyekController@add'); + $router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit'); + $router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update'); + $router->post('/user-to-proyek/search', 'UserToProyekController@search'); + $router->delete('/user-to-proyek/delete/{id}', 'UserToProyekController@delete'); + $router->get('/user-to-proyek/list', 'UserToProyekController@list'); + $router->get('/user-to-proyek/select', 'UserToProyekController@select'); + + // flder document proyek + $router->post('/folder-document-proyek/add', 'FolderDocumentProyekController@add'); + $router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit'); + $router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update'); + $router->post('/folder-document-proyek/search', 'FolderDocumentProyekController@search'); + $router->delete('/folder-document-proyek/delete/{id}', 'FolderDocumentProyekController@delete'); + $router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list'); + $router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree'); + + // office-hours + $router->post('/office-hours/add', 'OfficeHoursController@add'); + $router->get('/office-hours/edit/{id}', 'OfficeHoursController@edit'); + $router->put('/office-hours/update/{id}', 'OfficeHoursController@update'); + $router->post('/office-hours/search', 'OfficeHoursController@search'); + $router->delete('/office-hours/delete/{id}', 'OfficeHoursController@delete'); + $router->get('/office-hours/list', 'OfficeHoursController@list'); + + // gantt-show-hide + $router->get('/gantt-show-hide/get-by-gantt/{gantt_id}', 'ShowHideColumnController@getByUserGantt'); + $router->post('/gantt-show-hide/add', 'ShowHideColumnController@add'); + $router->post('/gantt-show-hide/update/{gantt_id}', 'ShowHideColumnController@update'); + + + // master shift + $router->post('/shift/add', 'ShiftController@add'); + $router->get('/shift/edit/{id}', 'ShiftController@edit'); + $router->put('/shift/update/{id}', 'ShiftController@update'); + $router->post('/shift/search', 'ShiftController@search'); + $router->delete('/shift/delete/{id}', 'ShiftController@delete'); + $router->get('/shift/list', 'ShiftController@list'); + + // monthly shift + $router->post('/user-monthly-shift/add', 'UserMonthlyShiftController@add'); + $router->put('/user-monthly-shift/update/{id}', 'UserMonthlyShiftController@update'); + $router->post('/user-monthly-shift/search', 'UserMonthlyShiftController@search'); + $router->delete('/user-monthly-shift/delete/{id}', 'UserMonthlyShiftController@delete'); + $router->delete('/user-monthly-shift/delete-at/{yyyymm}', 'UserMonthlyShiftController@deleteYYYYMM'); + $router->get('/user-monthly-shift/list', 'UserMonthlyShiftController@list'); + $router->post('/user-monthly-shift/import', 'UserMonthlyShiftController@import'); + $router->get('/user-monthly-shift/list/{yyyymm}', 'UserMonthlyShiftController@listYYYYMM'); + + // Shift assignment + $router->post('/user-to-shift/add', 'UserToShiftController@add'); + $router->get('/user-to-shift/edit/{id}', 'UserToShiftController@edit'); + $router->put('/user-to-shift/update/{id}', 'UserToShiftController@update'); + $router->post('/user-to-shift/search', 'UserToShiftController@search'); + $router->delete('/user-to-shift/delete/{id}', 'UserToShiftController@delete'); + $router->get('/user-to-shift/list', 'UserToShiftController@list'); + + // control monitoring + $router->post('/control-monitoring/search', 'ControlMonitoringController@search'); + // currency + $router->get('/currency/list', 'CurrencyController@list'); + + // project to checklist k3 + $router->post('/project-to-checklist-k3/add', 'ProjectToChecklistK3Controller@add'); + $router->post('/project-to-checklist-k3/add-multiple', 'ProjectToChecklistK3Controller@addMultiple'); + $router->get('/project-to-checklist-k3/edit/{id}', 'ProjectToChecklistK3Controller@edit'); + $router->put('/project-to-checklist-k3/update/{id}', 'ProjectToChecklistK3Controller@update'); + $router->post('/project-to-checklist-k3/search', 'ProjectToChecklistK3Controller@search'); + $router->delete('/project-to-checklist-k3/delete/{id}', 'ProjectToChecklistK3Controller@delete'); + $router->get('/project-to-checklist-k3/list', 'ProjectToChecklistK3Controller@list'); + }); + +}); \ No newline at end of file diff --git a/sql/001-absensi.sql b/sql/001-absensi.sql new file mode 100644 index 0000000..aeaba58 --- /dev/null +++ b/sql/001-absensi.sql @@ -0,0 +1,80 @@ +CREATE TABLE public.m_shift ( + id SERIAL, + label VARCHAR(128) NOT NULL, + flex_time_minute INTEGER NOT NULL DEFAULT 30, + start_time TIME WITH TIME ZONE NOT NULL, + end_time TIME WITH TIME ZONE NOT NULL, + is_non_shift BOOLEAN NOT NULL DEFAULT FALSE, + created_at TIMESTAMP WITH TIME ZONE, + created_by VARCHAR(128), + updated_at TIMESTAMP WITH TIME ZONE, + updated_by VARCHAR(128), + UNIQUE(label), + PRIMARY KEY(id) +); + +ALTER TABLE public.m_users ADD PRIMARY KEY(id); +ALTER TABLE public.m_proyek ADD PRIMARY KEY(id); +ALTER TABLE public.m_company ADD PRIMARY KEY(id); + +-- TEMPORARY +-- ALTER TABLE m_shift RENAME COLUMN is_default TO is_non_shift; + +CREATE TABLE public.t_users_monthly_shift ( + id BIGSERIAL, + company_id BIGINT, + project_id BIGINT, + start_at TIMESTAMP WITH TIME ZONE NOT NULL, + end_at TIMESTAMP WITH TIME ZONE, + user_id BIGINT NOT NULL, + remarks VARCHAR(255), + schedules JSON, + created_at TIMESTAMP WITH TIME ZONE, + created_by VARCHAR(128), + updated_at TIMESTAMP WITH TIME ZONE, + updated_by VARCHAR(128), + FOREIGN KEY(project_id) REFERENCES m_proyek(id), + FOREIGN KEY(user_id) REFERENCES m_users(id), + FOREIGN KEY(company_id) REFERENCES m_company(id), + PRIMARY KEY(id) +); + +CREATE TABLE public.t_users_shift ( + id BIGSERIAL, + project_id BIGINT, + user_id BIGINT NOT NULL, + from_date TIMESTAMP WITH TIME ZONE NOT NULL, + to_date TIMESTAMP WITH TIME ZONE, + remarks VARCHAR(255), + mon_shift_id INTEGER, + tue_shift_id INTEGER, + wed_shift_id INTEGER, + thu_shift_id INTEGER, + fri_shift_id INTEGER, + sat_shift_id INTEGER, + sun_shift_id INTEGER, + created_at TIMESTAMP WITH TIME ZONE, + created_by VARCHAR(128), + updated_at TIMESTAMP WITH TIME ZONE, + updated_by VARCHAR(128), + FOREIGN KEY(project_id) REFERENCES m_proyek(id), + FOREIGN KEY(user_id) REFERENCES m_users(id), + FOREIGN KEY(mon_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(tue_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(wed_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(thu_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(fri_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(sat_shift_id) REFERENCES m_shift(id), + FOREIGN KEY(sun_shift_id) REFERENCES m_shift(id), + PRIMARY KEY(id) +); + +--- SAMPLE DATA +INSERT INTO m_shift(label,flex_time_minute, start_time, end_time, is_non_shift, created_at, created_by) +VALUES('S0', 30, '07:30:00', '15:30:00', TRUE, CURRENT_TIMESTAMP, 'System'); + +INSERT INTO t_users_shift(user_id, from_date, + mon_shift_id, tue_shift_id, wed_shift_id, thu_shift_id, fri_shift_id, sat_shift_id, sun_shift_id, + created_at, created_by) +VALUES(1, CURRENT_TIMESTAMP, + 1, 1, 1, 1, 1, NULL, NULL, CURRENT_TIMESTAMP, 'System'); \ No newline at end of file diff --git a/storage/app/.gitignore b/storage/app/.gitignore new file mode 100644 index 0000000..005717e --- /dev/null +++ b/storage/app/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/cache/.gitignore b/storage/framework/cache/.gitignore new file mode 100644 index 0000000..6f05fe4 --- /dev/null +++ b/storage/framework/cache/.gitignore @@ -0,0 +1,3 @@ +* +!data/ +!.gitignore diff --git a/storage/framework/cache/data/.gitignore b/storage/framework/cache/data/.gitignore new file mode 100644 index 0000000..005717e --- /dev/null +++ b/storage/framework/cache/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/framework/views/.gitignore b/storage/framework/views/.gitignore new file mode 100644 index 0000000..005717e --- /dev/null +++ b/storage/framework/views/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/storage/logs/.gitignore b/storage/logs/.gitignore new file mode 100644 index 0000000..005717e --- /dev/null +++ b/storage/logs/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php new file mode 100644 index 0000000..812e3cf --- /dev/null +++ b/tests/ExampleTest.php @@ -0,0 +1,21 @@ +get('/'); + + $this->assertEquals( + $this->app->version(), $this->response->getContent() + ); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..6a9aa6f --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,16 @@ +