How to solve 'There are no commands defined in the "cashier" namespace' in Laravel
When i did start to learn "Laravel Cashier" and i was following step by step of laravel official document, but i run bellow command :
php artisan cashier:table users
At that time i found following error on my terminal:
[Symfony\Component\Console\Exception\CommandNotFoundException]There are no commands defined in the "cashier" namespace.
I try to solve this error, i also clear all cache and add service provider, it means i try totally and i can't found solution for this error, but you can also add migration like this way if you want it is a same like we did bellow command. so first run command for create migration:
php artisan make:migration add_cashier_table_fields
ok, now put bellow content on following file :
Migration:
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBillTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function ($table) {
$table->string('stripe_id')->nullable();
$table->string('card_brand')->nullable();
$table->string('card_last_four')->nullable();
$table->timestamp('trial_ends_at')->nullable();
});
Schema::create('subscriptions', function ($table) {
$table->increments('id');
$table->integer('user_id');
$table->string('name');
$table->string('stripe_id');
$table->string('stripe_plan');
$table->integer('quantity');
$table->timestamp('trial_ends_at')->nullable();
$table->timestamp('ends_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Call External API in Laravel?
- Laravel Send an Email on Error Exceptions Tutorial
- Laravel Fetch Data using Ajax Example
- How to Run Laravel Project on Different Port?
- How to integrate TinyMCE Editor in Laravel?
- Laravel Image Upload with Spatie's Media Library Example
- Laravel Google Chart Example Tutorial
- How to Redirect Route with Querystring in Laravel?
- How to Get User Agent Value in Laravel?
- Ajax - Cross-Origin Request Blocked in Laravel?
- Laravel CKeditor 5 Image Upload Tutorial Example
- Laravel Create JSON File & Download From Text Example