-
Notifications
You must be signed in to change notification settings - Fork 8
Account #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Account #15
Conversation
| { | ||
| // | ||
| $id = auth()->user()->id; | ||
| $income_sum = DB::table('accounts')->where('user_id', '=', $id)->where('income', true)->sum('amount'); //int |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$account->delete();
| } | ||
|
|
||
| /** | ||
| * Get the todos the user assigned to. |
There was a problem hiding this comment.
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)
New page for Pluto, where people can handle accountancy.