Why there are no commands defined in the make namespace? - php

I have installed laravel via composer. I have created the database I need and I'm just trying to add the models I need. So I have tried the artisan command :
php artisan make:model Task
but it returned the following error :
[InvalidArgumentException]
There are no commands defined in the "make" namespace.
Maybe I have to install other components for artisan ? How can I fix this?

No make command in laravel 4, I have upgraded my laravel application to 5.1 and now it is working

Related

php artisan make:auth not defined in Laravel 8

I'm trying to run this command in Laravel 8.57.0 but it's not working:
PHP artisan make:auth
and the error is :
Command "make:auth" is not defined
Did you mean one of these?
make:test
make:request
make:migration
make:seeder
make:middleware
make:controller
make:provider
make:policy
make:event
make:console
make:job
make:listener
make:model
make:command
I also tried
composer require laravel/ui
php artisan ui vue --auth
php artisan migrate
but still have the same error. So, I guess that either I am using the wrong command or I am trying to do something that can not be done. Maybe most likely experienced people will see right away what is wrong.
What are you trying to do exactly? Create the authentication scaffolding from the laravel/ui package?
If so, then these two commands should be enough:
composer require laravel/ui
php artisan ui vue --auth
You can read further about it here.
Since Laravel >= 6, the command php artisan make:auth was removed from the core and moved to an individual package called laravel/ui, so the command now looks like: php artisan ui vue --auth.
Depending on what you want to accomplish I can recommend you the following solutions:
Check this answer, this may be marked as duplicated: php artisan make:auth command is not defined
Run composer dump-autoload and php artisan optimize
Try a different package, like Laravel Fortify
Why don't you try using the fortify package for authentication?
composer require laravel/fortify
The details can be found here.
Why dont you use Laravel Sanctum
composer require laravel/sanctum

How to Install Swagger to Laravel 8 API for documentation?

Installing Swagger for the First Time in laravel 8
composer require "darkaonline/l5-swagger"
composer require zircote/swagger-php
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
Getting Error like:
I'm guessing the URL you're hitting might be incorrect. Change it to just docs/api-docs instead of docs/api-docs.json. In addition, if you haven't ran the generate command already, you would have to do so to make it work.
php artisan l5-swagger:generate

Laravel 8 UI issue

I have installed Laravel 8 as a new project. When I run the project I get the "In order to use the Auth::routes() method, please install the laravel/ui package." But Laravel installation doc says that laravel ui is depreciated and that we should use Jetstream. So I installed Jetstream with the Livewire stack. Back to test the project and I get the same error msg.
I have run a composer dump-autoload.
What do I have to do to get a Laravel 8 project to run?
You will need to clear and recreate cache. Run the following php artisan commands:
php artisan cache:clear
php artisan config:cache
php artisan route:cache
I had this problem as well on many 'upgrades' from earlier versions of Laravel. I don't want to change the entire auth mechanism, as it works, so I will keep the code I have.
#Elisha Senoo's answer is correct, and solved it most of the time. However, if you find yourself unable to clear the cache (because it has the same error message on the artisan command), the solution is to manually clear the .php files within the bootstrap/cache folder and then php artisan config:cache.

Laravel route list returns error

When i try to show list of available routes artisan returns the following error:
$ php artisan route:list
[ReflectionException]
Class API does not exist
It worked a while ago but now i can't get it to work.
Laravel version is:
$ php artisan -V
Laravel Framework version 5.1.10 (LTS)
Is it possible to debug somehow this error?
You can find what's wrong in the storage/logs/laravel-YYYY-MM-DD.log file.
Check it, resolve and run artisan again.
What's your php version ? I think, if you are under php5.5, then change the shell.

Auth resources are missing in laravel

I want to make use of auth system which comes with the laravel package but the problem is when I make new laravel package using composer i.e composer create-project laravel/laravel project name --prefer-dist
it do not install those auth resources which includes (i.e. auth folder inside resources > views) and also I can't find the Services Folder inside app directory.
All other things are working fine except this authentication system.
What can be the possible problems? Please give me solution
I am working with MAMP.
Taylor Otwell has made it opt-in for Laravel 5.1
You need to run following command after installation
php artisan scaffold:auth
UPDATE
I think this has been answered here
You could also run the command php artisan make:auth in the root directory of you laravel project. I had the same problem and it worked for me.
The command php artisan scaffold:auth didn't work for me i don't know why.
it issued the error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "auth" is not defined.
Did you mean this?
make:auth
in Laravel 5.2 you just have to run this command "php artisan make:auth" and the auth folder will be created
Since laravel 6.* version make:auth is no longer supported, use ui:auth instead.
For deploying ui pack run
composer require laravel/ui --dev
then update composer.json :
composer update -W
and do the:
php artisan ui:auth
You need execute
php artisan make:auth
now if your style css and js are missing
You need load file .css and .js
1) execute in your project
npm install
2) then execute
npm run dev => now in folder /public now exist folder js and css
3) reload page

Categories