I want to have second param as optional one.
Routes:
Route::get('/offers/preview/{id}/{string?}', 'OfferController@preview');
Controller:
public function preview($id, $string)
{
// some code
}
Calling "offers/preview/101/test" looks ok.
Error by calling "offers/preview/101"
ErrorException in OfferController.php line 53:
Missing argument 2 for App\Http\Controllers\OfferController::preview()
Thank you in advance.