Laravel - Vue chunk upload - Frontend and Backend example - php

I use Laravel 5.5 and I tried to use Pion chunk upload to upload large files. I followed the steps and I think backend should work. The problem is that I am unable to make work the frontend uploader. I want to use a vue component for this task and I tried several of them, but the most promising was the Simple Uploader.
Can someone show me a full example of these two working together?

Related

How can i download a file created in an old app in my new Laravel App

There are two applications, an old one written in raw php and a new one in Laravel 6.
The old one generates a File using dabatase data and i want to know if there is a chance that i can run that function in my laravel app so i don't have to rewrite that function all over again.
The two apps are in the same server.
Should i copy the code of the old app in a Laravel Controller and run it there?, or maybe build an API.
Thanks
Quick answer: don't paste legacy PHP code in a Laravel controller.
Since you have decided to start a new Laravel 6 application, you should try to stick with the Laravel way (and modern PHP coding standards), and therefore rewritte your old legacy code from scratch into your new Laravel app.
There is no shortcut for that, and it might take time, but not only will it last longer in time and be more efficient than the legacy code, it will also help you learn new coding standards.
Here is an article that can help you getting started: How to rewrite a legacy PHP application to Laravel.
If what the old code does is just getting rows from the database and exporting it into a file, that should be fairly simple thanks to Laravel and a composer package like maatwebsite/Laravel-Excel
You can find many articles on Google on How to Export Mysql Data to Excel File in Laravel

Use a single page component.vue in a not laravel php page

in the last months I made some great progress using vue, and just a couple of days ago a friend asked me if I can do a little plugin for his page, that is made in pure PHP. I made a vue.js component, call it test.vue . It is Single File Component with script and template all togheter. Now, I tested it on my local enviroment on an laravel App the I was developing, and it works fine. But I don't understand how I can add it to the php page of him. In my App, I got NPM running and recompiling all my jss and css, but now that I have this single file I kind of lost the direction.
How can I run the single file component in a out of laravel php page? In laravel I just register the component in my app.js, do the npm mix and then just add the component markup into a blade view and everything works..
Some help will be much appreciate

Working with php files using webpack

I'm working on project using React on client side and PHP on server. I'm building client using webpack but my problem is that I'm not sure what's the right way to "import" .php files. I want to post to them using axios, so I need to know their place in my project structure. But if I run "webpack" my files will land in /dist folder. For example from component the path to php file would be "../../dist/php/getItem.php" but after webpacking it will change.......
How can I make some kind of special folder for php files, that would be available for me before as well as after building my components? I've found "file-loader" for webpack but I can't find any example of using it for php files.
I hope I explained my problem

Add Captcha Image to laravel App without installing any package

I already uploaded a laravel app and my boss wants me to add a captcha image to the website, now I researched a lot of captcha techniques for laravel and it all requires me to install a package, the problem is I dont want to reupload the website. Any solutions on this?
No matter what you do, you're going to need to write code and upload it.
Yes there exists a way using php library in laravel without using composer http://www.onlinekurukshetra.com/using-captcha-in-laravel-without-composer/ works fine for me.
Also custom validation using laravel for validating the captcha is there. But Need a way validate it client side. Think you have to made custom code for it.

Symfony 2 MediaBundle file upload tutorial wanted, how to start?

I'm new with Symfony and MediaBundle, can't find tutorial how to upload files to server using MediaBundle, only display. Video would be perfect. I'm using latest Symfony 2.5. I need simple file upload, without any Sonata Media Bundle, or I must use Sonata for upload?
Only official example I found:
http://symfony.com/doc/current/cmf/bundles/media/introduction.html#uploading-files
and no working code examples.
For uploading, I use the OneupUploaderBundle and use jQuery for my front end. Uploading can be involved because you have to handle different interfaces on users and then also have a method to save files on your server. This bundle allows you to use different front ends for the design and has sever nice events for handling different types of uploads.
I use the included oneup_uploader.pre_upload event to review the file that will be uploaded and use oneup_uploader.post_upload to have the file's name stored in a related entity so I can easily access it from a controller/service. It has some decent examples but post any questions if you are stuck. One of the most useful features for me is the custom logic for uploads.

Categories