feat: 项目基础框架+配置+Kernel
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* create by vscode
|
||||
* @author lion
|
||||
*/
|
||||
namespace App;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Admin extends Model
|
||||
{
|
||||
protected $table = 'admin';
|
||||
public $timestamps = false;
|
||||
protected $appends = ['role_name'];
|
||||
|
||||
public function getRoleNameAttribute(){
|
||||
return $this->hasOne('App\AdminRole','id','role_id')->value('name');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user