feat(curd): 关联表优化支持 add relation support and optimize model associations
- Add support for handling relations in CURD operations - Optimize model associations to use hasOne instead of belongsTo - Implement field selection for relations - Update controller to handle AJAX requests and return JSON data Modify model to include relation methods
This commit is contained in:
@@ -17,8 +17,9 @@ class {{controllerName}} extends AdminController
|
||||
{
|
||||
parent::__construct($app);
|
||||
self::$model = {{modelFilename}}::class;
|
||||
$this->notes = $notes = self::$model::$notes;
|
||||
$notes = self::$model::$notes;
|
||||
{{constructRelation}}
|
||||
$this->notes =$notes;
|
||||
$this->assign(compact('notes'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user