json(); } /** * Show the form for creating a new resource. */ public function create() { // } /** * Store a newly created resource in storage. */ public function store(Request $request): JsonResponse { $request->validate([ 'file' => 'required|file|mimes:json', 'frameworkID' => 'required|exists:frameworks,id', 'pageID' => 'required|exists:pages,id', ]); $file = $request->file('file'); $path = $file->store('instructions', 'public'); $instruction = Instruction::create([ 'page_id' => $request->pageID, 'framework_id' => $request->frameworkID, 'file_path' => $path, ]); return response()->json([ 'message' => 'Instruction saved successfully', 'instruction' => $instruction, ]); } /** * Display the specified resource. */ public function show(Instruction $instruction) { // } /** * Show the form for editing the specified resource. */ public function edit(Instruction $instruction) { // } /** * Update the specified resource in storage. */ public function update(Request $request, Instruction $instruction) { // } /** * Remove the specified resource from storage. */ public function destroy(Instruction $instruction) { // } }