Now we should make an upload form for our image site. We must make a view file, which will be loaded over a controller.
app/routes.php, remove the line starting with
Route::get()that comes with Laravel, and add the following lines:
//This is for the get event of the index page Route::get('/',array('as'=>'index_page','uses'=>'ImageController@getIndex')); //This is for the post event of the index.page Route::post('/',array('as'=>'index_page_post','before' =>'csrf', 'uses'=>'ImageController@postIndex'));
'as' defines the name of the route (like a shortcut). So if you make links to the routes, even if the URL changes for the route, your links to the application won't be broken. The