<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('home', 'ProductController@index');
Route::get('/', 'ProductController@index');

Route::get('user/preferences', 'UserController@getSettings');
Route::get('user/{user}', 'UserController@show');

Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);


Route::get('test', function(){
	return view('test.test');
});

Route::post('product/activate', 'ProductController@activate');
Route::post('product/{product}/buy', 'TransactionController@transaction');
Route::post('product/{product}/price', 'ProductController@updatePrice');
Route::post('product/{product}/amount', 'ProductController@newAmount');
Route::post('product/{product}/auction', 'ProductController@newAuction');
Route::post('product/{product}/comment', 'ProductController@newComment');
Route::post('product/{product}/bid/{auction}', 'AuctionController@bid');

Route::get('auction/{auction}', 'AuctionController@show');
Route::get('product/my', 'ProductController@getMyProducts');

Route::get('transactions/', 'TransactionController@index');
Route::get('transactions/{transaction}', 'TransactionController@show');
Route::resource('product', 'ProductController');

Route::get('contact', 'PagesController@contact');
Route::get	('about', 'PagesController@about');




Route::get('lang', function(){
	$locale = Request::get('lang');
	Session::put('locale', $locale);
	return Redirect::back();
});