mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
3.2.1
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
use App\Log;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function getStatus()
|
||||
{
|
||||
$client = new GuzzleHttp\Client();
|
||||
@@ -16,4 +21,55 @@ function getStatus()
|
||||
}
|
||||
|
||||
return $isBroken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $result
|
||||
* @param string $event
|
||||
* @param int $user_id
|
||||
* @param null $obj_type
|
||||
* @param null $obj_id
|
||||
*/
|
||||
function clog(string $type,string $result,string $event,$user_id = null,$obj_type = null,$obj_id = null)
|
||||
{
|
||||
$log = new Log;
|
||||
|
||||
$log->result = $result;
|
||||
$log->event = $event;
|
||||
$log->type = $type;
|
||||
|
||||
if ($user_id != null)
|
||||
{
|
||||
$log->user_id = $user_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->user_id = \Auth::User()->id;
|
||||
}
|
||||
|
||||
if ($obj_type != null)
|
||||
{
|
||||
$log->logable_type = $obj_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->logable_type = '';
|
||||
}
|
||||
|
||||
if ($obj_id != null)
|
||||
{
|
||||
$log->logable_id = $obj_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$log->logable_id = 0;
|
||||
}
|
||||
|
||||
$log->save();
|
||||
}
|
||||
|
||||
function clogNav($event)
|
||||
{
|
||||
clog('navigate','success',$event);
|
||||
}
|
||||
Reference in New Issue
Block a user