miracuthbert / saas-boilerplate

SaaS boilerplate built in Laravel, Bootstrap 4 and VueJs.
359 stars 141 forks source link

There are no commands defined in the "app" namespace. #13

Open bauersfeld opened 4 years ago

bauersfeld commented 4 years ago

When I run step 4 of the installation

"Run php artisan app:name to set the name (namespace) of your app. (Remember not to live any spaces)"

I get this error

"There are no commands defined in the "app" namespace."

I don't understand how this will work when the app:name command is nested inside of app/App/Console/Commands.

What is the logic here?

ambitionphp commented 4 years ago

same issue here.. stumped for a bit now but will update if i find a solution.

ambitionphp commented 4 years ago

okay, so in Kernal.php add the "AppName" command:

in protected $commands add: \SAASBoilerplat\App\Console\Commands\AppName::class,

and then run: php artisan app:name YourAppNameHere

bauersfeld commented 3 years ago

Thanks, that worked to create the namespace, but now the migrate command is failing

php artisan migrate PHP Fatal error: Uncaught ReflectionException: Class SAASBoilerplate\App\Console\Kernel does not exist in /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php:809 Stack trace:

0 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct('SAASBoilerplate...')

1 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build('SAASBoilerplate...')

2 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve('SAASBoilerplate...', Array, false)

3 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve('SAASBoilerplate...', Array, false)

4 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/l in /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811

Fatal error: Uncaught ReflectionException: Class SAASBoilerplate\App\Console\Kernel does not exist in /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php:809 Stack trace:

0 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(809): ReflectionClass->__construct('SAASBoilerplate...')

1 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(691): Illuminate\Container\Container->build('SAASBoilerplate...')

2 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(796): Illuminate\Container\Container->resolve('SAASBoilerplate...', Array, false)

3 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php(269): Illuminate\Foundation\Application->resolve('SAASBoilerplate...', Array, false)

4 /Users/paul/Downloads/laravel/saas-boilerplate/vendor/l in /Users/paul/Downloads/laravel/saas-boilerplate/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 811

jvallef commented 3 years ago

php artisan migrate fails even if skip previous artisan app command...

PHP Fatal error: Cannot declare class CreateSubscriptionsTable, because the name is already in use in /Users/jvallefdz/web/saasboilerplate/vendor/laravel/cashier/database/migrations/2019_05_03_000002_create_subscriptions_table.php on line 0

stoneshaq commented 3 years ago

This is how i solved the issues..

Kernel.php add the "AppName" command:

in protected $commands add: \SAASBoilerplat\App\Console\Commands\AppName::class,

and then run: php artisan app:name SAASBoilerplate

when you run migrate you will get an error with cashier.. so go to AppServiceProvider.php and add

Cashier::ignoreMigrations();

under register().. it should look like

public function register() { Cashier::ignoreMigrations(); }

and dont forget to add use Laravel\Cashier\Cashier;

now run php artisan migrate.. Hope it helps

tboztuna commented 3 years ago

To people who gets error with migrations:

You can just use php artisan migrate --path=database/migrations/ to create database tables without any doubt.

OneHighCloud commented 3 years ago

This command is removed in Laravel 6.0. So, if you are using Laravel 6 or above, the command wouldn't work. You can edit .env APP_NAME="---Your App Name---" for the purpose.

sapfeer0k commented 2 years ago

To solve the problem with migrations you need to replace all occurrences of SAASBoilerplate in all files with your appName , then migration will work.

riettotek commented 2 years ago

why they decided to remove that command. i just can't get it! 👎

gabayim commented 1 year ago

Hi Thx for the help. im getting the error : "No application encryption key has been specified"

any clue ?