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.
This commit is contained in:
Daeng Deni Mardaeni
2025-01-30 15:54:52 +07:00
parent a43c65e4c2
commit 32de93ef9f
10 changed files with 542 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<?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']);
}
}
}