dstpabuaran.com/app/Http/Requests/Admin/Master/SupplierRequest.php
Yoga Pangestu 8edeaf0db7 feat: implement supplier management with CRUD functionality
- Added SupplierController for handling supplier operations.
- Created SupplierRequest for validation of supplier data.
- Introduced SupplierService for business logic related to suppliers.
- Developed UI components for supplier management, including a data table and dialogs for creating and editing suppliers.
- Updated routes to include resourceful routes for suppliers.
- Added SupplierSeeder for populating initial supplier data.
- Implemented tests for supplier functionality, including creation, updating, and deletion.
2026-07-29 01:16:58 +07:00

35 lines
807 B
PHP

<?php
namespace App\Http\Requests\Admin\Master;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class SupplierRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$supplier = $this->route('supplier');
return [
'name' => ['required', 'string', 'max:200', Rule::unique('suppliers', 'name')->ignore($supplier)],
'phone_number' => ['nullable', 'string', 'max:20', 'digits_between:1,20'],
'address' => ['nullable', 'string'],
];
}
public function attributes(): array
{
return [
'name' => 'nama',
'phone_number' => 'nomor telepon',
'address' => 'alamat',
];
}
}