Sonu's avatar
Level 3

Pagination Truncates My Base Url

I Am Working On LocalHost And this is My BaseUrl http://localhost/laravelAdmin
But When i click On Pagination Pagination truncated My url .

Here Is My Url At LocalHost http://localhost/laravelAdmin/users/view but when i click on any page pagination Truncates My Folder Name And Return Me This Url And Page Not Opens http://localhost/users/view?page=2

Its Skips My Folder Name Why Its Happenz ?

0 likes
7 replies
bobbybouwmann's avatar

How do you call your pagination? Any other relevant code that you can show?

1 like
Sonu's avatar
Level 3

@ blackbird Here is the Code My Controller

public function view($id)
    {
        
        $useriformation = DB::table('users')->paginate(2);
        return view('views')->with('useriformation', $useriformation);
    }

And On View I Am Using {!! $useriformation->render() !!} To Make Pagination

bobbybouwmann's avatar

Ok, this should be fine! Can you post the route that is called here?

1 like
bobbybouwmann's avatar

You show me the function view, but you don't call that function in your routes...

1 like
Sonu's avatar
Level 3

Sorry I Send you The Wrong Routes Here are the Correct One

Route::get('/users/{id}', ['uses' =>'UserController@view']);

Please or to participate in this conversation.