New mass delete form and options. #241

This commit is contained in:
James Cole
2016-04-23 09:33:54 +02:00
parent f43938726a
commit 3948cb8e6c
13 changed files with 288 additions and 6 deletions

View File

@@ -51,6 +51,21 @@ class JournalRepository implements JournalRepositoryInterface
return true;
}
/**
* @param int $journalId
*
* @return TransactionJournal
*/
public function find(int $journalId) : TransactionJournal
{
$journal = $this->user->transactionjournals()->where('id', $journalId)->first();
if (is_null($journal)) {
return new TransactionJournal;
}
return $journal;
}
/**
* Get users first transaction journal
*
@@ -131,7 +146,7 @@ class JournalRepository implements JournalRepositoryInterface
public function getJournalsOfTypes(array $types, int $page, int $pageSize = 50): LengthAwarePaginator
{
$offset = ($page - 1) * $pageSize;
$query = $this->user
$query = $this->user
->transactionJournals()
->expanded()
->transactionTypes($types);