Belül Laravel csomagot tettem, azt akarom, hogy átirányítja a felhasználót a vezérlő tevékenységének, amely megköveteli a paramétert (ugyanabban a csomagban).
Vezérlő:
public function postMatchItem(Request $request, $id)
{
$this->validate($request, [
'item_match' => 'required|numeric|exists:item,id',
]);
$spot_buy_item = SpotBuyItem::find($id);
$item = Item::find($request->input('item_match'));
$price = $item->getPrice();
$spot_buy_item_response = new SpotBuyItemResponse();
$spot_buy_item_response->spot_buy_item_id = $id;
$spot_buy_item_response->spot_buy_id = $spot_buy_item->spot_buy_id;
$spot_buy_item_response->item_id = $item->id;
$spot_buy_item_response->user_id = $spot_buy_item->user_id;
$spot_buy_item_response->spot_buy_price = $price;
$spot_buy_item_response->created_ts = Carbon::now();
$spot_buy_item_response->save();
return redirect()->action('Ariel\SpotBuy\Http\Controllers\Admin\[email protected]', [$id]);
}
A fellépés az átirányítás ugyanazt az utat használjak a routes.php
fájlt, hogy a felhasználót, hogy a vezérlő akció
Útvonal:
Route::get('/part/{id}', 'Ariel\SpotBuy\Http\Controllers\Admin\[email protected]')->where('id', '[0-9]+');
Megpróbáltam változatait ezen az úton nem járt sikerrel, többek között [email protected]
például a dokumentáció azt sugallja ( https://laravel.com/docs/5.1/responses#redirects )
Megjegyzés : Van ez a munka megnevezésével én útvonalat routes.php
és használata return redirect()->route('route_name', [$id]);
, de még mindig szeretné tudni, hogyan kell átadni a csomagot szabályozó intézkedéseket a ->action()
funkciót.