创建模型

This commit is contained in:
2025-05-12 09:04:46 +08:00
parent fc327e9f48
commit 8ee9ab1b92
19 changed files with 594 additions and 139 deletions

View File

@@ -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.
*

View 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 = [];
}

View 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
View 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
View 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 = [];
}

View 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
View 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 = [];
}

View File

@@ -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',
];
}
}