i want to show the active deposit of my user.therefore i want to get last amount user has deposited in his account. but i have new in Laravel . i have tried following but its sums all amount of user not only last one. if you need i will share whole bunch of code here.
$data['a_deposit'] = Deposit::whereUser_id(Auth::user()->id)->orderBy('id','DESC',LIMIT 1)->take(1)->sum('amount');
from here i want to get last amount
$data['last_deposit'] = Deposit::whereUser_id(Auth::user()->id)->orderBy('id','DESC')->take(6)->get();