rest to menu
This commit is contained in:
@ -74,17 +74,17 @@ class RestController
|
||||
|
||||
}
|
||||
|
||||
#[NoReturn] public function actionCreate(): void
|
||||
#[NoReturn] public function actionStore(): void
|
||||
{
|
||||
|
||||
$request = new Request();
|
||||
$data = $request->post();
|
||||
$data = [
|
||||
'title' => 'title'
|
||||
];
|
||||
Debug::prn($data);
|
||||
$model = $this->model;
|
||||
Debug::prn($model->toArray());
|
||||
$model->save($data);
|
||||
foreach ($this->model->getFillable() as $item){
|
||||
$this->model->{$item} = $data[$item] ?? null;
|
||||
}
|
||||
$this->model->save();
|
||||
|
||||
$this->renderApi($this->model->toArray());
|
||||
}
|
||||
|
||||
#[NoReturn] protected function renderApi(array $data): void
|
||||
|
Reference in New Issue
Block a user