0

I am new with Larvel and I am trying to make migration & make model so I write in the terminal php artisan make:model -m

I get the following error:

Warning: require(/Users/saramuneef/trainblog/vendor/autoload.php): failed to open stream: No such file or directory in /Users/saramuneef/trainblog/artisan on line 18

I am using xammp for local host, and this error appears when I try to make .env file by use artisan key:generate

php artisan make:model Trainee

Fatal error: require(): Failed opening required '/Users/saramuneef/trainblog/vendor/autoload.php' (include_path='.:') in /Users/saramuneef/trainblog/artisan on line 18

I expect it to create a model, but it fails

Watercayman
  • 7,970
  • 10
  • 31
  • 49
sarah
  • 31
  • 2
  • 7

1 Answers1

1
  1. Run composer install.

  2. Make sure there is an artisan file in your project folder.

  3. Run php artisan make:model <ModelName> -m if you want to create model and migration together.

  4. Run php artisan make:model <ModelName> -m -c if you want to create model,migration & controller together.

Sakibur Rahman
  • 834
  • 3
  • 10
  • 26