File upload not working

Posted 11 months ago by aondoe

Hello everyone.

I'm having trouble with file upload in laravel 5.6 I'm trying to upload images to my CMS I've created with Laravel.

I have a table called "post_its" below:

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

I had to add a column in the table to upload images so I did so like below:

    public function up()
        Schema::table('post_its', function(Blueprint $table)
            //add a column to the post_its table and give it 100 characters. Also specify 100 characters
            $table->string('featured_img', 100)->nullable();

Here's my form data I'm trying to fix, as you can see below:

<form action="{{route('posts.update', $post->id)}}" method="POST" type="multipart/form-data">
<!--other form fields are here as well, but omitted for brevity-->
        <div class="form-group">
                <input type="file" name="featured_img" title="Featured image">

Every other field works and updates the database table, but not this upload field. All the fields under the featured_img column says null. I was hoping after I added this column I could edit this column. Any suggestions?

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