本文整理汇总了PHP中App\Http\Controllers\Log::info方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::info方法的具体用法?PHP Log::info怎么用?PHP Log::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Http\Controllers\Log
的用法示例。
在下文中一共展示了Log::info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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";
}
示例2: 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]);
}
示例3: 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;
}
示例4: 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();
}
示例5: 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";
}
示例6: 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);
}
示例7: index
/**
* Display a list of all of the user's task.
*
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
\Log::info('.......shoud not be here.......in task controller index method.............');
// $tasks = DB::select('SELECT * FROM tasks where user_id = 6;');
// \Log::info($tasks);
// return view ('tasks.index',['tasks' => $tasks]);
// return view('tasks.index', [
// 'tasks' => $this->tasks->forUser($request->user()),
// ]);
return redirect('/user/userhomepage');
}
示例8: store
/**
* Store a newly created resource in storage.
*
* @param Requests\VoteRequest|Request $request
* @param $id
* @return Response
*/
public function store(Requests\VoteRequest $request)
{
// AJAX JSON RESPONSE
$response = array('status' => 'success', 'msg' => 'Article has been posted. Redirecting now.');
if (Auth::check()) {
\Log::info(Auth::user());
Auth::user()->votes()->create($request->all());
} else {
return \Response::json('Nope');
}
return \Response::json($response);
}
示例9: import
public function import()
{
DB::beginTransaction();
\Log::info('import()');
foreach (Publicacao::all() as $publicacao) {
// $publicacao = $this->createContent(Publicacao::where('publicacaoId', 2679)->first());
// dd($publicacao);
$this->createContent($publicacao);
}
DB::commit();
return 'SUCESSO!';
}
示例10: 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);
}
示例11: updateRandom
public function updateRandom()
{
$data = Redis::smembers('latest_group');
$strData = implode(", ", $data);
\Log::info("Current set from Redis: {$strData}");
$response = new StreamedResponse(function () use($strData) {
$x = mt_rand(1, 100);
echo "data: {$strData}\n\n";
ob_flush();
flush();
sleep(2);
});
$response->headers->set('Content-Type', 'text/event-stream');
return $response;
}
示例12: printRawSql
/**
* 打印原生态sql
* @access protected
* @param boolean $needLog 是否要记录日志
* @return array
*/
protected function printRawSql($needLog = false)
{
$queries = \DB::getQueryLog();
$formattedQueries = [];
foreach ($queries as $query) {
$prep = $query['query'];
foreach ($query['bindings'] as $binding) {
$prep = preg_replace("#\\?#", $binding, $prep, 1);
}
$formattedQueries[] = $prep;
}
if ($needLog) {
\Log::info($formattedQueries);
}
return $formattedQueries;
}
示例13: notificar
public function notificar(Request $request)
{
$mensagem = $request->input('mensagem');
$titulo = $request->input('titulo');
if (is_string($mensagem) && is_string($titulo)) {
$gcm = \App::make('App\\GcmModel');
$res = $gcm->all();
$ids = [];
foreach ($res as $key) {
$ids[] = $key->registration_id;
}
$result = json_encode((new \App\Gcm())->enviar($ids, $titulo, $mensagem));
dd($result);
\Log::info($result);
}
return redirect()->back();
}
示例14: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
if (!is_array($request->all())) {
return ['error' => 'request must be an array'];
}
$rules = ['name' => 'required', 'email' => 'required|email', 'password' => 'required'];
try {
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
return ['created' => false, 'errors' => $validator->errors()->all()];
}
User::create($request->all());
return ['created' => true];
} catch (Exception $e) {
\Log::info('Error creating user: ' . $e);
return \Response::json(['created' => false], 500);
}
}
示例15: grids
public static function grids($batters, $page)
{
if ($page == 'team') {
$idColumns = [(new FieldConfig())->setName('nameLast')->setLabel('Last')];
}
switch ($page) {
case "team":
\Log::info('page');
// $gridColumns = $idColumns;
// $narrowGridColumns = $idColumns;
break;
}
$narrowCfg = (new GridConfig())->setDataProvider(new EloquentDataProvider($batters))->setColumns($idColumns)->setPageSize(500);
$narrowGrid = new Grid($narrowCfg);
$gridCfg = (new GridConfig())->setDataProvider(new EloquentDataProvider($batters))->setColumns($idColumns)->setPageSize(500);
$grid = new Grid($gridCfg);
return array('narrowGrid' => $narrowGrid, 'grid' => $grid);
}