Change redirect after deletion of spending to spendings' index route
MODIFY
app/Http/Controllers/SpendingController.php
app/Http/Controllers/SpendingController.php
@@ -50,11 +50,8 @@ class SpendingController extends Controller {
}
public function destroy(Spending $spending) {
- $year = date('Y', strtotime($spending->date));
- $month = date('n', strtotime($spending->date));
-
$spending->delete();
- return redirect()->route('dashboard', compact('year', 'month'));
+ return redirect()->route('spendings.index');
}
}

Change redirect after deletion of spending to spendings' index route