protected function saveIt() { $address = $this->address->region->name . " " . $this->address->name; $data = serialize($this->checker); $array = ['type' => $this->status, 'user_id' => $this->user->id, 'data' => $data, 'address' => $address]; \App\Moderation::create($array); }
public function request(Request $request) { $data = $request->all(); $signature = \Auth::user()->name; $aim = \App\Moderation::find($data['target']); $letter = \App\Myclasses\Response::moreInfoLetter($aim); $myMessage = new \App\Myclasses\localLetters\adminMail($letter); $myMessage->send(); $aim->request = 'sent'; $aim->save(); return redirect('/administration'); }
public function moderation(Request $request) { $target = Moderation::find($request->input('target')); $systemData = unserialize($target->data); $dataArray = $systemData->getData(); $star = $systemData->getCenterObject(); $messageE = $systemData->getSmartCheckMessage(); $messageObj = unserialize($messageE['full']); $explanation = $messageObj->getMessage(); $pNames = Arrays::planetsForCabinet(); $systemInfo = new \App\Myclasses\Insides\Converter($dataArray['address']); switch ($star->star) { case 3: $step = 0.1; $stepKey = 2; break; case 4: $step = 0.05; $stepKey = 1; break; case 0: case 5: case 14: case 15: $step = 2; $stepKey = 6; break; default: $step = 1; $stepKey = 5; } $starName = Arrays::nameStar($star); $fullName = $starName . " " . $pNames[$dataArray['planet']] . " " . $dataArray['distance'] . " " . $dataArray['mark']; $chartData = "star=" . $star->star . "&class=" . $star->class . "&size=" . $star->size; return view($this->localeDir . 'administration.systemExtension', compact('target', 'systemInfo', 'explanation', 'fullName', 'chartData', 'step', 'stepKey')); }