38 lines
932 B
PHP
38 lines
932 B
PHP
<?php
|
||
|
||
namespace RuLong\Identity\Models;
|
||
|
||
use Illuminate\Database\Eloquent\Model;
|
||
|
||
class Identity extends Model
|
||
{
|
||
//
|
||
protected $casts = [
|
||
'configs' => 'array',
|
||
];
|
||
|
||
public function getConfigTextAttribute()
|
||
{
|
||
if (count($this->configs) > 0) {
|
||
$configText = config('rulong_identity.configs');
|
||
$str = '';
|
||
foreach ($this->configs as $key => $value) {
|
||
$configArray = $configText[$key] ?? false;
|
||
if ($configArray) {
|
||
$name = $configArray['name'] ?? '';
|
||
$modified = $configArray['modified'] ?? '';
|
||
$str .= $name . ':' . $value . $modified . "<br>";
|
||
}
|
||
}
|
||
return $str;
|
||
} else {
|
||
return '';
|
||
}
|
||
}
|
||
|
||
public function useridentitys()
|
||
{
|
||
return $this->hasMany(UserIdentity::class);
|
||
}
|
||
}
|