save it into variable and die and dump the result.see if it is correct path. make sure you import News class as well
$variable = '/news/' . $news->number . '/' . $news->issue;
dd($variable);
Is something like this possible? It doesn't seem to be working for me. What I am trying to do is use the id in the old path, get the item, and redirect it based on two pieces of data in the collection.
Route::get( '/news/{id}', function( $id ) {
$news= News::find( $id );
return Redirect::to( '/news/' . $news->number . '/' . $news->issue, 301 );
});
When i go to the url, i get a 404 error, instead of a redirect. Im not sure how to troubleshoot this problem.
Please or to participate in this conversation.