我正在使用Laravel 4,我希望在路由逻辑之后添加filter
。所以执行过滤器但不执行重定向指令return Redirect::to($pool->url . '/share')->with('poolURL' ,URL::to($pool->url));
这段代码:
if(Session::has('pool')){
$entry = Session::get('pool');
// Update pool userId
$entry['user_id'] = Auth::user()->id;
$pool = Pool::create($entry);
// Update pool URL
$pool->url = Auth::user()->username
. '/pool/'
. Str::slug($pool->beneficiary)
. '/'
. $pool->id;
// Update and redirect to Share page
if($pool->save())
{
return Redirect::to($pool->url . '/share')->with('poolURL' ,URL::to($pool->url));
}
}