0

Can someone help me while enrollment_form gets uploaded to the database? I also want it to be uploaded/stored in the /public folder.

public function submitForm(Request $request)
{
    DB::table('enrollment')->insert([
        'user_id' => $request->user_id,
        'enrollment_form' => $request->enrollment_form,
        'name' => $request->user_name,
        'email' => $request->user_email,
        'status' => $request->user_status
    ]);
    
    return back()->with('user_form', 'Enrollment successfully submitted!');
}
2
  • laravel-8 or laravel-9? The manual has a page on File Uploads Commented Sep 12, 2022 at 11:27
  • @brombeer do u know what approach of insert function, i want only the first entry keep replacing each time i inserted value to the database? Commented Sep 14, 2022 at 7:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.