25 lines
557 B
PHP
25 lines
557 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ThirdAccess extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
|
|
protected $fillable = [
|
|
'third_name', 'third_appid', 'third_appkey'
|
|
];
|
|
|
|
protected static function boot()
|
|
{
|
|
parent::boot();
|
|
// 监听 oldman 的创建事件,用于初始化 位置信息
|
|
static::creating(function ($thirdAccess) {
|
|
$thirdAccess->third_appkey = \Illuminate\Support\Str::random(32);
|
|
});
|
|
}
|
|
}
|