lundi 5 avril 2021

how to upload file using queue in laravel?

I am a beginner at Laravel. I want to upload files using a queue in Laravel. I have created a simple example in laravel to upload file, but I don't know how to use queue with upload file.

index.blade.php

    <h2>Upload file</h2>

<form action="" method="post" enctype="multipart/form-data">

}

}





    <label for="file">Please choose a file to upload</label>

    <input type="file" name="file" id="file"><br>

    <button type="submit">Upload</button>

</form>

FileController.php


<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class FileController extends Controller
{
    public function index()
    {
        return view('file.index');
    }

    public function store(Request $request)
    {
        $file = $request->file('file')->store('uploads', 'public');
        
        }
}




via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire