Support the ongoing development of Laravel.io →
Security Architecture
Last updated 1 year ago.
0

It shouldn't be dangerous. Why you think it can be dangerous?

Btw: Your function showAuthorPosts could be better. Instead of getting the id manually declare the route with an id. Like this:

Route::get('user/{id}', function($id)
{
return 'User '.$id;
});

see also on: http://laravel.com/docs/routing#route-parameters

Last updated 1 year ago.
0

or

Route::get('authorsorwhateveruri/{id}', 'PaymentController@showAuthorPosts');
public function showAuthorPosts($id)
    {
        // $id = Request::segment(3); not needed.

        if(is_numeric($id)) {

Though im not sure if you can chain it with a ->where('id', '[0-9]+');
Then you would not need to check if numeric.

Last updated 1 year ago.
0
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

root root Joined 2 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.