当前位置: 首页>>代码示例>>PHP>>正文


PHP Controllers\Log类代码示例

本文整理汇总了PHP中App\Http\Controllers\Log的典型用法代码示例。如果您正苦于以下问题:PHP Log类的具体用法?PHP Log怎么用?PHP Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Log类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Log

 function logout_all()
 {
     $log = new Log();
     $id = $_SESSION['user_login_id'];
     $sql = "UPDATE `user_login` SET `user_logout_time` = SYSDATE() , `user_login_status` = '0' WHERE `id` = '{$id}' ";
     DB::update(DB::raw($sql));
     $log->add_log(" ", " ", "User Logout");
     // add a log
 }
开发者ID:sandakinhs,项目名称:iCRM3,代码行数:9,代码来源:logout.php

示例2: nuevaReceta

 public function nuevaReceta(Receta $receta)
 {
     $result = $this->serviceReceta->nuevaReceta($receta);
     if ($result) {
         $log = new Log();
         $log->setIdAnimal($receta->getIdAnimal());
         $log->setTipoLog('Receta');
         $log->setDescripcion(' Receta creada con exito');
         $this->serviceLog->nuevoLog($log);
         return 'Atencion creada con exito';
     } else {
         return 'Error al crear atencion, intentelo nuevamente';
     }
 }
开发者ID:jhonVargasT,项目名称:veterinaria-santa-ana,代码行数:14,代码来源:ControlReceta.php

示例3: nuevoApunte

 public function nuevoApunte(Apunte $apunte)
 {
     $result = $this->serviceApunte->nuevoApunte($apunte);
     if ($result) {
         $log = new Log();
         $log->setIdAnimal($apunte->getIdAnimal());
         $log->setTipoLog('Apunte');
         $log->setDescripcion('Apunte creado con exito');
         $this->serviceLog->nuevoLog($log);
         return 'Apunte creada con exito';
     } else {
         return 'Error al crear apunte, intentelo nuevamente';
     }
 }
开发者ID:jhonVargasT,项目名称:veterinaria-santa-ana,代码行数:14,代码来源:ControlApunte.php

示例4: edit

 public function edit(Request $request)
 {
     if (!\Session::get('user')->can('硬件管理')) {
         abort(401);
     }
     $hardware = Hardware::find($request->input('id'));
     $old_attributes = $hardware->attributesToArray();
     $hardware->name = $request->input('name');
     $hardware->description = $request->input('description');
     $hardware->model = $request->input('model');
     $hardware->self_produce = (bool) ($request->input('self_produce') == 'on');
     $new_attributes = $hardware->attributesToArray();
     $user = \Session::get('user');
     foreach (array_diff_assoc($old_attributes, $new_attributes) as $key => $value) {
         $old = $old_attributes[$key];
         $new = $new_attributes[$key];
         if ($key == 'self_produce') {
             $old = $old == 'true' ? '自产' : '外采';
             $new = $new == 'true' ? '自产' : '外采';
         }
         \Log::notice(strtr('硬件修改: 用户(%name[%id]) 修改了硬件 (%hardware[%hardware_id]) 的基本信息: [%key] %old --> %new', ['%name' => $user->name, '%id' => $user->id, '%hardware' => $hardware->name, '%hardware_id' => $hardware->id, '%key' => $key, '%old' => $old, '%new' => $new]));
     }
     $hardware->save();
     return redirect()->back()->with('message_content', '修改成功!')->with('message_type', 'info');
 }
开发者ID:genee-projects,项目名称:snail,代码行数:25,代码来源:HardwareController.php

示例5: index

 public function index(Request $request)
 {
     $c = $request->cookie('kvowner');
     if ($c) {
         $tmp = explode(':', $c);
         if (count($tmp) != 3) {
             return redirect('/')->withCookie(\Cookie::forget('kvowner'));
         }
         $ls = intval($tmp[0]);
         $space = floatval($tmp[1]);
         $file_id = intval($tmp[2]);
         $apartment = \App\Apartment::where('ls', $ls)->where('space', $space)->first();
         if (!$apartment) {
             \Log::info('1');
             return redirect('/')->withCookie(\Cookie::forget('kvowner'));
         }
         \Log::info('2');
         $file = \App\MeterFile::where('active', 1)->first();
         if (!$file) {
             \Log::info('3');
             return redirect('/')->withCookie(\Cookie::forget('kvowner'));
         } else {
             \Log::info('4');
             if ($file->id != $file_id) {
                 \Log::info('5');
                 return redirect('/')->withCookie(\Cookie::forget('kvowner'));
             }
         }
         return view('main', ['saved' => true, 'apartment' => $apartment]);
     }
     $streets = \App\Street::orderBy('name')->orderBy('prefix')->get();
     return view('main', ['saved' => false, 'streets' => $streets]);
 }
