This is like asking us to build your application.
What have you tried so far? What part is not working for you? We can all type it out here, but you won't learn anything from, let alone understand it.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am developing an appraisal management system using Master Detail Form with just three tables:
Goals
KPI
Goal Types
Models
Goal
protected $fillable = [
'goal_name',
'goal_description',
];
public function goalType()
{
return $this->belongsTo('App\Models\GoalType','goal_type_id');
}
KPI
protected $fillable = [
'goal_id
'goal_type_id',
'kpi_description',
];
GoalController
public function create()
{
$goaltypes = GoalType::all();
return view('goals.create');
}
Goal Type
protected $fillable = [
'goal_type_name'
];
public function store(StoreGoalRequest $request)
{
$goaltype = GoalType::create([
'goal_name' => $request->goal_name,
'goal_description' => $request->goal_description,
'created_by' => Auth::user()->id,
'created_at' => date("Y-m-d H:i:s"),
'is_active' => 1,
]);
Session::flash('success', 'Appraisal Goal is created successfully');
return redirect()->route('goals.index');
}
One Goal will have many KPI. The goal_name, goal_type_name and goal_description are entered only once at an instance. goal_type_name is a dropdown derived from goal_type_id.
I want to create a master detail form, whereby there will be a add button that will add kpi_description (text box) several times.
When save button is clicked:
goal_name and goal_description will be saved in goals table
goal_type_id from the dropdown, goal_id from goals table and kpi_description will be saved in the kpi table
nothing is saved in goal_type table. It only supplies the goal_type_id and goal_type_name for the dropdown
goals table is the main controller.
How do I modify my model and controller, and also write my view to achieve this?
Thank you
Please or to participate in this conversation.