database/migrations/2022_03_19_122459_change_on_delete_category.php
/**
     * Reverse the migrations.
     *
     * @return void
     */
Reverse the migrations.
@return void
Reverse the migrations . @return void
public function down()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }
public function down ( ) { Schema :: create ( 'categories' , function ( Blueprint $ table ) { $ table -> foreign ( 'user_id' ) -> references ( 'id' ) -> on ( 'users' ) -> onDelete ( 'cascade' ) ; } ) ; }
Reverse the migrations.
Reverse the migrations .