Referring to Auth::user will not work from the command line.

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-08-26 07:37:09 +02:00
parent 7079e76886
commit 0fe70dae17
3 changed files with 3 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ class SetCategory implements ActionInterface
public function act(TransactionJournal $journal): bool
{
$name = $this->action->action_value;
$category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]);
$category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => $journal->user->id]);
$journal->categories()->sync([$category->id]);
return true;