aa
This commit is contained in:
@@ -172,9 +172,7 @@ class ArticleController extends Controller
|
|||||||
public function showArticoliByDataStart($data_start)
|
public function showArticoliByDataStart($data_start)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$validatedData = request()->validate([
|
$this->validateDate($data_start);
|
||||||
'data_start' => 'required|date_format:Y-m-d',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$articoliVenduti = $this->articoliByDataStart($data_start);
|
$articoliVenduti = $this->articoliByDataStart($data_start);
|
||||||
|
|
||||||
@@ -188,8 +186,20 @@ class ArticleController extends Controller
|
|||||||
// Potresti considerare di registrare l'errore per debugging
|
// Potresti considerare di registrare l'errore per debugging
|
||||||
return new Response('Error exporting articles: ' . $e->getMessage(), 500);
|
return new Response('Error exporting articles: ' . $e->getMessage(), 500);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
protected function validateDate($date)
|
||||||
|
{
|
||||||
|
$validator = \Validator::make(['data_start' => $date], [
|
||||||
|
'data_start' => 'required|date_format:Y-m-d'
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
throw new ValidationException($validator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function showOrdini($numrec)
|
public function showOrdini($numrec)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user