restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Requests\Api\Service;
use App\Models\Service;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ServiceRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$service = Service::find($this->service_id);
return [
'service_id' => 'required|exists:services,id',
'power_id' => [
Rule::requiredIf(function () use ($service) {
// If service exists and is_power is true, require power_id
return $service && $service->is_power;
}),
'nullable', // Allow null if the condition is false
'exists:powers,id' // Validate the power_id exists in the powers table
],
'city_id' => 'required|exists:cities,id',
'phone' => 'required|numeric',
'full_name' => 'required',
'comment' => 'nullable',
];
}
}