开发者ID:pomkalk,项目名称:uez-meters-laravel,代码行数:33,代码来源:MainController.php

示例6: update

 public function update(Request $request, $id)
 {
     $arrear = Arrear::findOrFail($id);
     // money, confirm
     $arrear->update($request->all());
     $payment = $arrear->payment;
     switch ($request->confirm) {
         case 1:
             $message = $arrear->user->name . ' 對款項進行調整';
             $userId = $payment->user_id;
             break;
         case 2:
             $message = $payment->user->name . ' 對款項進行調整';
             $userId = $arrear->user_id;
             break;
         case 3:
             $message = $arrear->user->name . ' 已確認您提出的款項';
             $userId = $payment->user_id;
             break;
         default:
             break;
     }
     \Log::info($request->confirm);
     \Log::info($payment->user_id);
     event(new ApnsEvent($userId, $payment->id, $message));
     $this->checkCompleted($payment);
     return $payment;
 }
开发者ID:LFKv3,项目名称:backend,代码行数:28,代码来源:ArrearsController.php

示例7: execute

 private function execute($message, $tg)
 {
     try {
         if (!array_key_exists('text', $message)) {
             app()->abort(200, 'Missing command');
         }
         if (starts_with($message['text'], '/start')) {
             $this->start($message, $tg);
         } else {
             if (starts_with($message['text'], '/cancel')) {
                 $this->cancel($message, $tg);
             } else {
                 if (starts_with($message['text'], '/list')) {
                     $this->listApps($message, $tg);
                 } else {
                     if (starts_with($message['text'], '/revoke')) {
                         $this->revoke($message, $tg);
                     } else {
                         if (starts_with($message['text'], '/help')) {
                             $this->help($message, $tg);
                         } else {
                             $this->commandReply($message, $tg);
                         }
                     }
                 }
             }
         }
         return response()->json('', 200);
     } catch (\Exception $e) {
         \Log::error($e);
         app()->abort(200);
     }
 }
开发者ID:3x14159265,项目名称:telegramlogin,代码行数:33,代码来源:TelegramController.php

示例8: LihatLog

 public function LihatLog()
 {
     // return Log::getMonolog();
     Log::listen(function ($level, $message, $context) {
         return " {$level} || {$message} || {$context} ";
     });
 }
开发者ID:repodevs,项目名称:laravel-5-routing,代码行数:7,代码来源:CobaController.php

示例9: store

 /**
  * Stores new upload
  *
  */
 public function store()
 {
     $file = Input::file('file');
     $upload = new Upload();
     try {
         $upload->process($file);
     } catch (Exception $exception) {
         // Something went wrong. Log it.
         Log::error($exception);
         $error = array('name' => $file->getClientOriginalName(), 'size' => $file->getSize(), 'error' => $exception->getMessage());
         // Return error
         return Response::json($error, 400);
     }
     // If it now has an id, it should have been successful.
     if ($upload->id) {
         $newurl = URL::asset($upload->publicpath() . $upload->filename);
         // this creates the response structure for jquery file upload
         $success = new stdClass();
         $success->name = $upload->filename;
         $success->size = $upload->size;
         $success->url = $newurl;
         $success->thumbnailUrl = $newurl;
         $success->deleteUrl = action('UploadController@delete', $upload->id);
         $success->deleteType = 'DELETE';
         $success->fileID = $upload->id;
         return Response::json(array('files' => array($success)), 200);
     } else {
         return Response::json('Error', 400);
     }
 }
开发者ID:EthanK28,项目名称:laravel-with-jquery-upload,代码行数:34,代码来源:UploadController.php

示例10: check

 public function check($bid)
 {
     $bid = Bids::findOrFail(Input::get("bid"));
     $offset = Input::get("offset");
     if ($offset < 0) {
         $now = \Carbon\Carbon::now()->subHours($offset);
     } else {
         $now = \Carbon\Carbon::now()->addHours($offset);
     }
     if (strtotime($bid->expiration) - strtotime($now) < 0) {
         //bid is expired
         if ($bid->amount < $bid->reservedPrice) {
             //void since bidding price is less then reserved price
             $bid->delete();
             return "Bidding price less then reserved price";
         } else {
             //proceed and Charge
             //since we get information about expiration from client we have to check it on the server as well
             //check wether winning user has its card working
             if ($bid->customerId) {
                 \Stripe\Stripe::setApiKey("sk_test_Z98H9hmuZWjFWfbkPFvrJMgk");
                 \Stripe\Charge::create(array("amount" => $bid->priceToCents(), "currency" => "usd", "customer" => $bid->customerId));
                 \Log::info('Charged: ' . $bid->amount);
             }
             $bid->complete = 1;
             $bid->save();
             $bid->delete();
         }
     } else {
         //someone is messing with javascript
         return "error";
     }
     return "Bidding is valid";
 }
开发者ID:alexandrzavalii,项目名称:auction,代码行数:34,代码来源:BidController.php

示例11: postQuickUpdate

 public function postQuickUpdate()
 {
     $inputs = Input::all();
     $widget = Widget::find($inputs['pk']);
     $widget->{$inputs}['name'] = $inputs['value'];
     Log::info("widgets save" . $widget->id . " " . $widget->name);
     $widget->save();
     return "test";
 }
开发者ID:rstuemer,项目名称:homeauto,代码行数:9,代码来源:WidgetsController.php

示例12: store

 public function store(Request $request)
 {
     \Log::info($request->input('author'));
     $comment = new Comment();
     $comment->content = $request->input('content');
     $comment->author = $request->input('author');
     $comment->save();
     return $comment->toArray();
 }
开发者ID:HoangTuBe,项目名称:react,代码行数:9,代码来源:CommentController.php

示例13: notifyHost

 private function notifyHost($client, $reservation)
 {
     $host = $reservation->property->user;
     $twilioNumber = config('services.twilio')['number'];
     try {
         $client->account->messages->sendMessage($twilioNumber, $host->fullNumber(), $reservation->message);
     } catch (Exception $e) {
         Log::error($e->getMessage());
     }
 }
开发者ID:blumtech,项目名称:airtng-laravel,代码行数:10,代码来源:ReservationController.php

示例14: update

 public function update(Request $request)
 {
     $query = DB::table('Company')->where('companyId', $request->input('companyId'))->update(array('companyName' => $request->input('companyName'), 'generalAttributes' => $request->input('generalAttributes'), 'purposeAndTopic' => $request->input('purposeAndTopic'), 'companyCenterAndDepartment' => $request->input('companyCenterAndDepartment'), 'jobDescription' => $request->input('jobDescription'), 'companyAdress' => $request->input('companyAdress'), 'employeeCount' => $request->input('employeeCount'), 'companyMail' => $request->input('companyMail'), 'employeeId' => \Session::get('employeeId')));
     \Log::error($query);
     if ($query) {
         $result = array("result" => "success");
     } else {
         $result = array("result" => "failed");
     }
     return \View::make('ajaxResult', $result);
 }
开发者ID:buraksecer,项目名称:kariyer-portal,代码行数:11,代码来源:CompanyController.php

示例15: deploy

 /**
  * Application deploy.
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function deploy(Request $request)
 {
     list($algo, $hash) = explode('=', $request->header('X-Hub-Signature'), 2);
     if (!hash_equals($hash, hash_hmac($algo, $request->getContent(), config('services.github-webhook.secret')))) {
         \Log::notice('Github Webhook', ['auth' => 'failed', 'ip' => $request->ip()]);
     } else {
         \Log::info('Github Webhook', ['auth' => 'success', 'ip' => $request->ip()]);
         \Artisan::queue('deploy');
     }
     return response()->json('', 200);
 }
开发者ID:BePsvPT,项目名称:CCU-Plus,代码行数:17,代码来源:HomeController.php


注:本文中的App\Http\Controllers\Log类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。