Skip to content

Account#15

Open
TheBarbaraIsTaken wants to merge 3 commits intoEotvosCollegium:mainfrom
TheBarbaraIsTaken:account
Open

Account#15
TheBarbaraIsTaken wants to merge 3 commits intoEotvosCollegium:mainfrom
TheBarbaraIsTaken:account

Conversation

@TheBarbaraIsTaken
Copy link
Copy Markdown
Contributor

New page for Pluto, where people can handle accountancy.

{
//
$id = auth()->user()->id;
$income_sum = DB::table('accounts')->where('user_id', '=', $id)->where('income', true)->sum('amount'); //int
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the relations:
$user = auth()->user();
$income_sum = $user->accounts->where('income', true)->sum('amount');

* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing validation

*/
public function destroy(Account $account)
{
DB::table('account_user')->where('account_id', '=', $account->id)->delete();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$account->delete();

Comment thread app/Models/User.php
}

/**
* Get the todos the user assigned to.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update (or delete) comments (everywhere)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants