Laravel 5 getting ID from URL

前端 未结 7 1763
一整个雨季
一整个雨季 2020-12-31 08:22

I have a table view in which I can click an button icon and redirect to another page carrying the id of the row that has been clicked.

@foreach ($pa         


        
相关标签:
7条回答
  • 2020-12-31 09:10

    Basically when you are defining the routes, you use something called route parameters, something like this

    Route::get('/visit/{id}', 'Controller@someMethod');
    

    This id will be available as a parameter in your handler funtion,

    public function someMethod($id) {
        // you have the id here
    }
    
    0 讨论(0)
提交回复
热议问题