Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel softdelete migration

use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
 
Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
 
Schema::table('flights', function (Blueprint $table) {
    $table->dropSoftDeletes();
});
Comment

drop column migration laravel

 Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('articles', function($table) {
             $table->dropColumn('comment_count');
             $table->dropColumn('view_count');
          });
      }

      public function down()
      {
          Schema::table('articles', function($table) {
             $table->integer('comment_count');
             $table->integer('view_count');
          });
      }
  }
Comment

laravel migration delete column

Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('table', function($table) {
             $table->dropColumn('coulmn_name');
          });
      }

      public function down()
      {
          Schema::table('table', function($table) {
             $table->integer('column_name');
          });
      }
  }
Comment

laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');
Comment

delete a migration laravel

// delete a migration safely from laravel 
delete migration from database/migrations/ directory
and also delete entry from migrations table
Comment

delete rows by migration laravel

Comment::where('post_id',$id)->delete();

// in down migration

    public function down()
    {
        Schema::table('package_types', function (Blueprint $table) {
            AppModelsPackageType::query()->where('id','gt',1)->delete();
        });
    }
Comment

laravel migration softdelete

>>> $test->forceDelete();
=> true
Comment

laravel softdelete migration

use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
 
Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
 
Schema::table('flights', function (Blueprint $table) {
    $table->dropSoftDeletes();
});
Comment

drop column migration laravel

 Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('articles', function($table) {
             $table->dropColumn('comment_count');
             $table->dropColumn('view_count');
          });
      }

      public function down()
      {
          Schema::table('articles', function($table) {
             $table->integer('comment_count');
             $table->integer('view_count');
          });
      }
  }
Comment

laravel migration delete column

Class RemoveCommentViewCount extends Migration
  {
      public function up()
      {
          Schema::table('table', function($table) {
             $table->dropColumn('coulmn_name');
          });
      }

      public function down()
      {
          Schema::table('table', function($table) {
             $table->integer('column_name');
          });
      }
  }
Comment

laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');
Comment

delete a migration laravel

// delete a migration safely from laravel 
delete migration from database/migrations/ directory
and also delete entry from migrations table
Comment

delete rows by migration laravel

Comment::where('post_id',$id)->delete();

// in down migration

    public function down()
    {
        Schema::table('package_types', function (Blueprint $table) {
            AppModelsPackageType::query()->where('id','gt',1)->delete();
        });
    }
Comment

laravel migration softdelete

>>> $test->forceDelete();
=> true
Comment

PREVIOUS NEXT
Code Example
Php :: how to empty an array in php 
Php :: wp wordPress variables de session 
Php :: php nested class 
Php :: cakephp sql query 
Php :: Using $this when not in object context 
Php :: screen size to php 
Php :: php check string 
Php :: png to pdf 
Php :: what is the use of migration file in laravel 
Php :: php laravel string substring 
Php :: pessimistic locking laravel 
Php :: php readlink 
Php :: php loop in js 
Php :: iframe site bi link laravel 
Php :: Spatie vendor publish 
Php :: laravel create get id 
Php :: list function php 
Php :: laravel request not returning errors 
Php :: get data from stdclass object php 
Php :: middleware in laravel 
Php :: dynamic variable in php 
Php :: Laravel render stuff in a given environment 
Php :: php strings 
Php :: php loop object keys 
Php :: laravel default rate limit 
Php :: laravel 9 requirements 
Php :: laravel debugbar not showing 
Php :: why php is not using datatype 
Php :: facetwp listing template archive 
Php :: WordPress Image/Files uploads 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =