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


PHP Log::error方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: notifyHost

 private function notifyHost($client, $reservation)
 {
     $host = $reservation->property->user;
     $twilioNumber = config('services.twilio')['number'];
     $messageBody = $reservation->message . ' - Reply \'yes\' or \'accept\' to confirm the reservation, or anything else to reject it.';
     try {
         $client->messages->create($host->fullNumber(), ['from' => $twilioNumber, 'body' => $messageBody]);
     } catch (Exception $e) {
         Log::error($e->getMessage());
     }
 }
开发者ID:TwilioDevEd,项目名称:airtng-laravel,代码行数:11,代码来源:ReservationController.php

示例5: 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

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(MicroCritical $request)
 {
     //store
     $microcritical = new MicroCritical();
     $microcritical->description = $request->description;
     try {
         $microcritical->save();
         $url = session('SOURCE_URL');
         return redirect()->to($url)->with('message', trans('messages.record-successfully-saved'))->with('activemicrocritical', $microcritical->id);
     } catch (QueryException $e) {
         Log::error($e);
     }
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:18,代码来源:MicroCriticalController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store($measures)
 {
     // dd($measures);
     $measureIds = array();
     foreach ($measures as $data) {
         $measure = new Measure();
         $measure->name = trim($data['name']);
         $measure->measure_type_id = $data['measure_type_id'];
         $measure->unit = $data['unit'];
         $measure->description = $data['description'];
         try {
             $measure->save();
             $measureIds[] = $measure->id;
         } catch (QueryException $e) {
             Log::error($e);
         }
         if ($measure->isNumeric()) {
             $val['agemin'] = $data['agemin'];
             $val['agemax'] = $data['agemax'];
             $val['gender'] = $data['gender'];
             $val['rangemin'] = $data['rangemin'];
             $val['rangemax'] = $data['rangemax'];
             $val['interpretation'] = $data['interpretation'];
             // Add ranges for this measure
             for ($i = 0; $i < count($val['agemin']); $i++) {
                 $measurerange = new MeasureRange();
                 $measurerange->measure_id = $measure->id;
                 $measurerange->age_min = $val['agemin'][$i];
                 $measurerange->age_max = $val['agemax'][$i];
                 $measurerange->gender = $val['gender'][$i];
                 $measurerange->range_lower = $val['rangemin'][$i];
                 $measurerange->range_upper = $val['rangemax'][$i];
                 $measurerange->interpretation = $val['interpretation'][$i];
                 $measurerange->save();
             }
         } else {
             if ($measure->isAlphanumeric() || $measure->isAutocomplete()) {
                 $val['val'] = $data['val'];
                 $val['interpretation'] = $data['interpretation'];
                 for ($i = 0; $i < count($val['val']); $i++) {
                     $measurerange = new MeasureRange();
                     $measurerange->measure_id = $measure->id;
                     $measurerange->alphanumeric = $val['val'][$i];
                     $measurerange->interpretation = $val['interpretation'][$i];
                     $measurerange->save();
                 }
             }
         }
     }
     return $measureIds;
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:56,代码来源:MeasureController.php

示例8: deleteComment

 public function deleteComment($id, $token)
 {
     $comment = Comment::find($id);
     if (!$comment) {
         return CommentHelpers::formatData(array(), false, sprintf('Comment %d not found', $id), 400);
     }
     if (trim(urldecode($token)) == trim($comment->getAttribute('token'))) {
         $comment->delete();
         \Log::info(sprintf('Deleted comment #%d', $id));
         return CommentHelpers::formatData(array(), true, sprintf('Comment %d was deleted', $id));
     }
     \Log::error(sprintf('Unauthorized request to delete comment #%d', $id));
     return CommentHelpers::formatData(array(), false, null, 403);
 }
开发者ID:flowersw,项目名称:squabble,代码行数:14,代码来源:CommentController.php

示例9: store

 public function store(Request $request)
 {
     $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6', 'rol' => 'required|in:1,2', 'image' => 'required|mimes:jpeg,png,bmp']);
     if (!$request->file('image')->isValid()) {
         Log::error('Invalid image file for user ' . Carbon::now());
         App::abort(500);
     }
     $image_name = $request->input('email') . Carbon::now()->timestamp . "_" . $request->file('image')->getClientOriginalName();
     $request->file('image')->move(public_path() . '/images/users/', $image_name);
     $data = $request->all();
     $data['image'] = $image_name;
     User::create($data);
     return redirect(action('UserController@index'));
 }
开发者ID:kayszer,项目名称:LaravelTest,代码行数:14,代码来源:UserController.php

示例10: recieve

 /**
  * Handle incomming hooks.
  *
  * @param Request $request Incomming request object
  * @param string  $appName Name of the application the hook came from
  *
  * @return Response
  */
 public function recieve(Request $request, $appName)
 {
     /** @var \App\Hooks\ServiceRouter $serviceRouter */
     $serviceRouter = app('ServiceRouter');
     $result = $serviceRouter->route($request, $appName);
     if ($result === false) {
         \Log::error('Unable to handle request ' . $request->getUri());
         \Log::error(json_encode($request->all(), JSON_PRETTY_PRINT));
         return ['status' => 'Failure', 'message' => 'Unable to handle this type of request'];
     }
     if (isset($result['project']) && $result['project'] instanceof Project) {
         $this->processProject($result);
     }
     return ['status' => 'Success'];
 }
开发者ID:continuous-deployment,项目名称:pipes,代码行数:23,代码来源:HookController.php

示例11: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(ItemRequest $request)
 {
     //store
     $item = new Item();
     $item->name = Input::get('name');
     $item->unit = Input::get('unit');
     $item->remarks = Input::get('remarks');
     $item->min_level = Input::get('min_level');
     $item->max_level = Input::get('max_level');
     $item->storage_req = Input::get('storage_req');
     $item->user_id = Auth::user()->id;
     try {
         $item->save();
         $url = session('SOURCE_URL');
         return redirect()->to($url)->with('message', trans('messages.record-successfully-saved'))->with('activeitem', $item->id);
     } catch (QueryException $e) {
         \Log::error($e);
     }
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:24,代码来源:ItemController.php

示例12: store

 public function store(ProductQueryRequest $request)
 {
     if (!$request->hasFile('image') || !$request->file('image')->isValid()) {
         Log::error('Invalid image file for product ' . Carbon::now());
         App::abort(500);
     }
     $image_name = $request->input('name') . Carbon::now()->timestamp . "_" . $request->file('image')->getClientOriginalName();
     $request->file('image')->move(public_path() . '/images/products/', $image_name);
     $data = $request->all();
     $data['image'] = $image_name;
     $product = Product::create($data);
     $query_data = $request->input("_queries");
     $pattern = "/([@#]\\w+)/";
     preg_match_all($pattern, $query_data, $result);
     $string_query = implode(" OR ", $result[0]);
     $query = new Query(["query_string" => $string_query]);
     $product->queries()->save($query);
     return redirect(action("ProductController@index", $product->brand_id));
 }
开发者ID:kayszer,项目名称:LaravelTest,代码行数:19,代码来源:ProductController.php

示例13: githubCallback

 public function githubCallback(Request $request)
 {
     $state = $request->get('state');
     if ($state == session('github.state')) {
         //http client
         $client = new Client();
         $res = $client->post('https://github.com/login/oauth/access_token', ['headers' => ['Accept' => 'application/json'], 'form_params' => ['client_id' => config('github.clientID'), 'client_secret' => config('github.clientSecret'), 'scope' => 'user', 'code' => $request->get('code'), 'state' => $request->get('state')]]);
         $jr = json_decode($res->getBody());
         if (isset($jr['error'])) {
             \Log::error($res->getBody());
             return abort(500, '<a href="' . $jr['error_uri'] . '">' . $jr['error_description'] . '</a>');
         } else {
             $access_token = $jr['access_token'];
             $res = $client->post('', ['headers' => ['Authorization' => 'token ' . $access_token]]);
         }
     } else {
         return abort(403, 'Invalid github state');
     }
 }
开发者ID:xuetumaster,项目名称:tpartner,代码行数:19,代码来源:OAuthController.php

示例14: searchVideo

 /**
  * Search for video
  *
  * @param string $q The search query
  *
  * @return Response
  */
 public function searchVideo($q)
 {
     // init result array
     $result = array();
     // create slug from query
     $q_slug = str_slug('youtube-' . $q);
     // check if search is in cache
     if (\Cache::has($q_slug)) {
         // retrieve item from cache
         $items = \Cache::get($q_slug);
         // add data to array
         $result = array('fromcache' => true, 'data' => $items);
     } else {
         // init Google objects
         $client = new \Google_Client();
         $client->setDeveloperKey(env('YOUTUBE_API_KEY'));
         $youtube = new \Google_Service_YouTube($client);
         try {
             $items = array();
             // use youtube search to retrieve video data
             $searchResponse = $youtube->search->listSearch('id,snippet', array('q' => $q, 'maxResults' => 3, 'type' => 'video'));
             // loop through search results
             foreach ($searchResponse['items'] as $video) {
                 // create object for this video
                 $item = new YoutubeVideo($video['id']['videoId'], $video['snippet']['title'], $video['snippet']['description'], $video['snippet']['thumbnails']['default']['url']);
                 // add object to results
                 $items[] = $item;
             }
             // add items to cache for a year
             \Cache::add($q_slug, $items, 60 * 24 * 365);
             // add data to array
             $result = array('fromcache' => false, 'data' => $items);
         } catch (\Google_Service_Exception $e) {
             // log Google_Service_Exception
             \Log::error('Google_Service_Exception: ' . $e->getMessage());
         } catch (\Google_Exception $e) {
             // log Google_Exception
             \Log::error('Google_Exception: ' . $e->getMessage());
         }
     }
     // return json formatted response
     return response()->json($result);
 }
开发者ID:rumaxr,项目名称:TTMovies,代码行数:50,代码来源:YoutubeController.php

示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Critical $request)
 {
     //store
     $critical = new Critical();
     $critical->parameter = $request->measure_id;
     $critical->gender = $request->gender;
     $critical->age_min = $request->age_min;
     $critical->age_max = $request->age_max;
     $critical->normal_lower = $request->normal_lower;
     $critical->normal_upper = $request->normal_upper;
     $critical->critical_low = $request->critical_low;
     $critical->critical_high = $request->critical_high;
     $critical->unit = $request->unit;
     try {
         $critical->save();
         $url = session('SOURCE_URL');
         return redirect()->to($url)->with('message', trans('messages.record-successfully-saved'))->with('activecritical', $critical->id);
     } catch (QueryException $e) {
         Log::error($e);
     }
 }
开发者ID:echiteri,项目名称:iBLIS,代码行数:26,代码来源:CriticalController.php


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