Validate store function in RecurringController
MODIFY
app/Http/Controllers/RecurringController.php
app/Http/Controllers/RecurringController.php
@@ -32,7 +32,13 @@ class RecurringController extends Controller {
}
public function store(Request $request) {
- // TODO VALIDATE
+ $request->validate([
+ 'day' => 'required|integer|between:1,28',
+ 'end' => 'required|date|date_format:Y-m-d',
+ 'tag' => 'nullable|exists:tags,id', // TODO CHECK IF TAG BELONGS TO USER
+ 'description' => 'required|max:255',
+ 'amount' => 'required|regex:/^\d*(\.\d{2})?$/'
+ ]);
$user = Auth::user();

Validate store function in RecurringController