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

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.