Skip to content

Commit

Permalink
Create draft show page
Browse files Browse the repository at this point in the history
  • Loading branch information
benguozakinci@gmail.com authored and benguozakinci@gmail.com committed Aug 3, 2021
1 parent 7a38e9c commit 986522e
Show file tree
Hide file tree
Showing 10 changed files with 31,394 additions and 14,244 deletions.
35 changes: 0 additions & 35 deletions .env.example

This file was deleted.

15 changes: 12 additions & 3 deletions app/Http/Controllers/Banking/Accounts.php
Expand Up @@ -8,6 +8,7 @@
use App\Jobs\Banking\DeleteAccount;
use App\Jobs\Banking\UpdateAccount;
use App\Models\Banking\Account;
use App\Models\Banking\Transaction;
use App\Models\Setting\Currency;

class Accounts extends Controller
Expand All @@ -31,9 +32,17 @@ public function index()
*/
public function show(Account $account)
{
return view('banking.accounts.show', compact('account'));
}
$amounts = [
'incoming' => 0,
'outgoing' => 0,
'balance' => 0,
];

$transactions = $account->transactions;

return view('banking.accounts.show', compact('account', 'amounts', 'transactions'));

}
/**
* Show the form for creating a new resource.
*
Expand Down Expand Up @@ -91,7 +100,7 @@ public function duplicate(Account $account)

flash($message)->success();

return redirect()->route('account.edit', $clone->id);
return redirect()->route('accounts.edit', $clone->id);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Banking/Account.php
Expand Up @@ -5,10 +5,11 @@
use App\Abstracts\Model;
use App\Traits\Transactions;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Bkwld\Cloner\Cloneable;

class Account extends Model
{
use HasFactory, Transactions;
use Cloneable, HasFactory, Transactions;

protected $table = 'accounts';

Expand Down

0 comments on commit 986522e

Please sign in to comment.