I got this error when I deleted all recorded currency in my table, please tell me what's going on.
This my code in controller
public function massDestroy(Request $request)
{
if (! Gate::allows('currency_delete')) {
return abort(401);
}
if ($request->input('ids')) {
$entries = Currency::whereIn('id', $request->input('ids'))->get();
foreach ($entries as $entry) {
$entry->delete();
}
}
}
while this is my code in javascript.php
@if (auth()->check())
$('#moneyFormat').maskMoney({
// The symbol to be displayed before the value entered by the user
prefix:'{{ auth()->user()->currency->symbol }}',
// The thousands separator
thousands:'{{ auth()->user()->currency->money_format_thousands }}',
// The decimal separator
decimal:'{{ auth()->user()->currency->money_format_decimal }}'
});
$('#expense, #income').submit(function(){
var value = $('#moneyFormat').maskMoney('unmasked')[0];
$('#moneyFormat').val(value);
});
@endif