Made big headway in preference management, accounts, importing stuff, etc. etc.

This commit is contained in:
James Cole
2014-07-06 15:18:11 +02:00
parent 188105492c
commit 4192f2bc8f
46 changed files with 672 additions and 187 deletions

View File

@@ -1,4 +1,13 @@
<?php
Route::bind('account', function ($value, $route) {
if(Auth::user()) {
return Auth::user()->accounts()->find($value);
} else {
return null;
}
});
// protected routes:
Route::group(['before' => 'auth'], function () {
@@ -6,6 +15,12 @@ Route::group(['before' => 'auth'], function () {
// home controller
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
// chart controller
Route::get('/chart/home/{account?}', ['uses' => 'ChartController@home', 'as' => 'chart.home']);
// preferences controller
Route::get('/preferences', ['uses' => 'PreferencesController@index', 'as' => 'preferences']);
// user controller
Route::get('/logout', ['uses' => 'UserController@logout', 'as' => 'logout']);
@@ -13,11 +28,14 @@ Route::group(['before' => 'auth'], function () {
Route::get('/profile', ['uses' => 'ProfileController@index', 'as' => 'profile']);
Route::get('/profile/change-password',['uses' => 'ProfileController@changePassword', 'as' => 'change-password']);
// account controller:
Route::get('/accounts', ['uses' => 'AccountController@index', 'as' => 'accounts.index']);
Route::get('/accounts/create', ['uses' => 'AccountController@create', 'as' => 'accounts.create']);
Route::get('/accounts/{account}', ['uses' => 'AccountController@show', 'as' => 'accounts.show']);
// migration controller
Route::get('/migrate', ['uses' => 'MigrationController@index', 'as' => 'migrate']);
// account controller:
Route::get('/accounts/create', ['uses' => 'AccountController@create', 'as' => 'accounts.create']);
}
);
@@ -29,6 +47,9 @@ Route::group(['before' => 'csrf|auth'], function () {
// migration controller
Route::post('/migrate', ['uses' => 'MigrationController@postIndex']);
// preferences controller
Route::post('/preferences', ['uses' => 'PreferencesController@postIndex']);
// account controller:
Route::get('/accounts/store', ['uses' => 'AccountController@store', 'as' => 'accounts.store']);