Laravel 8 - Envoyer & Homestead Deployment Issues - laravel

So I am using Laravel Homestead for my local development. I opted to install it per-project rather than globally so that all of my Homestead configuration files would be tracked in my git repository. To keep my repository clean, I opted to place the entirety of the Laravel application into a sub-directory named 'code'.
This, however, has presented me with a challenge when attempting to deploy my application via Envoyer. It seems as though Envoyer assumes the Laravel application files are in the root directory of the repository. As such, when it attempts to deploy it fails.
I've been searching around and can't seem to find any way of specifying to Envoyer that my Laravel application files are not in the root directory of the repository but are in the 'code' directory. Any help would be greatly appreciated!
Repository Structure:
/
- Homestead related files
- /code
- Laravel application files

Related

Deploying Strapi to Heroku

I've been following the official Strapi tutorials on how to develop and deploy an application to Heroku and it seems you have to configure some files like ./config/environments/**/database.json.
The problem is that, installing the app without --quickstart (yarn create strapi-app my-project), my config folder just has a functions folder and database.js and server.js files.
Should I create manually this database.json or is this supposed to be created automatically when initializing the app without --quickstart?
I was also confused so I manually created the folders /environments/production and inside the file database.json and it worked for me.
Link to the docs: https://strapi.io/documentation/3.0.0-beta.x/deployment/heroku.html#_4-update-your-database-config-file

Get actual project directory of Gitlab

I'll straight to my point. I have an machine which installed gitlab and nginx, and I have an fresh laravel project that already has commited, but I need to access the source code of "public" directory of laravel for my nginx. how to get source code of public directory, so I can put into line "root path" in files "sites-enabled" nginx, so nginx can access those files ?
The GitLab API doesn't expose the filesystem location directly so you need to stitch the url together.
To get the entry point of all your repositories check you GitLab configuration. (Normally /etc/gitlab/gitlab.rb). Find the key gitlab_git_http_server['repo_root'].
In there you will see folders which represent your namespaces in these folders are your project.

Moving Laravel project from Windows 7 to Raspbian Jessie

I created a Laravel webapp running on a homestead vm on my Windows 7 machine. I want to take this webapp and move it over to my raspberry pi so it's easily accessible from my other devices, since my decsktop doesn't have a direct connection to my router.
I have my pi setup with apache2 and Laravel all the way to the point that if I create a Laravel project in /var/www using
php ~/composer.phar create-project --prefer-dist laravel/laravel project
Then I can access it through the URL:
192.168.1.232/project/public
However, when I pull the webapp I created on the homestead machine through get and place it in /var/www on the pi, I get a page isnt working, currently unable to handle request error.
Does anyone know what files I would need to change/git ignore to develop Laravel on my windows machine and then pull certain versions to my pi without creating errors?
EDIT: I was able to fix this issue by looking at the git ignored files. Two necessary files, /vendor and .env were being ignored when I pushed my project to git. All I did was recreate the .env file in my project directory on my pi, and move a copy a vendor file over from a project I created on the pi, and my webapp started to work.

Laravel 5 on Heroku file_put_contents permission issue

I deployed my Laravel 5 app (empty initial app) to Heroku using Github repository and it keeps producing exception
production.ERROR: ErrorException: file_put_contents(/8a232580639f5a7a06b1d497d0825c281c17c91d.php): failed to open stream: Read-only file system in /app/bootstrap/cache/compiled.php:7198
Why would it even try to create a file in the root / directory?
The interesting thing is if I create a new Laravel application and deploy it using Heroku's Git (vs Github repo) it works without problems.
Make sure storage/ path is not ignored. Instead of ignoring the whole storage/ path, replace it with the following in your .gitignore. This can be improved on what are the files and directories that will be created under storage, I haven't much done laravel/lumen in a while so I'm not so sure. But this are the basic ones.
storage/app/*.php
storage/framework/*/*.php

How to deploy a Laravel 5 using composer and FTP

I built a project using Laravel 5 on my dev machine and now I'd like to deploy it.
One solution that came to my mind is to upload everything using FTP but I guess there is a better way.
I uploaded the composer.json but I receive tons of errors.
I have ssh/root access but using GIT is not an option.
Make sure you can use composer binary on your server and you are set
upload every file except vendor folder (you may use some FTPS manager that reads git-ignore file and does not upload ignored files)
set permissions to ./storage folder (browse thru this severfault thread)
make sure your web server root is ./public
create env file (that is not going to be changed ever, until you want) and do not overwrite it with "local" env file.
$ composer install (installs everything from composer.lock)
$ composer update (updates from repositories again, do test on local before updating on production)

Resources