本文整理汇总了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
}
示例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';
}
}
示例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';
}
}
示例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');
}
示例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]);
}
示例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;
}
示例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);
}
}
示例8: LihatLog
public function LihatLog()
{
// return Log::getMonolog();
Log::listen(function ($level, $message, $context) {
return " {$level} || {$message} || {$context} ";
});
}
示例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);
}
}
示例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";
}
示例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";
}
示例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();
}
示例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());
}
}
示例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);
}
示例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);
}