Skip to content

Firefly III: a personal finances manager

Some updates.

James Colebc16298b6e3f
diff --git a/app/Models/Account.php b/app/Models/Account.php
index 086a812704..0fc0d17393 100644
--- a/app/Models/Account.php
+++ b/app/Models/Account.php
@@ -12,17 +12,17 @@ class Account extends Model
public function accountMeta()
{
- return $this->hasMany('AccountMeta');
+ return $this->hasMany('FireflyIII\Models\AccountMeta');
}
public function accountType()
{
- return $this->belongsTo('AccountType');
+ return $this->belongsTo('FireflyIII\Models\AccountType');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php
index a90460af49..9dc8b17ff2 100644
--- a/app/Models/AccountMeta.php
+++ b/app/Models/AccountMeta.php
@@ -7,7 +7,7 @@ class AccountMeta extends Model
public function account()
{
- return $this->belongsTo('Account');
+ return $this->belongsTo('FireflyIII\Models\Account');
}
diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php
index b3369c656c..4933080210 100644
--- a/app/Models/AccountType.php
+++ b/app/Models/AccountType.php
@@ -8,6 +8,6 @@ class AccountType extends Model
//
public function accounts()
{
- return $this->hasMany('Account');
+ return $this->hasMany('FireflyIII\Models\Account');
}
}
diff --git a/app/Models/Bill.php b/app/Models/Bill.php
index b1226a1a1d..1ef82afe84 100644
--- a/app/Models/Bill.php
+++ b/app/Models/Bill.php
@@ -7,12 +7,12 @@ class Bill extends Model
public function transactionjournals()
{
- return $this->hasMany('TransactionJournal');
+ return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/Budget.php b/app/Models/Budget.php
index e8c7ac829a..469f8c791b 100644
--- a/app/Models/Budget.php
+++ b/app/Models/Budget.php
@@ -8,22 +8,22 @@ class Budget extends Model
public function budgetlimits()
{
- return $this->hasMany('BudgetLimit');
+ return $this->hasMany('FireflyIII\Models\BudgetLimit');
}
public function limitrepetitions()
{
- return $this->hasManyThrough('LimitRepetition', 'BudgetLimit', 'budget_id');
+ return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
}
public function transactionjournals()
{
- return $this->belongsToMany('TransactionJournal', 'budget_transaction_journal', 'budget_id');
+ return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'budget_transaction_journal', 'budget_id');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php
index 61fdc17962..c9723f7f9b 100644
--- a/app/Models/BudgetLimit.php
+++ b/app/Models/BudgetLimit.php
@@ -7,12 +7,12 @@ class BudgetLimit extends Model
public function budget()
{
- return $this->belongsTo('Budget');
+ return $this->belongsTo('FireflyIII\Models\Budget');
}
public function limitrepetitions()
{
- return $this->hasMany('LimitRepetition');
+ return $this->hasMany('FireflyIII\Models\LimitRepetition');
}
}
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 912242f176..4e74ae7b69 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -7,12 +7,12 @@ class Category extends Model
public function transactionjournals()
{
- return $this->belongsToMany('TransactionJournal', 'category_transaction_journal', 'category_id');
+ return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
}
diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php
index 039aa5f941..c485bc7add 100644
--- a/app/Models/LimitRepetition.php
+++ b/app/Models/LimitRepetition.php
@@ -7,7 +7,7 @@ class LimitRepetition extends Model
public function budgetLimit()
{
- return $this->belongsTo('BudgetLimit');
+ return $this->belongsTo('FireflyIII\Models\BudgetLimit');
}
}
diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php
index fbd728bbde..5d1eb4ee33 100644
--- a/app/Models/PiggyBank.php
+++ b/app/Models/PiggyBank.php
@@ -7,21 +7,21 @@ class PiggyBank extends Model
public function account()
{
- return $this->belongsTo('Account');
+ return $this->belongsTo('FireflyIII\Models\Account');
}
public function piggyBankEvents()
{
- return $this->hasMany('PiggyBankEvent');
+ return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
public function piggyBankRepetitions()
{
- return $this->hasMany('PiggyBankRepetition');
+ return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
}
public function reminders()
{
- return $this->morphMany('Reminder', 'remindersable');
+ return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
}
}
diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php
index 85242c29f8..405fb14b2b 100644
--- a/app/Models/PiggyBankEvent.php
+++ b/app/Models/PiggyBankEvent.php
@@ -7,12 +7,12 @@ class PiggyBankEvent extends Model
public function piggyBank()
{
- return $this->belongsTo('PiggyBank');
+ return $this->belongsTo('FireflyIII\Models\PiggyBank');
}
public function transactionJournal()
{
- return $this->belongsTo('TransactionJournal');
+ return $this->belongsTo('FireflyIII\Models\TransactionJournal');
}
}
diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php
index b17a2547b6..356373b4cf 100644
--- a/app/Models/PiggyBankRepetition.php
+++ b/app/Models/PiggyBankRepetition.php
@@ -7,7 +7,7 @@ class PiggyBankRepetition extends Model
public function piggyBank()
{
- return $this->belongsTo('PiggyBank');
+ return $this->belongsTo('FireflyIII\Models\PiggyBank');
}
}
diff --git a/app/Models/Preference.php b/app/Models/Preference.php
index 26fba678e0..b06be83545 100644
--- a/app/Models/Preference.php
+++ b/app/Models/Preference.php
@@ -17,7 +17,7 @@ class Preference extends Model
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
}
diff --git a/app/Models/Reminder.php b/app/Models/Reminder.php
index 9ea434e14b..124cc12cd4 100644
--- a/app/Models/Reminder.php
+++ b/app/Models/Reminder.php
@@ -12,7 +12,7 @@ class Reminder extends Model
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php
index 84672db4ff..afe1adf8ce 100644
--- a/app/Models/Transaction.php
+++ b/app/Models/Transaction.php
@@ -7,12 +7,12 @@ class Transaction extends Model
public function account()
{
- return $this->belongsTo('Account');
+ return $this->belongsTo('FireflyIII\Models\Account');
}
public function transactionJournal()
{
- return $this->belongsTo('TransactionJournal');
+ return $this->belongsTo('FireflyIII\Models\TransactionJournal');
}
}
diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php
index a14db72e4c..d30539b27c 100644
--- a/app/Models/TransactionCurrency.php
+++ b/app/Models/TransactionCurrency.php
@@ -7,7 +7,7 @@ class TransactionCurrency extends Model
public function transactionJournals()
{
- return $this->hasMany('TransactionJournal');
+ return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
}
diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php
index c65f6a7ccd..e9369265ed 100644
--- a/app/Models/TransactionGroup.php
+++ b/app/Models/TransactionGroup.php
@@ -7,12 +7,12 @@ class TransactionGroup extends Model
public function transactionjournals()
{
- return $this->belongsToMany('TransactionJournal');
+ return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php
index 973eef46b3..0c4c694eef 100644
--- a/app/Models/TransactionJournal.php
+++ b/app/Models/TransactionJournal.php
@@ -7,17 +7,17 @@ class TransactionJournal extends Model
public function bill()
{
- return $this->belongsTo('Bill');
+ return $this->belongsTo('FireflyIII\Models\Bill');
}
public function budgets()
{
- return $this->belongsToMany('Budget');
+ return $this->belongsToMany('FireflyIII\Models\Budget');
}
public function categories()
{
- return $this->belongsToMany('Category');
+ return $this->belongsToMany('FireflyIII\Models\Category');
}
public function getDescriptionAttribute($value)
@@ -33,38 +33,38 @@ class TransactionJournal extends Model
public function piggyBankEvents()
{
- return $this->hasMany('PiggyBankEvent');
+ return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
}
public function setDescriptionAttribute($value)
{
- $this->attributes['description'] = Crypt::encrypt($value);
+ $this->attributes['description'] = \Crypt::encrypt($value);
$this->attributes['encrypted'] = true;
}
public function transactionCurrency()
{
- return $this->belongsTo('TransactionCurrency');
+ return $this->belongsTo('FireflyIII\Models\TransactionCurrency');
}
public function transactionType()
{
- return $this->belongsTo('TransactionType');
+ return $this->belongsTo('FireflyIII\Models\TransactionType');
}
public function transactiongroups()
{
- return $this->belongsToMany('TransactionGroup');
+ return $this->belongsToMany('FireflyIII\Models\TransactionGroup');
}
public function transactions()
{
- return $this->hasMany('Transaction');
+ return $this->hasMany('FireflyIII\Models\Transaction');
}
public function user()
{
- return $this->belongsTo('User');
+ return $this->belongsTo('FireflyIII\User');
}
diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php
index d587b027d5..37acae6acb 100644
--- a/app/Models/TransactionType.php
+++ b/app/Models/TransactionType.php
@@ -7,7 +7,7 @@ class TransactionType extends Model
public function transactionJournals()
{
- return $this->hasMany('TransactionJournal');
+ return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
}
diff --git a/app/Models/User.php b/app/User.php
similarity index 67%
rename from app/Models/User.php
rename to app/User.php
index e606e579d0..595f1bcddc 100644
--- a/app/Models/User.php
+++ b/app/User.php
@@ -1,4 +1,4 @@
-<?php namespace FireflyIII\Models;
+<?php namespace FireflyIII;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
@@ -32,47 +32,47 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
public function accounts()
{
- return $this->hasMany('Account');
+ return $this->hasMany('FireflyIII\Models\Account');
}
public function bills()
{
- return $this->hasMany('Bill');
+ return $this->hasMany('FireflyIII\Models\Bill');
}
public function budgets()
{
- return $this->hasMany('Budget');
+ return $this->hasMany('FireflyIII\Models\Budget');
}
public function categories()
{
- return $this->hasMany('Category');
+ return $this->hasMany('FireflyIII\Models\Category');
}
public function piggyBanks()
{
- return $this->hasManyThrough('PiggyBank', 'Account');
+ return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'Account');
}
public function preferences()
{
- return $this->hasMany('Preference');
+ return $this->hasMany('FireflyIII\Models\Preference');
}
public function reminders()
{
- return $this->hasMany('Reminder');
+ return $this->hasMany('FireflyIII\Models\Reminder');
}
public function transactionjournals()
{
- return $this->hasMany('TransactionJournal');
+ return $this->hasMany('FireflyIII\Models\TransactionJournal');
}
public function setPasswordAttribute($value)
{
- $this->attributes['password'] = Hash::make($value);
+ $this->attributes['password'] = \Hash::make($value);
}
}
diff --git a/composer.lock b/composer.lock
index 724e3cbbe0..1d2d6a6bde 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "748428ef7844b760438fcafa6965cafa",
+ "hash": "5bb84809ab2fa2c5a8486b6b38f1e47f",
"packages": [
{
"name": "classpreloader/classpreloader",
diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php
index 2f75349429..3d24119910 100644
--- a/database/seeds/TestDataSeeder.php
+++ b/database/seeds/TestDataSeeder.php
@@ -1,7 +1,7 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
-use FireflyIII\Models\User;
+use FireflyIII\User;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Budget;
@@ -17,6 +17,7 @@ use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
+use FireflyIII\Models\TransactionGroup;
/**
* @SuppressWarnings("CamelCase") // I'm fine with this.