0

so I have installed a fresh copy of Laravel and want it to resemble (exactly) an existing project on my other server.

My goal is to have a development server and a production server, and I wanted to use git to track changes and push code.

My problem is when I manage to get the github code onto the new, fresh Laravel install it ruins that Laravel installation. Middleware, artisan commands and other things all seem to break, and I have tried this multiple times.

I am looking for someone to provide me steps to get my github code onto the fresh install without breaking it.

If there is a way to get a directory at a time, so I can test what is breaking it, that would be good too. I think what was happening before was that composer and the auto-loaders were not handling the new code from github properly.

I did this: https://stackoverflow.com/a/8888015/4942980 but it led to this: Laravel 5 Seeder Class Does Not Exist

I can provide more information upon request if this isn't helpful.

EDIT: I clone my github Laravel application code by doing git clone I then install laravel using composer update in that directory and it breaks php artisan.

PHP Fatal error:  Uncaught InvalidArgumentException: The "" directory does not exist. in /var/www/laravel/vendor/symfony/finder/Finder.php:546
Stack trace:
#0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(76): Symfony\Component\Finder\Finder->in(false)
#1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(59): Illuminate\Foundation\Bootstrap\LoadConfiguration->getConfigurationFiles(Object(Illuminate\Foundation\Application))
#2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(38): Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\Foundation\Application), Object(Illuminate\Config\Repository))
#3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(Object(Illuminate\Foundation\Application))
#4 /var/www/laravel/vendor/laravel/framework/src/Il in /var/www/laravel/vendor/symfony/finder/Finder.php on line 546
Summer Developer
  • 2,056
  • 7
  • 31
  • 68
  • 1. When you say you want it to resemble an existing project ... why don't you start of with that project? 2. Could you provide us with the steps you use to "get the github code onto the Laravel install"? 3. Are you using the same Laravel versions for both projects? – sisve Jun 15 '17 at 04:39
  • @sisve Updated, and yes, same Laravel version, `5.3.*` – Summer Developer Jun 15 '17 at 23:56
  • You use `composer install` to install all required packages, not `composer update´. This sounds like a user error in your setup, and not a Laravel issue. I cannot help you further. – sisve Jun 16 '17 at 05:16

1 Answers1

0

If I was you I would create out the box provisioned vms like homestead. Homestead has been provisioned to Laravel's optimal environment. What you could do is create a deployment script to create homestead instances. By doing this you would achieve environments that are identical. I think your other issue may be solved by running:

composer dump-autoload -o

composer update
Ronan Boiteau
  • 9,608
  • 6
  • 34
  • 56
amac
  • 921
  • 1
  • 6
  • 17