THIS IS A QUESTION FOR LARAVEL 3
Given the following route
Route::get(\'groups/(:any)\', array(\'as\' => \'group\', \'uses\' =>
$ php artisan route:list
+--------+--------------------------------+----------------------------+-- -----------------+----------------------------------------------------+--------- ---+
| Domain | Method | URI | Name | Action | Middleware |
+--------+--------------------------------+----------------------------+-------------------+----------------------------------------------------+------------+
| | GET|HEAD | / |
| | GET | campaign/showtakeup/{id} | showtakeup | App\Http\Controllers\campaignController@showtakeup | auth | |
routes.php
Route::get('campaign/showtakeup/{id}', ['uses' =>'campaignController@showtakeup'])->name('showtakeup');
campaign.showtakeup.blade.php
@foreach($campaign as $campaigns)
//route parameters; you may pass them as the second argument to the method:
<a href="{{route('showtakeup', ['id' => $campaigns->id])}}">{{ $campaigns->name }}</a>
@endforeach
Hope this solves your problem. Thanks
This is what you need in 1 line of code.
Route::get('/groups/{groupId}', 'GroupsController@getShow');
Suggestion: Use CamelCase as opposed to underscores, try & follow PSR-* guidelines.
Hope it helps.
You can add them like this
Route::get('company/{name}', 'PublicareaController@companydetails');
You don't need anything special for adding paramaters. Just like you had it.
Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show'));
class Groups_Controller extends Base_Controller {
public $restful = true;
public function get_show($groupID) {
return 'I am group id ' . $groupID;
}
}