1. Go to this page and download the library: Download bildvitta/iss-upload library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Bildvitta\IssUpload\Http\Controllers\UploadController;
Route::post('/upload-pdf')->name('upload_pdf')->uses(UploadController::class);
use Bildvitta\IssUpload\Http\Requests\UploadRequest;
use Bildvitta\IssUpload\IssUpload;
use Illuminate\Http\JsonResponse;
use App\Http\Requests\YourRequestValidator;
class NewPostController extends Controller
{
public function __invoke(YourRequestValidator $yourRequestValidator, UploadRequest $uploadRequest): JsonResponse
{
#TODO: Your Logic.
// $issUpload = new IssUpload($uploadRequest->entity, ($uploadRequest->filename, $uploadRequest->mime_type);
$issUpload = new IssUpload();
$issUpload->setEntity($uploadRequest->entity);
$issUpload->setFilename($uploadRequest->filename);
$issUpload->setMimeType($uploadRequest->mime_type);
dd($issUpload->getUploadSource());
#TODO: Your Logic.
}
}