PHP-034 / Beginner
Using $request->all() without input validation
Why is this a problem?
Values whose type, length and format are unchecked reach the DB or external APIs.
How to fix it
php
$data = $request->validate([
'name' => 'required|string|max:100',
'price' => 'required|integer|min:0',
]);
Product::create($data);