搭建轻舟一期门户、后台和统一登录。
让分类、会员和示例工具共用同一账号,本地即可跑通登录与授权。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class HomeSection extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'slug', 'sort', 'display_limit', 'status'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['sort' => 'integer', 'display_limit' => 'integer'];
|
||||
}
|
||||
|
||||
public function tools(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Tool::class, 'home_section_tool')
|
||||
->withPivot('sort')
|
||||
->orderByPivot('sort');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user