我的功能
public function post_sofware_technology(Request $request)
{
$titile = $request->input('category_title');
$excerpt = $request->input('Excerpt');
$post = new posts();
$post->post_title = $titile;
$post->post_excerpt = $excerpt;
$post->save();
$soft_id = $post->id;
$this->edit_web_services($soft_id);
}
另一个功能
public function edit_web_services($soft_id)
{
$soft = $soft_id;
dd($soft);
}
我想将我的$soft_id = $post->id;
值从post_sofware_technology()
方法传递到同一控制器内的edit_web_services($soft_id)
。
答案 0 :(得分:0)
尝试
public function post_sofware_technology(Request $request)
{
$titile = $request->input('category_title');
$excerpt = $request->input('Excerpt');
$post = new posts();
$post->post_title = $titile;
$post->post_excerpt = $excerpt;
$post->save();
$soft_id = $post->id;
return $this->edit_web_services($soft_id);
}