创建模型
This commit is contained in:
@@ -4,10 +4,10 @@ namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class UserModel extends BaseModel
|
||||
class AdminModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'cc_admin';
|
||||
protected $table = 'admin';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
17
app/Models/AdminNoticeModel.php
Normal file
17
app/Models/AdminNoticeModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class AdminNoticeModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'admin_notice';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/ApiOpLogModel.php
Normal file
17
app/Models/ApiOpLogModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class ApiOpLogModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'api_op_log';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/FileModel.php
Normal file
17
app/Models/FileModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class FileModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'file';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/MenuModel.php
Normal file
17
app/Models/MenuModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class MenuModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'menu';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/RoleMenuRelationModel.php
Normal file
17
app/Models/RoleMenuRelationModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class RoleMenuRelationModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'role_menu_relations';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
17
app/Models/RoleModel.php
Normal file
17
app/Models/RoleModel.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
|
||||
class RoleModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'role';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user