-2

I am keep getting this error response when creating an controller through artisan:

PHP Warning: require(/home/ubuntu/workit/vendor/autoload.php): failed to open stream: No such file or directory in /home/ubuntu/workit/artisan on line 18 PHP Fatal error: require(): Failed opening required '/home/ubuntu/workit/vendor/autoload.php' (include_path='.:/usr/share/php') in /home/ubuntu/workit/artisan on line 18

I use the following command to create an new controller:

php artisan make:controller PostsController 
thisiskelvin
  • 4,136
  • 1
  • 10
  • 17
Adeniyi
  • 1
  • 3
  • Have you installed the composer packages? – Jerodev Dec 17 '18 at 12:30
  • Possible duplicate of [require(vendor/autoload.php): failed to open stream](https://stackoverflow.com/questions/41209349/requirevendor-autoload-php-failed-to-open-stream) – Jerodev Dec 17 '18 at 12:38

2 Answers2

1

Try running

composer update

That may help your problem.

Jesus Erwin Suarez
  • 1,571
  • 16
  • 17
  • Thanks @Erwin . i have done that but still getting same error response. i'm actually on paizacloud not that i'm running the laravel locall. is there any other online IDE i can write laravel on? – Adeniyi Dec 17 '18 at 12:55
  • `composer dump-autoload` ? – LouLav Dec 17 '18 at 12:57
  • after running composer dump-autoload. what i got as response is as below; PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /home/ubuntu/workit/bootstrap/app.php:14 Stack trace: #0 /home/ubuntu/workit/artisan(20): require_once() #1 {main} thrown in /home/ubuntu/workit/bootstrap/app.php on line 14 – Adeniyi Dec 17 '18 at 13:06
  • Did you try to check your file permissions? – Jesus Erwin Suarez Dec 17 '18 at 13:51
0

Install the composer packages by running composer install once it is completed. Then you can your make controller using the artisan command.

thisiskelvin
  • 4,136
  • 1
  • 10
  • 17
rfpdl
  • 956
  • 1
  • 11
  • 35
  • Thanks @ponce . i have done that but still getting same error response. i'm actually on paizacloud not that i'm running the laravel locally – Adeniyi Dec 17 '18 at 12:53