-2

Right now I'm following a tutorial, where it led me to install Laravel Artisan extension in VS Code. It went to the point where I need to open a command palette and write Artisan Make: Model to create a model.

After I tried that, it shows an error message along with command 'artisan.make.model' not found

So umm, anybody know why this happen? Or any other way I can bypass this problem?

Thank you in advance!

Nankatsu
  • 45
  • 5
  • Try solutions on this page https://stackoverflow.com/questions/34339517/lumen-laravel-eloquent-php-artisan-makemodel-not-defined – Exception Oct 25 '22 at 05:31
  • make sure you are in the project root directory and you must give space like this ``php artisan make:model ModelName`` – Sumit kumar Oct 25 '22 at 05:37
  • also you don't have to use vscode plugin for running laravel artisan commands just open command prompt or terminal by ``ctrl+` `` then a terminal will pop up and there you have to run ``php artisan make:model``. – Sumit kumar Oct 25 '22 at 05:52
  • I already tried to install it. But then an error shown along with ```Problem 1 - Root composer.json requires wn/lumen-generators ^1.3 -> satisfiable by wn/lumen-generators[1.3.0, ..., 1.3.4]. - wn/lumen-generators[1.3.0, ..., 1.3.4] require illuminate/console ^5.1 -> found illuminate/console[v5.1.1, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.``` – Nankatsu Oct 25 '22 at 06:01
  • can you tell what are you installing laravel/lumen or laravel/laravel – Sumit kumar Oct 25 '22 at 06:07
  • there is already a solution for your composer error https://stackoverflow.com/questions/56441281/laravel-lumen-illuminate-console-wont-update – Sumit kumar Oct 25 '22 at 06:09

1 Answers1

0

For using Laravel Artisan extension:

Install the Laravel Artisan Extension (Author: Ryan Naddy)

Make Sure you're in project work directory.

Then, Open command palette by shortcut Ctrl+Shift+p

There Search Artisan: Make Model and Follow instructions like next prompt will ask you for model name where you have to provide Name of your model and whether you want a controller/migration or not.

Same can be done by Php artisan make:model ModelName -mc just by opening command prompt or terminal so whichever way it suits you.

Note: I've tested this on ubuntu so let me know if you want more help.

Sumit kumar
  • 402
  • 2
  • 10