Skip to content

Firefly III: a personal finances manager

New cleanup command for artisan

James Cole10b969a074c9
diff --git a/app/commands/Cleanup.php b/app/commands/Cleanup.php
new file mode 100644
index 0000000000..2e5c889068
--- /dev/null
+++ b/app/commands/Cleanup.php
@@ -0,0 +1,77 @@
+<?php
+
+use Illuminate\Console\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class Cleanup extends Command
+{
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Clean caches, regenerate some stuff.';
+ /**
+ * The console command name.
+ *
+ * @var string
+ */
+ protected $name = 'firefly:cleanup';
+
+ /**
+ * Create a new command instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * Execute the console command.
+ *
+ * @return mixed
+ */
+ public function fire()
+ {
+ $this->info('Start!');
+ Artisan::call('clear-compiled');
+ $this->info('Cleared compiled...');
+ Artisan::call('ide-helper:generate');
+ $this->info('IDE helper, done...');
+ Artisan::call('ide-helper:models', ['write']);
+ $this->info('IDE models, done...');
+ Artisan::call('optimize');
+ $this->info('Optimized...');
+ Artisan::call('dump-autoload');
+ $this->info('Done!');
+ }
+
+ /**
+ * Get the console command arguments.
+ *
+ * @return array
+ */
+ protected function getArguments()
+ {
+ return [
+ // ['example', InputArgument::REQUIRED, 'An example argument.'],
+ ];
+ }
+
+ /**
+ * Get the console command options.
+ *
+ * @return array
+ */
+ protected function getOptions()
+ {
+ return [
+ // ['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
+ ];
+ }
+
+}
diff --git a/app/models/Account.php b/app/models/Account.php
index 896ef8820a..03645bbb13 100644
--- a/app/models/Account.php
+++ b/app/models/Account.php
@@ -3,29 +3,28 @@ use Carbon\Carbon;
use LaravelBook\Ardent\Ardent as Ardent;
use LaravelBook\Ardent\Builder;
-
/**
* Account
*
- * @property integer $id
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- * @property integer $user_id
- * @property integer $account_type_id
- * @property string $name
- * @property boolean $active
- * @property-read \AccountType $accountType
+ * @property integer $id
+ * @property \Carbon\Carbon $created_at
+ * @property \Carbon\Carbon $updated_at
+ * @property integer $user_id
+ * @property integer $account_type_id
+ * @property string $name
+ * @property boolean $active
+ * @property-read \AccountType $accountType
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
- * @property-read \Illuminate\Database\Eloquent\Collection|\Piggybank[] $piggybanks
- * @property-read \User $user
- * @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereName($value)
- * @method static \Illuminate\Database\Query\Builder|\Account whereActive($value)
- * @method static \Account accountTypeIn($types)
+ * @property-read \Illuminate\Database\Eloquent\Collection|\Piggybank[] $piggybanks
+ * @property-read \User $user
+ * @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereName($value)
+ * @method static \Illuminate\Database\Query\Builder|\Account whereActive($value)
+ * @method static \Account accountTypeIn($types)
*/
class Account extends Ardent
{
diff --git a/app/models/Reminder.php b/app/models/Reminder.php
index 3ecb0387eb..199c5b66e8 100644
--- a/app/models/Reminder.php
+++ b/app/models/Reminder.php
@@ -30,8 +30,8 @@ use LaravelBook\Ardent\Ardent;
* @method static \Reminder dateIs($start, $end)
* @property integer $remindersable_id
* @property string $remindersable_type
- * @method static \Illuminate\Database\Query\Builder|\Reminder whereRemindersableId($value)
- * @method static \Illuminate\Database\Query\Builder|\Reminder whereRemindersableType($value)
+ * @method static \Illuminate\Database\Query\Builder|\Reminder whereRemindersableId($value)
+ * @method static \Illuminate\Database\Query\Builder|\Reminder whereRemindersableType($value)
*/
class Reminder extends Eloquent
{
diff --git a/app/models/TransactionJournal.php b/app/models/TransactionJournal.php
index 9e51ceefd2..2796563950 100644
--- a/app/models/TransactionJournal.php
+++ b/app/models/TransactionJournal.php
@@ -56,6 +56,10 @@ use LaravelBook\Ardent\Builder;
* 'Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\
* 'Category[] $categories
+ * @property-read \Illuminate\Database\Eloquent\Collection|\
+ * 'Budget[] $budgets
+ * @property-read \Illuminate\Database\Eloquent\Collection|\
+ * 'Category[] $categories
*/
class TransactionJournal extends Ardent
{
diff --git a/app/start/artisan.php b/app/start/artisan.php
index 1df850bc95..3b223f16ec 100644
--- a/app/start/artisan.php
+++ b/app/start/artisan.php
@@ -11,3 +11,4 @@
|
*/
+Artisan::add(new Cleanup);
\ No newline at end of file