mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
More code.
This commit is contained in:
@@ -21,6 +21,8 @@ use Steam;
|
||||
*/
|
||||
class GoogleChartController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param GChart $chart
|
||||
*
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
use Navigation;
|
||||
use Preferences;
|
||||
@@ -16,15 +17,21 @@ use URL;
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('range');
|
||||
//$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function flush()
|
||||
{
|
||||
Cache::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,6 +70,7 @@ class HomeController extends Controller
|
||||
$transactions[] = [$set, $account];
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($transactions);
|
||||
|
||||
return view('index', compact('count', 'title', 'subTitle', 'mainTitleIcon', 'transactions'));
|
||||
|
@@ -3,11 +3,13 @@
|
||||
/**
|
||||
* Home Controller
|
||||
*/
|
||||
Route::group(
|
||||
['middleware' => ['auth','range']], function () {
|
||||
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
|
||||
Route::get('/prev', ['uses' => 'HomeController@sessionPrev', 'as' => 'sessionPrev']);
|
||||
Route::get('/next', ['uses' => 'HomeController@sessionNext', 'as' => 'sessionNext']);
|
||||
Route::get('/jump/{range}', ['uses' => 'HomeController@rangeJump', 'as' => 'rangeJump']);
|
||||
|
||||
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
|
||||
/**
|
||||
* Account Controller
|
||||
*/
|
||||
@@ -139,6 +141,8 @@ Route::get('/transaction/show/{tj}', ['uses' => 'TransactionController@show', 'a
|
||||
*/
|
||||
Route::get('/logout', ['uses' => 'UserController@logout', 'as' => 'logout']);
|
||||
|
||||
}
|
||||
);
|
||||
Route::controllers(
|
||||
[
|
||||
'auth' => 'Auth\AuthController',
|
||||
|
@@ -21,14 +21,9 @@ class Account extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\AccountType');
|
||||
}
|
||||
|
||||
public function user()
|
||||
public function getDates()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
|
||||
public function transactions()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function scopeAccountTypeIn(EloquentBuilder $query, array $types)
|
||||
@@ -40,9 +35,14 @@ class Account extends Model
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
public function transactions()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -16,13 +16,14 @@ class AccountMeta extends Model
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ class AccountType extends Model
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Bill extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'date'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
@@ -14,10 +19,6 @@ class Bill extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','date'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -11,6 +11,11 @@ class Budget extends Model
|
||||
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
|
||||
@@ -25,10 +30,6 @@ class Budget extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -10,13 +10,14 @@ class BudgetLimit extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Budget');
|
||||
}
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\LimitRepetition');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate'];
|
||||
}
|
||||
|
||||
public function limitrepetitions()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\LimitRepetition');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Category extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||
@@ -14,9 +19,5 @@ class Category extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ class LimitRepetition extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||
|
@@ -10,6 +10,11 @@ class PiggyBank extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
||||
}
|
||||
|
||||
public function piggyBankEvents()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||
@@ -24,8 +29,4 @@ class PiggyBank extends Model
|
||||
{
|
||||
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at','startdate','targetdate'];
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PiggyBankEvent extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'date'];
|
||||
}
|
||||
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||
@@ -14,9 +19,5 @@ class PiggyBankEvent extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','date'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,13 +5,14 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PiggyBankRepetition extends Model
|
||||
{
|
||||
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
||||
}
|
||||
|
||||
public function piggyBank()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,11 +5,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Preference extends Model
|
||||
{
|
||||
|
||||
protected $fillable = ['user_id', 'data', 'name'];
|
||||
|
||||
public function getDataAttribute($value)
|
||||
{
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
@@ -19,9 +26,5 @@ class Preference extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Reminder extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||
}
|
||||
|
||||
public function remindersable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
@@ -14,9 +19,5 @@ class Reminder extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','startdate','enddate'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,12 +10,13 @@ class Transaction extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\Account');
|
||||
}
|
||||
|
||||
public function transactionJournal()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournal()
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
}
|
||||
|
@@ -5,12 +5,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionCurrency extends Model
|
||||
{
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionGroup extends Model
|
||||
{
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
||||
@@ -14,9 +19,5 @@ class TransactionGroup extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at','deleted_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -5,12 +5,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TransactionType extends Model
|
||||
{
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'deleted_at'];
|
||||
}
|
||||
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['name', 'email', 'password'];
|
||||
protected $fillable = ['email', 'password'];
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
|
Reference in New Issue
Block a user