User Order step1
This commit is contained in:
parent
eb55b01b0d
commit
a5db985ae8
90 changed files with 6439 additions and 421 deletions
71
app/Models/Logger.php
Normal file
71
app/Models/Logger.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Logger
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $model_id
|
||||
* @property string $model
|
||||
* @property string $action
|
||||
* @property string $channel
|
||||
* @property string $message
|
||||
* @property int $level
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property User $user
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class Logger extends Model
|
||||
{
|
||||
protected $table = 'loggers';
|
||||
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'model_id' => 'int',
|
||||
'level' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'model_id',
|
||||
'model',
|
||||
'action',
|
||||
'channel',
|
||||
'message',
|
||||
'level'
|
||||
];
|
||||
|
||||
public $levelTypes = [
|
||||
1 => 'debug',
|
||||
2 => 'info',
|
||||
3 => 'notice',
|
||||
4 => 'warning',
|
||||
5 => 'error',
|
||||
6 => 'critical',
|
||||
7 => 'alert',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function getLevelType(){
|
||||
|
||||
return isset($this->levelTypes[$this->level]) ? $this->levelTypes[$this->level] : "";
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue