Merge remote-tracking branch 'origin/main'

# Conflicts:
#	routes/web.php
This commit is contained in:
c.girardi
2024-02-17 16:50:53 +01:00
19 changed files with 422 additions and 46 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\File;
class FileRequest extends FormRequest
{
public $filetoinsert;
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'filetoinsert' => ['required', 'mimes:txt']//, File::types(['csv'])]
];
}
public function messages(): array
{
return [
'filetoinsert.required' => 'ERROR: csv file not selected!',
'filetoinsert.mimes'=> "ERRORE: select only csv format"
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StorefileRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdatefileRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@@ -10,10 +10,19 @@ class WordRequest extends FormRequest
{
return [
'name' => ['required'],
'translation' => ['required'],
'translation' => ['required', 'unique:words,translation'],
];
}
public function messages(): array
{
return [
'name.required' => 'Insert italian Word',
'translation.required' => 'Insert dialect Word',
];
}
public function authorize(): bool
{
return true;