The resource route definition will have a show route that is matching the admin/halls/export URI first; change the order of the route definitions, so that export is first.
Aug 20, 2019
2
Level 3
Excel Export button routes not working
I have an Export button in the index page when the user clicks the Export button I want the data to be exported to an Excel sheet. In this case, do I need to add routes? because I am not redirecting it to any pages. I just want data to be exported to an Excel sheet. I am new to this environment and I am trying to understand routes as well.
I have been trying to
In routes.php
Route::group(array('prefix' => 'admin', 'before' => 'auth.admin'), function()
{
Route::resource('halls', 'HallsAdminController');
Route::get('halls/export', 'HallsAdminController@export');
Route::post('halls/{id}', 'HallsAdminController@store');
Route::get('halls/{id}/create/{step}', 'HallsAdminController@create');
Route::get('halls/{id}/edit/{step}', 'HallsAdminController@edit');
Route::get('halls/{id}/images/{image_id}/delete', 'HallsAdminController@destroy_image');
});
In Index.php
<div class="controls">
<a href="{{ url('admin/halls/export') }}" class="new">Export</a>
</div>
In HallsAdminController.php
public function export(){
dd("Export Clicked");
}
but it is not hitting export function, what am I doing wrong. Please help me.
Level 104
Please or to participate in this conversation.