Fix Pint formatting
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class StudentMedicalCondition extends BaseModel
|
||||
@@ -47,6 +46,7 @@ class StudentMedicalCondition extends BaseModel
|
||||
public function scopeForStudents(Builder $q, array $studentIds): Builder
|
||||
{
|
||||
$ids = array_values(array_unique(array_filter(array_map('intval', $studentIds))));
|
||||
|
||||
return empty($ids) ? $q->whereRaw('1=0') : $q->whereIn('student_id', $ids);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class StudentMedicalCondition extends BaseModel
|
||||
$req = $updating ? 'sometimes' : 'required';
|
||||
|
||||
return [
|
||||
'student_id' => [$req, 'integer', 'min:1', 'exists:students,id'],
|
||||
'student_id' => [$req, 'integer', 'min:1', 'exists:students,id'],
|
||||
'condition_name' => [$req, 'string', 'max:100'],
|
||||
];
|
||||
}
|
||||
@@ -108,10 +108,10 @@ class StudentMedicalCondition extends BaseModel
|
||||
public static function messages(): array
|
||||
{
|
||||
return [
|
||||
'student_id.required' => 'Student ID is required.',
|
||||
'student_id.min' => 'Invalid Student ID.',
|
||||
'student_id.required' => 'Student ID is required.',
|
||||
'student_id.min' => 'Invalid Student ID.',
|
||||
'condition_name.required' => 'Condition name is required.',
|
||||
'condition_name.max' => 'Condition name must be 100 characters or fewer.',
|
||||
'condition_name.max' => 'Condition name must be 100 characters or fewer.',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user