How do I request file input and save it in the databse?

Posted 8 months ago by lawkunchi
My Controller

public function postRegister(Request $request) 
       $this->validate($request, [
           'first_name' => 'string|required|max:100',
           'last_name' => 'string|required|max:100',
            'file' => '';  //here

       $user = new User([
           'first_name' => $request->input('first_name'),
           'last_name' => $request->input('last_name'),
           'file' => $request->input('file'),

My Migration

 public function up()
       Schema::create('users', function (Blueprint $table) {

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.