【发布时间】:2020-05-21 06:53:36
【问题描述】:
我正在尝试使用我的主控制器中的函数重定向变量和消息。
消息码没问题,一般用->with('abo', 'messagetext')显示。
问题是不是两种类型都被重定向,只有变量(没有消息):(
目标是重定向以下变量:suchString、userId、suche
public function subscribe(Request $request)
{
$suchString = $request->input('suchString');
$userId = $request->input('userId');
Subscribe::create([
'abo_string' => $suchString,
'userid' => $userId
]);
$suche = Document::where( 'title', 'LIKE', '%' . $suchString . '%' )
->orWhere( 'category', 'LIKE', '%' . $suchString . '%' )
->orWhere( 'description', 'LIKE', '%' . $suchString . '%' )
->get();
$users = User::all();
return view('pages.search')->with('abo', 'messagetext');
}
【问题讨论】:
标签: php laravel variables redirect multiple-variable-return