Files
lpj/app/Http/Requests/CustomFieldRequest.php
Daeng Deni Mardaeni 32de93ef9f feat(custom-field): tambahkan fitur custom field
- Menambahkan model CustomField dengan atribut mass assignable.
- Membuat request validation untuk custom field.
- Menambahkan route dan breadcrumb untuk custom field.
- Membuat migration untuk tabel custom_fields.
- Menambahkan export functionality untuk custom field.
- Membuat view untuk menambah dan mengedit custom field.
2025-01-30 15:54:52 +07:00

34 lines
687 B
PHP

<?php
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CustomFieldRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'name' => 'required|max:255',
'type' => 'required|in:text,select,radio,checkbox',
];
}
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
public function prepareValidationData($data){
if(!$this->type){
$this->merge(['type' => 'text']);
}
}
}