| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
-
- namespace App\Http\Requests\Transaction;
-
- use App\Models\EntryTransaction;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Validation\Rule;
-
- class StoreTransactionRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true;
- }
-
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, mixed>
- */
- public function rules()
- {
- return [
- 'plat_number' => 'required',
- 'entry_transaction_id' => [
- 'required',
- Rule::in(EntryTransaction::pluck('transaction_number')),
- ],
- 'type_vehicle_id' => 'required',
- ];
- }
- }
|