phplaravelherokugoogle-api-php-clientheroku-api

Is it possible to store file uploads to a particular google drive public folder from laravel application?


I am developing a blog using Laravel 5.6 and PostgreSQL. I have made a fully functional blog and have successfully deployed it in Heroku in Free tier.

Initially I have made a photo upload system in which user file uploads are stored in public/storage and filename is stored in a table field in posts table.

But in heroku we can't do this due to their ephemeral filesystem.

Now I neither know how to use or would be able to afford amazon s3 solution.

Don't want to store images in database directly either. Because soon I will be making a complete social networking type app for fun in my college.

As a student what I can think of is to directly upload the image in a MY google drive account public folder instead of file system.

And then retrieve that also.

I googled for a solution, but I didn't find what I am wanting. I have no experience working with APIs before.

Really need your help.

Regards.


Solution

  • You need a Laravel drive connector in order to do this. Best bet is to search on GitHub for "Laravel Google Drive" as there are several and without more information it's difficult to recommend one over another. Another option is to use AWS S3. You get 5GB for free for your first year and it's dirt cheap after that - and there is lots of documentation and support for S3 (see https://laravel.com/docs/5.6/filesystem).