登录注册功能
This commit is contained in:
26
app/Models/CategoryModel.php
Normal file
26
app/Models/CategoryModel.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* 分类表
|
||||
*/
|
||||
class CategoryModel extends BaseModel
|
||||
{
|
||||
//
|
||||
protected $table = 'categories';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* 项目
|
||||
* @return HasMany
|
||||
*/
|
||||
public function projects(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProjectModel::class, 'category_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user